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

package com.azure.resourcemanager.datadog.models;

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

/** Set of rules for sending metrics for the Monitor resource. */
@Fluent
public final class MetricRules {
    /*
     * List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only
     * Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are
     * specified, the rules will only include resources with the associated tags.
     */
    @JsonProperty(value = "filteringTags")
    private List<FilteringTag> filteringTags;

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

    /**
     * Get the filteringTags property: List of filtering tags to be used for capturing metrics. If empty, all resources
     * will be captured. If only Exclude action is specified, the rules will apply to the list of all available
     * resources. If Include actions are specified, the rules will only include resources with the associated tags.
     *
     * @return the filteringTags value.
     */
    public List<FilteringTag> filteringTags() {
        return this.filteringTags;
    }

    /**
     * Set the filteringTags property: List of filtering tags to be used for capturing metrics. If empty, all resources
     * will be captured. If only Exclude action is specified, the rules will apply to the list of all available
     * resources. If Include actions are specified, the rules will only include resources with the associated tags.
     *
     * @param filteringTags the filteringTags value to set.
     * @return the MetricRules object itself.
     */
    public MetricRules withFilteringTags(List<FilteringTag> filteringTags) {
        this.filteringTags = filteringTags;
        return this;
    }

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