feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,138 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/personalize-events/PersonalizeEventsErrors.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/NoResult.h>
#include <aws/core/client/AsyncCallerContext.h>
#include <aws/core/http/HttpTypes.h>
#include <future>
#include <functional>
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 PersonalizeEvents
{
namespace Model
{
class PutEventsRequest;
typedef Aws::Utils::Outcome<Aws::NoResult, PersonalizeEventsError> PutEventsOutcome;
typedef std::future<PutEventsOutcome> PutEventsOutcomeCallable;
} // namespace Model
class PersonalizeEventsClient;
typedef std::function<void(const PersonalizeEventsClient*, const Model::PutEventsRequest&, const Model::PutEventsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutEventsResponseReceivedHandler;
/**
* <p>Amazon Personalize can consume real-time user event data, such as
* <i>stream</i> or <i>click</i> data, and use it for model training either alone
* or combined with historical data. For more information see
* <a>recording-events</a>.</p>
*/
class AWS_PERSONALIZEEVENTS_API PersonalizeEventsClient : 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.
*/
PersonalizeEventsClient(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.
*/
PersonalizeEventsClient(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
*/
PersonalizeEventsClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~PersonalizeEventsClient();
/**
* <p>Records user interaction event data. For more information see
* <a>event-record-api</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents">AWS
* API Reference</a></p>
*/
virtual Model::PutEventsOutcome PutEvents(const Model::PutEventsRequest& request) const;
/**
* <p>Records user interaction event data. For more information see
* <a>event-record-api</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents">AWS
* API Reference</a></p>
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::PutEventsOutcomeCallable PutEventsCallable(const Model::PutEventsRequest& request) const;
/**
* <p>Records user interaction event data. For more information see
* <a>event-record-api</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void PutEventsAsync(const Model::PutEventsRequest& request, const PutEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void PutEventsAsyncHelper(const Model::PutEventsRequest& request, const PutEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
};
} // namespace PersonalizeEvents
} // namespace Aws

View File

@@ -0,0 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace PersonalizeEvents
{
namespace PersonalizeEventsEndpoint
{
AWS_PERSONALIZEEVENTS_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace PersonalizeEventsEndpoint
} // namespace PersonalizeEvents
} // namespace Aws

View File

@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_PERSONALIZEEVENTS_API PersonalizeEventsErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};
} // namespace Client
} // namespace Aws

View File

@@ -0,0 +1,72 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
namespace Aws
{
namespace PersonalizeEvents
{
enum class PersonalizeEventsErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
REQUEST_TIMEOUT = 24,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
INVALID_INPUT= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1
};
class AWS_PERSONALIZEEVENTS_API PersonalizeEventsError : public Aws::Client::AWSError<PersonalizeEventsErrors>
{
public:
PersonalizeEventsError() {}
PersonalizeEventsError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<PersonalizeEventsErrors>(rhs) {}
PersonalizeEventsError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<PersonalizeEventsErrors>(rhs) {}
PersonalizeEventsError(const Aws::Client::AWSError<PersonalizeEventsErrors>& rhs) : Aws::Client::AWSError<PersonalizeEventsErrors>(rhs) {}
PersonalizeEventsError(Aws::Client::AWSError<PersonalizeEventsErrors>&& rhs) : Aws::Client::AWSError<PersonalizeEventsErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace PersonalizeEventsErrorMapper
{
AWS_PERSONALIZEEVENTS_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace PersonalizeEvents
} // namespace Aws

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace PersonalizeEvents
{
class AWS_PERSONALIZEEVENTS_API PersonalizeEventsRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~PersonalizeEventsRequest () {}
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2018-03-22"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace PersonalizeEvents
} // namespace Aws

View File

@@ -0,0 +1,29 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#ifdef _MSC_VER
//disable windows complaining about max template size.
#pragma warning (disable : 4503)
#endif // _MSC_VER
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif // _MSC_VER
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_PERSONALIZEEVENTS_EXPORTS
#define AWS_PERSONALIZEEVENTS_API __declspec(dllexport)
#else
#define AWS_PERSONALIZEEVENTS_API __declspec(dllimport)
#endif /* AWS_PERSONALIZEEVENTS_EXPORTS */
#else
#define AWS_PERSONALIZEEVENTS_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_PERSONALIZEEVENTS_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,499 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace PersonalizeEvents
{
namespace Model
{
/**
* <p>Represents user interaction event information sent using the
* <code>PutEvents</code> API.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/Event">AWS
* API Reference</a></p>
*/
class AWS_PERSONALIZEEVENTS_API Event
{
public:
Event();
Event(Aws::Utils::Json::JsonView jsonValue);
Event& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline const Aws::String& GetEventId() const{ return m_eventId; }
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline bool EventIdHasBeenSet() const { return m_eventIdHasBeenSet; }
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline void SetEventId(const Aws::String& value) { m_eventIdHasBeenSet = true; m_eventId = value; }
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline void SetEventId(Aws::String&& value) { m_eventIdHasBeenSet = true; m_eventId = std::move(value); }
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline void SetEventId(const char* value) { m_eventIdHasBeenSet = true; m_eventId.assign(value); }
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline Event& WithEventId(const Aws::String& value) { SetEventId(value); return *this;}
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline Event& WithEventId(Aws::String&& value) { SetEventId(std::move(value)); return *this;}
/**
* <p>An ID associated with the event. If an event ID is not provided, Amazon
* Personalize generates a unique ID for the event. An event ID is not used as an
* input to the model. Amazon Personalize uses the event ID to distinquish unique
* events. Any subsequent events after the first with the same event ID are not
* used in model training.</p>
*/
inline Event& WithEventId(const char* value) { SetEventId(value); return *this;}
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline const Aws::String& GetEventType() const{ return m_eventType; }
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline bool EventTypeHasBeenSet() const { return m_eventTypeHasBeenSet; }
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline void SetEventType(const Aws::String& value) { m_eventTypeHasBeenSet = true; m_eventType = value; }
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline void SetEventType(Aws::String&& value) { m_eventTypeHasBeenSet = true; m_eventType = std::move(value); }
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline void SetEventType(const char* value) { m_eventTypeHasBeenSet = true; m_eventType.assign(value); }
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline Event& WithEventType(const Aws::String& value) { SetEventType(value); return *this;}
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline Event& WithEventType(Aws::String&& value) { SetEventType(std::move(value)); return *this;}
/**
* <p>The type of event. This property corresponds to the <code>EVENT_TYPE</code>
* field of the Interactions schema.</p>
*/
inline Event& WithEventType(const char* value) { SetEventType(value); return *this;}
/**
* <p>The event value that corresponds to the <code>EVENT_VALUE</code> field of the
* Interactions schema.</p>
*/
inline double GetEventValue() const{ return m_eventValue; }
/**
* <p>The event value that corresponds to the <code>EVENT_VALUE</code> field of the
* Interactions schema.</p>
*/
inline bool EventValueHasBeenSet() const { return m_eventValueHasBeenSet; }
/**
* <p>The event value that corresponds to the <code>EVENT_VALUE</code> field of the
* Interactions schema.</p>
*/
inline void SetEventValue(double value) { m_eventValueHasBeenSet = true; m_eventValue = value; }
/**
* <p>The event value that corresponds to the <code>EVENT_VALUE</code> field of the
* Interactions schema.</p>
*/
inline Event& WithEventValue(double value) { SetEventValue(value); return *this;}
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline const Aws::String& GetItemId() const{ return m_itemId; }
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline bool ItemIdHasBeenSet() const { return m_itemIdHasBeenSet; }
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline void SetItemId(const Aws::String& value) { m_itemIdHasBeenSet = true; m_itemId = value; }
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline void SetItemId(Aws::String&& value) { m_itemIdHasBeenSet = true; m_itemId = std::move(value); }
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline void SetItemId(const char* value) { m_itemIdHasBeenSet = true; m_itemId.assign(value); }
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline Event& WithItemId(const Aws::String& value) { SetItemId(value); return *this;}
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline Event& WithItemId(Aws::String&& value) { SetItemId(std::move(value)); return *this;}
/**
* <p>The item ID key that corresponds to the <code>ITEM_ID</code> field of the
* Interactions schema.</p>
*/
inline Event& WithItemId(const char* value) { SetItemId(value); return *this;}
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline const Aws::String& GetProperties() const{ return m_properties; }
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline bool PropertiesHasBeenSet() const { return m_propertiesHasBeenSet; }
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline void SetProperties(const Aws::String& value) { m_propertiesHasBeenSet = true; m_properties = value; }
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline void SetProperties(Aws::String&& value) { m_propertiesHasBeenSet = true; m_properties = std::move(value); }
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline void SetProperties(const char* value) { m_propertiesHasBeenSet = true; m_properties.assign(value); }
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline Event& WithProperties(const Aws::String& value) { SetProperties(value); return *this;}
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline Event& WithProperties(Aws::String&& value) { SetProperties(std::move(value)); return *this;}
/**
* <p>A string map of event-specific data that you might choose to record. For
* example, if a user rates a movie on your site, other than movie ID
* (<code>itemId</code>) and rating (<code>eventValue</code>) , you might also send
* the number of movie ratings made by the user.</p> <p>Each item in the map
* consists of a key-value pair. For example,</p> <p> <code>{"numberOfRatings":
* "12"}</code> </p> <p>The keys use camel case names that match the fields in the
* Interactions schema. In the above example, the <code>numberOfRatings</code>
* would match the 'NUMBER_OF_RATINGS' field defined in the Interactions
* schema.</p>
*/
inline Event& WithProperties(const char* value) { SetProperties(value); return *this;}
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline const Aws::Utils::DateTime& GetSentAt() const{ return m_sentAt; }
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline bool SentAtHasBeenSet() const { return m_sentAtHasBeenSet; }
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline void SetSentAt(const Aws::Utils::DateTime& value) { m_sentAtHasBeenSet = true; m_sentAt = value; }
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline void SetSentAt(Aws::Utils::DateTime&& value) { m_sentAtHasBeenSet = true; m_sentAt = std::move(value); }
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline Event& WithSentAt(const Aws::Utils::DateTime& value) { SetSentAt(value); return *this;}
/**
* <p>The timestamp (in Unix time) on the client side when the event occurred.</p>
*/
inline Event& WithSentAt(Aws::Utils::DateTime&& value) { SetSentAt(std::move(value)); return *this;}
/**
* <p>The ID of the recommendation.</p>
*/
inline const Aws::String& GetRecommendationId() const{ return m_recommendationId; }
/**
* <p>The ID of the recommendation.</p>
*/
inline bool RecommendationIdHasBeenSet() const { return m_recommendationIdHasBeenSet; }
/**
* <p>The ID of the recommendation.</p>
*/
inline void SetRecommendationId(const Aws::String& value) { m_recommendationIdHasBeenSet = true; m_recommendationId = value; }
/**
* <p>The ID of the recommendation.</p>
*/
inline void SetRecommendationId(Aws::String&& value) { m_recommendationIdHasBeenSet = true; m_recommendationId = std::move(value); }
/**
* <p>The ID of the recommendation.</p>
*/
inline void SetRecommendationId(const char* value) { m_recommendationIdHasBeenSet = true; m_recommendationId.assign(value); }
/**
* <p>The ID of the recommendation.</p>
*/
inline Event& WithRecommendationId(const Aws::String& value) { SetRecommendationId(value); return *this;}
/**
* <p>The ID of the recommendation.</p>
*/
inline Event& WithRecommendationId(Aws::String&& value) { SetRecommendationId(std::move(value)); return *this;}
/**
* <p>The ID of the recommendation.</p>
*/
inline Event& WithRecommendationId(const char* value) { SetRecommendationId(value); return *this;}
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline const Aws::Vector<Aws::String>& GetImpression() const{ return m_impression; }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline bool ImpressionHasBeenSet() const { return m_impressionHasBeenSet; }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline void SetImpression(const Aws::Vector<Aws::String>& value) { m_impressionHasBeenSet = true; m_impression = value; }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline void SetImpression(Aws::Vector<Aws::String>&& value) { m_impressionHasBeenSet = true; m_impression = std::move(value); }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline Event& WithImpression(const Aws::Vector<Aws::String>& value) { SetImpression(value); return *this;}
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline Event& WithImpression(Aws::Vector<Aws::String>&& value) { SetImpression(std::move(value)); return *this;}
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline Event& AddImpression(const Aws::String& value) { m_impressionHasBeenSet = true; m_impression.push_back(value); return *this; }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline Event& AddImpression(Aws::String&& value) { m_impressionHasBeenSet = true; m_impression.push_back(std::move(value)); return *this; }
/**
* <p>A list of item IDs that represents the sequence of items you have shown the
* user. For example, <code>["itemId1", "itemId2", "itemId3"]</code>.</p>
*/
inline Event& AddImpression(const char* value) { m_impressionHasBeenSet = true; m_impression.push_back(value); return *this; }
private:
Aws::String m_eventId;
bool m_eventIdHasBeenSet;
Aws::String m_eventType;
bool m_eventTypeHasBeenSet;
double m_eventValue;
bool m_eventValueHasBeenSet;
Aws::String m_itemId;
bool m_itemIdHasBeenSet;
Aws::String m_properties;
bool m_propertiesHasBeenSet;
Aws::Utils::DateTime m_sentAt;
bool m_sentAtHasBeenSet;
Aws::String m_recommendationId;
bool m_recommendationIdHasBeenSet;
Aws::Vector<Aws::String> m_impression;
bool m_impressionHasBeenSet;
};
} // namespace Model
} // namespace PersonalizeEvents
} // namespace Aws

View File

@@ -0,0 +1,257 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/personalize-events/PersonalizeEvents_EXPORTS.h>
#include <aws/personalize-events/PersonalizeEventsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/personalize-events/model/Event.h>
#include <utility>
namespace Aws
{
namespace PersonalizeEvents
{
namespace Model
{
/**
*/
class AWS_PERSONALIZEEVENTS_API PutEventsRequest : public PersonalizeEventsRequest
{
public:
PutEventsRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "PutEvents"; }
Aws::String SerializePayload() const override;
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline const Aws::String& GetTrackingId() const{ return m_trackingId; }
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline bool TrackingIdHasBeenSet() const { return m_trackingIdHasBeenSet; }
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline void SetTrackingId(const Aws::String& value) { m_trackingIdHasBeenSet = true; m_trackingId = value; }
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline void SetTrackingId(Aws::String&& value) { m_trackingIdHasBeenSet = true; m_trackingId = std::move(value); }
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline void SetTrackingId(const char* value) { m_trackingIdHasBeenSet = true; m_trackingId.assign(value); }
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline PutEventsRequest& WithTrackingId(const Aws::String& value) { SetTrackingId(value); return *this;}
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline PutEventsRequest& WithTrackingId(Aws::String&& value) { SetTrackingId(std::move(value)); return *this;}
/**
* <p>The tracking ID for the event. The ID is generated by a call to the <a
* href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a>
* API.</p>
*/
inline PutEventsRequest& WithTrackingId(const char* value) { SetTrackingId(value); return *this;}
/**
* <p>The user associated with the event.</p>
*/
inline const Aws::String& GetUserId() const{ return m_userId; }
/**
* <p>The user associated with the event.</p>
*/
inline bool UserIdHasBeenSet() const { return m_userIdHasBeenSet; }
/**
* <p>The user associated with the event.</p>
*/
inline void SetUserId(const Aws::String& value) { m_userIdHasBeenSet = true; m_userId = value; }
/**
* <p>The user associated with the event.</p>
*/
inline void SetUserId(Aws::String&& value) { m_userIdHasBeenSet = true; m_userId = std::move(value); }
/**
* <p>The user associated with the event.</p>
*/
inline void SetUserId(const char* value) { m_userIdHasBeenSet = true; m_userId.assign(value); }
/**
* <p>The user associated with the event.</p>
*/
inline PutEventsRequest& WithUserId(const Aws::String& value) { SetUserId(value); return *this;}
/**
* <p>The user associated with the event.</p>
*/
inline PutEventsRequest& WithUserId(Aws::String&& value) { SetUserId(std::move(value)); return *this;}
/**
* <p>The user associated with the event.</p>
*/
inline PutEventsRequest& WithUserId(const char* value) { SetUserId(value); return *this;}
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline const Aws::String& GetSessionId() const{ return m_sessionId; }
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline bool SessionIdHasBeenSet() const { return m_sessionIdHasBeenSet; }
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline void SetSessionId(const Aws::String& value) { m_sessionIdHasBeenSet = true; m_sessionId = value; }
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline void SetSessionId(Aws::String&& value) { m_sessionIdHasBeenSet = true; m_sessionId = std::move(value); }
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline void SetSessionId(const char* value) { m_sessionIdHasBeenSet = true; m_sessionId.assign(value); }
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline PutEventsRequest& WithSessionId(const Aws::String& value) { SetSessionId(value); return *this;}
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline PutEventsRequest& WithSessionId(Aws::String&& value) { SetSessionId(std::move(value)); return *this;}
/**
* <p>The session ID associated with the user's visit. Your application generates
* the sessionId when a user first visits your website or uses your application.
* Amazon Personalize uses the sessionId to associate events with the user before
* they log in. For more information see <a>event-record-api</a>.</p>
*/
inline PutEventsRequest& WithSessionId(const char* value) { SetSessionId(value); return *this;}
/**
* <p>A list of event data from the session.</p>
*/
inline const Aws::Vector<Event>& GetEventList() const{ return m_eventList; }
/**
* <p>A list of event data from the session.</p>
*/
inline bool EventListHasBeenSet() const { return m_eventListHasBeenSet; }
/**
* <p>A list of event data from the session.</p>
*/
inline void SetEventList(const Aws::Vector<Event>& value) { m_eventListHasBeenSet = true; m_eventList = value; }
/**
* <p>A list of event data from the session.</p>
*/
inline void SetEventList(Aws::Vector<Event>&& value) { m_eventListHasBeenSet = true; m_eventList = std::move(value); }
/**
* <p>A list of event data from the session.</p>
*/
inline PutEventsRequest& WithEventList(const Aws::Vector<Event>& value) { SetEventList(value); return *this;}
/**
* <p>A list of event data from the session.</p>
*/
inline PutEventsRequest& WithEventList(Aws::Vector<Event>&& value) { SetEventList(std::move(value)); return *this;}
/**
* <p>A list of event data from the session.</p>
*/
inline PutEventsRequest& AddEventList(const Event& value) { m_eventListHasBeenSet = true; m_eventList.push_back(value); return *this; }
/**
* <p>A list of event data from the session.</p>
*/
inline PutEventsRequest& AddEventList(Event&& value) { m_eventListHasBeenSet = true; m_eventList.push_back(std::move(value)); return *this; }
private:
Aws::String m_trackingId;
bool m_trackingIdHasBeenSet;
Aws::String m_userId;
bool m_userIdHasBeenSet;
Aws::String m_sessionId;
bool m_sessionIdHasBeenSet;
Aws::Vector<Event> m_eventList;
bool m_eventListHasBeenSet;
};
} // namespace Model
} // namespace PersonalizeEvents
} // namespace Aws