Interface SustainabilityClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
The AWS Sustainability service provides programmatic access to estimated environmental impact data for your Amazon Web Services usage. Use the AWS Sustainability service to retrieve, analyze, and track the environmental impact of your cloud infrastructure over time.
With the AWS Sustainability service, you can:
-
Retrieve estimated carbon emissions and water allocation for your Amazon Web Services usage across different time periods
-
Group environmental impact data by dimensions such as account, region, and service
-
Filter environmental impact data to focus on specific accounts, regions, or services
-
Access multiple carbon emissions calculation methodologies including Location-based Method (LBM) and Market-based Method (MBM)
-
Aggregate environmental impact data at various time granularities including monthly, quarterly, and yearly periods
The API supports pagination for efficient data retrieval and provides dimension values to help you understand the available grouping and filtering options for your account.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic SustainabilityClientBuilderbuilder()Create a builder that can be used to configure and create aSustainabilityClient.static SustainabilityClientcreate()Create aSustainabilityClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.getEstimatedCarbonEmissions(Consumer<GetEstimatedCarbonEmissionsRequest.Builder> getEstimatedCarbonEmissionsRequest) Returns estimated carbon emission values based on customer grouping and filtering parameters.getEstimatedCarbonEmissions(GetEstimatedCarbonEmissionsRequest getEstimatedCarbonEmissionsRequest) Returns estimated carbon emission values based on customer grouping and filtering parameters.getEstimatedCarbonEmissionsDimensionValues(Consumer<GetEstimatedCarbonEmissionsDimensionValuesRequest.Builder> getEstimatedCarbonEmissionsDimensionValuesRequest) Returns the possible dimension values available for a customer's account.getEstimatedCarbonEmissionsDimensionValues(GetEstimatedCarbonEmissionsDimensionValuesRequest getEstimatedCarbonEmissionsDimensionValuesRequest) Returns the possible dimension values available for a customer's account.getEstimatedCarbonEmissionsDimensionValuesPaginator(Consumer<GetEstimatedCarbonEmissionsDimensionValuesRequest.Builder> getEstimatedCarbonEmissionsDimensionValuesRequest) getEstimatedCarbonEmissionsDimensionValuesPaginator(GetEstimatedCarbonEmissionsDimensionValuesRequest getEstimatedCarbonEmissionsDimensionValuesRequest) getEstimatedCarbonEmissionsPaginator(Consumer<GetEstimatedCarbonEmissionsRequest.Builder> getEstimatedCarbonEmissionsRequest) This is a variant ofgetEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)operation.getEstimatedCarbonEmissionsPaginator(GetEstimatedCarbonEmissionsRequest getEstimatedCarbonEmissionsRequest) This is a variant ofgetEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)operation.getEstimatedWaterAllocation(Consumer<GetEstimatedWaterAllocationRequest.Builder> getEstimatedWaterAllocationRequest) Returns estimated water allocation values based on customer grouping and filtering parameters.getEstimatedWaterAllocation(GetEstimatedWaterAllocationRequest getEstimatedWaterAllocationRequest) Returns estimated water allocation values based on customer grouping and filtering parameters.getEstimatedWaterAllocationDimensionValues(Consumer<GetEstimatedWaterAllocationDimensionValuesRequest.Builder> getEstimatedWaterAllocationDimensionValuesRequest) Returns the possible dimension values available for a customer's account.getEstimatedWaterAllocationDimensionValues(GetEstimatedWaterAllocationDimensionValuesRequest getEstimatedWaterAllocationDimensionValuesRequest) Returns the possible dimension values available for a customer's account.getEstimatedWaterAllocationDimensionValuesPaginator(Consumer<GetEstimatedWaterAllocationDimensionValuesRequest.Builder> getEstimatedWaterAllocationDimensionValuesRequest) getEstimatedWaterAllocationDimensionValuesPaginator(GetEstimatedWaterAllocationDimensionValuesRequest getEstimatedWaterAllocationDimensionValuesRequest) getEstimatedWaterAllocationPaginator(Consumer<GetEstimatedWaterAllocationRequest.Builder> getEstimatedWaterAllocationRequest) This is a variant ofgetEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)operation.getEstimatedWaterAllocationPaginator(GetEstimatedWaterAllocationRequest getEstimatedWaterAllocationRequest) This is a variant ofgetEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)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
-
getEstimatedCarbonEmissions
default GetEstimatedCarbonEmissionsResponse getEstimatedCarbonEmissions(GetEstimatedCarbonEmissionsRequest getEstimatedCarbonEmissionsRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns estimated carbon emission values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.
- Parameters:
getEstimatedCarbonEmissionsRequest-- Returns:
- Result of the GetEstimatedCarbonEmissions operation returned by the service.
- See Also:
-
getEstimatedCarbonEmissions
default GetEstimatedCarbonEmissionsResponse getEstimatedCarbonEmissions(Consumer<GetEstimatedCarbonEmissionsRequest.Builder> getEstimatedCarbonEmissionsRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns estimated carbon emission values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.
This is a convenience which creates an instance of the
GetEstimatedCarbonEmissionsRequest.Builderavoiding the need to create one manually viaGetEstimatedCarbonEmissionsRequest.builder()- Parameters:
getEstimatedCarbonEmissionsRequest- AConsumerthat will call methods onGetEstimatedCarbonEmissionsRequest.Builderto create a request.- Returns:
- Result of the GetEstimatedCarbonEmissions operation returned by the service.
- See Also:
-
getEstimatedCarbonEmissionsPaginator
default GetEstimatedCarbonEmissionsIterable getEstimatedCarbonEmissionsPaginator(GetEstimatedCarbonEmissionsRequest getEstimatedCarbonEmissionsRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)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.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client.getEstimatedCarbonEmissionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client .getEstimatedCarbonEmissionsPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client.getEstimatedCarbonEmissionsPaginator(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
getEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)operation.- Parameters:
getEstimatedCarbonEmissionsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedCarbonEmissionsPaginator
default GetEstimatedCarbonEmissionsIterable getEstimatedCarbonEmissionsPaginator(Consumer<GetEstimatedCarbonEmissionsRequest.Builder> getEstimatedCarbonEmissionsRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)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.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client.getEstimatedCarbonEmissionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client .getEstimatedCarbonEmissionsPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsIterable responses = client.getEstimatedCarbonEmissionsPaginator(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
getEstimatedCarbonEmissions(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsRequest)operation.
This is a convenience which creates an instance of the
GetEstimatedCarbonEmissionsRequest.Builderavoiding the need to create one manually viaGetEstimatedCarbonEmissionsRequest.builder()- Parameters:
getEstimatedCarbonEmissionsRequest- AConsumerthat will call methods onGetEstimatedCarbonEmissionsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedCarbonEmissionsDimensionValues
default GetEstimatedCarbonEmissionsDimensionValuesResponse getEstimatedCarbonEmissionsDimensionValues(GetEstimatedCarbonEmissionsDimensionValuesRequest getEstimatedCarbonEmissionsDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.
- Parameters:
getEstimatedCarbonEmissionsDimensionValuesRequest-- Returns:
- Result of the GetEstimatedCarbonEmissionsDimensionValues operation returned by the service.
- See Also:
-
getEstimatedCarbonEmissionsDimensionValues
default GetEstimatedCarbonEmissionsDimensionValuesResponse getEstimatedCarbonEmissionsDimensionValues(Consumer<GetEstimatedCarbonEmissionsDimensionValuesRequest.Builder> getEstimatedCarbonEmissionsDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.
This is a convenience which creates an instance of the
GetEstimatedCarbonEmissionsDimensionValuesRequest.Builderavoiding the need to create one manually viaGetEstimatedCarbonEmissionsDimensionValuesRequest.builder()- Parameters:
getEstimatedCarbonEmissionsDimensionValuesRequest- AConsumerthat will call methods onGetEstimatedCarbonEmissionsDimensionValuesRequest.Builderto create a request.- Returns:
- Result of the GetEstimatedCarbonEmissionsDimensionValues operation returned by the service.
- See Also:
-
getEstimatedCarbonEmissionsDimensionValuesPaginator
default GetEstimatedCarbonEmissionsDimensionValuesIterable getEstimatedCarbonEmissionsDimensionValuesPaginator(GetEstimatedCarbonEmissionsDimensionValuesRequest getEstimatedCarbonEmissionsDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedCarbonEmissionsDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesRequest)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.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client.getEstimatedCarbonEmissionsDimensionValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client .getEstimatedCarbonEmissionsDimensionValuesPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client.getEstimatedCarbonEmissionsDimensionValuesPaginator(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
getEstimatedCarbonEmissionsDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesRequest)operation.- Parameters:
getEstimatedCarbonEmissionsDimensionValuesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedCarbonEmissionsDimensionValuesPaginator
default GetEstimatedCarbonEmissionsDimensionValuesIterable getEstimatedCarbonEmissionsDimensionValuesPaginator(Consumer<GetEstimatedCarbonEmissionsDimensionValuesRequest.Builder> getEstimatedCarbonEmissionsDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedCarbonEmissionsDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesRequest)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.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client.getEstimatedCarbonEmissionsDimensionValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client .getEstimatedCarbonEmissionsDimensionValuesPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedCarbonEmissionsDimensionValuesIterable responses = client.getEstimatedCarbonEmissionsDimensionValuesPaginator(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
getEstimatedCarbonEmissionsDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedCarbonEmissionsDimensionValuesRequest)operation.
This is a convenience which creates an instance of the
GetEstimatedCarbonEmissionsDimensionValuesRequest.Builderavoiding the need to create one manually viaGetEstimatedCarbonEmissionsDimensionValuesRequest.builder()- Parameters:
getEstimatedCarbonEmissionsDimensionValuesRequest- AConsumerthat will call methods onGetEstimatedCarbonEmissionsDimensionValuesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedWaterAllocation
default GetEstimatedWaterAllocationResponse getEstimatedWaterAllocation(GetEstimatedWaterAllocationRequest getEstimatedWaterAllocationRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns estimated water allocation values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.
- Parameters:
getEstimatedWaterAllocationRequest-- Returns:
- Result of the GetEstimatedWaterAllocation operation returned by the service.
- See Also:
-
getEstimatedWaterAllocation
default GetEstimatedWaterAllocationResponse getEstimatedWaterAllocation(Consumer<GetEstimatedWaterAllocationRequest.Builder> getEstimatedWaterAllocationRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns estimated water allocation values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.
This is a convenience which creates an instance of the
GetEstimatedWaterAllocationRequest.Builderavoiding the need to create one manually viaGetEstimatedWaterAllocationRequest.builder()- Parameters:
getEstimatedWaterAllocationRequest- AConsumerthat will call methods onGetEstimatedWaterAllocationRequest.Builderto create a request.- Returns:
- Result of the GetEstimatedWaterAllocation operation returned by the service.
- See Also:
-
getEstimatedWaterAllocationPaginator
default GetEstimatedWaterAllocationIterable getEstimatedWaterAllocationPaginator(GetEstimatedWaterAllocationRequest getEstimatedWaterAllocationRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)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.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client.getEstimatedWaterAllocationPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client .getEstimatedWaterAllocationPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client.getEstimatedWaterAllocationPaginator(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
getEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)operation.- Parameters:
getEstimatedWaterAllocationRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedWaterAllocationPaginator
default GetEstimatedWaterAllocationIterable getEstimatedWaterAllocationPaginator(Consumer<GetEstimatedWaterAllocationRequest.Builder> getEstimatedWaterAllocationRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)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.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client.getEstimatedWaterAllocationPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client .getEstimatedWaterAllocationPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationIterable responses = client.getEstimatedWaterAllocationPaginator(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
getEstimatedWaterAllocation(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationRequest)operation.
This is a convenience which creates an instance of the
GetEstimatedWaterAllocationRequest.Builderavoiding the need to create one manually viaGetEstimatedWaterAllocationRequest.builder()- Parameters:
getEstimatedWaterAllocationRequest- AConsumerthat will call methods onGetEstimatedWaterAllocationRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedWaterAllocationDimensionValues
default GetEstimatedWaterAllocationDimensionValuesResponse getEstimatedWaterAllocationDimensionValues(GetEstimatedWaterAllocationDimensionValuesRequest getEstimatedWaterAllocationDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.
- Parameters:
getEstimatedWaterAllocationDimensionValuesRequest-- Returns:
- Result of the GetEstimatedWaterAllocationDimensionValues operation returned by the service.
- See Also:
-
getEstimatedWaterAllocationDimensionValues
default GetEstimatedWaterAllocationDimensionValuesResponse getEstimatedWaterAllocationDimensionValues(Consumer<GetEstimatedWaterAllocationDimensionValuesRequest.Builder> getEstimatedWaterAllocationDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException Returns the possible dimension values available for a customer's account. We recommend using pagination to ensure that the operation returns quickly and successfully.
This is a convenience which creates an instance of the
GetEstimatedWaterAllocationDimensionValuesRequest.Builderavoiding the need to create one manually viaGetEstimatedWaterAllocationDimensionValuesRequest.builder()- Parameters:
getEstimatedWaterAllocationDimensionValuesRequest- AConsumerthat will call methods onGetEstimatedWaterAllocationDimensionValuesRequest.Builderto create a request.- Returns:
- Result of the GetEstimatedWaterAllocationDimensionValues operation returned by the service.
- See Also:
-
getEstimatedWaterAllocationDimensionValuesPaginator
default GetEstimatedWaterAllocationDimensionValuesIterable getEstimatedWaterAllocationDimensionValuesPaginator(GetEstimatedWaterAllocationDimensionValuesRequest getEstimatedWaterAllocationDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedWaterAllocationDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesRequest)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.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client.getEstimatedWaterAllocationDimensionValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client .getEstimatedWaterAllocationDimensionValuesPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client.getEstimatedWaterAllocationDimensionValuesPaginator(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
getEstimatedWaterAllocationDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesRequest)operation.- Parameters:
getEstimatedWaterAllocationDimensionValuesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getEstimatedWaterAllocationDimensionValuesPaginator
default GetEstimatedWaterAllocationDimensionValuesIterable getEstimatedWaterAllocationDimensionValuesPaginator(Consumer<GetEstimatedWaterAllocationDimensionValuesRequest.Builder> getEstimatedWaterAllocationDimensionValuesRequest) throws ValidationException, InternalServerException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, SustainabilityException This is a variant of
getEstimatedWaterAllocationDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesRequest)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.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client.getEstimatedWaterAllocationDimensionValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client .getEstimatedWaterAllocationDimensionValuesPaginator(request); for (software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.sustainability.paginators.GetEstimatedWaterAllocationDimensionValuesIterable responses = client.getEstimatedWaterAllocationDimensionValuesPaginator(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
getEstimatedWaterAllocationDimensionValues(software.amazon.awssdk.services.sustainability.model.GetEstimatedWaterAllocationDimensionValuesRequest)operation.
This is a convenience which creates an instance of the
GetEstimatedWaterAllocationDimensionValuesRequest.Builderavoiding the need to create one manually viaGetEstimatedWaterAllocationDimensionValuesRequest.builder()- Parameters:
getEstimatedWaterAllocationDimensionValuesRequest- AConsumerthat will call methods onGetEstimatedWaterAllocationDimensionValuesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aSustainabilityClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aSustainabilityClient. -
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
-