@SdkInternalApi
    final DeleteCachePolicyResult executeDeleteCachePolicy(DeleteCachePolicyRequest deleteCachePolicyRequest) {

        ExecutionContext executionContext = createExecutionContext(deleteCachePolicyRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<DeleteCachePolicyRequest> request = null;
        Response<DeleteCachePolicyResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new DeleteCachePolicyRequestMarshaller().marshall(super.beforeMarshalling(deleteCachePolicyRequest));
                // 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, "CloudFront");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCachePolicy");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<DeleteCachePolicyResult> responseHandler = new StaxResponseHandler<DeleteCachePolicyResult>(
                    new DeleteCachePolicyResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Deletes a cache policy.
</p>
<p>
You cannot delete a cache policy if it's attached to a cache behavior. First update your distributions to remove
the cache policy from all cache behaviors, then delete the cache policy.
</p>
<p>
To delete a cache policy, you must provide the policy's identifier and version. To get these values, you can use
<code>ListCachePolicies</code> or <code>GetCachePolicy</code>.
</p>

@param deleteCachePolicyRequest
@return Result of the DeleteCachePolicy operation returned by the service.
@throws AccessDeniedException
        Access denied.
@throws InvalidIfMatchVersionException
        The <code>If-Match</code> version is missing or not valid.
@throws NoSuchCachePolicyException
        The cache policy does not exist.
@throws PreconditionFailedException
        The precondition in one or more of the request fields evaluated to <code>false</code>.
@throws IllegalDeleteException
        You cannot delete a managed policy.
@throws CachePolicyInUseException
        Cannot delete the cache policy because it is attached to one or more cache behaviors.
@sample AmazonCloudFront.DeleteCachePolicy
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/DeleteCachePolicy" target="_top">AWS
     API Documentation</a>
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/AmazonCloudFrontClient.java