Interface PersonalizeRuntimeAsyncClient

All Superinterfaces:
AutoCloseable, AwsClient, SdkAutoCloseable, SdkClient

@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface PersonalizeRuntimeAsyncClient extends AwsClient
Service client for accessing Amazon Personalize Runtime asynchronously. This can be created using the static builder() method.The asynchronous client performs non-blocking I/O when configured with any SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API call.

  • Field Details

  • Method Details

    • getActionRecommendations

      default CompletableFuture<GetActionRecommendationsResponse> getActionRecommendations(GetActionRecommendationsRequest getActionRecommendationsRequest)

      Returns a list of recommended actions in sorted in descending order by prediction score. Use the GetActionRecommendations API if you have a custom campaign that deploys a solution version trained with a PERSONALIZED_ACTIONS recipe.

      For more information about PERSONALIZED_ACTIONS recipes, see PERSONALIZED_ACTIONS recipes. For more information about getting action recommendations, see Getting action recommendations.

      Parameters:
      getActionRecommendationsRequest -
      Returns:
      A Java Future containing the result of the GetActionRecommendations operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getActionRecommendations

      default CompletableFuture<GetActionRecommendationsResponse> getActionRecommendations(Consumer<GetActionRecommendationsRequest.Builder> getActionRecommendationsRequest)

      Returns a list of recommended actions in sorted in descending order by prediction score. Use the GetActionRecommendations API if you have a custom campaign that deploys a solution version trained with a PERSONALIZED_ACTIONS recipe.

      For more information about PERSONALIZED_ACTIONS recipes, see PERSONALIZED_ACTIONS recipes. For more information about getting action recommendations, see Getting action recommendations.


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

      Parameters:
      getActionRecommendationsRequest - A Consumer that will call methods on GetActionRecommendationsRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the GetActionRecommendations operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getPersonalizedRanking

      default CompletableFuture<GetPersonalizedRankingResponse> getPersonalizedRanking(GetPersonalizedRankingRequest getPersonalizedRankingRequest)

      Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user.

      The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.

      Parameters:
      getPersonalizedRankingRequest -
      Returns:
      A Java Future containing the result of the GetPersonalizedRanking operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getPersonalizedRanking

      default CompletableFuture<GetPersonalizedRankingResponse> getPersonalizedRanking(Consumer<GetPersonalizedRankingRequest.Builder> getPersonalizedRankingRequest)

      Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user.

      The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.


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

      Parameters:
      getPersonalizedRankingRequest - A Consumer that will call methods on GetPersonalizedRankingRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the GetPersonalizedRanking operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getRecommendations

      default CompletableFuture<GetRecommendationsResponse> getRecommendations(GetRecommendationsRequest getRecommendationsRequest)

      Returns a list of recommended items. For campaigns, the campaign's Amazon Resource Name (ARN) is required and the required user and item input depends on the recipe type used to create the solution backing the campaign as follows:

      • USER_PERSONALIZATION - userId required, itemId not used

      • RELATED_ITEMS - itemId required, userId not used

      Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.

      For recommenders, the recommender's ARN is required and the required item and user input depends on the use case (domain-based recipe) backing the recommender. For information on use case requirements see Choosing recommender use cases.

      Parameters:
      getRecommendationsRequest -
      Returns:
      A Java Future containing the result of the GetRecommendations operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getRecommendations

      default CompletableFuture<GetRecommendationsResponse> getRecommendations(Consumer<GetRecommendationsRequest.Builder> getRecommendationsRequest)

      Returns a list of recommended items. For campaigns, the campaign's Amazon Resource Name (ARN) is required and the required user and item input depends on the recipe type used to create the solution backing the campaign as follows:

      • USER_PERSONALIZATION - userId required, itemId not used

      • RELATED_ITEMS - itemId required, userId not used

      Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.

      For recommenders, the recommender's ARN is required and the required item and user input depends on the use case (domain-based recipe) backing the recommender. For information on use case requirements see Choosing recommender use cases.


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

      Parameters:
      getRecommendationsRequest - A Consumer that will call methods on GetRecommendationsRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the GetRecommendations operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • InvalidInputException Provide a valid value for the field or parameter.
      • ResourceNotFoundException The specified resource does not exist.
      • 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.
      • PersonalizeRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • serviceClientConfiguration

      default PersonalizeRuntimeServiceClientConfiguration 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 PersonalizeRuntimeAsyncClient 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 PersonalizeRuntimeAsyncClient.