// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.AlertSeverity;
import com.azure.resourcemanager.securityinsights.models.AlertStatus;
import com.azure.resourcemanager.securityinsights.models.AttackTactic;
import com.azure.resourcemanager.securityinsights.models.ConfidenceLevel;
import com.azure.resourcemanager.securityinsights.models.ConfidenceScoreStatus;
import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties;
import com.azure.resourcemanager.securityinsights.models.KillChainIntent;
import com.azure.resourcemanager.securityinsights.models.SecurityAlertPropertiesConfidenceReasonsItem;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** SecurityAlert entity property bag. */
@Fluent
public final class SecurityAlertProperties extends EntityCommonProperties {
    /*
     * The display name of the alert.
     */
    @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY)
    private String alertDisplayName;

    /*
     * The type name of the alert.
     */
    @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY)
    private String alertType;

    /*
     * Display name of the main entity being reported on.
     */
    @JsonProperty(value = "compromisedEntity", access = JsonProperty.Access.WRITE_ONLY)
    private String compromisedEntity;

    /*
     * The confidence level of this alert.
     */
    @JsonProperty(value = "confidenceLevel", access = JsonProperty.Access.WRITE_ONLY)
    private ConfidenceLevel confidenceLevel;

    /*
     * The confidence reasons
     */
    @JsonProperty(value = "confidenceReasons", access = JsonProperty.Access.WRITE_ONLY)
    private List<SecurityAlertPropertiesConfidenceReasonsItem> confidenceReasons;

    /*
     * The confidence score of the alert.
     */
    @JsonProperty(value = "confidenceScore", access = JsonProperty.Access.WRITE_ONLY)
    private Double confidenceScore;

    /*
     * The confidence score calculation status, i.e. indicating if score calculation is pending for this alert, not
     * applicable or final.
     */
    @JsonProperty(value = "confidenceScoreStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ConfidenceScoreStatus confidenceScoreStatus;

    /*
     * Alert description.
     */
    @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
    private String description;

    /*
     * The impact end time of the alert (the time of the last event contributing to the alert).
     */
    @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime endTimeUtc;

    /*
     * Holds the alert intent stage(s) mapping for this alert.
     */
    @JsonProperty(value = "intent", access = JsonProperty.Access.WRITE_ONLY)
    private KillChainIntent intent;

    /*
     * The identifier of the alert inside the product which generated the alert.
     */
    @JsonProperty(value = "providerAlertId", access = JsonProperty.Access.WRITE_ONLY)
    private String providerAlertId;

    /*
     * The time the alert was made available for consumption.
     */
    @JsonProperty(value = "processingEndTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime processingEndTime;

    /*
     * The name of a component inside the product which generated the alert.
     */
    @JsonProperty(value = "productComponentName", access = JsonProperty.Access.WRITE_ONLY)
    private String productComponentName;

    /*
     * The name of the product which published this alert.
     */
    @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY)
    private String productName;

    /*
     * The version of the product generating the alert.
     */
    @JsonProperty(value = "productVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String productVersion;

    /*
     * Manual action items to take to remediate the alert.
     */
    @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> remediationSteps;

    /*
     * The severity of the alert
     */
    @JsonProperty(value = "severity")
    private AlertSeverity severity;

    /*
     * The impact start time of the alert (the time of the first event contributing to the alert).
     */
    @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startTimeUtc;

    /*
     * The lifecycle status of the alert.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private AlertStatus status;

    /*
     * Holds the product identifier of the alert for the product.
     */
    @JsonProperty(value = "systemAlertId", access = JsonProperty.Access.WRITE_ONLY)
    private String systemAlertId;

    /*
     * The tactics of the alert
     */
    @JsonProperty(value = "tactics", access = JsonProperty.Access.WRITE_ONLY)
    private List<AttackTactic> tactics;

    /*
     * The time the alert was generated.
     */
    @JsonProperty(value = "timeGenerated", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime timeGenerated;

    /*
     * The name of the vendor that raise the alert.
     */
    @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY)
    private String vendorName;

    /*
     * The uri link of the alert.
     */
    @JsonProperty(value = "alertLink", access = JsonProperty.Access.WRITE_ONLY)
    private String alertLink;

    /*
     * The list of resource identifiers of the alert.
     */
    @JsonProperty(value = "resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY)
    private List<Object> resourceIdentifiers;

    /**
     * Get the alertDisplayName property: The display name of the alert.
     *
     * @return the alertDisplayName value.
     */
    public String alertDisplayName() {
        return this.alertDisplayName;
    }

    /**
     * Get the alertType property: The type name of the alert.
     *
     * @return the alertType value.
     */
    public String alertType() {
        return this.alertType;
    }

    /**
     * Get the compromisedEntity property: Display name of the main entity being reported on.
     *
     * @return the compromisedEntity value.
     */
    public String compromisedEntity() {
        return this.compromisedEntity;
    }

    /**
     * Get the confidenceLevel property: The confidence level of this alert.
     *
     * @return the confidenceLevel value.
     */
    public ConfidenceLevel confidenceLevel() {
        return this.confidenceLevel;
    }

    /**
     * Get the confidenceReasons property: The confidence reasons.
     *
     * @return the confidenceReasons value.
     */
    public List<SecurityAlertPropertiesConfidenceReasonsItem> confidenceReasons() {
        return this.confidenceReasons;
    }

    /**
     * Get the confidenceScore property: The confidence score of the alert.
     *
     * @return the confidenceScore value.
     */
    public Double confidenceScore() {
        return this.confidenceScore;
    }

    /**
     * Get the confidenceScoreStatus property: The confidence score calculation status, i.e. indicating if score
     * calculation is pending for this alert, not applicable or final.
     *
     * @return the confidenceScoreStatus value.
     */
    public ConfidenceScoreStatus confidenceScoreStatus() {
        return this.confidenceScoreStatus;
    }

    /**
     * Get the description property: Alert description.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the endTimeUtc property: The impact end time of the alert (the time of the last event contributing to the
     * alert).
     *
     * @return the endTimeUtc value.
     */
    public OffsetDateTime endTimeUtc() {
        return this.endTimeUtc;
    }

    /**
     * Get the intent property: Holds the alert intent stage(s) mapping for this alert.
     *
     * @return the intent value.
     */
    public KillChainIntent intent() {
        return this.intent;
    }

    /**
     * Get the providerAlertId property: The identifier of the alert inside the product which generated the alert.
     *
     * @return the providerAlertId value.
     */
    public String providerAlertId() {
        return this.providerAlertId;
    }

    /**
     * Get the processingEndTime property: The time the alert was made available for consumption.
     *
     * @return the processingEndTime value.
     */
    public OffsetDateTime processingEndTime() {
        return this.processingEndTime;
    }

    /**
     * Get the productComponentName property: The name of a component inside the product which generated the alert.
     *
     * @return the productComponentName value.
     */
    public String productComponentName() {
        return this.productComponentName;
    }

    /**
     * Get the productName property: The name of the product which published this alert.
     *
     * @return the productName value.
     */
    public String productName() {
        return this.productName;
    }

    /**
     * Get the productVersion property: The version of the product generating the alert.
     *
     * @return the productVersion value.
     */
    public String productVersion() {
        return this.productVersion;
    }

    /**
     * Get the remediationSteps property: Manual action items to take to remediate the alert.
     *
     * @return the remediationSteps value.
     */
    public List<String> remediationSteps() {
        return this.remediationSteps;
    }

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

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

    /**
     * Get the startTimeUtc property: The impact start time of the alert (the time of the first event contributing to
     * the alert).
     *
     * @return the startTimeUtc value.
     */
    public OffsetDateTime startTimeUtc() {
        return this.startTimeUtc;
    }

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

    /**
     * Get the systemAlertId property: Holds the product identifier of the alert for the product.
     *
     * @return the systemAlertId value.
     */
    public String systemAlertId() {
        return this.systemAlertId;
    }

    /**
     * Get the tactics property: The tactics of the alert.
     *
     * @return the tactics value.
     */
    public List<AttackTactic> tactics() {
        return this.tactics;
    }

    /**
     * Get the timeGenerated property: The time the alert was generated.
     *
     * @return the timeGenerated value.
     */
    public OffsetDateTime timeGenerated() {
        return this.timeGenerated;
    }

    /**
     * Get the vendorName property: The name of the vendor that raise the alert.
     *
     * @return the vendorName value.
     */
    public String vendorName() {
        return this.vendorName;
    }

    /**
     * Get the alertLink property: The uri link of the alert.
     *
     * @return the alertLink value.
     */
    public String alertLink() {
        return this.alertLink;
    }

    /**
     * Get the resourceIdentifiers property: The list of resource identifiers of the alert.
     *
     * @return the resourceIdentifiers value.
     */
    public List<Object> resourceIdentifiers() {
        return this.resourceIdentifiers;
    }

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