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

package com.azure.resourcemanager.hdinsight.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The regional quota capability. */
@Fluent
public final class QuotaCapability {
    /*
     * The number of cores used in the subscription.
     */
    @JsonProperty(value = "coresUsed")
    private Long coresUsed;

    /*
     * The number of cores that the subscription allowed.
     */
    @JsonProperty(value = "maxCoresAllowed")
    private Long maxCoresAllowed;

    /*
     * The list of region quota capabilities.
     */
    @JsonProperty(value = "regionalQuotas")
    private List<RegionalQuotaCapability> regionalQuotas;

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

    /**
     * Get the coresUsed property: The number of cores used in the subscription.
     *
     * @return the coresUsed value.
     */
    public Long coresUsed() {
        return this.coresUsed;
    }

    /**
     * Set the coresUsed property: The number of cores used in the subscription.
     *
     * @param coresUsed the coresUsed value to set.
     * @return the QuotaCapability object itself.
     */
    public QuotaCapability withCoresUsed(Long coresUsed) {
        this.coresUsed = coresUsed;
        return this;
    }

    /**
     * Get the maxCoresAllowed property: The number of cores that the subscription allowed.
     *
     * @return the maxCoresAllowed value.
     */
    public Long maxCoresAllowed() {
        return this.maxCoresAllowed;
    }

    /**
     * Set the maxCoresAllowed property: The number of cores that the subscription allowed.
     *
     * @param maxCoresAllowed the maxCoresAllowed value to set.
     * @return the QuotaCapability object itself.
     */
    public QuotaCapability withMaxCoresAllowed(Long maxCoresAllowed) {
        this.maxCoresAllowed = maxCoresAllowed;
        return this;
    }

    /**
     * Get the regionalQuotas property: The list of region quota capabilities.
     *
     * @return the regionalQuotas value.
     */
    public List<RegionalQuotaCapability> regionalQuotas() {
        return this.regionalQuotas;
    }

    /**
     * Set the regionalQuotas property: The list of region quota capabilities.
     *
     * @param regionalQuotas the regionalQuotas value to set.
     * @return the QuotaCapability object itself.
     */
    public QuotaCapability withRegionalQuotas(List<RegionalQuotaCapability> regionalQuotas) {
        this.regionalQuotas = regionalQuotas;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (regionalQuotas() != null) {
            regionalQuotas().forEach(e -> e.validate());
        }
    }
}
