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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner;
import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.OffsetDateTime;
import java.util.List;

/** Represents MLBehaviorAnalytics alert rule. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("MLBehaviorAnalytics")
@Fluent
public final class MLBehaviorAnalyticsAlertRule extends AlertRuleInner {
    /*
     * MLBehaviorAnalytics alert rule properties
     */
    @JsonProperty(value = "properties")
    private MLBehaviorAnalyticsAlertRuleProperties innerProperties;

    /**
     * Get the innerProperties property: MLBehaviorAnalytics alert rule properties.
     *
     * @return the innerProperties value.
     */
    private MLBehaviorAnalyticsAlertRuleProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public MLBehaviorAnalyticsAlertRule withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the alertRuleTemplateName property: The Name of the alert rule template used to create this rule.
     *
     * @return the alertRuleTemplateName value.
     */
    public String alertRuleTemplateName() {
        return this.innerProperties() == null ? null : this.innerProperties().alertRuleTemplateName();
    }

    /**
     * Set the alertRuleTemplateName property: The Name of the alert rule template used to create this rule.
     *
     * @param alertRuleTemplateName the alertRuleTemplateName value to set.
     * @return the MLBehaviorAnalyticsAlertRule object itself.
     */
    public MLBehaviorAnalyticsAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MLBehaviorAnalyticsAlertRuleProperties();
        }
        this.innerProperties().withAlertRuleTemplateName(alertRuleTemplateName);
        return this;
    }

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

    /**
     * Get the displayName property: The display name for alerts created by this alert rule.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Get the enabled property: Determines whether this alert rule is enabled or disabled.
     *
     * @return the enabled value.
     */
    public Boolean enabled() {
        return this.innerProperties() == null ? null : this.innerProperties().enabled();
    }

    /**
     * Set the enabled property: Determines whether this alert rule is enabled or disabled.
     *
     * @param enabled the enabled value to set.
     * @return the MLBehaviorAnalyticsAlertRule object itself.
     */
    public MLBehaviorAnalyticsAlertRule withEnabled(Boolean enabled) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MLBehaviorAnalyticsAlertRuleProperties();
        }
        this.innerProperties().withEnabled(enabled);
        return this;
    }

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

    /**
     * Get the severity property: The severity for alerts created by this alert rule.
     *
     * @return the severity value.
     */
    public AlertSeverity severity() {
        return this.innerProperties() == null ? null : this.innerProperties().severity();
    }

    /**
     * Get the tactics property: The tactics of the alert rule.
     *
     * @return the tactics value.
     */
    public List<AttackTactic> tactics() {
        return this.innerProperties() == null ? null : this.innerProperties().tactics();
    }

    /**
     * Get the techniques property: The techniques of the alert rule.
     *
     * @return the techniques value.
     */
    public List<String> techniques() {
        return this.innerProperties() == null ? null : this.innerProperties().techniques();
    }

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