/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace PersonalizeRuntime { /** *

*/ class AWS_PERSONALIZERUNTIME_API PersonalizeRuntimeClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods { public: typedef Aws::Client::AWSJsonClient BASECLASS; static const char* SERVICE_NAME; static const char* ALLOCATION_TAG; typedef PersonalizeRuntimeClientConfiguration ClientConfigurationType; typedef PersonalizeRuntimeEndpointProvider EndpointProviderType; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ PersonalizeRuntimeClient(const Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration& clientConfiguration = Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration(), std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG)); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ PersonalizeRuntimeClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration& clientConfiguration = Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ PersonalizeRuntimeClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration& clientConfiguration = Aws::PersonalizeRuntime::PersonalizeRuntimeClientConfiguration()); /* Legacy constructors due deprecation */ /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ PersonalizeRuntimeClient(const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ PersonalizeRuntimeClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ PersonalizeRuntimeClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~PersonalizeRuntimeClient(); /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::GetPersonalizedRankingOutcome GetPersonalizedRanking(const Model::GetPersonalizedRankingRequest& request) const; /** * A Callable wrapper for GetPersonalizedRanking that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetPersonalizedRankingOutcomeCallable GetPersonalizedRankingCallable(const GetPersonalizedRankingRequestT& request) const { return SubmitCallable(&PersonalizeRuntimeClient::GetPersonalizedRanking, request); } /** * An Async wrapper for GetPersonalizedRanking that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetPersonalizedRankingAsync(const GetPersonalizedRankingRequestT& request, const GetPersonalizedRankingResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&PersonalizeRuntimeClient::GetPersonalizedRanking, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::GetRecommendationsOutcome GetRecommendations(const Model::GetRecommendationsRequest& request) const; /** * A Callable wrapper for GetRecommendations that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetRecommendationsOutcomeCallable GetRecommendationsCallable(const GetRecommendationsRequestT& request) const { return SubmitCallable(&PersonalizeRuntimeClient::GetRecommendations, request); } /** * An Async wrapper for GetRecommendations that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetRecommendationsAsync(const GetRecommendationsRequestT& request, const GetRecommendationsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&PersonalizeRuntimeClient::GetRecommendations, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const PersonalizeRuntimeClientConfiguration& clientConfiguration); PersonalizeRuntimeClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace PersonalizeRuntime } // namespace Aws