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

com.azure.resourcemanager.security.models.AutomationActionLogicApp 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.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation
 * capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore.
 */
@Fluent
public final class AutomationActionLogicApp extends AutomationAction {
    /*
     * The type of the action that will be triggered by the Automation
     */
    private ActionType actionType = ActionType.LOGIC_APP;

    /*
     * The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have
     * permissions to trigger the Logic App
     */
    private String logicAppResourceId;

    /*
     * The Logic App trigger URI endpoint (it will not be included in any response).
     */
    private String uri;

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

    /**
     * Get the actionType property: The type of the action that will be triggered by the Automation.
     * 
     * @return the actionType value.
     */
    @Override
    public ActionType actionType() {
        return this.actionType;
    }

    /**
     * Get the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other
     * subscriptions, given that you have permissions to trigger the Logic App.
     * 
     * @return the logicAppResourceId value.
     */
    public String logicAppResourceId() {
        return this.logicAppResourceId;
    }

    /**
     * Set the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other
     * subscriptions, given that you have permissions to trigger the Logic App.
     * 
     * @param logicAppResourceId the logicAppResourceId value to set.
     * @return the AutomationActionLogicApp object itself.
     */
    public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId) {
        this.logicAppResourceId = logicAppResourceId;
        return this;
    }

    /**
     * Get the uri property: The Logic App trigger URI endpoint (it will not be included in any response).
     * 
     * @return the uri value.
     */
    public String uri() {
        return this.uri;
    }

    /**
     * Set the uri property: The Logic App trigger URI endpoint (it will not be included in any response).
     * 
     * @param uri the uri value to set.
     * @return the AutomationActionLogicApp object itself.
     */
    public AutomationActionLogicApp withUri(String uri) {
        this.uri = uri;
        return this;
    }

    /**
     * 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("actionType", this.actionType == null ? null : this.actionType.toString());
        jsonWriter.writeStringField("logicAppResourceId", this.logicAppResourceId);
        jsonWriter.writeStringField("uri", this.uri);
        return jsonWriter.writeEndObject();
    }

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

                if ("actionType".equals(fieldName)) {
                    deserializedAutomationActionLogicApp.actionType = ActionType.fromString(reader.getString());
                } else if ("logicAppResourceId".equals(fieldName)) {
                    deserializedAutomationActionLogicApp.logicAppResourceId = reader.getString();
                } else if ("uri".equals(fieldName)) {
                    deserializedAutomationActionLogicApp.uri = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAutomationActionLogicApp;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy