@SdkInternalApi
    final ListReplacePermissionAssociationsWorkResult executeListReplacePermissionAssociationsWork(
            ListReplacePermissionAssociationsWorkRequest listReplacePermissionAssociationsWorkRequest) {

        ExecutionContext executionContext = createExecutionContext(listReplacePermissionAssociationsWorkRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<ListReplacePermissionAssociationsWorkRequest> request = null;
        Response<ListReplacePermissionAssociationsWorkResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new ListReplacePermissionAssociationsWorkRequestProtocolMarshaller(protocolFactory).marshall(super
                        .beforeMarshalling(listReplacePermissionAssociationsWorkRequest));
                // 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, "RAM");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListReplacePermissionAssociationsWork");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            HttpResponseHandler<AmazonWebServiceResponse<ListReplacePermissionAssociationsWorkResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
                    new ListReplacePermissionAssociationsWorkResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Retrieves the current status of the asynchronous tasks performed by RAM when you perform the
<a>ReplacePermissionAssociationsWork</a> operation.
</p>

@param listReplacePermissionAssociationsWorkRequest
@return Result of the ListReplacePermissionAssociationsWork operation returned by the service.
@throws ServerInternalException
        The operation failed because the service could not respond to the request due to an internal problem. Try
        again later.
@throws ServiceUnavailableException
        The operation failed because the service isn't available. Try again later.
@throws InvalidNextTokenException
        The operation failed because the specified value for <code>NextToken</code> isn't valid. You must specify
        a value you received in the <code>NextToken</code> response of a previous call to this operation.
@throws InvalidParameterException
        The operation failed because a parameter you specified isn't valid.
@sample AWSRAM.ListReplacePermissionAssociationsWork
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListReplacePermissionAssociationsWork"
     target="_top">AWS API Documentation</a>
aws-java-sdk-ram/src/main/java/com/amazonaws/services/ram/AWSRAMClient.java