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

package com.azure.resourcemanager.purview.models;

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

/** metric specifications for the operation. */
@Fluent
public final class OperationMetaMetricSpecification {
    /*
     * aggregation type of metric
     */
    @JsonProperty(value = "aggregationType")
    private String aggregationType;

    /*
     * properties for dimension
     */
    @JsonProperty(value = "dimensions")
    private List<DimensionProperties> dimensions;

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

    /*
     * localized name of the metric
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * enable regional mdm account
     */
    @JsonProperty(value = "enableRegionalMdmAccount")
    private String enableRegionalMdmAccount;

    /*
     * internal metric name
     */
    @JsonProperty(value = "internalMetricName")
    private String internalMetricName;

    /*
     * name of the metric
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * dimension name use to replace resource id if specified
     */
    @JsonProperty(value = "resourceIdDimensionNameOverride")
    private String resourceIdDimensionNameOverride;

    /*
     * Metric namespace.
     * Only set the namespace if different from the default value,
     * leaving it empty makes it use the value from the ARM manifest.
     */
    @JsonProperty(value = "sourceMdmNamespace")
    private String sourceMdmNamespace;

    /*
     * supported aggregation types
     */
    @JsonProperty(value = "supportedAggregationTypes")
    private List<String> supportedAggregationTypes;

    /*
     * supported time grain types
     */
    @JsonProperty(value = "supportedTimeGrainTypes")
    private List<String> supportedTimeGrainTypes;

    /*
     * units for the metric
     */
    @JsonProperty(value = "unit")
    private String unit;

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

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

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

    /**
     * Get the dimensions property: properties for dimension.
     *
     * @return the dimensions value.
     */
    public List<DimensionProperties> dimensions() {
        return this.dimensions;
    }

    /**
     * Set the dimensions property: properties for dimension.
     *
     * @param dimensions the dimensions value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withDimensions(List<DimensionProperties> dimensions) {
        this.dimensions = dimensions;
        return this;
    }

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

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

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

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

    /**
     * Get the enableRegionalMdmAccount property: enable regional mdm account.
     *
     * @return the enableRegionalMdmAccount value.
     */
    public String enableRegionalMdmAccount() {
        return this.enableRegionalMdmAccount;
    }

    /**
     * Set the enableRegionalMdmAccount property: enable regional mdm account.
     *
     * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withEnableRegionalMdmAccount(String enableRegionalMdmAccount) {
        this.enableRegionalMdmAccount = enableRegionalMdmAccount;
        return this;
    }

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

    /**
     * Set the internalMetricName property: internal metric name.
     *
     * @param internalMetricName the internalMetricName value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withInternalMetricName(String internalMetricName) {
        this.internalMetricName = internalMetricName;
        return this;
    }

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

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

    /**
     * Get the resourceIdDimensionNameOverride property: dimension name use to replace resource id if specified.
     *
     * @return the resourceIdDimensionNameOverride value.
     */
    public String resourceIdDimensionNameOverride() {
        return this.resourceIdDimensionNameOverride;
    }

    /**
     * Set the resourceIdDimensionNameOverride property: dimension name use to replace resource id if specified.
     *
     * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withResourceIdDimensionNameOverride(
        String resourceIdDimensionNameOverride) {
        this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride;
        return this;
    }

    /**
     * Get the sourceMdmNamespace property: Metric namespace. Only set the namespace if different from the default
     * value, leaving it empty makes it use the value from the ARM manifest.
     *
     * @return the sourceMdmNamespace value.
     */
    public String sourceMdmNamespace() {
        return this.sourceMdmNamespace;
    }

    /**
     * Set the sourceMdmNamespace property: Metric namespace. Only set the namespace if different from the default
     * value, leaving it empty makes it use the value from the ARM manifest.
     *
     * @param sourceMdmNamespace the sourceMdmNamespace value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) {
        this.sourceMdmNamespace = sourceMdmNamespace;
        return this;
    }

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

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

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

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

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

    /**
     * Set the unit property: units for the metric.
     *
     * @param unit the unit value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withUnit(String unit) {
        this.unit = unit;
        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());
        }
    }
}
