/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace PersonalizeRuntime
{
namespace Model
{
class GetPersonalizedRankingRequest;
class GetRecommendationsRequest;
typedef Aws::Utils::Outcome GetPersonalizedRankingOutcome;
typedef Aws::Utils::Outcome GetRecommendationsOutcome;
typedef std::future GetPersonalizedRankingOutcomeCallable;
typedef std::future GetRecommendationsOutcomeCallable;
} // namespace Model
class PersonalizeRuntimeClient;
typedef std::function&) > GetPersonalizedRankingResponseReceivedHandler;
typedef std::function&) > GetRecommendationsResponseReceivedHandler;
/**
*
*/
class AWS_PERSONALIZERUNTIME_API PersonalizeRuntimeClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* 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 = Aws::Client::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 = Aws::Client::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 = Aws::Client::ClientConfiguration());
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;
/**
* 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
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetPersonalizedRankingOutcomeCallable GetPersonalizedRankingCallable(const Model::GetPersonalizedRankingRequest& request) const;
/**
* 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
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetPersonalizedRankingAsync(const Model::GetPersonalizedRankingRequest& request, const GetPersonalizedRankingResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns a list of recommended items. The required input depends on the recipe
* type used to create the solution backing the campaign, as follows:
-
*
RELATED_ITEMS - itemId required, userId not
* used
-
USER_PERSONALIZATION - itemId optional,
* userId required
Campaigns that are backed
* by a solution created using a recipe of type PERSONALIZED_RANKING use the
* API.
See Also:
AWS
* API Reference
*/
virtual Model::GetRecommendationsOutcome GetRecommendations(const Model::GetRecommendationsRequest& request) const;
/**
* Returns a list of recommended items. The required input depends on the recipe
* type used to create the solution backing the campaign, as follows:
-
*
RELATED_ITEMS - itemId required, userId not
* used
-
USER_PERSONALIZATION - itemId optional,
* userId required
Campaigns that are backed
* by a solution created using a recipe of type PERSONALIZED_RANKING use the
* API.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetRecommendationsOutcomeCallable GetRecommendationsCallable(const Model::GetRecommendationsRequest& request) const;
/**
* Returns a list of recommended items. The required input depends on the recipe
* type used to create the solution backing the campaign, as follows:
-
*
RELATED_ITEMS - itemId required, userId not
* used
-
USER_PERSONALIZATION - itemId optional,
* userId required
Campaigns that are backed
* by a solution created using a recipe of type PERSONALIZED_RANKING use the
* API.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetRecommendationsAsync(const Model::GetRecommendationsRequest& request, const GetRecommendationsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void GetPersonalizedRankingAsyncHelper(const Model::GetPersonalizedRankingRequest& request, const GetPersonalizedRankingResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void GetRecommendationsAsyncHelper(const Model::GetRecommendationsRequest& request, const GetRecommendationsResponseReceivedHandler& handler, const std::shared_ptr& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace PersonalizeRuntime
} // namespace Aws