// 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;
import java.util.List;

/** The IncidentPropertiesAction model. */
@Fluent
public final class IncidentPropertiesAction {
    /*
     * The severity of the incident
     */
    @JsonProperty(value = "severity")
    private IncidentSeverity severity;

    /*
     * The status of the incident
     */
    @JsonProperty(value = "status")
    private IncidentStatus status;

    /*
     * The reason the incident was closed
     */
    @JsonProperty(value = "classification")
    private IncidentClassification classification;

    /*
     * The classification reason the incident was closed with
     */
    @JsonProperty(value = "classificationReason")
    private IncidentClassificationReason classificationReason;

    /*
     * Describes the reason the incident was closed.
     */
    @JsonProperty(value = "classificationComment")
    private String classificationComment;

    /*
     * Information on the user an incident is assigned to
     */
    @JsonProperty(value = "owner")
    private IncidentOwnerInfo owner;

    /*
     * List of labels to add to the incident.
     */
    @JsonProperty(value = "labels")
    private List<IncidentLabel> labels;

    /**
     * Get the severity property: The severity of the incident.
     *
     * @return the severity value.
     */
    public IncidentSeverity severity() {
        return this.severity;
    }

    /**
     * Set the severity property: The severity of the incident.
     *
     * @param severity the severity value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withSeverity(IncidentSeverity severity) {
        this.severity = severity;
        return this;
    }

    /**
     * Get the status property: The status of the incident.
     *
     * @return the status value.
     */
    public IncidentStatus status() {
        return this.status;
    }

    /**
     * Set the status property: The status of the incident.
     *
     * @param status the status value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withStatus(IncidentStatus status) {
        this.status = status;
        return this;
    }

    /**
     * Get the classification property: The reason the incident was closed.
     *
     * @return the classification value.
     */
    public IncidentClassification classification() {
        return this.classification;
    }

    /**
     * Set the classification property: The reason the incident was closed.
     *
     * @param classification the classification value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withClassification(IncidentClassification classification) {
        this.classification = classification;
        return this;
    }

    /**
     * Get the classificationReason property: The classification reason the incident was closed with.
     *
     * @return the classificationReason value.
     */
    public IncidentClassificationReason classificationReason() {
        return this.classificationReason;
    }

    /**
     * Set the classificationReason property: The classification reason the incident was closed with.
     *
     * @param classificationReason the classificationReason value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withClassificationReason(IncidentClassificationReason classificationReason) {
        this.classificationReason = classificationReason;
        return this;
    }

    /**
     * Get the classificationComment property: Describes the reason the incident was closed.
     *
     * @return the classificationComment value.
     */
    public String classificationComment() {
        return this.classificationComment;
    }

    /**
     * Set the classificationComment property: Describes the reason the incident was closed.
     *
     * @param classificationComment the classificationComment value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withClassificationComment(String classificationComment) {
        this.classificationComment = classificationComment;
        return this;
    }

    /**
     * Get the owner property: Information on the user an incident is assigned to.
     *
     * @return the owner value.
     */
    public IncidentOwnerInfo owner() {
        return this.owner;
    }

    /**
     * Set the owner property: Information on the user an incident is assigned to.
     *
     * @param owner the owner value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withOwner(IncidentOwnerInfo owner) {
        this.owner = owner;
        return this;
    }

    /**
     * Get the labels property: List of labels to add to the incident.
     *
     * @return the labels value.
     */
    public List<IncidentLabel> labels() {
        return this.labels;
    }

    /**
     * Set the labels property: List of labels to add to the incident.
     *
     * @param labels the labels value to set.
     * @return the IncidentPropertiesAction object itself.
     */
    public IncidentPropertiesAction withLabels(List<IncidentLabel> labels) {
        this.labels = labels;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (owner() != null) {
            owner().validate();
        }
        if (labels() != null) {
            labels().forEach(e -> e.validate());
        }
    }
}
