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

package com.azure.resourcemanager.synapse.models;

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

/** What is this?. */
@Fluent
public final class OperationMetaMetricSpecification {
    /*
     * The source MDM namespace
     */
    @JsonProperty(value = "sourceMdmNamespace")
    private String sourceMdmNamespace;

    /*
     * Metric display name
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * Metric unique name
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Metric aggregation type
     */
    @JsonProperty(value = "aggregationType")
    private String aggregationType;

    /*
     * Metric description
     */
    @JsonProperty(value = "displayDescription")
    private String displayDescription;

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

    /*
     * Whether the regional MDM account is enabled
     */
    @JsonProperty(value = "enableRegionalMdmAccount")
    private Boolean enableRegionalMdmAccount;

    /*
     * Metric units
     */
    @JsonProperty(value = "unit")
    private String unit;

    /*
     * Metric dimensions
     */
    @JsonProperty(value = "dimensions")
    private List<OperationMetaMetricDimensionSpecification> dimensions;

    /*
     * Whether the metric supports instance-level aggregation
     */
    @JsonProperty(value = "supportsInstanceLevelAggregation")
    private Boolean supportsInstanceLevelAggregation;

    /*
     * Metric filter
     */
    @JsonProperty(value = "metricFilterPattern")
    private String metricFilterPattern;

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

    /**
     * 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 OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) {
        this.sourceMdmNamespace = sourceMdmNamespace;
        return this;
    }

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

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

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

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

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

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

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

    /**
     * Set the displayDescription property: Metric description.
     *
     * @param displayDescription the displayDescription value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withDisplayDescription(String displayDescription) {
        this.displayDescription = displayDescription;
        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 OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withSourceMdmAccount(String sourceMdmAccount) {
        this.sourceMdmAccount = sourceMdmAccount;
        return this;
    }

    /**
     * Get the enableRegionalMdmAccount property: Whether the regional MDM account is enabled.
     *
     * @return the enableRegionalMdmAccount value.
     */
    public Boolean enableRegionalMdmAccount() {
        return this.enableRegionalMdmAccount;
    }

    /**
     * Set the enableRegionalMdmAccount property: Whether the regional MDM account is enabled.
     *
     * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) {
        this.enableRegionalMdmAccount = enableRegionalMdmAccount;
        return this;
    }

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

    /**
     * Set the unit property: Metric units.
     *
     * @param unit the unit value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withUnit(String unit) {
        this.unit = unit;
        return this;
    }

    /**
     * Get the dimensions property: Metric dimensions.
     *
     * @return the dimensions value.
     */
    public List<OperationMetaMetricDimensionSpecification> dimensions() {
        return this.dimensions;
    }

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

    /**
     * Get the supportsInstanceLevelAggregation property: Whether the metric supports instance-level aggregation.
     *
     * @return the supportsInstanceLevelAggregation value.
     */
    public Boolean supportsInstanceLevelAggregation() {
        return this.supportsInstanceLevelAggregation;
    }

    /**
     * Set the supportsInstanceLevelAggregation property: Whether the metric supports instance-level aggregation.
     *
     * @param supportsInstanceLevelAggregation the supportsInstanceLevelAggregation value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withSupportsInstanceLevelAggregation(
        Boolean supportsInstanceLevelAggregation) {
        this.supportsInstanceLevelAggregation = supportsInstanceLevelAggregation;
        return this;
    }

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

    /**
     * Set the metricFilterPattern property: Metric filter.
     *
     * @param metricFilterPattern the metricFilterPattern value to set.
     * @return the OperationMetaMetricSpecification object itself.
     */
    public OperationMetaMetricSpecification withMetricFilterPattern(String metricFilterPattern) {
        this.metricFilterPattern = metricFilterPattern;
        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());
        }
    }
}
