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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.elasticsan.models.SkuCapability;
import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo;
import com.azure.resourcemanager.elasticsan.models.SkuName;
import com.azure.resourcemanager.elasticsan.models.SkuTier;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** ElasticSAN SKU and its properties. */
@Fluent
public final class SkuInformationInner {
    /*
     * Sku Name
     */
    @JsonProperty(value = "name", required = true)
    private SkuName name;

    /*
     * Sku Tier
     */
    @JsonProperty(value = "tier")
    private SkuTier tier;

    /*
     * The type of the resource.
     */
    @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY)
    private String resourceType;

    /*
     * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g.
     * West US, East US, Southeast Asia, etc.).
     */
    @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> locations;

    /*
     * Availability of the SKU for the location/zone
     */
    @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuLocationInfo> locationInfo;

    /*
     * The capability information in the specified SKU.
     */
    @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuCapability> capabilities;

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

    /**
     * Get the name property: Sku Name.
     *
     * @return the name value.
     */
    public SkuName name() {
        return this.name;
    }

    /**
     * Set the name property: Sku Name.
     *
     * @param name the name value to set.
     * @return the SkuInformationInner object itself.
     */
    public SkuInformationInner withName(SkuName name) {
        this.name = name;
        return this;
    }

    /**
     * Get the tier property: Sku Tier.
     *
     * @return the tier value.
     */
    public SkuTier tier() {
        return this.tier;
    }

    /**
     * Set the tier property: Sku Tier.
     *
     * @param tier the tier value to set.
     * @return the SkuInformationInner object itself.
     */
    public SkuInformationInner withTier(SkuTier tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the resourceType property: The type of the resource.
     *
     * @return the resourceType value.
     */
    public String resourceType() {
        return this.resourceType;
    }

    /**
     * Get the locations property: The set of locations that the SKU is available. This will be supported and registered
     * Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).
     *
     * @return the locations value.
     */
    public List<String> locations() {
        return this.locations;
    }

    /**
     * Get the locationInfo property: Availability of the SKU for the location/zone.
     *
     * @return the locationInfo value.
     */
    public List<SkuLocationInfo> locationInfo() {
        return this.locationInfo;
    }

    /**
     * Get the capabilities property: The capability information in the specified SKU.
     *
     * @return the capabilities value.
     */
    public List<SkuCapability> capabilities() {
        return this.capabilities;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (name() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property name in model SkuInformationInner"));
        }
        if (locationInfo() != null) {
            locationInfo().forEach(e -> e.validate());
        }
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
    }

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