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

com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase 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.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Action property bag base.
 */
@Fluent
public class ActionPropertiesBase implements JsonSerializable {
    /*
     * Logic App Resource Id,
     * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-
     * workflow-id}.
     */
    private String logicAppResourceId;

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

    /**
     * Get the logicAppResourceId property: Logic App Resource Id,
     * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
     * 
     * @return the logicAppResourceId value.
     */
    public String logicAppResourceId() {
        return this.logicAppResourceId;
    }

    /**
     * Set the logicAppResourceId property: Logic App Resource Id,
     * /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}.
     * 
     * @param logicAppResourceId the logicAppResourceId value to set.
     * @return the ActionPropertiesBase object itself.
     */
    public ActionPropertiesBase withLogicAppResourceId(String logicAppResourceId) {
        this.logicAppResourceId = logicAppResourceId;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (logicAppResourceId() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property logicAppResourceId in model ActionPropertiesBase"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ActionPropertiesBase.class);

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

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

                if ("logicAppResourceId".equals(fieldName)) {
                    deserializedActionPropertiesBase.logicAppResourceId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedActionPropertiesBase;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy