// 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 create order limit for current subscription. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "validationType")
@JsonTypeName("ValidateCreateOrderLimit")
@Fluent
public final class CreateOrderLimitForSubscriptionValidationRequest extends ValidationInputRequest {
    /*
     * Device type to be used for the job.
     */
    @JsonProperty(value = "deviceType", required = true)
    private SkuName deviceType;

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

    /**
     * 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 CreateOrderLimitForSubscriptionValidationRequest object itself.
     */
    public CreateOrderLimitForSubscriptionValidationRequest withDeviceType(SkuName deviceType) {
        this.deviceType = deviceType;
        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"
                            + " CreateOrderLimitForSubscriptionValidationRequest"));
        }
    }

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