@SdkInternalApi
    final GetResourceShareInvitationsResult executeGetResourceShareInvitations(GetResourceShareInvitationsRequest getResourceShareInvitationsRequest) {

        ExecutionContext executionContext = createExecutionContext(getResourceShareInvitationsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<GetResourceShareInvitationsRequest> request = null;
        Response<GetResourceShareInvitationsResult> response = null;

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

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Retrieves details about invitations that you have received for resource shares.
</p>

@param getResourceShareInvitationsRequest
@return Result of the GetResourceShareInvitations operation returned by the service.
@throws ResourceShareInvitationArnNotFoundException
        The operation failed because the specified <a
        href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name
        (ARN)</a> for an invitation was not found.
@throws InvalidMaxResultsException
        The operation failed because the specified value for <code>MaxResults</code> isn't valid.
@throws MalformedArnException
        The operation failed because the specified <a
        href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name
        (ARN)</a> has a format that isn't valid.
@throws UnknownResourceException
        The operation failed because a specified resource couldn't be found.
@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.
@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.
@sample AWSRAM.GetResourceShareInvitations
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetResourceShareInvitations"
     target="_top">AWS API Documentation</a>
aws-java-sdk-ram/src/main/java/com/amazonaws/services/ram/AWSRAMClient.java