Interface AccountAccessRuntimeClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
Use the Account Access Runtime API to list the roles that you can access and retrieve temporary Amazon Web Services credentials for those roles. You authenticate with a bearer token from IAM Identity Center. Each request is scoped to a tenant.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder that can be used to configure and create aAccountAccessRuntimeClient.static AccountAccessRuntimeClientcreate()Create aAccountAccessRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default GetRoleCredentialsResponsegetRoleCredentials(Consumer<GetRoleCredentialsRequest.Builder> getRoleCredentialsRequest) Returns temporary Amazon Web Services credentials for a role that you are entitled to assume within a tenant.default GetRoleCredentialsResponsegetRoleCredentials(GetRoleCredentialsRequest getRoleCredentialsRequest) Returns temporary Amazon Web Services credentials for a role that you are entitled to assume within a tenant.default ListRolesResponselistRoles(Consumer<ListRolesRequest.Builder> listRolesRequest) Returns the roles that you are entitled to access within a tenant.default ListRolesResponselistRoles(ListRolesRequest listRolesRequest) Returns the roles that you are entitled to access within a tenant.default ListRolesIterablelistRolesPaginator(Consumer<ListRolesRequest.Builder> listRolesRequest) This is a variant oflistRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation.default ListRolesIterablelistRolesPaginator(ListRolesRequest listRolesRequest) This is a variant oflistRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadataMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
getRoleCredentials
default GetRoleCredentialsResponse getRoleCredentials(GetRoleCredentialsRequest getRoleCredentialsRequest) throws AccessDeniedException, ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException Returns temporary Amazon Web Services credentials for a role that you are entitled to assume within a tenant. You can use these credentials for programmatic access with the CLI or an Amazon Web Services SDK. If you aren't entitled to the role, the request fails with an
AccessDeniedExceptionerror.- Parameters:
getRoleCredentialsRequest-- Returns:
- Result of the GetRoleCredentials operation returned by the service.
- See Also:
-
getRoleCredentials
default GetRoleCredentialsResponse getRoleCredentials(Consumer<GetRoleCredentialsRequest.Builder> getRoleCredentialsRequest) throws AccessDeniedException, ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException Returns temporary Amazon Web Services credentials for a role that you are entitled to assume within a tenant. You can use these credentials for programmatic access with the CLI or an Amazon Web Services SDK. If you aren't entitled to the role, the request fails with an
AccessDeniedExceptionerror.
This is a convenience which creates an instance of the
GetRoleCredentialsRequest.Builderavoiding the need to create one manually viaGetRoleCredentialsRequest.builder()- Parameters:
getRoleCredentialsRequest- AConsumerthat will call methods onGetRoleCredentialsRequest.Builderto create a request.- Returns:
- Result of the GetRoleCredentials operation returned by the service.
- See Also:
-
listRoles
default ListRolesResponse listRoles(ListRolesRequest listRolesRequest) throws ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException Returns the roles that you are entitled to access within a tenant. The results are paginated. Use a returned role with
GetRoleCredentialsto obtain temporary credentials.- Parameters:
listRolesRequest-- Returns:
- Result of the ListRoles operation returned by the service.
- See Also:
-
listRoles
default ListRolesResponse listRoles(Consumer<ListRolesRequest.Builder> listRolesRequest) throws ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException Returns the roles that you are entitled to access within a tenant. The results are paginated. Use a returned role with
GetRoleCredentialsto obtain temporary credentials.
This is a convenience which creates an instance of the
ListRolesRequest.Builderavoiding the need to create one manually viaListRolesRequest.builder()- Parameters:
listRolesRequest- AConsumerthat will call methods onListRolesRequest.Builderto create a request.- Returns:
- Result of the ListRoles operation returned by the service.
- See Also:
-
listRolesPaginator
default ListRolesIterable listRolesPaginator(ListRolesRequest listRolesRequest) throws ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException This is a variant of
listRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client.listRolesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client .listRolesPaginator(request); for (software.amazon.awssdk.services.accountaccessruntime.model.ListRolesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client.listRolesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation.- Parameters:
listRolesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listRolesPaginator
default ListRolesIterable listRolesPaginator(Consumer<ListRolesRequest.Builder> listRolesRequest) throws ThrottlingException, UnauthorizedException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, AccountAccessRuntimeException This is a variant of
listRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client.listRolesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client .listRolesPaginator(request); for (software.amazon.awssdk.services.accountaccessruntime.model.ListRolesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.accountaccessruntime.paginators.ListRolesIterable responses = client.listRolesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listRoles(software.amazon.awssdk.services.accountaccessruntime.model.ListRolesRequest)operation.
This is a convenience which creates an instance of the
ListRolesRequest.Builderavoiding the need to create one manually viaListRolesRequest.builder()- Parameters:
listRolesRequest- AConsumerthat will call methods onListRolesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aAccountAccessRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aAccountAccessRuntimeClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-