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

package com.azure.resourcemanager.providerhub.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 SkuLocationInfo model. */
@Fluent
public final class SkuLocationInfo {
    /*
     * The location property.
     */
    @JsonProperty(value = "location", required = true)
    private String location;

    /*
     * The zones property.
     */
    @JsonProperty(value = "zones")
    private List<String> zones;

    /*
     * The zoneDetails property.
     */
    @JsonProperty(value = "zoneDetails")
    private List<SkuZoneDetail> zoneDetails;

    /*
     * The extendedLocations property.
     */
    @JsonProperty(value = "extendedLocations")
    private List<String> extendedLocations;

    /*
     * The type property.
     */
    @JsonProperty(value = "type")
    private ExtendedLocationType type;

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

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

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

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

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

    /**
     * Get the zoneDetails property: The zoneDetails property.
     *
     * @return the zoneDetails value.
     */
    public List<SkuZoneDetail> zoneDetails() {
        return this.zoneDetails;
    }

    /**
     * Set the zoneDetails property: The zoneDetails property.
     *
     * @param zoneDetails the zoneDetails value to set.
     * @return the SkuLocationInfo object itself.
     */
    public SkuLocationInfo withZoneDetails(List<SkuZoneDetail> zoneDetails) {
        this.zoneDetails = zoneDetails;
        return this;
    }

    /**
     * Get the extendedLocations property: The extendedLocations property.
     *
     * @return the extendedLocations value.
     */
    public List<String> extendedLocations() {
        return this.extendedLocations;
    }

    /**
     * Set the extendedLocations property: The extendedLocations property.
     *
     * @param extendedLocations the extendedLocations value to set.
     * @return the SkuLocationInfo object itself.
     */
    public SkuLocationInfo withExtendedLocations(List<String> extendedLocations) {
        this.extendedLocations = extendedLocations;
        return this;
    }

    /**
     * Get the type property: The type property.
     *
     * @return the type value.
     */
    public ExtendedLocationType type() {
        return this.type;
    }

    /**
     * Set the type property: The type property.
     *
     * @param type the type value to set.
     * @return the SkuLocationInfo object itself.
     */
    public SkuLocationInfo withType(ExtendedLocationType type) {
        this.type = type;
        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 SkuLocationInfo"));
        }
        if (zoneDetails() != null) {
            zoneDetails().forEach(e -> e.validate());
        }
    }

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