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

package com.azure.resourcemanager.automation.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.models.UsageCounterName;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Definition of Usage. */
@Fluent
public final class UsageInner {
    /*
     * Gets or sets the id of the resource.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Gets or sets the usage counter name.
     */
    @JsonProperty(value = "name")
    private UsageCounterName name;

    /*
     * Gets or sets the usage unit name.
     */
    @JsonProperty(value = "unit")
    private String unit;

    /*
     * Gets or sets the current usage value.
     */
    @JsonProperty(value = "currentValue")
    private Double currentValue;

    /*
     * Gets or sets max limit. -1 for unlimited
     */
    @JsonProperty(value = "limit")
    private Long limit;

    /*
     * Gets or sets the throttle status.
     */
    @JsonProperty(value = "throttleStatus")
    private String throttleStatus;

    /**
     * Get the id property: Gets or sets the id of the resource.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Gets or sets the id of the resource.
     *
     * @param id the id value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the name property: Gets or sets the usage counter name.
     *
     * @return the name value.
     */
    public UsageCounterName name() {
        return this.name;
    }

    /**
     * Set the name property: Gets or sets the usage counter name.
     *
     * @param name the name value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withName(UsageCounterName name) {
        this.name = name;
        return this;
    }

    /**
     * Get the unit property: Gets or sets the usage unit name.
     *
     * @return the unit value.
     */
    public String unit() {
        return this.unit;
    }

    /**
     * Set the unit property: Gets or sets the usage unit name.
     *
     * @param unit the unit value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withUnit(String unit) {
        this.unit = unit;
        return this;
    }

    /**
     * Get the currentValue property: Gets or sets the current usage value.
     *
     * @return the currentValue value.
     */
    public Double currentValue() {
        return this.currentValue;
    }

    /**
     * Set the currentValue property: Gets or sets the current usage value.
     *
     * @param currentValue the currentValue value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withCurrentValue(Double currentValue) {
        this.currentValue = currentValue;
        return this;
    }

    /**
     * Get the limit property: Gets or sets max limit. -1 for unlimited.
     *
     * @return the limit value.
     */
    public Long limit() {
        return this.limit;
    }

    /**
     * Set the limit property: Gets or sets max limit. -1 for unlimited.
     *
     * @param limit the limit value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withLimit(Long limit) {
        this.limit = limit;
        return this;
    }

    /**
     * Get the throttleStatus property: Gets or sets the throttle status.
     *
     * @return the throttleStatus value.
     */
    public String throttleStatus() {
        return this.throttleStatus;
    }

    /**
     * Set the throttleStatus property: Gets or sets the throttle status.
     *
     * @param throttleStatus the throttleStatus value to set.
     * @return the UsageInner object itself.
     */
    public UsageInner withThrottleStatus(String throttleStatus) {
        this.throttleStatus = throttleStatus;
        return this;
    }

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