/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.iamrolesanywhere;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.iamrolesanywhere.AWSIAMRolesAnywhereClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.iamrolesanywhere.model.*;
import com.amazonaws.services.iamrolesanywhere.model.transform.*;
/**
* Client for accessing IAM Roles Anywhere. All service calls made using this client are blocking, and will not return
* until the service call completes.
*
*
* Identity and Access Management Roles Anywhere provides a secure way for your workloads such as servers, containers,
* and applications that run outside of Amazon Web Services to obtain temporary Amazon Web Services credentials. Your
* workloads can use the same IAM policies and roles you have for native Amazon Web Services applications to access
* Amazon Web Services resources. Using IAM Roles Anywhere eliminates the need to manage long-term credentials for
* workloads running outside of Amazon Web Services.
*
*
* To use IAM Roles Anywhere, your workloads must use X.509 certificates issued by their certificate authority (CA). You
* register the CA with IAM Roles Anywhere as a trust anchor to establish trust between your public key infrastructure
* (PKI) and IAM Roles Anywhere. If you don't manage your own PKI system, you can use Private Certificate Authority to
* create a CA and then use that to establish trust with IAM Roles Anywhere.
*
*
* This guide describes the IAM Roles Anywhere operations that you can call programmatically. For more information about
* IAM Roles Anywhere, see the IAM Roles Anywhere User
* Guide.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSIAMRolesAnywhereClient extends AmazonWebServiceClient implements AWSIAMRolesAnywhere {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSIAMRolesAnywhere.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "rolesanywhere";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.withContentTypeOverride("application/json")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller(
com.amazonaws.services.iamrolesanywhere.model.transform.AccessDeniedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("TooManyTagsException").withExceptionUnmarshaller(
com.amazonaws.services.iamrolesanywhere.model.transform.TooManyTagsExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.iamrolesanywhere.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller(
com.amazonaws.services.iamrolesanywhere.model.transform.ValidationExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.iamrolesanywhere.model.AWSIAMRolesAnywhereException.class));
public static AWSIAMRolesAnywhereClientBuilder builder() {
return AWSIAMRolesAnywhereClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on IAM Roles Anywhere using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSIAMRolesAnywhereClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on IAM Roles Anywhere using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSIAMRolesAnywhereClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("rolesanywhere.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/iamrolesanywhere/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/iamrolesanywhere/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Creates a profile, a list of the roles that Roles Anywhere service is trusted to assume. You use profiles
* to intersect permissions with IAM managed policies.
*
*
* Required permissions: rolesanywhere:CreateProfile
.
*
*
* @param createProfileRequest
* @return Result of the CreateProfile operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.CreateProfile
* @see AWS
* API Documentation
*/
@Override
public CreateProfileResult createProfile(CreateProfileRequest request) {
request = beforeClientExecution(request);
return executeCreateProfile(request);
}
@SdkInternalApi
final CreateProfileResult executeCreateProfile(CreateProfileRequest createProfileRequest) {
ExecutionContext executionContext = createExecutionContext(createProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a trust anchor to establish trust between IAM Roles Anywhere and your certificate authority (CA). You can
* define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA
* certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued
* by the CA in exchange for temporary Amazon Web Services credentials.
*
*
* Required permissions: rolesanywhere:CreateTrustAnchor
.
*
*
* @param createTrustAnchorRequest
* @return Result of the CreateTrustAnchor operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.CreateTrustAnchor
* @see AWS API Documentation
*/
@Override
public CreateTrustAnchorResult createTrustAnchor(CreateTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeCreateTrustAnchor(request);
}
@SdkInternalApi
final CreateTrustAnchorResult executeCreateTrustAnchor(CreateTrustAnchorRequest createTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(createTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a certificate revocation list (CRL).
*
*
* Required permissions: rolesanywhere:DeleteCrl
.
*
*
* @param deleteCrlRequest
* @return Result of the DeleteCrl operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DeleteCrl
* @see AWS API
* Documentation
*/
@Override
public DeleteCrlResult deleteCrl(DeleteCrlRequest request) {
request = beforeClientExecution(request);
return executeDeleteCrl(request);
}
@SdkInternalApi
final DeleteCrlResult executeDeleteCrl(DeleteCrlRequest deleteCrlRequest) {
ExecutionContext executionContext = createExecutionContext(deleteCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a profile.
*
*
* Required permissions: rolesanywhere:DeleteProfile
.
*
*
* @param deleteProfileRequest
* @return Result of the DeleteProfile operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DeleteProfile
* @see AWS
* API Documentation
*/
@Override
public DeleteProfileResult deleteProfile(DeleteProfileRequest request) {
request = beforeClientExecution(request);
return executeDeleteProfile(request);
}
@SdkInternalApi
final DeleteProfileResult executeDeleteProfile(DeleteProfileRequest deleteProfileRequest) {
ExecutionContext executionContext = createExecutionContext(deleteProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a trust anchor.
*
*
* Required permissions: rolesanywhere:DeleteTrustAnchor
.
*
*
* @param deleteTrustAnchorRequest
* @return Result of the DeleteTrustAnchor operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DeleteTrustAnchor
* @see AWS API Documentation
*/
@Override
public DeleteTrustAnchorResult deleteTrustAnchor(DeleteTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeDeleteTrustAnchor(request);
}
@SdkInternalApi
final DeleteTrustAnchorResult executeDeleteTrustAnchor(DeleteTrustAnchorRequest deleteTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(deleteTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Disables a certificate revocation list (CRL).
*
*
* Required permissions: rolesanywhere:DisableCrl
.
*
*
* @param disableCrlRequest
* @return Result of the DisableCrl operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DisableCrl
* @see AWS API
* Documentation
*/
@Override
public DisableCrlResult disableCrl(DisableCrlRequest request) {
request = beforeClientExecution(request);
return executeDisableCrl(request);
}
@SdkInternalApi
final DisableCrlResult executeDisableCrl(DisableCrlRequest disableCrlRequest) {
ExecutionContext executionContext = createExecutionContext(disableCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisableCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disableCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisableCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisableCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Disables a profile. When disabled, temporary credential requests with this profile fail.
*
*
* Required permissions: rolesanywhere:DisableProfile
.
*
*
* @param disableProfileRequest
* @return Result of the DisableProfile operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DisableProfile
* @see AWS
* API Documentation
*/
@Override
public DisableProfileResult disableProfile(DisableProfileRequest request) {
request = beforeClientExecution(request);
return executeDisableProfile(request);
}
@SdkInternalApi
final DisableProfileResult executeDisableProfile(DisableProfileRequest disableProfileRequest) {
ExecutionContext executionContext = createExecutionContext(disableProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisableProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disableProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisableProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisableProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Disables a trust anchor. When disabled, temporary credential requests specifying this trust anchor are
* unauthorized.
*
*
* Required permissions: rolesanywhere:DisableTrustAnchor
.
*
*
* @param disableTrustAnchorRequest
* @return Result of the DisableTrustAnchor operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.DisableTrustAnchor
* @see AWS API Documentation
*/
@Override
public DisableTrustAnchorResult disableTrustAnchor(DisableTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeDisableTrustAnchor(request);
}
@SdkInternalApi
final DisableTrustAnchorResult executeDisableTrustAnchor(DisableTrustAnchorRequest disableTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(disableTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisableTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disableTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisableTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisableTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables a certificate revocation list (CRL). When enabled, certificates stored in the CRL are unauthorized to
* receive session credentials.
*
*
* Required permissions: rolesanywhere:EnableCrl
.
*
*
* @param enableCrlRequest
* @return Result of the EnableCrl operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.EnableCrl
* @see AWS API
* Documentation
*/
@Override
public EnableCrlResult enableCrl(EnableCrlRequest request) {
request = beforeClientExecution(request);
return executeEnableCrl(request);
}
@SdkInternalApi
final EnableCrlResult executeEnableCrl(EnableCrlRequest enableCrlRequest) {
ExecutionContext executionContext = createExecutionContext(enableCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new EnableCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables temporary credential requests for a profile.
*
*
* Required permissions: rolesanywhere:EnableProfile
.
*
*
* @param enableProfileRequest
* @return Result of the EnableProfile operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.EnableProfile
* @see AWS
* API Documentation
*/
@Override
public EnableProfileResult enableProfile(EnableProfileRequest request) {
request = beforeClientExecution(request);
return executeEnableProfile(request);
}
@SdkInternalApi
final EnableProfileResult executeEnableProfile(EnableProfileRequest enableProfileRequest) {
ExecutionContext executionContext = createExecutionContext(enableProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new EnableProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables a trust anchor. When enabled, certificates in the trust anchor chain are authorized for trust validation.
*
*
* Required permissions: rolesanywhere:EnableTrustAnchor
.
*
*
* @param enableTrustAnchorRequest
* @return Result of the EnableTrustAnchor operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.EnableTrustAnchor
* @see AWS API Documentation
*/
@Override
public EnableTrustAnchorResult enableTrustAnchor(EnableTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeEnableTrustAnchor(request);
}
@SdkInternalApi
final EnableTrustAnchorResult executeEnableTrustAnchor(EnableTrustAnchorRequest enableTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(enableTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new EnableTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets a certificate revocation list (CRL).
*
*
* Required permissions: rolesanywhere:GetCrl
.
*
*
* @param getCrlRequest
* @return Result of the GetCrl operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @sample AWSIAMRolesAnywhere.GetCrl
* @see AWS API
* Documentation
*/
@Override
public GetCrlResult getCrl(GetCrlRequest request) {
request = beforeClientExecution(request);
return executeGetCrl(request);
}
@SdkInternalApi
final GetCrlResult executeGetCrl(GetCrlRequest getCrlRequest) {
ExecutionContext executionContext = createExecutionContext(getCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets a profile.
*
*
* Required permissions: rolesanywhere:GetProfile
.
*
*
* @param getProfileRequest
* @return Result of the GetProfile operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.GetProfile
* @see AWS API
* Documentation
*/
@Override
public GetProfileResult getProfile(GetProfileRequest request) {
request = beforeClientExecution(request);
return executeGetProfile(request);
}
@SdkInternalApi
final GetProfileResult executeGetProfile(GetProfileRequest getProfileRequest) {
ExecutionContext executionContext = createExecutionContext(getProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets a subject, which associates a certificate identity with authentication attempts. The subject stores
* auditing information such as the status of the last authentication attempt, the certificate data used in the
* attempt, and the last time the associated identity attempted authentication.
*
*
* Required permissions: rolesanywhere:GetSubject
.
*
*
* @param getSubjectRequest
* @return Result of the GetSubject operation returned by the service.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.GetSubject
* @see AWS API
* Documentation
*/
@Override
public GetSubjectResult getSubject(GetSubjectRequest request) {
request = beforeClientExecution(request);
return executeGetSubject(request);
}
@SdkInternalApi
final GetSubjectResult executeGetSubject(GetSubjectRequest getSubjectRequest) {
ExecutionContext executionContext = createExecutionContext(getSubjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetSubjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSubjectRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSubject");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSubjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets a trust anchor.
*
*
* Required permissions: rolesanywhere:GetTrustAnchor
.
*
*
* @param getTrustAnchorRequest
* @return Result of the GetTrustAnchor operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.GetTrustAnchor
* @see AWS
* API Documentation
*/
@Override
public GetTrustAnchorResult getTrustAnchor(GetTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeGetTrustAnchor(request);
}
@SdkInternalApi
final GetTrustAnchorResult executeGetTrustAnchor(GetTrustAnchorRequest getTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(getTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Imports the certificate revocation list (CRL). A CRL is a list of certificates that have been revoked by the
* issuing certificate Authority (CA). IAM Roles Anywhere validates against the CRL before issuing credentials.
*
*
* Required permissions: rolesanywhere:ImportCrl
.
*
*
* @param importCrlRequest
* @return Result of the ImportCrl operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ImportCrl
* @see AWS API
* Documentation
*/
@Override
public ImportCrlResult importCrl(ImportCrlRequest request) {
request = beforeClientExecution(request);
return executeImportCrl(request);
}
@SdkInternalApi
final ImportCrlResult executeImportCrl(ImportCrlRequest importCrlRequest) {
ExecutionContext executionContext = createExecutionContext(importCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ImportCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all certificate revocation lists (CRL) in the authenticated account and Amazon Web Services Region.
*
*
* Required permissions: rolesanywhere:ListCrls
.
*
*
* @param listCrlsRequest
* @return Result of the ListCrls operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ListCrls
* @see AWS API
* Documentation
*/
@Override
public ListCrlsResult listCrls(ListCrlsRequest request) {
request = beforeClientExecution(request);
return executeListCrls(request);
}
@SdkInternalApi
final ListCrlsResult executeListCrls(ListCrlsRequest listCrlsRequest) {
ExecutionContext executionContext = createExecutionContext(listCrlsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListCrlsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCrlsRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCrls");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCrlsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all profiles in the authenticated account and Amazon Web Services Region.
*
*
* Required permissions: rolesanywhere:ListProfiles
.
*
*
* @param listProfilesRequest
* @return Result of the ListProfiles operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ListProfiles
* @see AWS API
* Documentation
*/
@Override
public ListProfilesResult listProfiles(ListProfilesRequest request) {
request = beforeClientExecution(request);
return executeListProfiles(request);
}
@SdkInternalApi
final ListProfilesResult executeListProfiles(ListProfilesRequest listProfilesRequest) {
ExecutionContext executionContext = createExecutionContext(listProfilesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListProfilesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProfilesRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProfiles");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProfilesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the subjects in the authenticated account and Amazon Web Services Region.
*
*
* Required permissions: rolesanywhere:ListSubjects
.
*
*
* @param listSubjectsRequest
* @return Result of the ListSubjects operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ListSubjects
* @see AWS API
* Documentation
*/
@Override
public ListSubjectsResult listSubjects(ListSubjectsRequest request) {
request = beforeClientExecution(request);
return executeListSubjects(request);
}
@SdkInternalApi
final ListSubjectsResult executeListSubjects(ListSubjectsRequest listSubjectsRequest) {
ExecutionContext executionContext = createExecutionContext(listSubjectsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListSubjectsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSubjectsRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSubjects");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSubjectsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the tags attached to the resource.
*
*
* Required permissions: rolesanywhere:ListTagsForResource
.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
}
@SdkInternalApi
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {
ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the trust anchors in the authenticated account and Amazon Web Services Region.
*
*
* Required permissions: rolesanywhere:ListTrustAnchors
.
*
*
* @param listTrustAnchorsRequest
* @return Result of the ListTrustAnchors operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ListTrustAnchors
* @see AWS
* API Documentation
*/
@Override
public ListTrustAnchorsResult listTrustAnchors(ListTrustAnchorsRequest request) {
request = beforeClientExecution(request);
return executeListTrustAnchors(request);
}
@SdkInternalApi
final ListTrustAnchorsResult executeListTrustAnchors(ListTrustAnchorsRequest listTrustAnchorsRequest) {
ExecutionContext executionContext = createExecutionContext(listTrustAnchorsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTrustAnchorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTrustAnchorsRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTrustAnchors");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTrustAnchorsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches a list of notification settings to a trust anchor.
*
*
* A notification setting includes information such as event name, threshold, status of the notification setting,
* and the channel to notify.
*
*
* Required permissions: rolesanywhere:PutNotificationSettings
.
*
*
* @param putNotificationSettingsRequest
* @return Result of the PutNotificationSettings operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.PutNotificationSettings
* @see AWS API Documentation
*/
@Override
public PutNotificationSettingsResult putNotificationSettings(PutNotificationSettingsRequest request) {
request = beforeClientExecution(request);
return executePutNotificationSettings(request);
}
@SdkInternalApi
final PutNotificationSettingsResult executePutNotificationSettings(PutNotificationSettingsRequest putNotificationSettingsRequest) {
ExecutionContext executionContext = createExecutionContext(putNotificationSettingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new PutNotificationSettingsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(putNotificationSettingsRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutNotificationSettings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new PutNotificationSettingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Resets the custom notification setting to IAM Roles Anywhere default setting.
*
*
* Required permissions: rolesanywhere:ResetNotificationSettings
.
*
*
* @param resetNotificationSettingsRequest
* @return Result of the ResetNotificationSettings operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.ResetNotificationSettings
* @see AWS API Documentation
*/
@Override
public ResetNotificationSettingsResult resetNotificationSettings(ResetNotificationSettingsRequest request) {
request = beforeClientExecution(request);
return executeResetNotificationSettings(request);
}
@SdkInternalApi
final ResetNotificationSettingsResult executeResetNotificationSettings(ResetNotificationSettingsRequest resetNotificationSettingsRequest) {
ExecutionContext executionContext = createExecutionContext(resetNotificationSettingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ResetNotificationSettingsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(resetNotificationSettingsRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResetNotificationSettings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ResetNotificationSettingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Attaches tags to a resource.
*
*
* Required permissions: rolesanywhere:TagResource
.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @throws TooManyTagsException
* Too many tags.
* @sample AWSIAMRolesAnywhere.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResult tagResource(TagResourceRequest request) {
request = beforeClientExecution(request);
return executeTagResource(request);
}
@SdkInternalApi
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(tagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes tags from the resource.
*
*
* Required permissions: rolesanywhere:UntagResource
.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.UntagResource
* @see AWS
* API Documentation
*/
@Override
public UntagResourceResult untagResource(UntagResourceRequest request) {
request = beforeClientExecution(request);
return executeUntagResource(request);
}
@SdkInternalApi
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(untagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates the certificate revocation list (CRL). A CRL is a list of certificates that have been revoked by the
* issuing certificate authority (CA). IAM Roles Anywhere validates against the CRL before issuing credentials.
*
*
* Required permissions: rolesanywhere:UpdateCrl
.
*
*
* @param updateCrlRequest
* @return Result of the UpdateCrl operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.UpdateCrl
* @see AWS API
* Documentation
*/
@Override
public UpdateCrlResult updateCrl(UpdateCrlRequest request) {
request = beforeClientExecution(request);
return executeUpdateCrl(request);
}
@SdkInternalApi
final UpdateCrlResult executeUpdateCrl(UpdateCrlRequest updateCrlRequest) {
ExecutionContext executionContext = createExecutionContext(updateCrlRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateCrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCrlRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateCrl");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCrlResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates a profile, a list of the roles that IAM Roles Anywhere service is trusted to assume. You use
* profiles to intersect permissions with IAM managed policies.
*
*
* Required permissions: rolesanywhere:UpdateProfile
.
*
*
* @param updateProfileRequest
* @return Result of the UpdateProfile operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.UpdateProfile
* @see AWS
* API Documentation
*/
@Override
public UpdateProfileResult updateProfile(UpdateProfileRequest request) {
request = beforeClientExecution(request);
return executeUpdateProfile(request);
}
@SdkInternalApi
final UpdateProfileResult executeUpdateProfile(UpdateProfileRequest updateProfileRequest) {
ExecutionContext executionContext = createExecutionContext(updateProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateProfileRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateProfile");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateProfileResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates a trust anchor. You establish trust between IAM Roles Anywhere and your certificate authority (CA) by
* configuring a trust anchor. You can define a trust anchor as a reference to an Private Certificate Authority
* (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust
* anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.
*
*
* Required permissions: rolesanywhere:UpdateTrustAnchor
.
*
*
* @param updateTrustAnchorRequest
* @return Result of the UpdateTrustAnchor operation returned by the service.
* @throws ValidationException
* Validation exception error.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action.
* @sample AWSIAMRolesAnywhere.UpdateTrustAnchor
* @see AWS API Documentation
*/
@Override
public UpdateTrustAnchorResult updateTrustAnchor(UpdateTrustAnchorRequest request) {
request = beforeClientExecution(request);
return executeUpdateTrustAnchor(request);
}
@SdkInternalApi
final UpdateTrustAnchorResult executeUpdateTrustAnchor(UpdateTrustAnchorRequest updateTrustAnchorRequest) {
ExecutionContext executionContext = createExecutionContext(updateTrustAnchorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateTrustAnchorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateTrustAnchorRequest));
// 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, "RolesAnywhere");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateTrustAnchor");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateTrustAnchorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
@Override
public void shutdown() {
super.shutdown();
}
}