// 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.fasterxml.jackson.annotation.JsonProperty;

/** Incident Configuration property bag. */
@Fluent
public final class IncidentConfiguration {
    /*
     * Create incidents from alerts triggered by this analytics rule
     */
    @JsonProperty(value = "createIncident", required = true)
    private boolean createIncident;

    /*
     * Set how the alerts that are triggered by this analytics rule, are grouped into incidents
     */
    @JsonProperty(value = "groupingConfiguration")
    private GroupingConfiguration groupingConfiguration;

    /**
     * Get the createIncident property: Create incidents from alerts triggered by this analytics rule.
     *
     * @return the createIncident value.
     */
    public boolean createIncident() {
        return this.createIncident;
    }

    /**
     * Set the createIncident property: Create incidents from alerts triggered by this analytics rule.
     *
     * @param createIncident the createIncident value to set.
     * @return the IncidentConfiguration object itself.
     */
    public IncidentConfiguration withCreateIncident(boolean createIncident) {
        this.createIncident = createIncident;
        return this;
    }

    /**
     * Get the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped
     * into incidents.
     *
     * @return the groupingConfiguration value.
     */
    public GroupingConfiguration groupingConfiguration() {
        return this.groupingConfiguration;
    }

    /**
     * Set the groupingConfiguration property: Set how the alerts that are triggered by this analytics rule, are grouped
     * into incidents.
     *
     * @param groupingConfiguration the groupingConfiguration value to set.
     * @return the IncidentConfiguration object itself.
     */
    public IncidentConfiguration withGroupingConfiguration(GroupingConfiguration groupingConfiguration) {
        this.groupingConfiguration = groupingConfiguration;
        return this;
    }

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