// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.servicefabric.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.servicefabric.models.ServiceResourceProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The service resource. */
@Fluent
public final class ServiceResourceInner extends ProxyResource {
    /*
     * The service resource properties.
     */
    @JsonProperty(value = "properties")
    private ServiceResourceProperties properties;

    /*
     * It will be deprecated in New API, resource location depends on the parent resource.
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * Azure resource tags.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * Azure resource etag.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * Metadata pertaining to creation and last modification of the resource.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /** Creates an instance of ServiceResourceInner class. */
    public ServiceResourceInner() {
    }

    /**
     * Get the properties property: The service resource properties.
     *
     * @return the properties value.
     */
    public ServiceResourceProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The service resource properties.
     *
     * @param properties the properties value to set.
     * @return the ServiceResourceInner object itself.
     */
    public ServiceResourceInner withProperties(ServiceResourceProperties properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the location property: It will be deprecated in New API, resource location depends on the parent resource.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: It will be deprecated in New API, resource location depends on the parent resource.
     *
     * @param location the location value to set.
     * @return the ServiceResourceInner object itself.
     */
    public ServiceResourceInner withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: Azure resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Azure resource tags.
     *
     * @param tags the tags value to set.
     * @return the ServiceResourceInner object itself.
     */
    public ServiceResourceInner withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the etag property: Azure resource etag.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (properties() != null) {
            properties().validate();
        }
    }
}
