Interface SageMakerA2IRuntimeAsyncClient

All Superinterfaces:
AutoCloseable, AwsClient, SdkAutoCloseable, SdkClient

@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface SageMakerA2IRuntimeAsyncClient extends AwsClient
Service client for accessing Amazon Augmented AI Runtime asynchronously. This can be created using the static builder() method.

Amazon Augmented AI (Amazon A2I) adds the benefit of human judgment to any machine learning application. When an AI application can't evaluate data with a high degree of confidence, human reviewers can take over. This human review is called a human review workflow. To create and start a human review workflow, you need three resources: a worker task template, a flow definition, and a human loop.

For information about these resources and prerequisites for using Amazon A2I, see Get Started with Amazon Augmented AI in the Amazon SageMaker Developer Guide.

This API reference includes information about API actions and data types that you can use to interact with Amazon A2I programmatically. Use this guide to:

  • Start a human loop with the StartHumanLoop operation when using Amazon A2I with a custom task type. To learn more about the difference between custom and built-in task types, see Use Task Types . To learn how to start a human loop using this API, see Create and Start a Human Loop for a Custom Task Type in the Amazon SageMaker Developer Guide.

  • Manage your human loops. You can list all human loops that you have created, describe individual human loops, and stop and delete human loops. To learn more, see Monitor and Manage Your Human Loop in the Amazon SageMaker Developer Guide.

Amazon A2I integrates APIs from various AWS services to create and start human review workflows for those services. To learn how Amazon A2I uses these APIs, see Use APIs in Amazon A2I in the Amazon SageMaker Developer Guide.

  • Field Details

  • Method Details

    • deleteHumanLoop

      default CompletableFuture<DeleteHumanLoopResponse> deleteHumanLoop(DeleteHumanLoopRequest deleteHumanLoopRequest)

      Deletes the specified human loop for a flow definition.

      If the human loop was deleted, this operation will return a ResourceNotFoundException.

      Parameters:
      deleteHumanLoopRequest -
      Returns:
      A Java Future containing the result of the DeleteHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • deleteHumanLoop

      default CompletableFuture<DeleteHumanLoopResponse> deleteHumanLoop(Consumer<DeleteHumanLoopRequest.Builder> deleteHumanLoopRequest)

      Deletes the specified human loop for a flow definition.

      If the human loop was deleted, this operation will return a ResourceNotFoundException.


      This is a convenience which creates an instance of the DeleteHumanLoopRequest.Builder avoiding the need to create one manually via DeleteHumanLoopRequest.builder()

      Parameters:
      deleteHumanLoopRequest - A Consumer that will call methods on DeleteHumanLoopRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the DeleteHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • describeHumanLoop

      default CompletableFuture<DescribeHumanLoopResponse> describeHumanLoop(DescribeHumanLoopRequest describeHumanLoopRequest)

      Returns information about the specified human loop. If the human loop was deleted, this operation will return a ResourceNotFoundException error.

      Parameters:
      describeHumanLoopRequest -
      Returns:
      A Java Future containing the result of the DescribeHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • describeHumanLoop

      default CompletableFuture<DescribeHumanLoopResponse> describeHumanLoop(Consumer<DescribeHumanLoopRequest.Builder> describeHumanLoopRequest)

      Returns information about the specified human loop. If the human loop was deleted, this operation will return a ResourceNotFoundException error.


      This is a convenience which creates an instance of the DescribeHumanLoopRequest.Builder avoiding the need to create one manually via DescribeHumanLoopRequest.builder()

      Parameters:
      describeHumanLoopRequest - A Consumer that will call methods on DescribeHumanLoopRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the DescribeHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listHumanLoops

      default CompletableFuture<ListHumanLoopsResponse> listHumanLoops(ListHumanLoopsRequest listHumanLoopsRequest)

      Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.

      Parameters:
      listHumanLoopsRequest -
      Returns:
      A Java Future containing the result of the ListHumanLoops operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listHumanLoops

      default CompletableFuture<ListHumanLoopsResponse> listHumanLoops(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest)

      Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.


      This is a convenience which creates an instance of the ListHumanLoopsRequest.Builder avoiding the need to create one manually via ListHumanLoopsRequest.builder()

      Parameters:
      listHumanLoopsRequest - A Consumer that will call methods on ListHumanLoopsRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the ListHumanLoops operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listHumanLoopsPaginator

      default ListHumanLoopsPublisher listHumanLoopsPaginator(ListHumanLoopsRequest listHumanLoopsRequest)

      This is a variant of listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsPublisher publisher = client.listHumanLoopsPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsPublisher publisher = client.listHumanLoopsPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest) operation.

      Parameters:
      listHumanLoopsRequest -
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listHumanLoopsPaginator

      default ListHumanLoopsPublisher listHumanLoopsPaginator(Consumer<ListHumanLoopsRequest.Builder> listHumanLoopsRequest)

      This is a variant of listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsPublisher publisher = client.listHumanLoopsPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.sagemakera2iruntime.paginators.ListHumanLoopsPublisher publisher = client.listHumanLoopsPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listHumanLoops(software.amazon.awssdk.services.sagemakera2iruntime.model.ListHumanLoopsRequest) operation.


      This is a convenience which creates an instance of the ListHumanLoopsRequest.Builder avoiding the need to create one manually via ListHumanLoopsRequest.builder()

      Parameters:
      listHumanLoopsRequest - A Consumer that will call methods on ListHumanLoopsRequest.Builder to create a request.
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • startHumanLoop

      default CompletableFuture<StartHumanLoopResponse> startHumanLoop(StartHumanLoopRequest startHumanLoopRequest)

      Starts a human loop, provided that at least one activation condition is met.

      Parameters:
      startHumanLoopRequest -
      Returns:
      A Java Future containing the result of the StartHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ThrottlingException You exceeded the maximum number of requests.
      • ServiceQuotaExceededException You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see Amazon Augmented AI Service Quotes. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see AWS Service Quotas in the AWS General Reference.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • ConflictException Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • startHumanLoop

      default CompletableFuture<StartHumanLoopResponse> startHumanLoop(Consumer<StartHumanLoopRequest.Builder> startHumanLoopRequest)

      Starts a human loop, provided that at least one activation condition is met.


      This is a convenience which creates an instance of the StartHumanLoopRequest.Builder avoiding the need to create one manually via StartHumanLoopRequest.builder()

      Parameters:
      startHumanLoopRequest - A Consumer that will call methods on StartHumanLoopRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the StartHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ThrottlingException You exceeded the maximum number of requests.
      • ServiceQuotaExceededException You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. For a list of Amazon A2I service quotes, see Amazon Augmented AI Service Quotes. Delete some resources or request an increase in your service quota. You can request a quota increase using Service Quotas or the AWS Support Center. To request an increase, see AWS Service Quotas in the AWS General Reference.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • ConflictException Your request has the same name as another active human loop but has different input data. You cannot start two human loops with the same name and different input data.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • stopHumanLoop

      default CompletableFuture<StopHumanLoopResponse> stopHumanLoop(StopHumanLoopRequest stopHumanLoopRequest)

      Stops the specified human loop.

      Parameters:
      stopHumanLoopRequest -
      Returns:
      A Java Future containing the result of the StopHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • stopHumanLoop

      default CompletableFuture<StopHumanLoopResponse> stopHumanLoop(Consumer<StopHumanLoopRequest.Builder> stopHumanLoopRequest)

      Stops the specified human loop.


      This is a convenience which creates an instance of the StopHumanLoopRequest.Builder avoiding the need to create one manually via StopHumanLoopRequest.builder()

      Parameters:
      stopHumanLoopRequest - A Consumer that will call methods on StopHumanLoopRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the StopHumanLoop operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • ValidationException The request isn't valid. Check the syntax and try again.
      • ResourceNotFoundException We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
      • ThrottlingException You exceeded the maximum number of requests.
      • InternalServerException We couldn't process your request because of an issue with the server. Try again later.
      • 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.
      • SageMakerA2IRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • serviceClientConfiguration

      default SageMakerA2IRuntimeServiceClientConfiguration serviceClientConfiguration()
      Description copied from interface: SdkClient
      The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration
      Specified by:
      serviceClientConfiguration in interface AwsClient
      Specified by:
      serviceClientConfiguration in interface SdkClient
      Returns:
      SdkServiceClientConfiguration
    • create

      Create a SageMakerA2IRuntimeAsyncClient with the region loaded from the DefaultAwsRegionProviderChain and credentials loaded from the DefaultCredentialsProvider.
    • builder

      Create a builder that can be used to configure and create a SageMakerA2IRuntimeAsyncClient.