@SdkInternalApi
    final ModifySnapshotAttributeResult executeModifySnapshotAttribute(ModifySnapshotAttributeRequest modifySnapshotAttributeRequest) {

        ExecutionContext executionContext = createExecutionContext(modifySnapshotAttributeRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<ModifySnapshotAttributeRequest> request = null;
        Response<ModifySnapshotAttributeResult> response = null;

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

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

            StaxResponseHandler<ModifySnapshotAttributeResult> responseHandler = new StaxResponseHandler<ModifySnapshotAttributeResult>(
                    new ModifySnapshotAttributeResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Adds or removes permission settings for the specified snapshot. You may add or remove specified Amazon Web
Services account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single
operation. If you need to both add and remove account IDs for a snapshot, you must use multiple operations. You
can make up to 500 modifications to a snapshot in a single operation.
</p>
<p>
Encrypted snapshots and snapshots with Amazon Web Services Marketplace product codes cannot be made public.
Snapshots encrypted with your default KMS key cannot be shared with other accounts.
</p>
<p>
For more information about modifying snapshot permissions, see <a
href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html">Share a
snapshot</a> in the <i>Amazon EBS User Guide</i>.
</p>

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