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

package com.azure.resourcemanager.kusto.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The locations and zones info for SKU. */
@Fluent
public final class SkuLocationInfoItem {
    /*
     * The available location of the SKU.
     */
    @JsonProperty(value = "location", required = true)
    private String location;

    /*
     * The available zone of the SKU.
     */
    @JsonProperty(value = "zones")
    private List<String> zones;

    /*
     * Gets details of capabilities available to a SKU in specific zones.
     */
    @JsonProperty(value = "zoneDetails")
    private List<ResourceSkuZoneDetails> zoneDetails;

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

    /**
     * Get the location property: The available location of the SKU.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The available location of the SKU.
     *
     * @param location the location value to set.
     * @return the SkuLocationInfoItem object itself.
     */
    public SkuLocationInfoItem withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the zones property: The available zone of the SKU.
     *
     * @return the zones value.
     */
    public List<String> zones() {
        return this.zones;
    }

    /**
     * Set the zones property: The available zone of the SKU.
     *
     * @param zones the zones value to set.
     * @return the SkuLocationInfoItem object itself.
     */
    public SkuLocationInfoItem withZones(List<String> zones) {
        this.zones = zones;
        return this;
    }

    /**
     * Get the zoneDetails property: Gets details of capabilities available to a SKU in specific zones.
     *
     * @return the zoneDetails value.
     */
    public List<ResourceSkuZoneDetails> zoneDetails() {
        return this.zoneDetails;
    }

    /**
     * Set the zoneDetails property: Gets details of capabilities available to a SKU in specific zones.
     *
     * @param zoneDetails the zoneDetails value to set.
     * @return the SkuLocationInfoItem object itself.
     */
    public SkuLocationInfoItem withZoneDetails(List<ResourceSkuZoneDetails> zoneDetails) {
        this.zoneDetails = zoneDetails;
        return this;
    }

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

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