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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationDetailedStatus;
import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState;
import com.azure.resourcemanager.networkcloud.models.ExtendedLocation;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. */
@Fluent
public final class ClusterMetricsConfigurationInner extends Resource {
    /*
     * ExtendedLocation represents the Azure custom location where the resource will be created.
     *
     * The extended location of the cluster associated with the resource.
     */
    @JsonProperty(value = "extendedLocation", required = true)
    private ExtendedLocation extendedLocation;

    /*
     * ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private ClusterMetricsConfigurationProperties innerProperties = new ClusterMetricsConfigurationProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will
     * be created.
     *
     * <p>The extended location of the cluster associated with the resource.
     *
     * @return the extendedLocation value.
     */
    public ExtendedLocation extendedLocation() {
        return this.extendedLocation;
    }

    /**
     * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will
     * be created.
     *
     * <p>The extended location of the cluster associated with the resource.
     *
     * @param extendedLocation the extendedLocation value to set.
     * @return the ClusterMetricsConfigurationInner object itself.
     */
    public ClusterMetricsConfigurationInner withExtendedLocation(ExtendedLocation extendedLocation) {
        this.extendedLocation = extendedLocation;
        return this;
    }

    /**
     * Get the innerProperties property: ClusterMetricsConfigurationProperties represents the properties of metrics
     * configuration for the cluster.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private ClusterMetricsConfigurationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /** {@inheritDoc} */
    @Override
    public ClusterMetricsConfigurationInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ClusterMetricsConfigurationInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the collectionInterval property: The interval in minutes by which metrics will be collected.
     *
     * @return the collectionInterval value.
     */
    public long collectionInterval() {
        return this.innerProperties() == null ? 0L : this.innerProperties().collectionInterval();
    }

    /**
     * Set the collectionInterval property: The interval in minutes by which metrics will be collected.
     *
     * @param collectionInterval the collectionInterval value to set.
     * @return the ClusterMetricsConfigurationInner object itself.
     */
    public ClusterMetricsConfigurationInner withCollectionInterval(long collectionInterval) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterMetricsConfigurationProperties();
        }
        this.innerProperties().withCollectionInterval(collectionInterval);
        return this;
    }

    /**
     * Get the detailedStatus property: The more detailed status of the metrics configuration.
     *
     * @return the detailedStatus value.
     */
    public ClusterMetricsConfigurationDetailedStatus detailedStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().detailedStatus();
    }

    /**
     * Get the detailedStatusMessage property: The descriptive message about the current detailed status.
     *
     * @return the detailedStatusMessage value.
     */
    public String detailedStatusMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage();
    }

    /**
     * Get the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the
     * moment.
     *
     * @return the disabledMetrics value.
     */
    public List<String> disabledMetrics() {
        return this.innerProperties() == null ? null : this.innerProperties().disabledMetrics();
    }

    /**
     * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the
     * core set of enabled metrics.
     *
     * @return the enabledMetrics value.
     */
    public List<String> enabledMetrics() {
        return this.innerProperties() == null ? null : this.innerProperties().enabledMetrics();
    }

    /**
     * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the
     * core set of enabled metrics.
     *
     * @param enabledMetrics the enabledMetrics value to set.
     * @return the ClusterMetricsConfigurationInner object itself.
     */
    public ClusterMetricsConfigurationInner withEnabledMetrics(List<String> enabledMetrics) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterMetricsConfigurationProperties();
        }
        this.innerProperties().withEnabledMetrics(enabledMetrics);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the metrics configuration.
     *
     * @return the provisioningState value.
     */
    public ClusterMetricsConfigurationProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (extendedLocation() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property extendedLocation in model ClusterMetricsConfigurationInner"));
        } else {
            extendedLocation().validate();
        }
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model ClusterMetricsConfigurationInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ClusterMetricsConfigurationInner.class);
}
