@Generated(value="software.amazon.awssdk:codegen") @ThreadSafe public interface BraketClient extends SdkClient
builder() method.
The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider. |
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static BraketClientBuilder |
builder()
Create a builder that can be used to configure and create a
BraketClient. |
default CancelQuantumTaskResponse |
cancelQuantumTask(CancelQuantumTaskRequest cancelQuantumTaskRequest)
Cancels the specified task.
|
default CancelQuantumTaskResponse |
cancelQuantumTask(Consumer<CancelQuantumTaskRequest.Builder> cancelQuantumTaskRequest)
Cancels the specified task.
|
static BraketClient |
create()
Create a
BraketClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
default CreateQuantumTaskResponse |
createQuantumTask(Consumer<CreateQuantumTaskRequest.Builder> createQuantumTaskRequest)
Creates a quantum task.
|
default CreateQuantumTaskResponse |
createQuantumTask(CreateQuantumTaskRequest createQuantumTaskRequest)
Creates a quantum task.
|
default GetDeviceResponse |
getDevice(Consumer<GetDeviceRequest.Builder> getDeviceRequest)
Retrieves the devices available in Amazon Braket.
|
default GetDeviceResponse |
getDevice(GetDeviceRequest getDeviceRequest)
Retrieves the devices available in Amazon Braket.
|
default GetQuantumTaskResponse |
getQuantumTask(Consumer<GetQuantumTaskRequest.Builder> getQuantumTaskRequest)
Retrieves the specified quantum task.
|
default GetQuantumTaskResponse |
getQuantumTask(GetQuantumTaskRequest getQuantumTaskRequest)
Retrieves the specified quantum task.
|
default ListTagsForResourceResponse |
listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest)
Shows the tags associated with this resource.
|
default ListTagsForResourceResponse |
listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
Shows the tags associated with this resource.
|
default SearchDevicesResponse |
searchDevices(Consumer<SearchDevicesRequest.Builder> searchDevicesRequest)
Searches for devices using the specified filters.
|
default SearchDevicesResponse |
searchDevices(SearchDevicesRequest searchDevicesRequest)
Searches for devices using the specified filters.
|
default SearchDevicesIterable |
searchDevicesPaginator(Consumer<SearchDevicesRequest.Builder> searchDevicesRequest)
Searches for devices using the specified filters.
|
default SearchDevicesIterable |
searchDevicesPaginator(SearchDevicesRequest searchDevicesRequest)
Searches for devices using the specified filters.
|
default SearchQuantumTasksResponse |
searchQuantumTasks(Consumer<SearchQuantumTasksRequest.Builder> searchQuantumTasksRequest)
Searches for tasks that match the specified filter values.
|
default SearchQuantumTasksResponse |
searchQuantumTasks(SearchQuantumTasksRequest searchQuantumTasksRequest)
Searches for tasks that match the specified filter values.
|
default SearchQuantumTasksIterable |
searchQuantumTasksPaginator(Consumer<SearchQuantumTasksRequest.Builder> searchQuantumTasksRequest)
Searches for tasks that match the specified filter values.
|
default SearchQuantumTasksIterable |
searchQuantumTasksPaginator(SearchQuantumTasksRequest searchQuantumTasksRequest)
Searches for tasks that match the specified filter values.
|
static ServiceMetadata |
serviceMetadata() |
default TagResourceResponse |
tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest)
Add a tag to the specified resource.
|
default TagResourceResponse |
tagResource(TagResourceRequest tagResourceRequest)
Add a tag to the specified resource.
|
default UntagResourceResponse |
untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest)
Remove tags from a resource.
|
default UntagResourceResponse |
untagResource(UntagResourceRequest untagResourceRequest)
Remove tags from a resource.
|
serviceNameclosestatic final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider.static BraketClient create()
BraketClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static BraketClientBuilder builder()
BraketClient.default CancelQuantumTaskResponse cancelQuantumTask(CancelQuantumTaskRequest cancelQuantumTaskRequest) throws ResourceNotFoundException, AccessDeniedException, ConflictException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Cancels the specified task.
cancelQuantumTaskRequest - ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ConflictException - An error occurred due to a conflict.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault CancelQuantumTaskResponse cancelQuantumTask(Consumer<CancelQuantumTaskRequest.Builder> cancelQuantumTaskRequest) throws ResourceNotFoundException, AccessDeniedException, ConflictException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Cancels the specified task.
This is a convenience which creates an instance of the CancelQuantumTaskRequest.Builder avoiding the need
to create one manually via CancelQuantumTaskRequest.builder()
cancelQuantumTaskRequest - A Consumer that will call methods on CancelQuantumTaskRequest.Builder to create a request.ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ConflictException - An error occurred due to a conflict.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault CreateQuantumTaskResponse createQuantumTask(CreateQuantumTaskRequest createQuantumTaskRequest) throws AccessDeniedException, ThrottlingException, DeviceOfflineException, InternalServiceException, ServiceQuotaExceededException, ValidationException, AwsServiceException, SdkClientException, BraketException
Creates a quantum task.
createQuantumTaskRequest - AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.DeviceOfflineException - The specified device is currently offline.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ServiceQuotaExceededException - The request failed because a service quota is exceeded.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault CreateQuantumTaskResponse createQuantumTask(Consumer<CreateQuantumTaskRequest.Builder> createQuantumTaskRequest) throws AccessDeniedException, ThrottlingException, DeviceOfflineException, InternalServiceException, ServiceQuotaExceededException, ValidationException, AwsServiceException, SdkClientException, BraketException
Creates a quantum task.
This is a convenience which creates an instance of the CreateQuantumTaskRequest.Builder avoiding the need
to create one manually via CreateQuantumTaskRequest.builder()
createQuantumTaskRequest - A Consumer that will call methods on CreateQuantumTaskRequest.Builder to create a request.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.DeviceOfflineException - The specified device is currently offline.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ServiceQuotaExceededException - The request failed because a service quota is exceeded.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetDeviceResponse getDevice(GetDeviceRequest getDeviceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, DeviceOfflineException, DeviceRetiredException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Retrieves the devices available in Amazon Braket.
getDeviceRequest - ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.DeviceOfflineException - The specified device is currently offline.DeviceRetiredException - The specified device has been retired.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetDeviceResponse getDevice(Consumer<GetDeviceRequest.Builder> getDeviceRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, DeviceOfflineException, DeviceRetiredException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Retrieves the devices available in Amazon Braket.
This is a convenience which creates an instance of the GetDeviceRequest.Builder avoiding the need to
create one manually via GetDeviceRequest.builder()
getDeviceRequest - A Consumer that will call methods on GetDeviceRequest.Builder to create a request.ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.DeviceOfflineException - The specified device is currently offline.DeviceRetiredException - The specified device has been retired.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetQuantumTaskResponse getQuantumTask(GetQuantumTaskRequest getQuantumTaskRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Retrieves the specified quantum task.
getQuantumTaskRequest - ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault GetQuantumTaskResponse getQuantumTask(Consumer<GetQuantumTaskRequest.Builder> getQuantumTaskRequest) throws ResourceNotFoundException, AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Retrieves the specified quantum task.
This is a convenience which creates an instance of the GetQuantumTaskRequest.Builder avoiding the need to
create one manually via GetQuantumTaskRequest.builder()
getQuantumTaskRequest - A Consumer that will call methods on GetQuantumTaskRequest.Builder to create a request.ResourceNotFoundException - The specified resource was not found.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Shows the tags associated with this resource.
listTagsForResourceRequest - ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Shows the tags associated with this resource.
This is a convenience which creates an instance of the ListTagsForResourceRequest.Builder avoiding the
need to create one manually via ListTagsForResourceRequest.builder()
listTagsForResourceRequest - A Consumer that will call methods on ListTagsForResourceRequest.Builder to create a
request.ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchDevicesResponse searchDevices(SearchDevicesRequest searchDevicesRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for devices using the specified filters.
searchDevicesRequest - AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchDevicesResponse searchDevices(Consumer<SearchDevicesRequest.Builder> searchDevicesRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for devices using the specified filters.
This is a convenience which creates an instance of the SearchDevicesRequest.Builder avoiding the need to
create one manually via SearchDevicesRequest.builder()
searchDevicesRequest - A Consumer that will call methods on SearchDevicesRequest.Builder to create a request.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchDevicesIterable searchDevicesPaginator(SearchDevicesRequest searchDevicesRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for devices using the specified filters.
This is a variant of searchDevices(software.amazon.awssdk.services.braket.model.SearchDevicesRequest)
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
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(request);
for (software.amazon.awssdk.services.braket.model.SearchDevicesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(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
searchDevices(software.amazon.awssdk.services.braket.model.SearchDevicesRequest) operation.
searchDevicesRequest - AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchDevicesIterable searchDevicesPaginator(Consumer<SearchDevicesRequest.Builder> searchDevicesRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for devices using the specified filters.
This is a variant of searchDevices(software.amazon.awssdk.services.braket.model.SearchDevicesRequest)
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
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(request);
for (software.amazon.awssdk.services.braket.model.SearchDevicesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.braket.paginators.SearchDevicesIterable responses = client.searchDevicesPaginator(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
searchDevices(software.amazon.awssdk.services.braket.model.SearchDevicesRequest) operation.
This is a convenience which creates an instance of the SearchDevicesRequest.Builder avoiding the need to
create one manually via SearchDevicesRequest.builder()
searchDevicesRequest - A Consumer that will call methods on SearchDevicesRequest.Builder to create a request.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchQuantumTasksResponse searchQuantumTasks(SearchQuantumTasksRequest searchQuantumTasksRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for tasks that match the specified filter values.
searchQuantumTasksRequest - AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchQuantumTasksResponse searchQuantumTasks(Consumer<SearchQuantumTasksRequest.Builder> searchQuantumTasksRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for tasks that match the specified filter values.
This is a convenience which creates an instance of the SearchQuantumTasksRequest.Builder avoiding the
need to create one manually via SearchQuantumTasksRequest.builder()
searchQuantumTasksRequest - A Consumer that will call methods on SearchQuantumTasksRequest.Builder to create a
request.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchQuantumTasksIterable searchQuantumTasksPaginator(SearchQuantumTasksRequest searchQuantumTasksRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for tasks that match the specified filter values.
This is a variant of
searchQuantumTasks(software.amazon.awssdk.services.braket.model.SearchQuantumTasksRequest) 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
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client.searchQuantumTasksPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client
.searchQuantumTasksPaginator(request);
for (software.amazon.awssdk.services.braket.model.SearchQuantumTasksResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client.searchQuantumTasksPaginator(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
searchQuantumTasks(software.amazon.awssdk.services.braket.model.SearchQuantumTasksRequest)
operation.
searchQuantumTasksRequest - AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault SearchQuantumTasksIterable searchQuantumTasksPaginator(Consumer<SearchQuantumTasksRequest.Builder> searchQuantumTasksRequest) throws AccessDeniedException, ThrottlingException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Searches for tasks that match the specified filter values.
This is a variant of
searchQuantumTasks(software.amazon.awssdk.services.braket.model.SearchQuantumTasksRequest) 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
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client.searchQuantumTasksPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client
.searchQuantumTasksPaginator(request);
for (software.amazon.awssdk.services.braket.model.SearchQuantumTasksResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.braket.paginators.SearchQuantumTasksIterable responses = client.searchQuantumTasksPaginator(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
searchQuantumTasks(software.amazon.awssdk.services.braket.model.SearchQuantumTasksRequest)
operation.
This is a convenience which creates an instance of the SearchQuantumTasksRequest.Builder avoiding the
need to create one manually via SearchQuantumTasksRequest.builder()
searchQuantumTasksRequest - A Consumer that will call methods on SearchQuantumTasksRequest.Builder to create a
request.AccessDeniedException - You do not have sufficient access to perform this action.ThrottlingException - The throttling rate limit is met.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Add a tag to the specified resource.
tagResourceRequest - ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Add a tag to the specified resource.
This is a convenience which creates an instance of the TagResourceRequest.Builder avoiding the need to
create one manually via TagResourceRequest.builder()
tagResourceRequest - A Consumer that will call methods on TagResourceRequest.Builder to create a request.ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Remove tags from a resource.
untagResourceRequest - ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ResourceNotFoundException, InternalServiceException, ValidationException, AwsServiceException, SdkClientException, BraketException
Remove tags from a resource.
This is a convenience which creates an instance of the UntagResourceRequest.Builder avoiding the need to
create one manually via UntagResourceRequest.builder()
untagResourceRequest - A Consumer that will call methods on UntagResourceRequest.Builder to create a request.ResourceNotFoundException - The specified resource was not found.InternalServiceException - The request processing has failed because of an unknown error, exception, or failure.ValidationException - The input fails to satisfy the constraints specified by an AWS service.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.BraketException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionstatic ServiceMetadata serviceMetadata()
Copyright © 2021. All rights reserved.