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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.timeseriesinsights.models.WarmStoragePropertiesState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** An object that contains the status of warm storage properties usage. */
@Fluent
public final class WarmStoragePropertiesUsage {
    /*
     * This string represents the state of warm storage properties usage. It can be "Ok", "Error", "Unknown".
     */
    @JsonProperty(value = "state")
    private WarmStoragePropertiesState state;

    /*
     * An object that contains the details about warm storage properties usage state.
     */
    @JsonProperty(value = "stateDetails", access = JsonProperty.Access.WRITE_ONLY)
    private WarmStoragePropertiesUsageStateDetails innerStateDetails;

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

    /**
     * Get the state property: This string represents the state of warm storage properties usage. It can be "Ok",
     * "Error", "Unknown".
     *
     * @return the state value.
     */
    public WarmStoragePropertiesState state() {
        return this.state;
    }

    /**
     * Set the state property: This string represents the state of warm storage properties usage. It can be "Ok",
     * "Error", "Unknown".
     *
     * @param state the state value to set.
     * @return the WarmStoragePropertiesUsage object itself.
     */
    public WarmStoragePropertiesUsage withState(WarmStoragePropertiesState state) {
        this.state = state;
        return this;
    }

    /**
     * Get the innerStateDetails property: An object that contains the details about warm storage properties usage
     * state.
     *
     * @return the innerStateDetails value.
     */
    private WarmStoragePropertiesUsageStateDetails innerStateDetails() {
        return this.innerStateDetails;
    }

    /**
     * Get the currentCount property: A value that represents the number of properties used by the environment for S1/S2
     * SKU and number of properties used by Warm Store for PAYG SKU.
     *
     * @return the currentCount value.
     */
    public Integer currentCount() {
        return this.innerStateDetails() == null ? null : this.innerStateDetails().currentCount();
    }

    /**
     * Set the currentCount property: A value that represents the number of properties used by the environment for S1/S2
     * SKU and number of properties used by Warm Store for PAYG SKU.
     *
     * @param currentCount the currentCount value to set.
     * @return the WarmStoragePropertiesUsage object itself.
     */
    public WarmStoragePropertiesUsage withCurrentCount(Integer currentCount) {
        if (this.innerStateDetails() == null) {
            this.innerStateDetails = new WarmStoragePropertiesUsageStateDetails();
        }
        this.innerStateDetails().withCurrentCount(currentCount);
        return this;
    }

    /**
     * Get the maxCount property: A value that represents the maximum number of properties used allowed by the
     * environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU.
     *
     * @return the maxCount value.
     */
    public Integer maxCount() {
        return this.innerStateDetails() == null ? null : this.innerStateDetails().maxCount();
    }

    /**
     * Set the maxCount property: A value that represents the maximum number of properties used allowed by the
     * environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU.
     *
     * @param maxCount the maxCount value to set.
     * @return the WarmStoragePropertiesUsage object itself.
     */
    public WarmStoragePropertiesUsage withMaxCount(Integer maxCount) {
        if (this.innerStateDetails() == null) {
            this.innerStateDetails = new WarmStoragePropertiesUsageStateDetails();
        }
        this.innerStateDetails().withMaxCount(maxCount);
        return this;
    }

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