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,133 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/mobileanalytics/MobileAnalyticsErrors.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 MobileAnalytics
{
namespace Model
{
class PutEventsRequest;
typedef Aws::Utils::Outcome<Aws::NoResult, MobileAnalyticsError> PutEventsOutcome;
typedef std::future<PutEventsOutcome> PutEventsOutcomeCallable;
} // namespace Model
class MobileAnalyticsClient;
typedef std::function<void(const MobileAnalyticsClient*, const Model::PutEventsRequest&, const Model::PutEventsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutEventsResponseReceivedHandler;
/**
* <p>Amazon Mobile Analytics is a service for collecting, visualizing, and
* understanding app usage data at scale.</p>
*/
class AWS_MOBILEANALYTICS_API MobileAnalyticsClient : 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.
*/
MobileAnalyticsClient(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.
*/
MobileAnalyticsClient(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
*/
MobileAnalyticsClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~MobileAnalyticsClient();
/**
* <p>The PutEvents operation records one or more events. You can have up to 1,500
* unique custom events per app, any combination of up to 40 attributes and metrics
* per custom event, and any number of attribute or metric values.</p>
*/
virtual Model::PutEventsOutcome PutEvents(const Model::PutEventsRequest& request) const;
/**
* <p>The PutEvents operation records one or more events. You can have up to 1,500
* unique custom events per app, any combination of up to 40 attributes and metrics
* per custom event, and any number of attribute or metric values.</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>The PutEvents operation records one or more events. You can have up to 1,500
* unique custom events per app, any combination of up to 40 attributes and metrics
* per custom event, and any number of attribute or metric values.</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 MobileAnalytics
} // 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/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace MobileAnalytics
{
namespace MobileAnalyticsEndpoint
{
AWS_MOBILEANALYTICS_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace MobileAnalyticsEndpoint
} // namespace MobileAnalytics
} // 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/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_MOBILEANALYTICS_API MobileAnalyticsErrorMarshaller : 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/mobileanalytics/MobileAnalytics_EXPORTS.h>
namespace Aws
{
namespace MobileAnalytics
{
enum class MobileAnalyticsErrors
{
//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,
///////////////////////////////////////////////////////////////////////////////////////////
BAD_REQUEST= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1
};
class AWS_MOBILEANALYTICS_API MobileAnalyticsError : public Aws::Client::AWSError<MobileAnalyticsErrors>
{
public:
MobileAnalyticsError() {}
MobileAnalyticsError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<MobileAnalyticsErrors>(rhs) {}
MobileAnalyticsError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<MobileAnalyticsErrors>(rhs) {}
MobileAnalyticsError(const Aws::Client::AWSError<MobileAnalyticsErrors>& rhs) : Aws::Client::AWSError<MobileAnalyticsErrors>(rhs) {}
MobileAnalyticsError(Aws::Client::AWSError<MobileAnalyticsErrors>&& rhs) : Aws::Client::AWSError<MobileAnalyticsErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace MobileAnalyticsErrorMapper
{
AWS_MOBILEANALYTICS_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace MobileAnalytics
} // 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/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
namespace Aws
{
namespace MobileAnalytics
{
class AWS_MOBILEANALYTICS_API MobileAnalyticsRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~MobileAnalyticsRequest () {}
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, "2014-06-05"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
} // namespace MobileAnalytics
} // 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_MOBILEANALYTICS_EXPORTS
#define AWS_MOBILEANALYTICS_API __declspec(dllexport)
#else
#define AWS_MOBILEANALYTICS_API __declspec(dllimport)
#endif /* AWS_MOBILEANALYTICS_EXPORTS */
#else
#define AWS_MOBILEANALYTICS_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_MOBILEANALYTICS_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,389 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/mobileanalytics/model/Session.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace MobileAnalytics
{
namespace Model
{
/**
* <p>A JSON object representing a batch of unique event occurrences in your
* app.</p>
*/
class AWS_MOBILEANALYTICS_API Event
{
public:
Event();
Event(Aws::Utils::Json::JsonView jsonValue);
Event& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline const Aws::String& GetEventType() const{ return m_eventType; }
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline bool EventTypeHasBeenSet() const { return m_eventTypeHasBeenSet; }
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline void SetEventType(const Aws::String& value) { m_eventTypeHasBeenSet = true; m_eventType = value; }
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline void SetEventType(Aws::String&& value) { m_eventTypeHasBeenSet = true; m_eventType = std::move(value); }
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline void SetEventType(const char* value) { m_eventTypeHasBeenSet = true; m_eventType.assign(value); }
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline Event& WithEventType(const Aws::String& value) { SetEventType(value); return *this;}
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline Event& WithEventType(Aws::String&& value) { SetEventType(std::move(value)); return *this;}
/**
* <p>A name signifying an event that occurred in your app. This is used for
* grouping and aggregating like events together for reporting purposes.</p>
*/
inline Event& WithEventType(const char* value) { SetEventType(value); return *this;}
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline const Aws::String& GetTimestamp() const{ return m_timestamp; }
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetTimestamp(const Aws::String& value) { m_timestampHasBeenSet = true; m_timestamp = value; }
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetTimestamp(Aws::String&& value) { m_timestampHasBeenSet = true; m_timestamp = std::move(value); }
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetTimestamp(const char* value) { m_timestampHasBeenSet = true; m_timestamp.assign(value); }
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Event& WithTimestamp(const Aws::String& value) { SetTimestamp(value); return *this;}
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Event& WithTimestamp(Aws::String&& value) { SetTimestamp(std::move(value)); return *this;}
/**
* <p>The time the event occurred in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Event& WithTimestamp(const char* value) { SetTimestamp(value); return *this;}
/**
* <p>The session the event occured within. </p>
*/
inline const Session& GetSession() const{ return m_session; }
/**
* <p>The session the event occured within. </p>
*/
inline bool SessionHasBeenSet() const { return m_sessionHasBeenSet; }
/**
* <p>The session the event occured within. </p>
*/
inline void SetSession(const Session& value) { m_sessionHasBeenSet = true; m_session = value; }
/**
* <p>The session the event occured within. </p>
*/
inline void SetSession(Session&& value) { m_sessionHasBeenSet = true; m_session = std::move(value); }
/**
* <p>The session the event occured within. </p>
*/
inline Event& WithSession(const Session& value) { SetSession(value); return *this;}
/**
* <p>The session the event occured within. </p>
*/
inline Event& WithSession(Session&& value) { SetSession(std::move(value)); return *this;}
/**
* <p>The version of the event.</p>
*/
inline const Aws::String& GetVersion() const{ return m_version; }
/**
* <p>The version of the event.</p>
*/
inline bool VersionHasBeenSet() const { return m_versionHasBeenSet; }
/**
* <p>The version of the event.</p>
*/
inline void SetVersion(const Aws::String& value) { m_versionHasBeenSet = true; m_version = value; }
/**
* <p>The version of the event.</p>
*/
inline void SetVersion(Aws::String&& value) { m_versionHasBeenSet = true; m_version = std::move(value); }
/**
* <p>The version of the event.</p>
*/
inline void SetVersion(const char* value) { m_versionHasBeenSet = true; m_version.assign(value); }
/**
* <p>The version of the event.</p>
*/
inline Event& WithVersion(const Aws::String& value) { SetVersion(value); return *this;}
/**
* <p>The version of the event.</p>
*/
inline Event& WithVersion(Aws::String&& value) { SetVersion(std::move(value)); return *this;}
/**
* <p>The version of the event.</p>
*/
inline Event& WithVersion(const char* value) { SetVersion(value); return *this;}
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetAttributes() const{ return m_attributes; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline bool AttributesHasBeenSet() const { return m_attributesHasBeenSet; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline void SetAttributes(const Aws::Map<Aws::String, Aws::String>& value) { m_attributesHasBeenSet = true; m_attributes = value; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline void SetAttributes(Aws::Map<Aws::String, Aws::String>&& value) { m_attributesHasBeenSet = true; m_attributes = std::move(value); }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& WithAttributes(const Aws::Map<Aws::String, Aws::String>& value) { SetAttributes(value); return *this;}
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& WithAttributes(Aws::Map<Aws::String, Aws::String>&& value) { SetAttributes(std::move(value)); return *this;}
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(const Aws::String& key, const Aws::String& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, value); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(Aws::String&& key, const Aws::String& value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), value); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(const Aws::String& key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, std::move(value)); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(Aws::String&& key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), std::move(value)); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(const char* key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, std::move(value)); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(Aws::String&& key, const char* value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), value); return *this; }
/**
* <p>A collection of key-value pairs that give additional context to the event.
* The key-value pairs are specified by the developer.</p> <p>This collection can
* be empty or the attribute object can be omitted.</p>
*/
inline Event& AddAttributes(const char* key, const char* value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, value); return *this; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline const Aws::Map<Aws::String, double>& GetMetrics() const{ return m_metrics; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline void SetMetrics(const Aws::Map<Aws::String, double>& value) { m_metricsHasBeenSet = true; m_metrics = value; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline void SetMetrics(Aws::Map<Aws::String, double>&& value) { m_metricsHasBeenSet = true; m_metrics = std::move(value); }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline Event& WithMetrics(const Aws::Map<Aws::String, double>& value) { SetMetrics(value); return *this;}
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline Event& WithMetrics(Aws::Map<Aws::String, double>&& value) { SetMetrics(std::move(value)); return *this;}
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline Event& AddMetrics(const Aws::String& key, double value) { m_metricsHasBeenSet = true; m_metrics.emplace(key, value); return *this; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline Event& AddMetrics(Aws::String&& key, double value) { m_metricsHasBeenSet = true; m_metrics.emplace(std::move(key), value); return *this; }
/**
* <p>A collection of key-value pairs that gives additional, measurable context to
* the event. The key-value pairs are specified by the developer.</p> <p>This
* collection can be empty or the attribute object can be omitted.</p>
*/
inline Event& AddMetrics(const char* key, double value) { m_metricsHasBeenSet = true; m_metrics.emplace(key, value); return *this; }
private:
Aws::String m_eventType;
bool m_eventTypeHasBeenSet;
Aws::String m_timestamp;
bool m_timestampHasBeenSet;
Session m_session;
bool m_sessionHasBeenSet;
Aws::String m_version;
bool m_versionHasBeenSet;
Aws::Map<Aws::String, Aws::String> m_attributes;
bool m_attributesHasBeenSet;
Aws::Map<Aws::String, double> m_metrics;
bool m_metricsHasBeenSet;
};
} // namespace Model
} // namespace MobileAnalytics
} // namespace Aws

View File

@@ -0,0 +1,184 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/mobileanalytics/MobileAnalyticsRequest.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/mobileanalytics/model/Event.h>
#include <utility>
namespace Aws
{
namespace MobileAnalytics
{
namespace Model
{
/**
* <p>A container for the data needed for a PutEvent operation</p>
*/
class AWS_MOBILEANALYTICS_API PutEventsRequest : public MobileAnalyticsRequest
{
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;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>An array of Event JSON objects</p>
*/
inline const Aws::Vector<Event>& GetEvents() const{ return m_events; }
/**
* <p>An array of Event JSON objects</p>
*/
inline bool EventsHasBeenSet() const { return m_eventsHasBeenSet; }
/**
* <p>An array of Event JSON objects</p>
*/
inline void SetEvents(const Aws::Vector<Event>& value) { m_eventsHasBeenSet = true; m_events = value; }
/**
* <p>An array of Event JSON objects</p>
*/
inline void SetEvents(Aws::Vector<Event>&& value) { m_eventsHasBeenSet = true; m_events = std::move(value); }
/**
* <p>An array of Event JSON objects</p>
*/
inline PutEventsRequest& WithEvents(const Aws::Vector<Event>& value) { SetEvents(value); return *this;}
/**
* <p>An array of Event JSON objects</p>
*/
inline PutEventsRequest& WithEvents(Aws::Vector<Event>&& value) { SetEvents(std::move(value)); return *this;}
/**
* <p>An array of Event JSON objects</p>
*/
inline PutEventsRequest& AddEvents(const Event& value) { m_eventsHasBeenSet = true; m_events.push_back(value); return *this; }
/**
* <p>An array of Event JSON objects</p>
*/
inline PutEventsRequest& AddEvents(Event&& value) { m_eventsHasBeenSet = true; m_events.push_back(std::move(value)); return *this; }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline const Aws::String& GetClientContext() const{ return m_clientContext; }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline bool ClientContextHasBeenSet() const { return m_clientContextHasBeenSet; }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline void SetClientContext(const Aws::String& value) { m_clientContextHasBeenSet = true; m_clientContext = value; }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline void SetClientContext(Aws::String&& value) { m_clientContextHasBeenSet = true; m_clientContext = std::move(value); }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline void SetClientContext(const char* value) { m_clientContextHasBeenSet = true; m_clientContext.assign(value); }
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline PutEventsRequest& WithClientContext(const Aws::String& value) { SetClientContext(value); return *this;}
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline PutEventsRequest& WithClientContext(Aws::String&& value) { SetClientContext(std::move(value)); return *this;}
/**
* <p>The client context including the client ID, app title, app version and
* package name.</p>
*/
inline PutEventsRequest& WithClientContext(const char* value) { SetClientContext(value); return *this;}
/**
* <p>The encoding used for the client context.</p>
*/
inline const Aws::String& GetClientContextEncoding() const{ return m_clientContextEncoding; }
/**
* <p>The encoding used for the client context.</p>
*/
inline bool ClientContextEncodingHasBeenSet() const { return m_clientContextEncodingHasBeenSet; }
/**
* <p>The encoding used for the client context.</p>
*/
inline void SetClientContextEncoding(const Aws::String& value) { m_clientContextEncodingHasBeenSet = true; m_clientContextEncoding = value; }
/**
* <p>The encoding used for the client context.</p>
*/
inline void SetClientContextEncoding(Aws::String&& value) { m_clientContextEncodingHasBeenSet = true; m_clientContextEncoding = std::move(value); }
/**
* <p>The encoding used for the client context.</p>
*/
inline void SetClientContextEncoding(const char* value) { m_clientContextEncodingHasBeenSet = true; m_clientContextEncoding.assign(value); }
/**
* <p>The encoding used for the client context.</p>
*/
inline PutEventsRequest& WithClientContextEncoding(const Aws::String& value) { SetClientContextEncoding(value); return *this;}
/**
* <p>The encoding used for the client context.</p>
*/
inline PutEventsRequest& WithClientContextEncoding(Aws::String&& value) { SetClientContextEncoding(std::move(value)); return *this;}
/**
* <p>The encoding used for the client context.</p>
*/
inline PutEventsRequest& WithClientContextEncoding(const char* value) { SetClientContextEncoding(value); return *this;}
private:
Aws::Vector<Event> m_events;
bool m_eventsHasBeenSet;
Aws::String m_clientContext;
bool m_clientContextHasBeenSet;
Aws::String m_clientContextEncoding;
bool m_clientContextEncodingHasBeenSet;
};
} // namespace Model
} // namespace MobileAnalytics
} // namespace Aws

View File

@@ -0,0 +1,214 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mobileanalytics/MobileAnalytics_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace MobileAnalytics
{
namespace Model
{
/**
* <p>Describes the session. Session information is required on ALL events.</p>
*/
class AWS_MOBILEANALYTICS_API Session
{
public:
Session();
Session(Aws::Utils::Json::JsonView jsonValue);
Session& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>A unique identifier for the session</p>
*/
inline const Aws::String& GetId() const{ return m_id; }
/**
* <p>A unique identifier for the session</p>
*/
inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
/**
* <p>A unique identifier for the session</p>
*/
inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
/**
* <p>A unique identifier for the session</p>
*/
inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
/**
* <p>A unique identifier for the session</p>
*/
inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
/**
* <p>A unique identifier for the session</p>
*/
inline Session& WithId(const Aws::String& value) { SetId(value); return *this;}
/**
* <p>A unique identifier for the session</p>
*/
inline Session& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
/**
* <p>A unique identifier for the session</p>
*/
inline Session& WithId(const char* value) { SetId(value); return *this;}
/**
* <p>The duration of the session.</p>
*/
inline long long GetDuration() const{ return m_duration; }
/**
* <p>The duration of the session.</p>
*/
inline bool DurationHasBeenSet() const { return m_durationHasBeenSet; }
/**
* <p>The duration of the session.</p>
*/
inline void SetDuration(long long value) { m_durationHasBeenSet = true; m_duration = value; }
/**
* <p>The duration of the session.</p>
*/
inline Session& WithDuration(long long value) { SetDuration(value); return *this;}
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline const Aws::String& GetStartTimestamp() const{ return m_startTimestamp; }
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline bool StartTimestampHasBeenSet() const { return m_startTimestampHasBeenSet; }
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStartTimestamp(const Aws::String& value) { m_startTimestampHasBeenSet = true; m_startTimestamp = value; }
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStartTimestamp(Aws::String&& value) { m_startTimestampHasBeenSet = true; m_startTimestamp = std::move(value); }
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStartTimestamp(const char* value) { m_startTimestampHasBeenSet = true; m_startTimestamp.assign(value); }
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStartTimestamp(const Aws::String& value) { SetStartTimestamp(value); return *this;}
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStartTimestamp(Aws::String&& value) { SetStartTimestamp(std::move(value)); return *this;}
/**
* <p>The time the event started in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStartTimestamp(const char* value) { SetStartTimestamp(value); return *this;}
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline const Aws::String& GetStopTimestamp() const{ return m_stopTimestamp; }
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline bool StopTimestampHasBeenSet() const { return m_stopTimestampHasBeenSet; }
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStopTimestamp(const Aws::String& value) { m_stopTimestampHasBeenSet = true; m_stopTimestamp = value; }
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStopTimestamp(Aws::String&& value) { m_stopTimestampHasBeenSet = true; m_stopTimestamp = std::move(value); }
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline void SetStopTimestamp(const char* value) { m_stopTimestampHasBeenSet = true; m_stopTimestamp.assign(value); }
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStopTimestamp(const Aws::String& value) { SetStopTimestamp(value); return *this;}
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStopTimestamp(Aws::String&& value) { SetStopTimestamp(std::move(value)); return *this;}
/**
* <p>The time the event terminated in ISO 8601 standard date time format. For
* example, 2014-06-30T19:07:47.885Z</p>
*/
inline Session& WithStopTimestamp(const char* value) { SetStopTimestamp(value); return *this;}
private:
Aws::String m_id;
bool m_idHasBeenSet;
long long m_duration;
bool m_durationHasBeenSet;
Aws::String m_startTimestamp;
bool m_startTimestampHasBeenSet;
Aws::String m_stopTimestamp;
bool m_stopTimestampHasBeenSet;
};
} // namespace Model
} // namespace MobileAnalytics
} // namespace Aws