Interface PricingClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
The Amazon Web Services Price List API is a centralized and convenient way to programmatically query Amazon Web
Services for services, products, and pricing information. The Amazon Web Services Price List uses standardized
product attributes such as Location, Storage Class, and Operating System, and
provides prices at the SKU level. You can use the Amazon Web Services Price List to do the following:
-
Build cost control and scenario planning tools
-
Reconcile billing data
-
Forecast future spend for budgeting purposes
-
Provide cost benefit analysis that compare your internal workloads with Amazon Web Services
Use GetServices without a service code to retrieve the service codes for all Amazon Web Services
services, then GetServices with a service code to retrieve the attribute names for that service. After
you have the service code and attribute names, you can use GetAttributeValues to see what values are
available for an attribute. With the service code and an attribute name and value, you can use
GetProducts to find specific products that you're interested in, such as an AmazonEC2
instance, with a Provisioned IOPS volumeType.
For more information, see Using the Amazon Web Services Price List API in the Billing User Guide.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic PricingClientBuilderbuilder()Create a builder that can be used to configure and create aPricingClient.static PricingClientcreate()Create aPricingClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default DescribeServicesResponseReturns the metadata for one service or a list of the metadata for all services.default DescribeServicesResponsedescribeServices(Consumer<DescribeServicesRequest.Builder> describeServicesRequest) Returns the metadata for one service or a list of the metadata for all services.default DescribeServicesResponsedescribeServices(DescribeServicesRequest describeServicesRequest) Returns the metadata for one service or a list of the metadata for all services.default DescribeServicesIterableThis is a variant ofdescribeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.default DescribeServicesIterabledescribeServicesPaginator(Consumer<DescribeServicesRequest.Builder> describeServicesRequest) This is a variant ofdescribeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.default DescribeServicesIterabledescribeServicesPaginator(DescribeServicesRequest describeServicesRequest) This is a variant ofdescribeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.default GetAttributeValuesResponsegetAttributeValues(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest) Returns a list of attribute values.default GetAttributeValuesResponsegetAttributeValues(GetAttributeValuesRequest getAttributeValuesRequest) Returns a list of attribute values.default GetAttributeValuesIterablegetAttributeValuesPaginator(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest) This is a variant ofgetAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)operation.default GetAttributeValuesIterablegetAttributeValuesPaginator(GetAttributeValuesRequest getAttributeValuesRequest) This is a variant ofgetAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)operation.default GetPriceListFileUrlResponsegetPriceListFileUrl(Consumer<GetPriceListFileUrlRequest.Builder> getPriceListFileUrlRequest) This feature is in preview release and is subject to change.default GetPriceListFileUrlResponsegetPriceListFileUrl(GetPriceListFileUrlRequest getPriceListFileUrlRequest) This feature is in preview release and is subject to change.default GetProductsResponsegetProducts(Consumer<GetProductsRequest.Builder> getProductsRequest) Returns a list of all products that match the filter criteria.default GetProductsResponsegetProducts(GetProductsRequest getProductsRequest) Returns a list of all products that match the filter criteria.default GetProductsIterablegetProductsPaginator(Consumer<GetProductsRequest.Builder> getProductsRequest) This is a variant ofgetProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)operation.default GetProductsIterablegetProductsPaginator(GetProductsRequest getProductsRequest) This is a variant ofgetProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)operation.default ListPriceListsResponselistPriceLists(Consumer<ListPriceListsRequest.Builder> listPriceListsRequest) This feature is in preview release and is subject to change.default ListPriceListsResponselistPriceLists(ListPriceListsRequest listPriceListsRequest) This feature is in preview release and is subject to change.default ListPriceListsIterablelistPriceListsPaginator(Consumer<ListPriceListsRequest.Builder> listPriceListsRequest) This is a variant oflistPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)operation.default ListPriceListsIterablelistPriceListsPaginator(ListPriceListsRequest listPriceListsRequest) This is a variant oflistPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)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
-
describeServices
default DescribeServicesResponse describeServices(DescribeServicesRequest describeServicesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as
AmazonEC2, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 arevolumeType,maxIopsVolume,operation,locationType, andinstanceCapacity10xlarge.- Parameters:
describeServicesRequest-- Returns:
- Result of the DescribeServices operation returned by the service.
- See Also:
-
describeServices
default DescribeServicesResponse describeServices(Consumer<DescribeServicesRequest.Builder> describeServicesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as
AmazonEC2, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 arevolumeType,maxIopsVolume,operation,locationType, andinstanceCapacity10xlarge.
This is a convenience which creates an instance of the
DescribeServicesRequest.Builderavoiding the need to create one manually viaDescribeServicesRequest.builder()- Parameters:
describeServicesRequest- AConsumerthat will call methods onDescribeServicesRequest.Builderto create a request.- Returns:
- Result of the DescribeServices operation returned by the service.
- See Also:
-
describeServices
default DescribeServicesResponse describeServices() throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingExceptionReturns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as
AmazonEC2, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 arevolumeType,maxIopsVolume,operation,locationType, andinstanceCapacity10xlarge.- Returns:
- Result of the DescribeServices operation returned by the service.
- See Also:
-
describeServicesPaginator
default DescribeServicesIterable describeServicesPaginator() throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingExceptionThis is a variant of
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)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.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client .describeServicesPaginator(request); for (software.amazon.awssdk.services.pricing.model.DescribeServicesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(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
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeServicesPaginator
default DescribeServicesIterable describeServicesPaginator(DescribeServicesRequest describeServicesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)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.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client .describeServicesPaginator(request); for (software.amazon.awssdk.services.pricing.model.DescribeServicesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(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
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.- Parameters:
describeServicesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeServicesPaginator
default DescribeServicesIterable describeServicesPaginator(Consumer<DescribeServicesRequest.Builder> describeServicesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)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.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client .describeServicesPaginator(request); for (software.amazon.awssdk.services.pricing.model.DescribeServicesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(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
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)operation.
This is a convenience which creates an instance of the
DescribeServicesRequest.Builderavoiding the need to create one manually viaDescribeServicesRequest.builder()- Parameters:
describeServicesRequest- AConsumerthat will call methods onDescribeServicesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getAttributeValues
default GetAttributeValuesResponse getAttributeValues(GetAttributeValuesRequest getAttributeValuesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns a list of attribute values. Attributes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the Billing and Cost Management User Guide.
- Parameters:
getAttributeValuesRequest-- Returns:
- Result of the GetAttributeValues operation returned by the service.
- See Also:
-
getAttributeValues
default GetAttributeValuesResponse getAttributeValues(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns a list of attribute values. Attributes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the Billing and Cost Management User Guide.
This is a convenience which creates an instance of the
GetAttributeValuesRequest.Builderavoiding the need to create one manually viaGetAttributeValuesRequest.builder()- Parameters:
getAttributeValuesRequest- AConsumerthat will call methods onGetAttributeValuesRequest.Builderto create a request.- Returns:
- Result of the GetAttributeValues operation returned by the service.
- See Also:
-
getAttributeValuesPaginator
default GetAttributeValuesIterable getAttributeValuesPaginator(GetAttributeValuesRequest getAttributeValuesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)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.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client .getAttributeValuesPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetAttributeValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(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
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)operation.- Parameters:
getAttributeValuesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getAttributeValuesPaginator
default GetAttributeValuesIterable getAttributeValuesPaginator(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)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.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client .getAttributeValuesPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetAttributeValuesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(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
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)operation.
This is a convenience which creates an instance of the
GetAttributeValuesRequest.Builderavoiding the need to create one manually viaGetAttributeValuesRequest.builder()- Parameters:
getAttributeValuesRequest- AConsumerthat will call methods onGetAttributeValuesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getPriceListFileUrl
default GetPriceListFileUrlResponse getPriceListFileUrl(GetPriceListFileUrlRequest getPriceListFileUrlRequest) throws InvalidParameterException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, AwsServiceException, SdkClientException, PricingException This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (Section 1.10).
This returns the URL that you can retrieve your Price List file from. This URL is based on the
PriceListArnandFileFormatthat you retrieve from the ListPriceLists response.- Parameters:
getPriceListFileUrlRequest-- Returns:
- Result of the GetPriceListFileUrl operation returned by the service.
- See Also:
-
getPriceListFileUrl
default GetPriceListFileUrlResponse getPriceListFileUrl(Consumer<GetPriceListFileUrlRequest.Builder> getPriceListFileUrlRequest) throws InvalidParameterException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, AwsServiceException, SdkClientException, PricingException This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (Section 1.10).
This returns the URL that you can retrieve your Price List file from. This URL is based on the
PriceListArnandFileFormatthat you retrieve from the ListPriceLists response.
This is a convenience which creates an instance of the
GetPriceListFileUrlRequest.Builderavoiding the need to create one manually viaGetPriceListFileUrlRequest.builder()- Parameters:
getPriceListFileUrlRequest- AConsumerthat will call methods onGetPriceListFileUrlRequest.Builderto create a request.- Returns:
- Result of the GetPriceListFileUrl operation returned by the service.
- See Also:
-
getProducts
default GetProductsResponse getProducts(GetProductsRequest getProductsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns a list of all products that match the filter criteria.
- Parameters:
getProductsRequest-- Returns:
- Result of the GetProducts operation returned by the service.
- See Also:
-
getProducts
default GetProductsResponse getProducts(Consumer<GetProductsRequest.Builder> getProductsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException Returns a list of all products that match the filter criteria.
This is a convenience which creates an instance of the
GetProductsRequest.Builderavoiding the need to create one manually viaGetProductsRequest.builder()- Parameters:
getProductsRequest- AConsumerthat will call methods onGetProductsRequest.Builderto create a request.- Returns:
- Result of the GetProducts operation returned by the service.
- See Also:
-
getProductsPaginator
default GetProductsIterable getProductsPaginator(GetProductsRequest getProductsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)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.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetProductsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(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
getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)operation.- Parameters:
getProductsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getProductsPaginator
default GetProductsIterable getProductsPaginator(Consumer<GetProductsRequest.Builder> getProductsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, InternalErrorException, ThrottlingException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)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.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetProductsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(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
getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)operation.
This is a convenience which creates an instance of the
GetProductsRequest.Builderavoiding the need to create one manually viaGetProductsRequest.builder()- Parameters:
getProductsRequest- AConsumerthat will call methods onGetProductsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listPriceLists
default ListPriceListsResponse listPriceLists(ListPriceListsRequest listPriceListsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (Section 1.10).
This returns a list of Price List references that the requester if authorized to view, given a
ServiceCode,CurrencyCode, and anEffectiveDate. Use without aRegionCodefilter to list Price List references from all available Amazon Web Services Regions. Use with aRegionCodefilter to get the Price List reference that's specific to a specific Amazon Web Services Region. You can use thePriceListArnfrom the response to get your preferred Price List files through the GetPriceListFileUrl API.- Parameters:
listPriceListsRequest-- Returns:
- Result of the ListPriceLists operation returned by the service.
- See Also:
-
listPriceLists
default ListPriceListsResponse listPriceLists(Consumer<ListPriceListsRequest.Builder> listPriceListsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (Section 1.10).
This returns a list of Price List references that the requester if authorized to view, given a
ServiceCode,CurrencyCode, and anEffectiveDate. Use without aRegionCodefilter to list Price List references from all available Amazon Web Services Regions. Use with aRegionCodefilter to get the Price List reference that's specific to a specific Amazon Web Services Region. You can use thePriceListArnfrom the response to get your preferred Price List files through the GetPriceListFileUrl API.
This is a convenience which creates an instance of the
ListPriceListsRequest.Builderavoiding the need to create one manually viaListPriceListsRequest.builder()- Parameters:
listPriceListsRequest- AConsumerthat will call methods onListPriceListsRequest.Builderto create a request.- Returns:
- Result of the ListPriceLists operation returned by the service.
- See Also:
-
listPriceListsPaginator
default ListPriceListsIterable listPriceListsPaginator(ListPriceListsRequest listPriceListsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
listPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)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.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(request); for (software.amazon.awssdk.services.pricing.model.ListPriceListsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(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
listPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)operation.- Parameters:
listPriceListsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listPriceListsPaginator
default ListPriceListsIterable listPriceListsPaginator(Consumer<ListPriceListsRequest.Builder> listPriceListsRequest) throws InvalidParameterException, InvalidNextTokenException, NotFoundException, AccessDeniedException, InternalErrorException, ThrottlingException, ResourceNotFoundException, ExpiredNextTokenException, AwsServiceException, SdkClientException, PricingException This is a variant of
listPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)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.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(request); for (software.amazon.awssdk.services.pricing.model.ListPriceListsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.pricing.paginators.ListPriceListsIterable responses = client.listPriceListsPaginator(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
listPriceLists(software.amazon.awssdk.services.pricing.model.ListPriceListsRequest)operation.
This is a convenience which creates an instance of the
ListPriceListsRequest.Builderavoiding the need to create one manually viaListPriceListsRequest.builder()- Parameters:
listPriceListsRequest- AConsumerthat will call methods onListPriceListsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aPricingClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aPricingClient. -
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
-