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

package com.azure.resourcemanager.hdinsight.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The details of metric specifications. */
@Fluent
public final class MetricSpecifications {
    /*
     * The name of the metric specification.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The display name of the metric specification.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * The display description of the metric specification.
     */
    @JsonProperty(value = "displayDescription")
    private String displayDescription;

    /*
     * The unit of the metric specification.
     */
    @JsonProperty(value = "unit")
    private String unit;

    /*
     * The aggregation type of the metric specification.
     */
    @JsonProperty(value = "aggregationType")
    private String aggregationType;

    /*
     * The supported aggregation types of the metric specification.
     */
    @JsonProperty(value = "supportedAggregationTypes")
    private List<String> supportedAggregationTypes;

    /*
     * The supported time grain types of the metric specification.
     */
    @JsonProperty(value = "supportedTimeGrainTypes")
    private List<String> supportedTimeGrainTypes;

    /*
     * The flag indicates whether enable regional mdm account or not.
     */
    @JsonProperty(value = "enableRegionalMdmAccount")
    private Boolean enableRegionalMdmAccount;

    /*
     * The source mdm account.
     */
    @JsonProperty(value = "sourceMdmAccount")
    private String sourceMdmAccount;

    /*
     * The source mdm namespace.
     */
    @JsonProperty(value = "sourceMdmNamespace")
    private String sourceMdmNamespace;

    /*
     * The metric filter pattern.
     */
    @JsonProperty(value = "metricFilterPattern")
    private String metricFilterPattern;

    /*
     * The flag indicates whether filling gap with zero.
     */
    @JsonProperty(value = "fillGapWithZero")
    private Boolean fillGapWithZero;

    /*
     * The category of the metric.
     */
    @JsonProperty(value = "category")
    private String category;

    /*
     * The override name of resource id dimension name.
     */
    @JsonProperty(value = "resourceIdDimensionNameOverride")
    private String resourceIdDimensionNameOverride;

    /*
     * The flag indicates whether the metric is internal or not.
     */
    @JsonProperty(value = "isInternal")
    private Boolean isInternal;

    /*
     * The override name of delegate metric.
     */
    @JsonProperty(value = "delegateMetricNameOverride")
    private String delegateMetricNameOverride;

    /*
     * The dimensions of the metric specification.
     */
    @JsonProperty(value = "dimensions")
    private List<Dimension> dimensions;

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

    /**
     * Get the name property: The name of the metric specification.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name of the metric specification.
     *
     * @param name the name value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the displayName property: The display name of the metric specification.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: The display name of the metric specification.
     *
     * @param displayName the displayName value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the displayDescription property: The display description of the metric specification.
     *
     * @return the displayDescription value.
     */
    public String displayDescription() {
        return this.displayDescription;
    }

    /**
     * Set the displayDescription property: The display description of the metric specification.
     *
     * @param displayDescription the displayDescription value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withDisplayDescription(String displayDescription) {
        this.displayDescription = displayDescription;
        return this;
    }

    /**
     * Get the unit property: The unit of the metric specification.
     *
     * @return the unit value.
     */
    public String unit() {
        return this.unit;
    }

    /**
     * Set the unit property: The unit of the metric specification.
     *
     * @param unit the unit value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withUnit(String unit) {
        this.unit = unit;
        return this;
    }

    /**
     * Get the aggregationType property: The aggregation type of the metric specification.
     *
     * @return the aggregationType value.
     */
    public String aggregationType() {
        return this.aggregationType;
    }

    /**
     * Set the aggregationType property: The aggregation type of the metric specification.
     *
     * @param aggregationType the aggregationType value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withAggregationType(String aggregationType) {
        this.aggregationType = aggregationType;
        return this;
    }

    /**
     * Get the supportedAggregationTypes property: The supported aggregation types of the metric specification.
     *
     * @return the supportedAggregationTypes value.
     */
    public List<String> supportedAggregationTypes() {
        return this.supportedAggregationTypes;
    }

    /**
     * Set the supportedAggregationTypes property: The supported aggregation types of the metric specification.
     *
     * @param supportedAggregationTypes the supportedAggregationTypes value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withSupportedAggregationTypes(List<String> supportedAggregationTypes) {
        this.supportedAggregationTypes = supportedAggregationTypes;
        return this;
    }

    /**
     * Get the supportedTimeGrainTypes property: The supported time grain types of the metric specification.
     *
     * @return the supportedTimeGrainTypes value.
     */
    public List<String> supportedTimeGrainTypes() {
        return this.supportedTimeGrainTypes;
    }

    /**
     * Set the supportedTimeGrainTypes property: The supported time grain types of the metric specification.
     *
     * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withSupportedTimeGrainTypes(List<String> supportedTimeGrainTypes) {
        this.supportedTimeGrainTypes = supportedTimeGrainTypes;
        return this;
    }

    /**
     * Get the enableRegionalMdmAccount property: The flag indicates whether enable regional mdm account or not.
     *
     * @return the enableRegionalMdmAccount value.
     */
    public Boolean enableRegionalMdmAccount() {
        return this.enableRegionalMdmAccount;
    }

    /**
     * Set the enableRegionalMdmAccount property: The flag indicates whether enable regional mdm account or not.
     *
     * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) {
        this.enableRegionalMdmAccount = enableRegionalMdmAccount;
        return this;
    }

    /**
     * Get the sourceMdmAccount property: The source mdm account.
     *
     * @return the sourceMdmAccount value.
     */
    public String sourceMdmAccount() {
        return this.sourceMdmAccount;
    }

    /**
     * Set the sourceMdmAccount property: The source mdm account.
     *
     * @param sourceMdmAccount the sourceMdmAccount value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withSourceMdmAccount(String sourceMdmAccount) {
        this.sourceMdmAccount = sourceMdmAccount;
        return this;
    }

    /**
     * Get the sourceMdmNamespace property: The source mdm namespace.
     *
     * @return the sourceMdmNamespace value.
     */
    public String sourceMdmNamespace() {
        return this.sourceMdmNamespace;
    }

    /**
     * Set the sourceMdmNamespace property: The source mdm namespace.
     *
     * @param sourceMdmNamespace the sourceMdmNamespace value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withSourceMdmNamespace(String sourceMdmNamespace) {
        this.sourceMdmNamespace = sourceMdmNamespace;
        return this;
    }

    /**
     * Get the metricFilterPattern property: The metric filter pattern.
     *
     * @return the metricFilterPattern value.
     */
    public String metricFilterPattern() {
        return this.metricFilterPattern;
    }

    /**
     * Set the metricFilterPattern property: The metric filter pattern.
     *
     * @param metricFilterPattern the metricFilterPattern value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withMetricFilterPattern(String metricFilterPattern) {
        this.metricFilterPattern = metricFilterPattern;
        return this;
    }

    /**
     * Get the fillGapWithZero property: The flag indicates whether filling gap with zero.
     *
     * @return the fillGapWithZero value.
     */
    public Boolean fillGapWithZero() {
        return this.fillGapWithZero;
    }

    /**
     * Set the fillGapWithZero property: The flag indicates whether filling gap with zero.
     *
     * @param fillGapWithZero the fillGapWithZero value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withFillGapWithZero(Boolean fillGapWithZero) {
        this.fillGapWithZero = fillGapWithZero;
        return this;
    }

    /**
     * Get the category property: The category of the metric.
     *
     * @return the category value.
     */
    public String category() {
        return this.category;
    }

    /**
     * Set the category property: The category of the metric.
     *
     * @param category the category value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withCategory(String category) {
        this.category = category;
        return this;
    }

    /**
     * Get the resourceIdDimensionNameOverride property: The override name of resource id dimension name.
     *
     * @return the resourceIdDimensionNameOverride value.
     */
    public String resourceIdDimensionNameOverride() {
        return this.resourceIdDimensionNameOverride;
    }

    /**
     * Set the resourceIdDimensionNameOverride property: The override name of resource id dimension name.
     *
     * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) {
        this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride;
        return this;
    }

    /**
     * Get the isInternal property: The flag indicates whether the metric is internal or not.
     *
     * @return the isInternal value.
     */
    public Boolean isInternal() {
        return this.isInternal;
    }

    /**
     * Set the isInternal property: The flag indicates whether the metric is internal or not.
     *
     * @param isInternal the isInternal value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withIsInternal(Boolean isInternal) {
        this.isInternal = isInternal;
        return this;
    }

    /**
     * Get the delegateMetricNameOverride property: The override name of delegate metric.
     *
     * @return the delegateMetricNameOverride value.
     */
    public String delegateMetricNameOverride() {
        return this.delegateMetricNameOverride;
    }

    /**
     * Set the delegateMetricNameOverride property: The override name of delegate metric.
     *
     * @param delegateMetricNameOverride the delegateMetricNameOverride value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withDelegateMetricNameOverride(String delegateMetricNameOverride) {
        this.delegateMetricNameOverride = delegateMetricNameOverride;
        return this;
    }

    /**
     * Get the dimensions property: The dimensions of the metric specification.
     *
     * @return the dimensions value.
     */
    public List<Dimension> dimensions() {
        return this.dimensions;
    }

    /**
     * Set the dimensions property: The dimensions of the metric specification.
     *
     * @param dimensions the dimensions value to set.
     * @return the MetricSpecifications object itself.
     */
    public MetricSpecifications withDimensions(List<Dimension> dimensions) {
        this.dimensions = dimensions;
        return this;
    }

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