// 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.models;

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.timeseriesinsights.fluent.models.WarmStoragePropertiesUsage;
import com.fasterxml.jackson.annotation.JsonProperty;

/** An object that represents the status of warm storage on an environment. */
@Immutable
public final class WarmStorageEnvironmentStatus {
    /*
     * An object that contains the status of warm storage properties usage.
     */
    @JsonProperty(value = "propertiesUsage", access = JsonProperty.Access.WRITE_ONLY)
    private WarmStoragePropertiesUsage innerPropertiesUsage;

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

    /**
     * Get the innerPropertiesUsage property: An object that contains the status of warm storage properties usage.
     *
     * @return the innerPropertiesUsage value.
     */
    private WarmStoragePropertiesUsage innerPropertiesUsage() {
        return this.innerPropertiesUsage;
    }

    /**
     * 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.innerPropertiesUsage() == null ? null : this.innerPropertiesUsage().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 WarmStorageEnvironmentStatus object itself.
     */
    public WarmStorageEnvironmentStatus withState(WarmStoragePropertiesState state) {
        if (this.innerPropertiesUsage() == null) {
            this.innerPropertiesUsage = new WarmStoragePropertiesUsage();
        }
        this.innerPropertiesUsage().withState(state);
        return this;
    }

    /**
     * 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.innerPropertiesUsage() == null ? null : this.innerPropertiesUsage().currentCount();
    }

    /**
     * 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.innerPropertiesUsage() == null ? null : this.innerPropertiesUsage().maxCount();
    }

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