// 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 source subtype under a source signal consumed in Fusion detection. */
@Fluent
public final class FusionTemplateSourceSubType {
    /*
     * The name of source subtype under a source signal consumed in Fusion detection.
     */
    @JsonProperty(value = "sourceSubTypeName", required = true)
    private String sourceSubTypeName;

    /*
     * The display name of source subtype under a source signal consumed in Fusion detection.
     */
    @JsonProperty(value = "sourceSubTypeDisplayName", access = JsonProperty.Access.WRITE_ONLY)
    private String sourceSubTypeDisplayName;

    /*
     * Severity configuration available for a source subtype consumed in fusion detection.
     */
    @JsonProperty(value = "severityFilter", required = true)
    private FusionTemplateSubTypeSeverityFilter severityFilter;

    /**
     * Get the sourceSubTypeName property: The name of source subtype under a source signal consumed in Fusion
     * detection.
     *
     * @return the sourceSubTypeName value.
     */
    public String sourceSubTypeName() {
        return this.sourceSubTypeName;
    }

    /**
     * Set the sourceSubTypeName property: The name of source subtype under a source signal consumed in Fusion
     * detection.
     *
     * @param sourceSubTypeName the sourceSubTypeName value to set.
     * @return the FusionTemplateSourceSubType object itself.
     */
    public FusionTemplateSourceSubType withSourceSubTypeName(String sourceSubTypeName) {
        this.sourceSubTypeName = sourceSubTypeName;
        return this;
    }

    /**
     * Get the sourceSubTypeDisplayName property: The display name of source subtype under a source signal consumed in
     * Fusion detection.
     *
     * @return the sourceSubTypeDisplayName value.
     */
    public String sourceSubTypeDisplayName() {
        return this.sourceSubTypeDisplayName;
    }

    /**
     * Get the severityFilter property: Severity configuration available for a source subtype consumed in fusion
     * detection.
     *
     * @return the severityFilter value.
     */
    public FusionTemplateSubTypeSeverityFilter severityFilter() {
        return this.severityFilter;
    }

    /**
     * Set the severityFilter property: Severity configuration available for a source subtype consumed in fusion
     * detection.
     *
     * @param severityFilter the severityFilter value to set.
     * @return the FusionTemplateSourceSubType object itself.
     */
    public FusionTemplateSourceSubType withSeverityFilter(FusionTemplateSubTypeSeverityFilter severityFilter) {
        this.severityFilter = severityFilter;
        return this;
    }

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

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