// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.FusionAlertRule;
import com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRule;
import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule;
import com.azure.resourcemanager.securityinsights.models.NrtAlertRule;
import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag;
import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Alert rule. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "kind",
    defaultImpl = AlertRuleInner.class)
@JsonTypeName("AlertRule")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "MLBehaviorAnalytics", value = MLBehaviorAnalyticsAlertRule.class),
    @JsonSubTypes.Type(name = "Fusion", value = FusionAlertRule.class),
    @JsonSubTypes.Type(name = "ThreatIntelligence", value = ThreatIntelligenceAlertRule.class),
    @JsonSubTypes.Type(
        name = "MicrosoftSecurityIncidentCreation",
        value = MicrosoftSecurityIncidentCreationAlertRule.class),
    @JsonSubTypes.Type(name = "Scheduled", value = ScheduledAlertRule.class),
    @JsonSubTypes.Type(name = "NRT", value = NrtAlertRule.class)
})
@Fluent
public class AlertRuleInner extends ResourceWithEtag {
    /** {@inheritDoc} */
    @Override
    public AlertRuleInner withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

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