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

com.azure.resourcemanager.securityinsights.models.PlaybookActionProperties 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-2022-09.

The 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;
import java.util.Objects;
import java.util.UUID;

/**
 * The PlaybookActionProperties model.
 */
@Fluent
public final class PlaybookActionProperties implements JsonSerializable {
    /*
     * The resource id of the playbook resource.
     */
    private String logicAppResourceId;

    /*
     * The tenant id of the playbook resource.
     */
    private UUID tenantId;

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

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

    /**
     * Set the logicAppResourceId property: The resource id of the playbook resource.
     * 
     * @param logicAppResourceId the logicAppResourceId value to set.
     * @return the PlaybookActionProperties object itself.
     */
    public PlaybookActionProperties withLogicAppResourceId(String logicAppResourceId) {
        this.logicAppResourceId = logicAppResourceId;
        return this;
    }

    /**
     * Get the tenantId property: The tenant id of the playbook resource.
     * 
     * @return the tenantId value.
     */
    public UUID tenantId() {
        return this.tenantId;
    }

    /**
     * Set the tenantId property: The tenant id of the playbook resource.
     * 
     * @param tenantId the tenantId value to set.
     * @return the PlaybookActionProperties object itself.
     */
    public PlaybookActionProperties withTenantId(UUID tenantId) {
        this.tenantId = tenantId;
        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("logicAppResourceId", this.logicAppResourceId);
        jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null));
        return jsonWriter.writeEndObject();
    }

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

                if ("logicAppResourceId".equals(fieldName)) {
                    deserializedPlaybookActionProperties.logicAppResourceId = reader.getString();
                } else if ("tenantId".equals(fieldName)) {
                    deserializedPlaybookActionProperties.tenantId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPlaybookActionProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy