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

com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Settings for how to dynamically override alert static details.
 */
@Fluent
public final class AlertDetailsOverride implements JsonSerializable {
    /*
     * the format containing columns name(s) to override the alert name
     */
    private String alertDisplayNameFormat;

    /*
     * the format containing columns name(s) to override the alert description
     */
    private String alertDescriptionFormat;

    /*
     * the column name to take the alert tactics from
     */
    private String alertTacticsColumnName;

    /*
     * the column name to take the alert severity from
     */
    private String alertSeverityColumnName;

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

    /**
     * Get the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name.
     * 
     * @return the alertDisplayNameFormat value.
     */
    public String alertDisplayNameFormat() {
        return this.alertDisplayNameFormat;
    }

    /**
     * Set the alertDisplayNameFormat property: the format containing columns name(s) to override the alert name.
     * 
     * @param alertDisplayNameFormat the alertDisplayNameFormat value to set.
     * @return the AlertDetailsOverride object itself.
     */
    public AlertDetailsOverride withAlertDisplayNameFormat(String alertDisplayNameFormat) {
        this.alertDisplayNameFormat = alertDisplayNameFormat;
        return this;
    }

    /**
     * Get the alertDescriptionFormat property: the format containing columns name(s) to override the alert description.
     * 
     * @return the alertDescriptionFormat value.
     */
    public String alertDescriptionFormat() {
        return this.alertDescriptionFormat;
    }

    /**
     * Set the alertDescriptionFormat property: the format containing columns name(s) to override the alert description.
     * 
     * @param alertDescriptionFormat the alertDescriptionFormat value to set.
     * @return the AlertDetailsOverride object itself.
     */
    public AlertDetailsOverride withAlertDescriptionFormat(String alertDescriptionFormat) {
        this.alertDescriptionFormat = alertDescriptionFormat;
        return this;
    }

    /**
     * Get the alertTacticsColumnName property: the column name to take the alert tactics from.
     * 
     * @return the alertTacticsColumnName value.
     */
    public String alertTacticsColumnName() {
        return this.alertTacticsColumnName;
    }

    /**
     * Set the alertTacticsColumnName property: the column name to take the alert tactics from.
     * 
     * @param alertTacticsColumnName the alertTacticsColumnName value to set.
     * @return the AlertDetailsOverride object itself.
     */
    public AlertDetailsOverride withAlertTacticsColumnName(String alertTacticsColumnName) {
        this.alertTacticsColumnName = alertTacticsColumnName;
        return this;
    }

    /**
     * Get the alertSeverityColumnName property: the column name to take the alert severity from.
     * 
     * @return the alertSeverityColumnName value.
     */
    public String alertSeverityColumnName() {
        return this.alertSeverityColumnName;
    }

    /**
     * Set the alertSeverityColumnName property: the column name to take the alert severity from.
     * 
     * @param alertSeverityColumnName the alertSeverityColumnName value to set.
     * @return the AlertDetailsOverride object itself.
     */
    public AlertDetailsOverride withAlertSeverityColumnName(String alertSeverityColumnName) {
        this.alertSeverityColumnName = alertSeverityColumnName;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("alertDisplayNameFormat", this.alertDisplayNameFormat);
        jsonWriter.writeStringField("alertDescriptionFormat", this.alertDescriptionFormat);
        jsonWriter.writeStringField("alertTacticsColumnName", this.alertTacticsColumnName);
        jsonWriter.writeStringField("alertSeverityColumnName", this.alertSeverityColumnName);
        return jsonWriter.writeEndObject();
    }

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

                if ("alertDisplayNameFormat".equals(fieldName)) {
                    deserializedAlertDetailsOverride.alertDisplayNameFormat = reader.getString();
                } else if ("alertDescriptionFormat".equals(fieldName)) {
                    deserializedAlertDetailsOverride.alertDescriptionFormat = reader.getString();
                } else if ("alertTacticsColumnName".equals(fieldName)) {
                    deserializedAlertDetailsOverride.alertTacticsColumnName = reader.getString();
                } else if ("alertSeverityColumnName".equals(fieldName)) {
                    deserializedAlertDetailsOverride.alertSeverityColumnName = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAlertDetailsOverride;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy