All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.

There is a newer version: 1.0.0
Show newest version
// 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.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData;
import com.azure.resourcemanager.securityinsights.models.IncidentClassification;
import com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason;
import com.azure.resourcemanager.securityinsights.models.IncidentLabel;
import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo;
import com.azure.resourcemanager.securityinsights.models.IncidentSeverity;
import com.azure.resourcemanager.securityinsights.models.IncidentStatus;
import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * Represents an incident in Azure Security Insights.
 */
@Fluent
public final class IncidentInner extends ResourceWithEtag {
    /*
     * Incident properties
     */
    private IncidentPropertiesInner innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

    /**
     * Creates an instance of IncidentInner class.
     */
    public IncidentInner() {
    }

    /**
     * Get the innerProperties property: Incident properties.
     * 
     * @return the innerProperties value.
     */
    private IncidentPropertiesInner innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    @Override
    public SystemData systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IncidentInner withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the additionalData property: Additional data on the incident.
     * 
     * @return the additionalData value.
     */
    public IncidentAdditionalData additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

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

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

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

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

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

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

    /**
     * Get the createdTimeUtc property: The time the incident was created.
     * 
     * @return the createdTimeUtc value.
     */
    public OffsetDateTime createdTimeUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc();
    }

    /**
     * Get the description property: The description of the incident.
     * 
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: The description of the incident.
     * 
     * @param description the description value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the firstActivityTimeUtc property: The time of the first activity in the incident.
     * 
     * @return the firstActivityTimeUtc value.
     */
    public OffsetDateTime firstActivityTimeUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().firstActivityTimeUtc();
    }

    /**
     * Set the firstActivityTimeUtc property: The time of the first activity in the incident.
     * 
     * @param firstActivityTimeUtc the firstActivityTimeUtc value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withFirstActivityTimeUtc(firstActivityTimeUtc);
        return this;
    }

    /**
     * Get the incidentUrl property: The deep-link url to the incident in Azure portal.
     * 
     * @return the incidentUrl value.
     */
    public String incidentUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().incidentUrl();
    }

    /**
     * Get the incidentNumber property: A sequential number.
     * 
     * @return the incidentNumber value.
     */
    public Integer incidentNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().incidentNumber();
    }

    /**
     * Get the labels property: List of labels relevant to this incident.
     * 
     * @return the labels value.
     */
    public List labels() {
        return this.innerProperties() == null ? null : this.innerProperties().labels();
    }

    /**
     * Set the labels property: List of labels relevant to this incident.
     * 
     * @param labels the labels value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withLabels(List labels) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withLabels(labels);
        return this;
    }

    /**
     * Get the providerName property: The name of the source provider that generated the incident.
     * 
     * @return the providerName value.
     */
    public String providerName() {
        return this.innerProperties() == null ? null : this.innerProperties().providerName();
    }

    /**
     * Set the providerName property: The name of the source provider that generated the incident.
     * 
     * @param providerName the providerName value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withProviderName(String providerName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withProviderName(providerName);
        return this;
    }

    /**
     * Get the providerIncidentId property: The incident ID assigned by the incident provider.
     * 
     * @return the providerIncidentId value.
     */
    public String providerIncidentId() {
        return this.innerProperties() == null ? null : this.innerProperties().providerIncidentId();
    }

    /**
     * Set the providerIncidentId property: The incident ID assigned by the incident provider.
     * 
     * @param providerIncidentId the providerIncidentId value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withProviderIncidentId(String providerIncidentId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withProviderIncidentId(providerIncidentId);
        return this;
    }

    /**
     * Get the lastActivityTimeUtc property: The time of the last activity in the incident.
     * 
     * @return the lastActivityTimeUtc value.
     */
    public OffsetDateTime lastActivityTimeUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().lastActivityTimeUtc();
    }

    /**
     * Set the lastActivityTimeUtc property: The time of the last activity in the incident.
     * 
     * @param lastActivityTimeUtc the lastActivityTimeUtc value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withLastActivityTimeUtc(lastActivityTimeUtc);
        return this;
    }

    /**
     * Get the lastModifiedTimeUtc property: The last time the incident was updated.
     * 
     * @return the lastModifiedTimeUtc value.
     */
    public OffsetDateTime lastModifiedTimeUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc();
    }

    /**
     * Get the owner property: Describes a user that the incident is assigned to.
     * 
     * @return the owner value.
     */
    public IncidentOwnerInfo owner() {
        return this.innerProperties() == null ? null : this.innerProperties().owner();
    }

    /**
     * Set the owner property: Describes a user that the incident is assigned to.
     * 
     * @param owner the owner value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withOwner(IncidentOwnerInfo owner) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withOwner(owner);
        return this;
    }

    /**
     * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident.
     * 
     * @return the relatedAnalyticRuleIds value.
     */
    public List relatedAnalyticRuleIds() {
        return this.innerProperties() == null ? null : this.innerProperties().relatedAnalyticRuleIds();
    }

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

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

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

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

    /**
     * Get the teamInformation property: Describes a team for the incident.
     * 
     * @return the teamInformation value.
     */
    public TeamInformationInner teamInformation() {
        return this.innerProperties() == null ? null : this.innerProperties().teamInformation();
    }

    /**
     * Set the teamInformation property: Describes a team for the incident.
     * 
     * @param teamInformation the teamInformation value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withTeamInformation(TeamInformationInner teamInformation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withTeamInformation(teamInformation);
        return this;
    }

    /**
     * Get the title property: The title of the incident.
     * 
     * @return the title value.
     */
    public String title() {
        return this.innerProperties() == null ? null : this.innerProperties().title();
    }

    /**
     * Set the title property: The title of the incident.
     * 
     * @param title the title value to set.
     * @return the IncidentInner object itself.
     */
    public IncidentInner withTitle(String title) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IncidentPropertiesInner();
        }
        this.innerProperties().withTitle(title);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("etag", etag());
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of IncidentInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of IncidentInner if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the IncidentInner.
     */
    public static IncidentInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            IncidentInner deserializedIncidentInner = new IncidentInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedIncidentInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedIncidentInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedIncidentInner.type = reader.getString();
                } else if ("etag".equals(fieldName)) {
                    deserializedIncidentInner.withEtag(reader.getString());
                } else if ("systemData".equals(fieldName)) {
                    deserializedIncidentInner.systemData = SystemData.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedIncidentInner.innerProperties = IncidentPropertiesInner.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedIncidentInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy