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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.security.models.RuleState;
import com.azure.resourcemanager.security.models.SuppressionAlertsScope;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Describes the suppression rule. */
@Fluent
public final class AlertsSuppressionRuleInner extends ProxyResource {
    /*
     * describes AlertsSuppressionRule properties
     */
    @JsonProperty(value = "properties")
    private AlertsSuppressionRuleProperties innerProperties;

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

    /**
     * Get the innerProperties property: describes AlertsSuppressionRule properties.
     *
     * @return the innerProperties value.
     */
    private AlertsSuppressionRuleProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'.
     *
     * @return the alertType value.
     */
    public String alertType() {
        return this.innerProperties() == null ? null : this.innerProperties().alertType();
    }

    /**
     * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'.
     *
     * @param alertType the alertType value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withAlertType(String alertType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withAlertType(alertType);
        return this;
    }

    /**
     * Get the lastModifiedUtc property: The last time this rule was modified.
     *
     * @return the lastModifiedUtc value.
     */
    public OffsetDateTime lastModifiedUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc();
    }

    /**
     * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null
     * this field will default to the maximum allowed expiration date.
     *
     * @return the expirationDateUtc value.
     */
    public OffsetDateTime expirationDateUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().expirationDateUtc();
    }

    /**
     * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null
     * this field will default to the maximum allowed expiration date.
     *
     * @param expirationDateUtc the expirationDateUtc value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expirationDateUtc) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withExpirationDateUtc(expirationDateUtc);
        return this;
    }

    /**
     * Get the reason property: The reason for dismissing the alert.
     *
     * @return the reason value.
     */
    public String reason() {
        return this.innerProperties() == null ? null : this.innerProperties().reason();
    }

    /**
     * Set the reason property: The reason for dismissing the alert.
     *
     * @param reason the reason value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withReason(String reason) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withReason(reason);
        return this;
    }

    /**
     * Get the state property: Possible states of the rule.
     *
     * @return the state value.
     */
    public RuleState state() {
        return this.innerProperties() == null ? null : this.innerProperties().state();
    }

    /**
     * Set the state property: Possible states of the rule.
     *
     * @param state the state value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withState(RuleState state) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withState(state);
        return this;
    }

    /**
     * Get the comment property: Any comment regarding the rule.
     *
     * @return the comment value.
     */
    public String comment() {
        return this.innerProperties() == null ? null : this.innerProperties().comment();
    }

    /**
     * Set the comment property: Any comment regarding the rule.
     *
     * @param comment the comment value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withComment(String comment) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withComment(comment);
        return this;
    }

    /**
     * Get the suppressionAlertsScope property: The suppression conditions.
     *
     * @return the suppressionAlertsScope value.
     */
    public SuppressionAlertsScope suppressionAlertsScope() {
        return this.innerProperties() == null ? null : this.innerProperties().suppressionAlertsScope();
    }

    /**
     * Set the suppressionAlertsScope property: The suppression conditions.
     *
     * @param suppressionAlertsScope the suppressionAlertsScope value to set.
     * @return the AlertsSuppressionRuleInner object itself.
     */
    public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AlertsSuppressionRuleProperties();
        }
        this.innerProperties().withSuppressionAlertsScope(suppressionAlertsScope);
        return this;
    }

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