@Override
    public CancelTaskResult cancelTask(CancelTaskRequest request) {
        request = beforeClientExecution(request);
        return executeCancelTask(request);
    }
<p>
Sends a cancel request for a specified task. You can cancel a task only if it's still in a <code>QUEUED</code>
state. Tasks that are already running can't be cancelled.
</p>
<note>
<p>
A task might still run if it's processed from the queue before the <code>CancelTask</code> operation changes the
task's state.
</p>
</note>

@param cancelTaskRequest
@return Result of the CancelTask operation returned by the service.
@throws ThrottlingException
        The request was denied due to request throttling.
@throws InternalServerException
        An unexpected error occurred while processing the request.
@throws ResourceNotFoundException
        The request references a resource that doesn't exist.
@throws ValidationException
        The input fails to satisfy the constraints specified by an Amazon Web Services service.
@throws AccessDeniedException
        You don't have sufficient access to perform this action.
@sample AWSSnowDeviceManagement.CancelTask
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/snow-device-management-2021-08-04/CancelTask"
     target="_top">AWS API Documentation</a>
aws-java-sdk-snowdevicemanagement/src/main/java/com/amazonaws/services/snowdevicemanagement/AWSSnowDeviceManagementClient.java