// 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 logs for the Monitor resource. */
@Fluent
public final class LogRules {
    /*
     * Flag specifying if AAD logs should be sent for the Monitor resource.
     */
    @JsonProperty(value = "sendAadLogs")
    private Boolean sendAadLogs;

    /*
     * Flag specifying if Azure subscription logs should be sent for the Monitor resource.
     */
    @JsonProperty(value = "sendSubscriptionLogs")
    private Boolean sendSubscriptionLogs;

    /*
     * Flag specifying if Azure resource logs should be sent for the Monitor resource.
     */
    @JsonProperty(value = "sendResourceLogs")
    private Boolean sendResourceLogs;

    /*
     * List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is
     * enabled. 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 LogRules class. */
    public LogRules() {
    }

    /**
     * Get the sendAadLogs property: Flag specifying if AAD logs should be sent for the Monitor resource.
     *
     * @return the sendAadLogs value.
     */
    public Boolean sendAadLogs() {
        return this.sendAadLogs;
    }

    /**
     * Set the sendAadLogs property: Flag specifying if AAD logs should be sent for the Monitor resource.
     *
     * @param sendAadLogs the sendAadLogs value to set.
     * @return the LogRules object itself.
     */
    public LogRules withSendAadLogs(Boolean sendAadLogs) {
        this.sendAadLogs = sendAadLogs;
        return this;
    }

    /**
     * Get the sendSubscriptionLogs property: Flag specifying if Azure subscription logs should be sent for the Monitor
     * resource.
     *
     * @return the sendSubscriptionLogs value.
     */
    public Boolean sendSubscriptionLogs() {
        return this.sendSubscriptionLogs;
    }

    /**
     * Set the sendSubscriptionLogs property: Flag specifying if Azure subscription logs should be sent for the Monitor
     * resource.
     *
     * @param sendSubscriptionLogs the sendSubscriptionLogs value to set.
     * @return the LogRules object itself.
     */
    public LogRules withSendSubscriptionLogs(Boolean sendSubscriptionLogs) {
        this.sendSubscriptionLogs = sendSubscriptionLogs;
        return this;
    }

    /**
     * Get the sendResourceLogs property: Flag specifying if Azure resource logs should be sent for the Monitor
     * resource.
     *
     * @return the sendResourceLogs value.
     */
    public Boolean sendResourceLogs() {
        return this.sendResourceLogs;
    }

    /**
     * Set the sendResourceLogs property: Flag specifying if Azure resource logs should be sent for the Monitor
     * resource.
     *
     * @param sendResourceLogs the sendResourceLogs value to set.
     * @return the LogRules object itself.
     */
    public LogRules withSendResourceLogs(Boolean sendResourceLogs) {
        this.sendResourceLogs = sendResourceLogs;
        return this;
    }

    /**
     * Get the filteringTags property: List of filtering tags to be used for capturing logs. This only takes effect if
     * SendResourceLogs flag is enabled. 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 logs. This only takes effect if
     * SendResourceLogs flag is enabled. 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 LogRules object itself.
     */
    public LogRules 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());
        }
    }
}
