// 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;

/** Represents a Severity filter setting for a given source subtype consumed in Fusion detection. */
@Fluent
public final class FusionSubTypeSeverityFiltersItem {
    /*
     * The Severity for a given source subtype consumed in Fusion detection.
     */
    @JsonProperty(value = "severity", required = true)
    private AlertSeverity severity;

    /*
     * Determines whether this severity is enabled or disabled for this source subtype consumed in Fusion detection.
     */
    @JsonProperty(value = "enabled", required = true)
    private boolean enabled;

    /**
     * Get the severity property: The Severity for a given source subtype consumed in Fusion detection.
     *
     * @return the severity value.
     */
    public AlertSeverity severity() {
        return this.severity;
    }

    /**
     * Set the severity property: The Severity for a given source subtype consumed in Fusion detection.
     *
     * @param severity the severity value to set.
     * @return the FusionSubTypeSeverityFiltersItem object itself.
     */
    public FusionSubTypeSeverityFiltersItem withSeverity(AlertSeverity severity) {
        this.severity = severity;
        return this;
    }

    /**
     * Get the enabled property: Determines whether this severity is enabled or disabled for this source subtype
     * consumed in Fusion detection.
     *
     * @return the enabled value.
     */
    public boolean enabled() {
        return this.enabled;
    }

    /**
     * Set the enabled property: Determines whether this severity is enabled or disabled for this source subtype
     * consumed in Fusion detection.
     *
     * @param enabled the enabled value to set.
     * @return the FusionSubTypeSeverityFiltersItem object itself.
     */
    public FusionSubTypeSeverityFiltersItem withEnabled(boolean enabled) {
        this.enabled = enabled;
        return this;
    }

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

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