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

package com.azure.resourcemanager.databox.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Request body to get the availability for scheduling orders. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "skuName",
    defaultImpl = ScheduleAvailabilityRequest.class)
@JsonTypeName("ScheduleAvailabilityRequest")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "DataBox", value = DataBoxScheduleAvailabilityRequest.class),
    @JsonSubTypes.Type(name = "DataBoxDisk", value = DiskScheduleAvailabilityRequest.class),
    @JsonSubTypes.Type(name = "DataBoxHeavy", value = HeavyScheduleAvailabilityRequest.class)
})
@Fluent
public class ScheduleAvailabilityRequest {
    /*
     * Location for data transfer. For locations check:
     * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
     */
    @JsonProperty(value = "storageLocation", required = true)
    private String storageLocation;

    /*
     * Country in which storage location should be supported.
     */
    @JsonProperty(value = "country")
    private String country;

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

    /**
     * Get the storageLocation property: Location for data transfer. For locations check:
     * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01.
     *
     * @return the storageLocation value.
     */
    public String storageLocation() {
        return this.storageLocation;
    }

    /**
     * Set the storageLocation property: Location for data transfer. For locations check:
     * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01.
     *
     * @param storageLocation the storageLocation value to set.
     * @return the ScheduleAvailabilityRequest object itself.
     */
    public ScheduleAvailabilityRequest withStorageLocation(String storageLocation) {
        this.storageLocation = storageLocation;
        return this;
    }

    /**
     * Get the country property: Country in which storage location should be supported.
     *
     * @return the country value.
     */
    public String country() {
        return this.country;
    }

    /**
     * Set the country property: Country in which storage location should be supported.
     *
     * @param country the country value to set.
     * @return the ScheduleAvailabilityRequest object itself.
     */
    public ScheduleAvailabilityRequest withCountry(String country) {
        this.country = country;
        return this;
    }

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

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