// 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.resourcemanager.securityinsights.fluent.models.ActionRequestProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Action for alert rule. */
@Fluent
public final class ActionRequest extends ResourceWithEtag {
    /*
     * Action properties for put request
     */
    @JsonProperty(value = "properties")
    private ActionRequestProperties innerProperties;

    /**
     * Get the innerProperties property: Action properties for put request.
     *
     * @return the innerProperties value.
     */
    private ActionRequestProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ActionRequest withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the triggerUri property: Logic App Callback URL for this specific workflow.
     *
     * @return the triggerUri value.
     */
    public String triggerUri() {
        return this.innerProperties() == null ? null : this.innerProperties().triggerUri();
    }

    /**
     * Set the triggerUri property: Logic App Callback URL for this specific workflow.
     *
     * @param triggerUri the triggerUri value to set.
     * @return the ActionRequest object itself.
     */
    public ActionRequest withTriggerUri(String triggerUri) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActionRequestProperties();
        }
        this.innerProperties().withTriggerUri(triggerUri);
        return this;
    }

    /**
     * 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.innerProperties() == null ? null : this.innerProperties().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 ActionRequest object itself.
     */
    public ActionRequest withLogicAppResourceId(String logicAppResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActionRequestProperties();
        }
        this.innerProperties().withLogicAppResourceId(logicAppResourceId);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
