// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.purview.workflow.generated;

import com.azure.analytics.purview.workflow.PurviewWorkflowClient;
import com.azure.analytics.purview.workflow.PurviewWorkflowClientBuilder;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class ApprovalTaskApprove {
    public static void main(String[] args) {
        PurviewWorkflowClient purviewWorkflowClient =
                new PurviewWorkflowClientBuilder()
                        .credential(new DefaultAzureCredentialBuilder().build())
                        .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT"))
                        .buildClient();
        // BEGIN:com.azure.analytics.purview.workflow.generated.approveapprovaltask.approvaltaskapprove
        BinaryData approvalResponseComment = BinaryData.fromString("{\"comment\":\"Thanks for raising this!\"}");
        RequestOptions requestOptions = new RequestOptions();
        Response<Void> response =
                purviewWorkflowClient.approveApprovalTaskWithResponse(
                        "98d98e2c-23fa-4157-a3f8-ff8ce5cc095c", approvalResponseComment, requestOptions);
        // END:com.azure.analytics.purview.workflow.generated.approveapprovaltask.approvaltaskapprove
    }
}
