@SdkInternalApi
    final CancelServicePipelineDeploymentResult executeCancelServicePipelineDeployment(
            CancelServicePipelineDeploymentRequest cancelServicePipelineDeploymentRequest) {

        ExecutionContext executionContext = createExecutionContext(cancelServicePipelineDeploymentRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CancelServicePipelineDeploymentRequest> request = null;
        Response<CancelServicePipelineDeploymentResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CancelServicePipelineDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super
                        .beforeMarshalling(cancelServicePipelineDeploymentRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Proton");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelServicePipelineDeployment");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            HttpResponseHandler<AmazonWebServiceResponse<CancelServicePipelineDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
                    new CancelServicePipelineDeploymentResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Attempts to cancel a service pipeline deployment on an <a>UpdateServicePipeline</a> action, if the deployment is
<code>IN_PROGRESS</code>. For more information, see <a
href="https://docs.aws.amazon.com/proton/latest/userguide/ag-svc-pipeline-update.html">Update a service
pipeline</a> in the <i>Proton User guide</i>.
</p>
<p>
The following list includes potential cancellation scenarios.
</p>
<ul>
<li>
<p>
If the cancellation attempt succeeds, the resulting deployment state is <code>CANCELLED</code>.
</p>
</li>
<li>
<p>
If the cancellation attempt fails, the resulting deployment state is <code>FAILED</code>.
</p>
</li>
<li>
<p>
If the current <a>UpdateServicePipeline</a> action succeeds before the cancellation attempt starts, the resulting
deployment state is <code>SUCCEEDED</code> and the cancellation attempt has no effect.
</p>
</li>
</ul>

@param cancelServicePipelineDeploymentRequest
@return Result of the CancelServicePipelineDeployment operation returned by the service.
@throws ValidationException
        The input is invalid or an out-of-range value was supplied for the input parameter.
@throws AccessDeniedException
        There <i>isn't</i> sufficient access for performing this action.
@throws ThrottlingException
        The request was denied due to request throttling.
@throws ConflictException
        The request <i>couldn't</i> be made due to a conflicting operation or resource.
@throws ResourceNotFoundException
        The requested resource <i>wasn't</i> found.
@throws InternalServerException
        The request failed to register with the service.
@sample AWSProton.CancelServicePipelineDeployment
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/CancelServicePipelineDeployment"
     target="_top">AWS API Documentation</a>
aws-java-sdk-proton/src/main/java/com/amazonaws/services/proton/AWSProtonClient.java