Interface IamToolboxClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
Contains APIs to work with AWS Identity and Access Management (IAM).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic IamToolboxClientBuilderbuilder()Create a builder that can be used to configure and create aIamToolboxClient.static IamToolboxClientcreate()Create aIamToolboxClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.getRequestAuthorizationDetails(Consumer<GetRequestAuthorizationDetailsRequest.Builder> getRequestAuthorizationDetailsRequest) Retrieves the authorization details for a specific access denied request.getRequestAuthorizationDetails(GetRequestAuthorizationDetailsRequest getRequestAuthorizationDetailsRequest) Retrieves the authorization details for a specific access denied request.getRequestAuthorizationDetailsPaginator(Consumer<GetRequestAuthorizationDetailsRequest.Builder> getRequestAuthorizationDetailsRequest) This is a variant ofgetRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)operation.getRequestAuthorizationDetailsPaginator(GetRequestAuthorizationDetailsRequest getRequestAuthorizationDetailsRequest) This is a variant ofgetRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)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
-
getRequestAuthorizationDetails
default GetRequestAuthorizationDetailsResponse getRequestAuthorizationDetails(GetRequestAuthorizationDetailsRequest getRequestAuthorizationDetailsRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, IamToolboxException Retrieves the authorization details for a specific access denied request. The details include the request context, the evaluations performed, and the policies that were evaluated.
Use this operation to understand why a request was denied. Supported services include an authorization ID in the access denied error message. Pass that ID to this operation to retrieve the details.
Authorization details are available for at least 24 hours after the denial.
To use this operation, you must have the
iam:GetRequestAuthorizationDetailspermission.- Parameters:
getRequestAuthorizationDetailsRequest-- Returns:
- Result of the GetRequestAuthorizationDetails operation returned by the service.
- See Also:
-
getRequestAuthorizationDetails
default GetRequestAuthorizationDetailsResponse getRequestAuthorizationDetails(Consumer<GetRequestAuthorizationDetailsRequest.Builder> getRequestAuthorizationDetailsRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, IamToolboxException Retrieves the authorization details for a specific access denied request. The details include the request context, the evaluations performed, and the policies that were evaluated.
Use this operation to understand why a request was denied. Supported services include an authorization ID in the access denied error message. Pass that ID to this operation to retrieve the details.
Authorization details are available for at least 24 hours after the denial.
To use this operation, you must have the
iam:GetRequestAuthorizationDetailspermission.
This is a convenience which creates an instance of the
GetRequestAuthorizationDetailsRequest.Builderavoiding the need to create one manually viaGetRequestAuthorizationDetailsRequest.builder()- Parameters:
getRequestAuthorizationDetailsRequest- AConsumerthat will call methods onGetRequestAuthorizationDetailsRequest.Builderto create a request.- Returns:
- Result of the GetRequestAuthorizationDetails operation returned by the service.
- See Also:
-
getRequestAuthorizationDetailsPaginator
default GetRequestAuthorizationDetailsIterable getRequestAuthorizationDetailsPaginator(GetRequestAuthorizationDetailsRequest getRequestAuthorizationDetailsRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, IamToolboxException This is a variant of
getRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)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.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client.getRequestAuthorizationDetailsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client .getRequestAuthorizationDetailsPaginator(request); for (software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client.getRequestAuthorizationDetailsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of null 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
getRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)operation.- Parameters:
getRequestAuthorizationDetailsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getRequestAuthorizationDetailsPaginator
default GetRequestAuthorizationDetailsIterable getRequestAuthorizationDetailsPaginator(Consumer<GetRequestAuthorizationDetailsRequest.Builder> getRequestAuthorizationDetailsRequest) throws AccessDeniedException, ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException, IamToolboxException This is a variant of
getRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)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.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client.getRequestAuthorizationDetailsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client .getRequestAuthorizationDetailsPaginator(request); for (software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.iamtoolbox.paginators.GetRequestAuthorizationDetailsIterable responses = client.getRequestAuthorizationDetailsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of null 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
getRequestAuthorizationDetails(software.amazon.awssdk.services.iamtoolbox.model.GetRequestAuthorizationDetailsRequest)operation.
This is a convenience which creates an instance of the
GetRequestAuthorizationDetailsRequest.Builderavoiding the need to create one manually viaGetRequestAuthorizationDetailsRequest.builder()- Parameters:
getRequestAuthorizationDetailsRequest- AConsumerthat will call methods onGetRequestAuthorizationDetailsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aIamToolboxClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aIamToolboxClient. -
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
-