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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A Service Fabric. */
@Fluent
public final class ServiceFabricInner extends Resource {
    /*
     * The properties of the resource.
     */
    @JsonProperty(value = "properties", required = true)
    private ServiceFabricPropertiesInner innerProperties = new ServiceFabricPropertiesInner();

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

    /**
     * Get the innerProperties property: The properties of the resource.
     *
     * @return the innerProperties value.
     */
    private ServiceFabricPropertiesInner innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceFabricInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceFabricInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the externalServiceFabricId property: The backing service fabric resource's id.
     *
     * @return the externalServiceFabricId value.
     */
    public String externalServiceFabricId() {
        return this.innerProperties() == null ? null : this.innerProperties().externalServiceFabricId();
    }

    /**
     * Set the externalServiceFabricId property: The backing service fabric resource's id.
     *
     * @param externalServiceFabricId the externalServiceFabricId value to set.
     * @return the ServiceFabricInner object itself.
     */
    public ServiceFabricInner withExternalServiceFabricId(String externalServiceFabricId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceFabricPropertiesInner();
        }
        this.innerProperties().withExternalServiceFabricId(externalServiceFabricId);
        return this;
    }

    /**
     * Get the environmentId property: The resource id of the environment under which the service fabric resource is
     * present.
     *
     * @return the environmentId value.
     */
    public String environmentId() {
        return this.innerProperties() == null ? null : this.innerProperties().environmentId();
    }

    /**
     * Set the environmentId property: The resource id of the environment under which the service fabric resource is
     * present.
     *
     * @param environmentId the environmentId value to set.
     * @return the ServiceFabricInner object itself.
     */
    public ServiceFabricInner withEnvironmentId(String environmentId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceFabricPropertiesInner();
        }
        this.innerProperties().withEnvironmentId(environmentId);
        return this;
    }

    /**
     * Get the applicableSchedule property: The applicable schedule for the virtual machine.
     *
     * @return the applicableSchedule value.
     */
    public ApplicableScheduleInner applicableSchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().applicableSchedule();
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model ServiceFabricInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ServiceFabricInner.class);
}
