@SdkInternalApi
    final EnableImageBlockPublicAccessResult executeEnableImageBlockPublicAccess(EnableImageBlockPublicAccessRequest enableImageBlockPublicAccessRequest) {

        ExecutionContext executionContext = createExecutionContext(enableImageBlockPublicAccessRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<EnableImageBlockPublicAccessRequest> request = null;
        Response<EnableImageBlockPublicAccessResult> response = null;

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

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

            StaxResponseHandler<EnableImageBlockPublicAccessResult> responseHandler = new StaxResponseHandler<EnableImageBlockPublicAccessResult>(
                    new EnableImageBlockPublicAccessResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Enables <i>block public access for AMIs</i> at the account level in the specified Amazon Web Services Region.
This prevents the public sharing of your AMIs. However, if you already have public AMIs, they will remain
publicly available.
</p>
<p>
The API can take up to 10 minutes to configure this setting. During this time, if you run <a
href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetImageBlockPublicAccessState.html"
>GetImageBlockPublicAccessState</a>, the response will be <code>unblocked</code>. When the API has completed the
configuration, the response will be <code>block-new-sharing</code>.
</p>
<p>
For more information, see <a
href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis"
>Block public access to your AMIs</a> in the <i>Amazon EC2 User Guide</i>.
</p>

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