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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.dynatrace.models.LogRules;
import com.azure.resourcemanager.dynatrace.models.MetricRules;
import com.azure.resourcemanager.dynatrace.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties for the Tag rules resource of a Monitor account. */
@Fluent
public final class MonitoringTagRulesProperties {
    /*
     * Set of rules for sending logs for the Monitor resource.
     */
    @JsonProperty(value = "logRules")
    private LogRules logRules;

    /*
     * Set of rules for sending metrics for the Monitor resource.
     */
    @JsonProperty(value = "metricRules")
    private MetricRules metricRules;

    /*
     * Provisioning state of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /**
     * Get the logRules property: Set of rules for sending logs for the Monitor resource.
     *
     * @return the logRules value.
     */
    public LogRules logRules() {
        return this.logRules;
    }

    /**
     * Set the logRules property: Set of rules for sending logs for the Monitor resource.
     *
     * @param logRules the logRules value to set.
     * @return the MonitoringTagRulesProperties object itself.
     */
    public MonitoringTagRulesProperties withLogRules(LogRules logRules) {
        this.logRules = logRules;
        return this;
    }

    /**
     * Get the metricRules property: Set of rules for sending metrics for the Monitor resource.
     *
     * @return the metricRules value.
     */
    public MetricRules metricRules() {
        return this.metricRules;
    }

    /**
     * Set the metricRules property: Set of rules for sending metrics for the Monitor resource.
     *
     * @param metricRules the metricRules value to set.
     * @return the MonitoringTagRulesProperties object itself.
     */
    public MonitoringTagRulesProperties withMetricRules(MetricRules metricRules) {
        this.metricRules = metricRules;
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (logRules() != null) {
            logRules().validate();
        }
        if (metricRules() != null) {
            metricRules().validate();
        }
    }
}
