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

package com.azure.resourcemanager.synapse.models;

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

/** Azure capacity definition. */
@Fluent
public final class AzureCapacity {
    /*
     * Scale type.
     */
    @JsonProperty(value = "scaleType", required = true)
    private AzureScaleType scaleType;

    /*
     * Minimum allowed capacity.
     */
    @JsonProperty(value = "minimum", required = true)
    private int minimum;

    /*
     * Maximum allowed capacity.
     */
    @JsonProperty(value = "maximum", required = true)
    private int maximum;

    /*
     * The default capacity that would be used.
     */
    @JsonProperty(value = "default", required = true)
    private int defaultProperty;

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

    /**
     * Get the scaleType property: Scale type.
     *
     * @return the scaleType value.
     */
    public AzureScaleType scaleType() {
        return this.scaleType;
    }

    /**
     * Set the scaleType property: Scale type.
     *
     * @param scaleType the scaleType value to set.
     * @return the AzureCapacity object itself.
     */
    public AzureCapacity withScaleType(AzureScaleType scaleType) {
        this.scaleType = scaleType;
        return this;
    }

    /**
     * Get the minimum property: Minimum allowed capacity.
     *
     * @return the minimum value.
     */
    public int minimum() {
        return this.minimum;
    }

    /**
     * Set the minimum property: Minimum allowed capacity.
     *
     * @param minimum the minimum value to set.
     * @return the AzureCapacity object itself.
     */
    public AzureCapacity withMinimum(int minimum) {
        this.minimum = minimum;
        return this;
    }

    /**
     * Get the maximum property: Maximum allowed capacity.
     *
     * @return the maximum value.
     */
    public int maximum() {
        return this.maximum;
    }

    /**
     * Set the maximum property: Maximum allowed capacity.
     *
     * @param maximum the maximum value to set.
     * @return the AzureCapacity object itself.
     */
    public AzureCapacity withMaximum(int maximum) {
        this.maximum = maximum;
        return this;
    }

    /**
     * Get the defaultProperty property: The default capacity that would be used.
     *
     * @return the defaultProperty value.
     */
    public int defaultProperty() {
        return this.defaultProperty;
    }

    /**
     * Set the defaultProperty property: The default capacity that would be used.
     *
     * @param defaultProperty the defaultProperty value to set.
     * @return the AzureCapacity object itself.
     */
    public AzureCapacity withDefaultProperty(int defaultProperty) {
        this.defaultProperty = defaultProperty;
        return this;
    }

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

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