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

package com.azure.resourcemanager.streamanalytics.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.SubResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.streamanalytics.fluent.models.SubscriptionQuotaProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Describes the current quota for the subscription. */
@Fluent
public final class SubscriptionQuota extends SubResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionQuota.class);

    /*
     * Describes the properties of the quota.
     */
    @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY)
    private SubscriptionQuotaProperties innerProperties;

    /*
     * Resource name
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Resource type
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /**
     * Get the innerProperties property: Describes the properties of the quota.
     *
     * @return the innerProperties value.
     */
    private SubscriptionQuotaProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: Resource name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Resource name.
     *
     * @param name the name value to set.
     * @return the SubscriptionQuota object itself.
     */
    public SubscriptionQuota withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the type property: Resource type.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /** {@inheritDoc} */
    @Override
    public SubscriptionQuota withId(String id) {
        super.withId(id);
        return this;
    }

    /**
     * Get the maxCount property: The max permitted usage of this resource.
     *
     * @return the maxCount value.
     */
    public Integer maxCount() {
        return this.innerProperties() == null ? null : this.innerProperties().maxCount();
    }

    /**
     * Get the currentCount property: The current usage of this resource.
     *
     * @return the currentCount value.
     */
    public Integer currentCount() {
        return this.innerProperties() == null ? null : this.innerProperties().currentCount();
    }

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