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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.scvmm.models.ExtendedLocation;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The AvailabilitySets resource definition. */
@Fluent
public final class AvailabilitySetInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private AvailabilitySetProperties innerProperties;

    /*
     * The system data.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * The extended location.
     */
    @JsonProperty(value = "extendedLocation")
    private ExtendedLocation extendedLocation;

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private AvailabilitySetProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: The system data.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the extendedLocation property: The extended location.
     *
     * @return the extendedLocation value.
     */
    public ExtendedLocation extendedLocation() {
        return this.extendedLocation;
    }

    /**
     * Set the extendedLocation property: The extended location.
     *
     * @param extendedLocation the extendedLocation value to set.
     * @return the AvailabilitySetInner object itself.
     */
    public AvailabilitySetInner withExtendedLocation(ExtendedLocation extendedLocation) {
        this.extendedLocation = extendedLocation;
        return this;
    }

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

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

    /**
     * Get the availabilitySetName property: Name of the availability set.
     *
     * @return the availabilitySetName value.
     */
    public String availabilitySetName() {
        return this.innerProperties() == null ? null : this.innerProperties().availabilitySetName();
    }

    /**
     * Set the availabilitySetName property: Name of the availability set.
     *
     * @param availabilitySetName the availabilitySetName value to set.
     * @return the AvailabilitySetInner object itself.
     */
    public AvailabilitySetInner withAvailabilitySetName(String availabilitySetName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AvailabilitySetProperties();
        }
        this.innerProperties().withAvailabilitySetName(availabilitySetName);
        return this;
    }

    /**
     * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.
     *
     * @return the vmmServerId value.
     */
    public String vmmServerId() {
        return this.innerProperties() == null ? null : this.innerProperties().vmmServerId();
    }

    /**
     * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.
     *
     * @param vmmServerId the vmmServerId value to set.
     * @return the AvailabilitySetInner object itself.
     */
    public AvailabilitySetInner withVmmServerId(String vmmServerId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AvailabilitySetProperties();
        }
        this.innerProperties().withVmmServerId(vmmServerId);
        return this;
    }

    /**
     * Get the provisioningState property: Gets or sets the provisioning state.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

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