@SdkInternalApi
    final DeleteKeyGroupResult executeDeleteKeyGroup(DeleteKeyGroupRequest deleteKeyGroupRequest) {

        ExecutionContext executionContext = createExecutionContext(deleteKeyGroupRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<DeleteKeyGroupRequest> request = null;
        Response<DeleteKeyGroupResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new DeleteKeyGroupRequestMarshaller().marshall(super.beforeMarshalling(deleteKeyGroupRequest));
                // 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, "DeleteKeyGroup");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<DeleteKeyGroupResult> responseHandler = new StaxResponseHandler<DeleteKeyGroupResult>(
                    new DeleteKeyGroupResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Deletes a key group.
</p>
<p>
You cannot delete a key group that is referenced in a cache behavior. First update your distributions to remove
the key group from all cache behaviors, then delete the key group.
</p>
<p>
To delete a key group, you must provide the key group's identifier and version. To get these values, use
<code>ListKeyGroups</code> followed by <code>GetKeyGroup</code> or <code>GetKeyGroupConfig</code>.
</p>

@param deleteKeyGroupRequest
@return Result of the DeleteKeyGroup operation returned by the service.
@throws InvalidIfMatchVersionException
        The <code>If-Match</code> version is missing or not valid.
@throws NoSuchResourceException
        A resource that was specified is not valid.
@throws PreconditionFailedException
        The precondition in one or more of the request fields evaluated to <code>false</code>.
@throws ResourceInUseException
        Cannot delete this resource because it is in use.
@sample AmazonCloudFront.DeleteKeyGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/DeleteKeyGroup" target="_top">AWS API
     Documentation</a>
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/AmazonCloudFrontClient.java