// 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.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** MicrosoftSecurityIncidentCreation rule common property bag. */
@Fluent
public class MicrosoftSecurityIncidentCreationAlertRuleCommonProperties {
    /*
     * the alerts' displayNames on which the cases will be generated
     */
    @JsonProperty(value = "displayNamesFilter")
    private List<String> displayNamesFilter;

    /*
     * the alerts' displayNames on which the cases will not be generated
     */
    @JsonProperty(value = "displayNamesExcludeFilter")
    private List<String> displayNamesExcludeFilter;

    /*
     * The alerts' productName on which the cases will be generated
     */
    @JsonProperty(value = "productFilter", required = true)
    private MicrosoftSecurityProductName productFilter;

    /*
     * the alerts' severities on which the cases will be generated
     */
    @JsonProperty(value = "severitiesFilter")
    private List<AlertSeverity> severitiesFilter;

    /**
     * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated.
     *
     * @return the displayNamesFilter value.
     */
    public List<String> displayNamesFilter() {
        return this.displayNamesFilter;
    }

    /**
     * Set the displayNamesFilter property: the alerts' displayNames on which the cases will be generated.
     *
     * @param displayNamesFilter the displayNamesFilter value to set.
     * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself.
     */
    public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesFilter(
        List<String> displayNamesFilter) {
        this.displayNamesFilter = displayNamesFilter;
        return this;
    }

    /**
     * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated.
     *
     * @return the displayNamesExcludeFilter value.
     */
    public List<String> displayNamesExcludeFilter() {
        return this.displayNamesExcludeFilter;
    }

    /**
     * Set the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated.
     *
     * @param displayNamesExcludeFilter the displayNamesExcludeFilter value to set.
     * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself.
     */
    public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withDisplayNamesExcludeFilter(
        List<String> displayNamesExcludeFilter) {
        this.displayNamesExcludeFilter = displayNamesExcludeFilter;
        return this;
    }

    /**
     * Get the productFilter property: The alerts' productName on which the cases will be generated.
     *
     * @return the productFilter value.
     */
    public MicrosoftSecurityProductName productFilter() {
        return this.productFilter;
    }

    /**
     * Set the productFilter property: The alerts' productName on which the cases will be generated.
     *
     * @param productFilter the productFilter value to set.
     * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself.
     */
    public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withProductFilter(
        MicrosoftSecurityProductName productFilter) {
        this.productFilter = productFilter;
        return this;
    }

    /**
     * Get the severitiesFilter property: the alerts' severities on which the cases will be generated.
     *
     * @return the severitiesFilter value.
     */
    public List<AlertSeverity> severitiesFilter() {
        return this.severitiesFilter;
    }

    /**
     * Set the severitiesFilter property: the alerts' severities on which the cases will be generated.
     *
     * @param severitiesFilter the severitiesFilter value to set.
     * @return the MicrosoftSecurityIncidentCreationAlertRuleCommonProperties object itself.
     */
    public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties withSeveritiesFilter(
        List<AlertSeverity> severitiesFilter) {
        this.severitiesFilter = severitiesFilter;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (productFilter() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property productFilter in model"
                            + " MicrosoftSecurityIncidentCreationAlertRuleCommonProperties"));
        }
    }

    private static final ClientLogger LOGGER =
        new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class);
}
