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

com.azure.resourcemanager.security.models.LogAnalyticsIdentifier Maven / Gradle / Ivy

Go to download

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

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.security.models;

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

/**
 * Represents a Log Analytics workspace scope identifier.
 */
@Immutable
public final class LogAnalyticsIdentifier extends ResourceIdentifier {
    /*
     * There can be multiple identifiers of different type per alert, this field specify the identifier type.
     */
    private ResourceIdentifierType type = ResourceIdentifierType.LOG_ANALYTICS;

    /*
     * The LogAnalytics workspace id that stores this alert.
     */
    private String workspaceId;

    /*
     * The azure subscription id for the LogAnalytics workspace storing this alert.
     */
    private String workspaceSubscriptionId;

    /*
     * The azure resource group for the LogAnalytics workspace storing this alert
     */
    private String workspaceResourceGroup;

    /*
     * (optional) The LogAnalytics agent id reporting the event that this alert is based on.
     */
    private String agentId;

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

    /**
     * Get the type property: There can be multiple identifiers of different type per alert, this field specify the
     * identifier type.
     * 
     * @return the type value.
     */
    @Override
    public ResourceIdentifierType type() {
        return this.type;
    }

    /**
     * Get the workspaceId property: The LogAnalytics workspace id that stores this alert.
     * 
     * @return the workspaceId value.
     */
    public String workspaceId() {
        return this.workspaceId;
    }

    /**
     * Get the workspaceSubscriptionId property: The azure subscription id for the LogAnalytics workspace storing this
     * alert.
     * 
     * @return the workspaceSubscriptionId value.
     */
    public String workspaceSubscriptionId() {
        return this.workspaceSubscriptionId;
    }

    /**
     * Get the workspaceResourceGroup property: The azure resource group for the LogAnalytics workspace storing this
     * alert.
     * 
     * @return the workspaceResourceGroup value.
     */
    public String workspaceResourceGroup() {
        return this.workspaceResourceGroup;
    }

    /**
     * Get the agentId property: (optional) The LogAnalytics agent id reporting the event that this alert is based on.
     * 
     * @return the agentId value.
     */
    public String agentId() {
        return this.agentId;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of LogAnalyticsIdentifier from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of LogAnalyticsIdentifier 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 LogAnalyticsIdentifier.
     */
    public static LogAnalyticsIdentifier fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            LogAnalyticsIdentifier deserializedLogAnalyticsIdentifier = new LogAnalyticsIdentifier();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("type".equals(fieldName)) {
                    deserializedLogAnalyticsIdentifier.type = ResourceIdentifierType.fromString(reader.getString());
                } else if ("workspaceId".equals(fieldName)) {
                    deserializedLogAnalyticsIdentifier.workspaceId = reader.getString();
                } else if ("workspaceSubscriptionId".equals(fieldName)) {
                    deserializedLogAnalyticsIdentifier.workspaceSubscriptionId = reader.getString();
                } else if ("workspaceResourceGroup".equals(fieldName)) {
                    deserializedLogAnalyticsIdentifier.workspaceResourceGroup = reader.getString();
                } else if ("agentId".equals(fieldName)) {
                    deserializedLogAnalyticsIdentifier.agentId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedLogAnalyticsIdentifier;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy