// 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;

import com.azure.analytics.purview.workflow.implementation.PurviewWorkflowClientImpl;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous PurviewWorkflowClient type. */
@ServiceClient(builder = PurviewWorkflowClientBuilder.class, isAsync = true)
public final class PurviewWorkflowAsyncClient {
    @Generated private final PurviewWorkflowClientImpl serviceClient;

    /**
     * Initializes an instance of PurviewWorkflowAsyncClient class.
     *
     * @param serviceClient the service client implementation.
     */
    @Generated
    PurviewWorkflowAsyncClient(PurviewWorkflowClientImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * List all workflows.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     triggers (Required): [
     *          (Required){
     *             type: String(when_term_creation_is_requested/when_term_deletion_is_requested/when_term_update_is_requested/when_terms_import_is_requested/when_data_access_grant_is_requested/when_asset_update_is_requested) (Required)
     *             underGlossaryHierarchy: String (Optional)
     *             underCollection: String (Optional)
     *             underGlossary: String (Optional)
     *         }
     *     ]
     *     createdTime: OffsetDateTime (Optional)
     *     createdBy: String (Optional)
     *     lastUpdateTime: OffsetDateTime (Optional)
     *     updatedBy: String (Optional)
     *     name: String (Required)
     *     isEnabled: boolean (Required)
     *     description: String (Required)
     * }
     * }</pre>
     *
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the workflow list as paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<BinaryData> listWorkflows(RequestOptions requestOptions) {
        return this.serviceClient.listWorkflowsAsync(requestOptions);
    }

    /**
     * Get a specific workflow.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     triggers (Required): [
     *          (Required){
     *             type: String(when_term_creation_is_requested/when_term_deletion_is_requested/when_term_update_is_requested/when_terms_import_is_requested/when_data_access_grant_is_requested/when_asset_update_is_requested) (Required)
     *             underGlossaryHierarchy: String (Optional)
     *             underCollection: String (Optional)
     *             underGlossary: String (Optional)
     *         }
     *     ]
     *     createdTime: OffsetDateTime (Optional)
     *     createdBy: String (Optional)
     *     lastUpdateTime: OffsetDateTime (Optional)
     *     updatedBy: String (Optional)
     *     name: String (Required)
     *     isEnabled: boolean (Required)
     *     description: String (Required)
     *     actionDag: Object (Required)
     * }
     * }</pre>
     *
     * @param workflowId The workflow id.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return a specific workflow along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getWorkflowWithResponse(String workflowId, RequestOptions requestOptions) {
        return this.serviceClient.getWorkflowWithResponseAsync(workflowId, requestOptions);
    }

    /**
     * Create or replace a workflow.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     triggers (Required): [
     *          (Required){
     *             type: String(when_term_creation_is_requested/when_term_deletion_is_requested/when_term_update_is_requested/when_terms_import_is_requested/when_data_access_grant_is_requested/when_asset_update_is_requested) (Required)
     *             underGlossaryHierarchy: String (Optional)
     *             underCollection: String (Optional)
     *             underGlossary: String (Optional)
     *         }
     *     ]
     *     name: String (Required)
     *     isEnabled: boolean (Required)
     *     description: String (Required)
     *     actionDag: Object (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     triggers (Required): [
     *          (Required){
     *             type: String(when_term_creation_is_requested/when_term_deletion_is_requested/when_term_update_is_requested/when_terms_import_is_requested/when_data_access_grant_is_requested/when_asset_update_is_requested) (Required)
     *             underGlossaryHierarchy: String (Optional)
     *             underCollection: String (Optional)
     *             underGlossary: String (Optional)
     *         }
     *     ]
     *     createdTime: OffsetDateTime (Optional)
     *     createdBy: String (Optional)
     *     lastUpdateTime: OffsetDateTime (Optional)
     *     updatedBy: String (Optional)
     *     name: String (Required)
     *     isEnabled: boolean (Required)
     *     description: String (Required)
     *     actionDag: Object (Required)
     * }
     * }</pre>
     *
     * @param workflowId The workflow id.
     * @param workflowCreateOrUpdateCommand Create or update workflow payload.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the workflow properties along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> createOrReplaceWorkflowWithResponse(
            String workflowId, BinaryData workflowCreateOrUpdateCommand, RequestOptions requestOptions) {
        return this.serviceClient.createOrReplaceWorkflowWithResponseAsync(
                workflowId, workflowCreateOrUpdateCommand, requestOptions);
    }

    /**
     * Delete a workflow.
     *
     * @param workflowId The workflow id.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> deleteWorkflowWithResponse(String workflowId, RequestOptions requestOptions) {
        return this.serviceClient.deleteWorkflowWithResponseAsync(workflowId, requestOptions);
    }

    /**
     * Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any
     * workflow's trigger matches with an operation in request, a run of the workflow is created.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     operations (Required): [
     *          (Required){
     *             type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *             payload: Object (Required)
     *         }
     *     ]
     *     comment: String (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     requestId: String (Required)
     *     requestor: String (Required)
     *     operations (Required): [
     *          (Required){
     *             type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *             payload: Object (Required)
     *             workflowRunIds (Optional): [
     *                 String (Optional)
     *             ]
     *         }
     *     ]
     *     comment: String (Optional)
     *     status: String(NotStarted/InProgress/Failed/Completed/Canceling/CancellationFailed/Canceled) (Required)
     * }
     * }</pre>
     *
     * @param userRequestsPayload The payload of submitting a user request.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return describes user ask to do operation(s) on Purview along with {@link Response} on successful completion of
     *     {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> submitUserRequestsWithResponse(
            BinaryData userRequestsPayload, RequestOptions requestOptions) {
        return this.serviceClient.submitUserRequestsWithResponseAsync(userRequestsPayload, requestOptions);
    }

    /**
     * List workflow runs.
     *
     * <p><strong>Query Parameters</strong>
     *
     * <table border="1">
     *     <caption>Query Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>timeWindow</td><td>String</td><td>No</td><td>Time window of filtering items. Allowed values: "1d", "7d", "30d", "90d".</td></tr>
     *     <tr><td>orderby</td><td>String</td><td>No</td><td>The key word which used to sort the results. Allowed values: "status desc", "status asc", "requestor desc", "requestor asc", "startTime desc", "startTime asc", "createdTime desc", "createdTime asc".</td></tr>
     *     <tr><td>runStatuses</td><td>List&lt;String&gt;</td><td>No</td><td>Filter workflow runs by workflow run status. In the form of "," separated string.</td></tr>
     *     <tr><td>workflowIds</td><td>List&lt;String&gt;</td><td>No</td><td>Filter items by workflow id list. In the form of "," separated string.</td></tr>
     *     <tr><td>maxpagesize</td><td>Integer</td><td>No</td><td>The maximum page size to get the items at one time.</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     workflowId: String (Required)
     *     startTime: OffsetDateTime (Required)
     *     requestor: String (Required)
     *     userRequestId: String (Optional)
     *     runPayload (Required): {
     *         type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *         targetValue: String (Required)
     *     }
     *     status: String(NotStarted/InProgress/Failed/Completed/Canceling/CancellationFailed/Canceled) (Required)
     *     endTime: OffsetDateTime (Optional)
     *     cancelTime: OffsetDateTime (Optional)
     *     cancelComment: String (Optional)
     * }
     * }</pre>
     *
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<BinaryData> listWorkflowRuns(RequestOptions requestOptions) {
        return this.serviceClient.listWorkflowRunsAsync(requestOptions);
    }

    /**
     * Get a workflow run.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     workflowId: String (Optional)
     *     startTime: OffsetDateTime (Optional)
     *     requestor: String (Optional)
     *     userRequestId: String (Optional)
     *     runPayload (Optional): {
     *         type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *         targetValue: String (Required)
     *         payload: Object (Required)
     *     }
     *     status: String(NotStarted/InProgress/Failed/Completed/Canceling/CancellationFailed/Canceled) (Optional)
     *     endTime: OffsetDateTime (Optional)
     *     cancelTime: OffsetDateTime (Optional)
     *     cancelComment: String (Optional)
     *     actionDag: Object (Required)
     *     detail (Required): {
     *         runInput: Object (Required)
     *         actions: Object (Required)
     *     }
     * }
     * }</pre>
     *
     * @param workflowRunId The workflow run id.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return a workflow run along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getWorkflowRunWithResponse(String workflowRunId, RequestOptions requestOptions) {
        return this.serviceClient.getWorkflowRunWithResponseAsync(workflowRunId, requestOptions);
    }

    /**
     * Cancel a workflow run.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     comment: String (Optional)
     * }
     * }</pre>
     *
     * @param workflowRunId The workflow run id.
     * @param runCancelReply Reply of canceling a workflow run.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> cancelWorkflowRunWithResponse(
            String workflowRunId, BinaryData runCancelReply, RequestOptions requestOptions) {
        return this.serviceClient.cancelWorkflowRunWithResponseAsync(workflowRunId, runCancelReply, requestOptions);
    }

    /**
     * Get all workflow tasks.
     *
     * <p><strong>Query Parameters</strong>
     *
     * <table border="1">
     *     <caption>Query Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>viewMode</td><td>String</td><td>No</td><td>To filter user's sent, received or history workflow tasks.</td></tr>
     *     <tr><td>workflowIds</td><td>List&lt;String&gt;</td><td>No</td><td>Filter items by workflow id list. In the form of "," separated string.</td></tr>
     *     <tr><td>timeWindow</td><td>String</td><td>No</td><td>Time window of filtering items. Allowed values: "1d", "7d", "30d", "90d".</td></tr>
     *     <tr><td>maxpagesize</td><td>Integer</td><td>No</td><td>The maximum page size to get the items at one time.</td></tr>
     *     <tr><td>orderby</td><td>String</td><td>No</td><td>The key word which used to sort the results. Allowed values: "status desc", "status asc", "requestor desc", "requestor asc", "startTime desc", "startTime asc", "createdTime desc", "createdTime asc".</td></tr>
     *     <tr><td>taskTypes</td><td>List&lt;String&gt;</td><td>No</td><td>Filter items by workflow task type. In the form of "," separated string.</td></tr>
     *     <tr><td>taskStatuses</td><td>List&lt;String&gt;</td><td>No</td><td>Filter workflow tasks by status. In the form of "," separated string.</td></tr>
     *     <tr><td>workflowNameKeyword</td><td>String</td><td>No</td><td>The key word which could used to filter workflow item with related workflow.</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     title: String (Optional)
     *     workflowRunId: String (Required)
     *     workflowId: String (Required)
     *     requestor: String (Required)
     *     createdTime: OffsetDateTime (Required)
     *     lastUpdateTime: OffsetDateTime (Required)
     *     payload (Required): {
     *         type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *         targetValue: String (Required)
     *         payload: Object (Optional)
     *     }
     *     reminderInfo (Optional): {
     *         lastRemindTime: OffsetDateTime (Optional)
     *         nextRemindTime: OffsetDateTime (Required)
     *         reminderSettings: Object (Required)
     *     }
     *     expiryInfo (Optional): {
     *         lastExpiryNotificationTime: OffsetDateTime (Optional)
     *         nextExpiryNotificationTime: OffsetDateTime (Required)
     *         expiryTime: OffsetDateTime (Required)
     *         expirySettings (Required): {
     *             expireAfter: Object (Required)
     *             notifyOnExpiration (Optional): [
     *                 String (Optional)
     *             ]
     *         }
     *     }
     * }
     * }</pre>
     *
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return all workflow tasks as paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<BinaryData> listWorkflowTasks(RequestOptions requestOptions) {
        return this.serviceClient.listWorkflowTasksAsync(requestOptions);
    }

    /**
     * Get a workflow task.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Required)
     *     title: String (Optional)
     *     workflowRunId: String (Required)
     *     workflowId: String (Required)
     *     requestor: String (Required)
     *     createdTime: OffsetDateTime (Required)
     *     lastUpdateTime: OffsetDateTime (Required)
     *     payload (Required): {
     *         type: String(CreateTerm/UpdateTerm/DeleteTerm/ImportTerms/UpdateAsset/GrantDataAccess) (Required)
     *         targetValue: String (Required)
     *         payload: Object (Optional)
     *     }
     *     reminderInfo (Optional): {
     *         lastRemindTime: OffsetDateTime (Optional)
     *         nextRemindTime: OffsetDateTime (Required)
     *         reminderSettings: Object (Required)
     *     }
     *     expiryInfo (Optional): {
     *         lastExpiryNotificationTime: OffsetDateTime (Optional)
     *         nextExpiryNotificationTime: OffsetDateTime (Required)
     *         expiryTime: OffsetDateTime (Required)
     *         expirySettings (Required): {
     *             expireAfter: Object (Required)
     *             notifyOnExpiration (Optional): [
     *                 String (Optional)
     *             ]
     *         }
     *     }
     * }
     * }</pre>
     *
     * @param taskId The task id.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return a workflow task along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getWorkflowTaskWithResponse(String taskId, RequestOptions requestOptions) {
        return this.serviceClient.getWorkflowTaskWithResponseAsync(taskId, requestOptions);
    }

    /**
     * Approve an approval task.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     comment: String (Optional)
     * }
     * }</pre>
     *
     * @param taskId The task id.
     * @param approvalResponseComment The request body of approving an approval request.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> approveApprovalTaskWithResponse(
            String taskId, BinaryData approvalResponseComment, RequestOptions requestOptions) {
        return this.serviceClient.approveApprovalTaskWithResponseAsync(taskId, approvalResponseComment, requestOptions);
    }

    /**
     * Reject an approval task.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     comment: String (Optional)
     * }
     * }</pre>
     *
     * @param taskId The task id.
     * @param approvalResponseComment The request body of rejecting an approval request.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> rejectApprovalTaskWithResponse(
            String taskId, BinaryData approvalResponseComment, RequestOptions requestOptions) {
        return this.serviceClient.rejectApprovalTaskWithResponseAsync(taskId, approvalResponseComment, requestOptions);
    }

    /**
     * Reassign a workflow task.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     reassignments (Optional): [
     *          (Optional){
     *             reassignFrom: String (Required)
     *             reassignTo: String (Required)
     *         }
     *     ]
     * }
     * }</pre>
     *
     * @param taskId The task id.
     * @param reassignCommand The request body of reassigning a workflow task.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> reassignWorkflowTaskWithResponse(
            String taskId, BinaryData reassignCommand, RequestOptions requestOptions) {
        return this.serviceClient.reassignWorkflowTaskWithResponseAsync(taskId, reassignCommand, requestOptions);
    }

    /**
     * Update the status of a workflow task request.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     newStatus: String(NotStarted/InProgress/Completed/Canceled) (Required)
     *     comment: String (Optional)
     * }
     * }</pre>
     *
     * @param taskId The task id.
     * @param taskUpdateCommand Request body of updating workflow task request.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> updateTaskStatusWithResponse(
            String taskId, BinaryData taskUpdateCommand, RequestOptions requestOptions) {
        return this.serviceClient.updateTaskStatusWithResponseAsync(taskId, taskUpdateCommand, requestOptions);
    }
}
