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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.newrelicobservability.models.FilteringTag;
import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Set of rules for sending metrics for the Monitor resource. */
@Fluent
public final class MetricRulesInner {
    /*
     * Flag specifying if metrics should be sent for the Monitor resource.
     */
    @JsonProperty(value = "sendMetrics")
    private SendMetricsStatus sendMetrics;

    /*
     * List of filtering tags to be used for capturing metrics.
     */
    @JsonProperty(value = "filteringTags")
    private List<FilteringTag> filteringTags;

    /*
     * User Email
     */
    @JsonProperty(value = "userEmail")
    private String userEmail;

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

    /**
     * Get the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource.
     *
     * @return the sendMetrics value.
     */
    public SendMetricsStatus sendMetrics() {
        return this.sendMetrics;
    }

    /**
     * Set the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource.
     *
     * @param sendMetrics the sendMetrics value to set.
     * @return the MetricRulesInner object itself.
     */
    public MetricRulesInner withSendMetrics(SendMetricsStatus sendMetrics) {
        this.sendMetrics = sendMetrics;
        return this;
    }

    /**
     * Get the filteringTags property: List of filtering tags to be used for capturing metrics.
     *
     * @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.
     *
     * @param filteringTags the filteringTags value to set.
     * @return the MetricRulesInner object itself.
     */
    public MetricRulesInner withFilteringTags(List<FilteringTag> filteringTags) {
        this.filteringTags = filteringTags;
        return this;
    }

    /**
     * Get the userEmail property: User Email.
     *
     * @return the userEmail value.
     */
    public String userEmail() {
        return this.userEmail;
    }

    /**
     * Set the userEmail property: User Email.
     *
     * @param userEmail the userEmail value to set.
     * @return the MetricRulesInner object itself.
     */
    public MetricRulesInner withUserEmail(String userEmail) {
        this.userEmail = userEmail;
        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());
        }
    }
}
