// 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 TaskStatusUpdate {
    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.updatetaskrequest.taskrequestupdate
        BinaryData taskUpdateCommand = BinaryData.fromString("{\"comment\":\"Thanks!\",\"newStatus\":\"In Progress\"}");
        RequestOptions requestOptions = new RequestOptions();
        String taskId = "d5bd0215-df84-4245-8e18-3a8f012be376";
        Response<Void> response =
                purviewWorkflowClient.updateTaskStatusWithResponse(
                    taskId, taskUpdateCommand, requestOptions);
        // END:com.azure.analytics.purview.workflow.generated.updatetaskrequest.taskrequestupdate
    }
}
