// 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.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Request to validate sku availability. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "validationType")
@JsonTypeName("ValidateSkuAvailability")
@Fluent
public final class SkuAvailabilityValidationRequest extends ValidationInputRequest {
    /*
     * Device type to be used for the job.
     */
    @JsonProperty(value = "deviceType", required = true)
    private SkuName deviceType;

    /*
     * Type of the transfer.
     */
    @JsonProperty(value = "transferType", required = true)
    private TransferType transferType;

    /*
     * ISO country code. Country for hardware shipment. For codes check:
     * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
     */
    @JsonProperty(value = "country", required = true)
    private String country;

    /*
     * Location for data transfer. For locations check:
     * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
     */
    @JsonProperty(value = "location", required = true)
    private String location;

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

    /**
     * Get the deviceType property: Device type to be used for the job.
     *
     * @return the deviceType value.
     */
    public SkuName deviceType() {
        return this.deviceType;
    }

    /**
     * Set the deviceType property: Device type to be used for the job.
     *
     * @param deviceType the deviceType value to set.
     * @return the SkuAvailabilityValidationRequest object itself.
     */
    public SkuAvailabilityValidationRequest withDeviceType(SkuName deviceType) {
        this.deviceType = deviceType;
        return this;
    }

    /**
     * Get the transferType property: Type of the transfer.
     *
     * @return the transferType value.
     */
    public TransferType transferType() {
        return this.transferType;
    }

    /**
     * Set the transferType property: Type of the transfer.
     *
     * @param transferType the transferType value to set.
     * @return the SkuAvailabilityValidationRequest object itself.
     */
    public SkuAvailabilityValidationRequest withTransferType(TransferType transferType) {
        this.transferType = transferType;
        return this;
    }

    /**
     * Get the country property: ISO country code. Country for hardware shipment. For codes check:
     * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements.
     *
     * @return the country value.
     */
    public String country() {
        return this.country;
    }

    /**
     * Set the country property: ISO country code. Country for hardware shipment. For codes check:
     * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements.
     *
     * @param country the country value to set.
     * @return the SkuAvailabilityValidationRequest object itself.
     */
    public SkuAvailabilityValidationRequest withCountry(String country) {
        this.country = country;
        return this;
    }

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

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (deviceType() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property deviceType in model SkuAvailabilityValidationRequest"));
        }
        if (transferType() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property transferType in model SkuAvailabilityValidationRequest"));
        }
        if (country() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property country in model SkuAvailabilityValidationRequest"));
        }
        if (location() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property location in model SkuAvailabilityValidationRequest"));
        }
    }

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