@SdkInternalApi
    final EnableImageDeregistrationProtectionResult executeEnableImageDeregistrationProtection(
            EnableImageDeregistrationProtectionRequest enableImageDeregistrationProtectionRequest) {

        ExecutionContext executionContext = createExecutionContext(enableImageDeregistrationProtectionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<EnableImageDeregistrationProtectionRequest> request = null;
        Response<EnableImageDeregistrationProtectionResult> response = null;

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

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

            StaxResponseHandler<EnableImageDeregistrationProtectionResult> responseHandler = new StaxResponseHandler<EnableImageDeregistrationProtectionResult>(
                    new EnableImageDeregistrationProtectionResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Enables deregistration protection for an AMI. When deregistration protection is enabled, the AMI can't be
deregistered.
</p>
<p>
To allow the AMI to be deregistered, you must first disable deregistration protection using
<a>DisableImageDeregistrationProtection</a>.
</p>
<p>
For more information, see <a
href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html#ami-deregistration-protection"
>Protect an AMI from deregistration</a> in the <i>Amazon EC2 User Guide</i>.
</p>

@param enableImageDeregistrationProtectionRequest
@return Result of the EnableImageDeregistrationProtection operation returned by the service.
@sample AmazonEC2.EnableImageDeregistrationProtection
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableImageDeregistrationProtection"
     target="_top">AWS API Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java