From 9b956e64ef50c3f4e529509ccdb438da78a1f2d8 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 17 Jan 2023 15:59:08 -0800 Subject: [PATCH 1/8] udpate to use async for result futures --- eventstream_rpc/tests/EchoTestRpcClient.cpp | 10 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 89 ++- .../tests/include/awstest/EchoTestRpcClient.h | 10 +- .../tests/include/awstest/EchoTestRpcModel.h | 105 ++- .../aws/greengrass/GreengrassCoreIpcClient.h | 10 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 638 ++++++++++++------ .../source/GreengrassCoreIpcClient.cpp | 10 +- .../source/GreengrassCoreIpcModel.cpp | 577 +++++++++------- 8 files changed, 898 insertions(+), 551 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index 95b6dcbd6..5316b1a6f 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -20,9 +20,15 @@ namespace Awstest return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); } - void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } + void EchoTestRpcClient::Close() noexcept + { + m_connection.Close(); + } - EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } + EchoTestRpcClient::~EchoTestRpcClient() noexcept + { + Close(); + } std::shared_ptr EchoTestRpcClient::NewGetAllProducts() noexcept { diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index 3fbcd8c61..872d7eeda 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -29,7 +29,10 @@ namespace Awstest const char *Product::MODEL_NAME = "awstest#Product"; - Aws::Crt::String Product::GetModelName() const noexcept { return Product::MODEL_NAME; } + Aws::Crt::String Product::GetModelName() const noexcept + { + return Product::MODEL_NAME; + } Aws::Crt::ScopedResource Product::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -85,7 +88,10 @@ namespace Awstest const char *Customer::MODEL_NAME = "awstest#Customer"; - Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::MODEL_NAME; } + Aws::Crt::String Customer::GetModelName() const noexcept + { + return Customer::MODEL_NAME; + } Aws::Crt::ScopedResource Customer::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -133,7 +139,10 @@ namespace Awstest const char *Pair::MODEL_NAME = "awstest#Pair"; - Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::MODEL_NAME; } + Aws::Crt::String Pair::GetModelName() const noexcept + { + return Pair::MODEL_NAME; + } Aws::Crt::ScopedResource Pair::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -336,7 +345,10 @@ namespace Awstest const char *MessageData::MODEL_NAME = "awstest#MessageData"; - Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::MODEL_NAME; } + Aws::Crt::String MessageData::GetModelName() const noexcept + { + return MessageData::MODEL_NAME; + } Aws::Crt::ScopedResource MessageData::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -412,7 +424,10 @@ namespace Awstest const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; - Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { return EchoStreamingMessage::MODEL_NAME; } + Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept + { + return EchoStreamingMessage::MODEL_NAME; + } Aws::Crt::ScopedResource EchoStreamingMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -510,7 +525,10 @@ namespace Awstest const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; - Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { return GetAllProductsRequest::MODEL_NAME; } + Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept + { + return GetAllProductsRequest::MODEL_NAME; + } Aws::Crt::ScopedResource GetAllProductsRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -659,7 +677,10 @@ namespace Awstest const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; - Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { return EchoMessageResponse::MODEL_NAME; } + Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept + { + return EchoMessageResponse::MODEL_NAME; + } Aws::Crt::ScopedResource EchoMessageResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -705,7 +726,10 @@ namespace Awstest const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; - Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::MODEL_NAME; } + Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept + { + return EchoMessageRequest::MODEL_NAME; + } Aws::Crt::ScopedResource EchoMessageRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -743,7 +767,10 @@ namespace Awstest const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; - Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { return EchoStreamingResponse::MODEL_NAME; } + Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept + { + return EchoStreamingResponse::MODEL_NAME; + } Aws::Crt::ScopedResource EchoStreamingResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -781,7 +808,10 @@ namespace Awstest const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; - Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { return EchoStreamingRequest::MODEL_NAME; } + Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept + { + return EchoStreamingRequest::MODEL_NAME; + } Aws::Crt::ScopedResource EchoStreamingRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -830,7 +860,10 @@ namespace Awstest const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; - Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } + Aws::Crt::String ServiceError::GetModelName() const noexcept + { + return ServiceError::MODEL_NAME; + } Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -978,7 +1011,7 @@ namespace Awstest std::future GetAllProductsOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); } GetAllProductsOperation::GetAllProductsOperation( @@ -1033,8 +1066,8 @@ namespace Awstest return Aws::Crt::String("awstest#CauseServiceErrorResponse"); } - Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -1046,8 +1079,7 @@ namespace Awstest std::future CauseServiceErrorOperation::GetResult() noexcept { - return std::async( - std::launch::deferred, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); } CauseServiceErrorOperation::CauseServiceErrorOperation( @@ -1101,15 +1133,15 @@ namespace Awstest } Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); } @@ -1138,7 +1170,7 @@ namespace Awstest std::future CauseStreamServiceToErrorOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); } CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( @@ -1195,8 +1227,8 @@ namespace Awstest } Aws::Crt::ScopedResource EchoStreamMessagesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); } @@ -1211,8 +1243,8 @@ namespace Awstest return Aws::Crt::String("awstest#EchoStreamingResponse"); } - Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::String("awstest#EchoStreamingMessage"); } @@ -1225,7 +1257,7 @@ namespace Awstest std::future EchoStreamMessagesOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); } EchoStreamMessagesOperation::EchoStreamMessagesOperation( @@ -1292,7 +1324,7 @@ namespace Awstest std::future EchoMessageOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { return EchoMessageResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return EchoMessageResult(GetOperationResult().get()); }); } EchoMessageOperation::EchoMessageOperation( @@ -1359,8 +1391,7 @@ namespace Awstest std::future GetAllCustomersOperation::GetResult() noexcept { - return std::async( - std::launch::deferred, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); } GetAllCustomersOperation::GetAllCustomersOperation( diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index e89f2c0ba..d1e54db99 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -28,10 +28,12 @@ namespace Awstest Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle events relating to the connection - * occur. - * @param connectionConfig The configuration parameters used for establishing the connection. - * @return An `RpcError` that can be used to check whether the connection was established. + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. */ std::future Connect( ConnectionLifecycleHandler &lifecycleHandler, diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index cdcd51f51..45e15eb27 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -63,7 +63,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(Customer *) noexcept; - /* This needs to be defined so that `Customer` can be used as a key in maps. */ + /* This needs to be defined so that `Customer` can be used as a key in maps. + */ bool operator<(const Customer &) const noexcept; static const char *MODEL_NAME; @@ -158,7 +159,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(MessageData *) noexcept; - /* This needs to be defined so that `MessageData` can be used as a key in maps. */ + /* This needs to be defined so that `MessageData` can be used as a key in + * maps. */ bool operator<(const MessageData &) const noexcept; static const char *MODEL_NAME; @@ -221,7 +223,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(EchoStreamingMessage *) noexcept; - /* This needs to be defined so that `EchoStreamingMessage` can be used as a key in maps. */ + /* This needs to be defined so that `EchoStreamingMessage` can be used as a + * key in maps. */ bool operator<(const EchoStreamingMessage &) const noexcept; static const char *MODEL_NAME; @@ -251,7 +254,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetAllProductsResponse *) noexcept; - /* This needs to be defined so that `GetAllProductsResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetAllProductsResponse` can be used as a + * key in maps. */ bool operator<(const GetAllProductsResponse &) const noexcept; static const char *MODEL_NAME; @@ -273,7 +277,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetAllProductsRequest *) noexcept; - /* This needs to be defined so that `GetAllProductsRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetAllProductsRequest` can be used as a + * key in maps. */ bool operator<(const GetAllProductsRequest &) const noexcept; static const char *MODEL_NAME; @@ -296,7 +301,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetAllCustomersResponse *) noexcept; - /* This needs to be defined so that `GetAllCustomersResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetAllCustomersResponse` can be used as a + * key in maps. */ bool operator<(const GetAllCustomersResponse &) const noexcept; static const char *MODEL_NAME; @@ -318,7 +324,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetAllCustomersRequest *) noexcept; - /* This needs to be defined so that `GetAllCustomersRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetAllCustomersRequest` can be used as a + * key in maps. */ bool operator<(const GetAllCustomersRequest &) const noexcept; static const char *MODEL_NAME; @@ -341,7 +348,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(EchoMessageResponse *) noexcept; - /* This needs to be defined so that `EchoMessageResponse` can be used as a key in maps. */ + /* This needs to be defined so that `EchoMessageResponse` can be used as a key + * in maps. */ bool operator<(const EchoMessageResponse &) const noexcept; static const char *MODEL_NAME; @@ -365,7 +373,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(EchoMessageRequest *) noexcept; - /* This needs to be defined so that `EchoMessageRequest` can be used as a key in maps. */ + /* This needs to be defined so that `EchoMessageRequest` can be used as a key + * in maps. */ bool operator<(const EchoMessageRequest &) const noexcept; static const char *MODEL_NAME; @@ -387,7 +396,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(EchoStreamingResponse *) noexcept; - /* This needs to be defined so that `EchoStreamingResponse` can be used as a key in maps. */ + /* This needs to be defined so that `EchoStreamingResponse` can be used as a + * key in maps. */ bool operator<(const EchoStreamingResponse &) const noexcept; static const char *MODEL_NAME; @@ -408,7 +418,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(EchoStreamingRequest *) noexcept; - /* This needs to be defined so that `EchoStreamingRequest` can be used as a key in maps. */ + /* This needs to be defined so that `EchoStreamingRequest` can be used as a + * key in maps. */ bool operator<(const EchoStreamingRequest &) const noexcept; static const char *MODEL_NAME; @@ -433,7 +444,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in maps. */ + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ bool operator<(const ServiceError &) const noexcept; static const char *MODEL_NAME; @@ -456,7 +468,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CauseServiceErrorResponse *) noexcept; - /* This needs to be defined so that `CauseServiceErrorResponse` can be used as a key in maps. */ + /* This needs to be defined so that `CauseServiceErrorResponse` can be used as + * a key in maps. */ bool operator<(const CauseServiceErrorResponse &) const noexcept; static const char *MODEL_NAME; @@ -477,7 +490,8 @@ namespace Awstest Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CauseServiceErrorRequest *) noexcept; - /* This needs to be defined so that `CauseServiceErrorRequest` can be used as a key in maps. */ + /* This needs to be defined so that `CauseServiceErrorRequest` can be used as + * a key in maps. */ bool operator<(const CauseServiceErrorRequest &) const noexcept; static const char *MODEL_NAME; @@ -535,8 +549,10 @@ namespace Awstest /** * Used to activate a stream for the `GetAllProductsOperation` * @param request The request used for the `GetAllProductsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetAllProductsRequest &request, @@ -598,8 +614,10 @@ namespace Awstest /** * Used to activate a stream for the `CauseServiceErrorOperation` * @param request The request used for the `CauseServiceErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const CauseServiceErrorRequest &request, @@ -619,8 +637,10 @@ namespace Awstest virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -639,7 +659,8 @@ namespace Awstest } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -654,7 +675,8 @@ namespace Awstest */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -710,9 +732,12 @@ namespace Awstest Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `CauseStreamServiceToErrorOperation` - * @param request The request used for the `CauseStreamServiceToErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `CauseStreamServiceToErrorOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const EchoStreamingRequest &request, @@ -732,8 +757,10 @@ namespace Awstest virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -742,7 +769,8 @@ namespace Awstest } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -757,7 +785,8 @@ namespace Awstest */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -812,8 +841,10 @@ namespace Awstest /** * Used to activate a stream for the `EchoStreamMessagesOperation` * @param request The request used for the `EchoStreamMessagesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const EchoStreamingRequest &request, @@ -875,8 +906,10 @@ namespace Awstest /** * Used to activate a stream for the `EchoMessageOperation` * @param request The request used for the `EchoMessageOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const EchoMessageRequest &request, @@ -938,8 +971,10 @@ namespace Awstest /** * Used to activate a stream for the `GetAllCustomersOperation` * @param request The request used for the `GetAllCustomersOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetAllCustomersRequest &request, diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h index 564548fd8..ce29e7444 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -30,10 +30,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle events relating to the connection - * occur. - * @param connectionConfig The configuration parameters used for establishing the connection. - * @return An `RpcError` that can be used to check whether the connection was established. + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. */ std::future Connect( ConnectionLifecycleHandler &lifecycleHandler, diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index 0b0559c21..ea4fb36f2 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -44,7 +44,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(MessageContext *) noexcept; - /* This needs to be defined so that `MessageContext` can be used as a key in maps. */ + /* This needs to be defined so that `MessageContext` can be used as a key in + * maps. */ bool operator<(const MessageContext &) const noexcept; static const char *MODEL_NAME; @@ -70,7 +71,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SystemResourceLimits *) noexcept; - /* This needs to be defined so that `SystemResourceLimits` can be used as a key in maps. */ + /* This needs to be defined so that `SystemResourceLimits` can be used as a + * key in maps. */ bool operator<(const SystemResourceLimits &) const noexcept; static const char *MODEL_NAME; @@ -100,7 +102,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ValidateConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be used as a key in maps. */ + /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be + * used as a key in maps. */ bool operator<(const ValidateConfigurationUpdateEvent &) const noexcept; static const char *MODEL_NAME; @@ -127,7 +130,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(MQTTMessage *) noexcept; - /* This needs to be defined so that `MQTTMessage` can be used as a key in maps. */ + /* This needs to be defined so that `MQTTMessage` can be used as a key in + * maps. */ bool operator<(const MQTTMessage &) const noexcept; static const char *MODEL_NAME; @@ -154,7 +158,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as a key in maps. */ + /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as + * a key in maps. */ bool operator<(const ConfigurationUpdateEvent &) const noexcept; static const char *MODEL_NAME; @@ -179,7 +184,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PostComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PostComponentUpdateEvent` can be used as a key in maps. */ + /* This needs to be defined so that `PostComponentUpdateEvent` can be used as + * a key in maps. */ bool operator<(const PostComponentUpdateEvent &) const noexcept; static const char *MODEL_NAME; @@ -205,7 +211,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PreComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a key in maps. */ + /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a + * key in maps. */ bool operator<(const PreComponentUpdateEvent &) const noexcept; static const char *MODEL_NAME; @@ -242,7 +249,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CertificateUpdate *) noexcept; - /* This needs to be defined so that `CertificateUpdate` can be used as a key in maps. */ + /* This needs to be defined so that `CertificateUpdate` can be used as a key + * in maps. */ bool operator<(const CertificateUpdate &) const noexcept; static const char *MODEL_NAME; @@ -314,7 +322,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(BinaryMessage *) noexcept; - /* This needs to be defined so that `BinaryMessage` can be used as a key in maps. */ + /* This needs to be defined so that `BinaryMessage` can be used as a key in + * maps. */ bool operator<(const BinaryMessage &) const noexcept; static const char *MODEL_NAME; @@ -343,7 +352,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(JsonMessage *) noexcept; - /* This needs to be defined so that `JsonMessage` can be used as a key in maps. */ + /* This needs to be defined so that `JsonMessage` can be used as a key in + * maps. */ bool operator<(const JsonMessage &) const noexcept; static const char *MODEL_NAME; @@ -397,7 +407,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(MQTTCredential *) noexcept; - /* This needs to be defined so that `MQTTCredential` can be used as a key in maps. */ + /* This needs to be defined so that `MQTTCredential` can be used as a key in + * maps. */ bool operator<(const MQTTCredential &) const noexcept; static const char *MODEL_NAME; @@ -434,7 +445,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(RunWithInfo *) noexcept; - /* This needs to be defined so that `RunWithInfo` can be used as a key in maps. */ + /* This needs to be defined so that `RunWithInfo` can be used as a key in + * maps. */ bool operator<(const RunWithInfo &) const noexcept; static const char *MODEL_NAME; @@ -475,7 +487,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ClientDeviceCredential *) noexcept; - /* This needs to be defined so that `ClientDeviceCredential` can be used as a key in maps. */ + /* This needs to be defined so that `ClientDeviceCredential` can be used as a + * key in maps. */ bool operator<(const ClientDeviceCredential &) const noexcept; static const char *MODEL_NAME; @@ -528,7 +541,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ValidateConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be used as a key in maps. */ + /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be + * used as a key in maps. */ bool operator<(const ValidateConfigurationUpdateEvents &) const noexcept; static const char *MODEL_NAME; @@ -587,7 +601,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscriptionResponseMessage *) noexcept; - /* This needs to be defined so that `SubscriptionResponseMessage` can be used as a key in maps. */ + /* This needs to be defined so that `SubscriptionResponseMessage` can be used + * as a key in maps. */ bool operator<(const SubscriptionResponseMessage &) const noexcept; static const char *MODEL_NAME; @@ -638,7 +653,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(IoTCoreMessage *) noexcept; - /* This needs to be defined so that `IoTCoreMessage` can be used as a key in maps. */ + /* This needs to be defined so that `IoTCoreMessage` can be used as a key in + * maps. */ bool operator<(const IoTCoreMessage &) const noexcept; static const char *MODEL_NAME; @@ -681,7 +697,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as a key in maps. */ + /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as + * a key in maps. */ bool operator<(const ConfigurationUpdateEvents &) const noexcept; static const char *MODEL_NAME; @@ -740,7 +757,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; - /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used as a key in maps. */ + /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used + * as a key in maps. */ bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; static const char *MODEL_NAME; @@ -785,7 +803,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CertificateUpdateEvent *) noexcept; - /* This needs to be defined so that `CertificateUpdateEvent` can be used as a key in maps. */ + /* This needs to be defined so that `CertificateUpdateEvent` can be used as a + * key in maps. */ bool operator<(const CertificateUpdateEvent &) const noexcept; static const char *MODEL_NAME; @@ -813,7 +832,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CertificateOptions *) noexcept; - /* This needs to be defined so that `CertificateOptions` can be used as a key in maps. */ + /* This needs to be defined so that `CertificateOptions` can be used as a key + * in maps. */ bool operator<(const CertificateOptions &) const noexcept; static const char *MODEL_NAME; @@ -841,7 +861,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ConfigurationValidityReport *) noexcept; - /* This needs to be defined so that `ConfigurationValidityReport` can be used as a key in maps. */ + /* This needs to be defined so that `ConfigurationValidityReport` can be used + * as a key in maps. */ bool operator<(const ConfigurationValidityReport &) const noexcept; static const char *MODEL_NAME; @@ -904,7 +925,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PublishMessage *) noexcept; - /* This needs to be defined so that `PublishMessage` can be used as a key in maps. */ + /* This needs to be defined so that `PublishMessage` can be used as a key in + * maps. */ bool operator<(const PublishMessage &) const noexcept; static const char *MODEL_NAME; @@ -971,7 +993,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SecretValue *) noexcept; - /* This needs to be defined so that `SecretValue` can be used as a key in maps. */ + /* This needs to be defined so that `SecretValue` can be used as a key in + * maps. */ bool operator<(const SecretValue &) const noexcept; static const char *MODEL_NAME; @@ -1003,7 +1026,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(LocalDeployment *) noexcept; - /* This needs to be defined so that `LocalDeployment` can be used as a key in maps. */ + /* This needs to be defined so that `LocalDeployment` can be used as a key in + * maps. */ bool operator<(const LocalDeployment &) const noexcept; static const char *MODEL_NAME; @@ -1037,7 +1061,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ComponentDetails *) noexcept; - /* This needs to be defined so that `ComponentDetails` can be used as a key in maps. */ + /* This needs to be defined so that `ComponentDetails` can be used as a key in + * maps. */ bool operator<(const ComponentDetails &) const noexcept; static const char *MODEL_NAME; @@ -1079,7 +1104,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CredentialDocument *) noexcept; - /* This needs to be defined so that `CredentialDocument` can be used as a key in maps. */ + /* This needs to be defined so that `CredentialDocument` can be used as a key + * in maps. */ bool operator<(const CredentialDocument &) const noexcept; static const char *MODEL_NAME; @@ -1110,7 +1136,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(VerifyClientDeviceIdentityResponse *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can be used as a key in maps. */ + /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can + * be used as a key in maps. */ bool operator<(const VerifyClientDeviceIdentityResponse &) const noexcept; static const char *MODEL_NAME; @@ -1134,7 +1161,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(VerifyClientDeviceIdentityRequest *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be used as a key in maps. */ + /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be + * used as a key in maps. */ bool operator<(const VerifyClientDeviceIdentityRequest &) const noexcept; static const char *MODEL_NAME; @@ -1158,7 +1186,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidTokenError *) noexcept; - /* This needs to be defined so that `InvalidTokenError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidTokenError` can be used as a key + * in maps. */ bool operator<(const InvalidTokenError &) const noexcept; static const char *MODEL_NAME; @@ -1182,7 +1211,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ValidateAuthorizationTokenResponse *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can be used as a key in maps. */ + /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can + * be used as a key in maps. */ bool operator<(const ValidateAuthorizationTokenResponse &) const noexcept; static const char *MODEL_NAME; @@ -1206,7 +1236,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ValidateAuthorizationTokenRequest *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be used as a key in maps. */ + /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be + * used as a key in maps. */ bool operator<(const ValidateAuthorizationTokenRequest &) const noexcept; static const char *MODEL_NAME; @@ -1230,7 +1261,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateThingShadowResponse *) noexcept; - /* This needs to be defined so that `UpdateThingShadowResponse` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateThingShadowResponse` can be used as + * a key in maps. */ bool operator<(const UpdateThingShadowResponse &) const noexcept; static const char *MODEL_NAME; @@ -1258,7 +1290,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateThingShadowRequest *) noexcept; - /* This needs to be defined so that `UpdateThingShadowRequest` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateThingShadowRequest` can be used as + * a key in maps. */ bool operator<(const UpdateThingShadowRequest &) const noexcept; static const char *MODEL_NAME; @@ -1282,7 +1315,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateStateResponse *) noexcept; - /* This needs to be defined so that `UpdateStateResponse` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateStateResponse` can be used as a key + * in maps. */ bool operator<(const UpdateStateResponse &) const noexcept; static const char *MODEL_NAME; @@ -1305,7 +1339,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateStateRequest *) noexcept; - /* This needs to be defined so that `UpdateStateRequest` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateStateRequest` can be used as a key + * in maps. */ bool operator<(const UpdateStateRequest &) const noexcept; static const char *MODEL_NAME; @@ -1329,7 +1364,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(FailedUpdateConditionCheckError *) noexcept; - /* This needs to be defined so that `FailedUpdateConditionCheckError` can be used as a key in maps. */ + /* This needs to be defined so that `FailedUpdateConditionCheckError` can be + * used as a key in maps. */ bool operator<(const FailedUpdateConditionCheckError &) const noexcept; static const char *MODEL_NAME; @@ -1353,7 +1389,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ConflictError *) noexcept; - /* This needs to be defined so that `ConflictError` can be used as a key in maps. */ + /* This needs to be defined so that `ConflictError` can be used as a key in + * maps. */ bool operator<(const ConflictError &) const noexcept; static const char *MODEL_NAME; @@ -1375,7 +1412,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateConfigurationResponse *) noexcept; - /* This needs to be defined so that `UpdateConfigurationResponse` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateConfigurationResponse` can be used + * as a key in maps. */ bool operator<(const UpdateConfigurationResponse &) const noexcept; static const char *MODEL_NAME; @@ -1402,7 +1440,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateConfigurationRequest *) noexcept; - /* This needs to be defined so that `UpdateConfigurationRequest` can be used as a key in maps. */ + /* This needs to be defined so that `UpdateConfigurationRequest` can be used + * as a key in maps. */ bool operator<(const UpdateConfigurationRequest &) const noexcept; static const char *MODEL_NAME; @@ -1429,8 +1468,9 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToValidateConfigurationUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key - * in maps. */ + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in + * maps. */ bool operator<(const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; static const char *MODEL_NAME; @@ -1454,7 +1494,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToValidateConfigurationUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in * maps. */ bool operator<(const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; static const char *MODEL_NAME; @@ -1480,7 +1521,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToTopicResponse *) noexcept; - /* This needs to be defined so that `SubscribeToTopicResponse` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToTopicResponse` can be used as + * a key in maps. */ bool operator<(const SubscribeToTopicResponse &) const noexcept; static const char *MODEL_NAME; @@ -1506,7 +1548,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToTopicRequest *) noexcept; - /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a + * key in maps. */ bool operator<(const SubscribeToTopicRequest &) const noexcept; static const char *MODEL_NAME; @@ -1529,7 +1572,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used + * as a key in maps. */ bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; static const char *MODEL_NAME; @@ -1554,7 +1598,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as + * a key in maps. */ bool operator<(const SubscribeToIoTCoreRequest &) const noexcept; static const char *MODEL_NAME; @@ -1579,8 +1624,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToConfigurationUpdateResponse *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` can be used as a key in maps. - */ + /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` + * can be used as a key in maps. */ bool operator<(const SubscribeToConfigurationUpdateResponse &) const noexcept; static const char *MODEL_NAME; @@ -1607,7 +1652,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToConfigurationUpdateRequest *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` + * can be used as a key in maps. */ bool operator<(const SubscribeToConfigurationUpdateRequest &) const noexcept; static const char *MODEL_NAME; @@ -1630,7 +1676,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToComponentUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can + * be used as a key in maps. */ bool operator<(const SubscribeToComponentUpdatesResponse &) const noexcept; static const char *MODEL_NAME; @@ -1651,7 +1698,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToComponentUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can + * be used as a key in maps. */ bool operator<(const SubscribeToComponentUpdatesRequest &) const noexcept; static const char *MODEL_NAME; @@ -1674,7 +1722,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToCertificateUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` + * can be used as a key in maps. */ bool operator<(const SubscribeToCertificateUpdatesResponse &) const noexcept; static const char *MODEL_NAME; @@ -1700,7 +1749,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToCertificateUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can be used as a key in maps. */ + /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can + * be used as a key in maps. */ bool operator<(const SubscribeToCertificateUpdatesRequest &) const noexcept; static const char *MODEL_NAME; @@ -1726,7 +1776,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(StopComponentResponse *) noexcept; - /* This needs to be defined so that `StopComponentResponse` can be used as a key in maps. */ + /* This needs to be defined so that `StopComponentResponse` can be used as a + * key in maps. */ bool operator<(const StopComponentResponse &) const noexcept; static const char *MODEL_NAME; @@ -1751,7 +1802,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(StopComponentRequest *) noexcept; - /* This needs to be defined so that `StopComponentRequest` can be used as a key in maps. */ + /* This needs to be defined so that `StopComponentRequest` can be used as a + * key in maps. */ bool operator<(const StopComponentRequest &) const noexcept; static const char *MODEL_NAME; @@ -1775,8 +1827,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SendConfigurationValidityReportResponse *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportResponse` can be used as a key in maps. - */ + /* This needs to be defined so that `SendConfigurationValidityReportResponse` + * can be used as a key in maps. */ bool operator<(const SendConfigurationValidityReportResponse &) const noexcept; static const char *MODEL_NAME; @@ -1807,8 +1859,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SendConfigurationValidityReportRequest *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportRequest` can be used as a key in maps. - */ + /* This needs to be defined so that `SendConfigurationValidityReportRequest` + * can be used as a key in maps. */ bool operator<(const SendConfigurationValidityReportRequest &) const noexcept; static const char *MODEL_NAME; @@ -1830,7 +1882,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ResumeComponentResponse *) noexcept; - /* This needs to be defined so that `ResumeComponentResponse` can be used as a key in maps. */ + /* This needs to be defined so that `ResumeComponentResponse` can be used as a + * key in maps. */ bool operator<(const ResumeComponentResponse &) const noexcept; static const char *MODEL_NAME; @@ -1853,7 +1906,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ResumeComponentRequest *) noexcept; - /* This needs to be defined so that `ResumeComponentRequest` can be used as a key in maps. */ + /* This needs to be defined so that `ResumeComponentRequest` can be used as a + * key in maps. */ bool operator<(const ResumeComponentRequest &) const noexcept; static const char *MODEL_NAME; @@ -1877,7 +1931,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ComponentNotFoundError *) noexcept; - /* This needs to be defined so that `ComponentNotFoundError` can be used as a key in maps. */ + /* This needs to be defined so that `ComponentNotFoundError` can be used as a + * key in maps. */ bool operator<(const ComponentNotFoundError &) const noexcept; static const char *MODEL_NAME; @@ -1903,7 +1958,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(RestartComponentResponse *) noexcept; - /* This needs to be defined so that `RestartComponentResponse` can be used as a key in maps. */ + /* This needs to be defined so that `RestartComponentResponse` can be used as + * a key in maps. */ bool operator<(const RestartComponentResponse &) const noexcept; static const char *MODEL_NAME; @@ -1928,7 +1984,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(RestartComponentRequest *) noexcept; - /* This needs to be defined so that `RestartComponentRequest` can be used as a key in maps. */ + /* This needs to be defined so that `RestartComponentRequest` can be used as a + * key in maps. */ bool operator<(const RestartComponentRequest &) const noexcept; static const char *MODEL_NAME; @@ -1950,7 +2007,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PutComponentMetricResponse *) noexcept; - /* This needs to be defined so that `PutComponentMetricResponse` can be used as a key in maps. */ + /* This needs to be defined so that `PutComponentMetricResponse` can be used + * as a key in maps. */ bool operator<(const PutComponentMetricResponse &) const noexcept; static const char *MODEL_NAME; @@ -1973,7 +2031,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PutComponentMetricRequest *) noexcept; - /* This needs to be defined so that `PutComponentMetricRequest` can be used as a key in maps. */ + /* This needs to be defined so that `PutComponentMetricRequest` can be used as + * a key in maps. */ bool operator<(const PutComponentMetricRequest &) const noexcept; static const char *MODEL_NAME; @@ -1995,7 +2054,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PublishToTopicResponse *) noexcept; - /* This needs to be defined so that `PublishToTopicResponse` can be used as a key in maps. */ + /* This needs to be defined so that `PublishToTopicResponse` can be used as a + * key in maps. */ bool operator<(const PublishToTopicResponse &) const noexcept; static const char *MODEL_NAME; @@ -2020,7 +2080,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PublishToTopicRequest *) noexcept; - /* This needs to be defined so that `PublishToTopicRequest` can be used as a key in maps. */ + /* This needs to be defined so that `PublishToTopicRequest` can be used as a + * key in maps. */ bool operator<(const PublishToTopicRequest &) const noexcept; static const char *MODEL_NAME; @@ -2043,7 +2104,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PublishToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as a key in maps. */ + /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as + * a key in maps. */ bool operator<(const PublishToIoTCoreResponse &) const noexcept; static const char *MODEL_NAME; @@ -2070,7 +2132,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PublishToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a key in maps. */ + /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a + * key in maps. */ bool operator<(const PublishToIoTCoreRequest &) const noexcept; static const char *MODEL_NAME; @@ -2094,7 +2157,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PauseComponentResponse *) noexcept; - /* This needs to be defined so that `PauseComponentResponse` can be used as a key in maps. */ + /* This needs to be defined so that `PauseComponentResponse` can be used as a + * key in maps. */ bool operator<(const PauseComponentResponse &) const noexcept; static const char *MODEL_NAME; @@ -2117,7 +2181,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(PauseComponentRequest *) noexcept; - /* This needs to be defined so that `PauseComponentRequest` can be used as a key in maps. */ + /* This needs to be defined so that `PauseComponentRequest` can be used as a + * key in maps. */ bool operator<(const PauseComponentRequest &) const noexcept; static const char *MODEL_NAME; @@ -2145,7 +2210,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListNamedShadowsForThingResponse *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be used as a key in maps. */ + /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be + * used as a key in maps. */ bool operator<(const ListNamedShadowsForThingResponse &) const noexcept; static const char *MODEL_NAME; @@ -2175,7 +2241,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListNamedShadowsForThingRequest *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be used as a key in maps. */ + /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be + * used as a key in maps. */ bool operator<(const ListNamedShadowsForThingRequest &) const noexcept; static const char *MODEL_NAME; @@ -2207,7 +2274,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used as a key in maps. */ + /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used + * as a key in maps. */ bool operator<(const ListLocalDeploymentsResponse &) const noexcept; static const char *MODEL_NAME; @@ -2229,7 +2297,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used as a key in maps. */ + /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used + * as a key in maps. */ bool operator<(const ListLocalDeploymentsRequest &) const noexcept; static const char *MODEL_NAME; @@ -2255,7 +2324,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListComponentsResponse *) noexcept; - /* This needs to be defined so that `ListComponentsResponse` can be used as a key in maps. */ + /* This needs to be defined so that `ListComponentsResponse` can be used as a + * key in maps. */ bool operator<(const ListComponentsResponse &) const noexcept; static const char *MODEL_NAME; @@ -2277,7 +2347,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListComponentsRequest *) noexcept; - /* This needs to be defined so that `ListComponentsRequest` can be used as a key in maps. */ + /* This needs to be defined so that `ListComponentsRequest` can be used as a + * key in maps. */ bool operator<(const ListComponentsRequest &) const noexcept; static const char *MODEL_NAME; @@ -2300,7 +2371,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetThingShadowResponse *) noexcept; - /* This needs to be defined so that `GetThingShadowResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetThingShadowResponse` can be used as a + * key in maps. */ bool operator<(const GetThingShadowResponse &) const noexcept; static const char *MODEL_NAME; @@ -2326,7 +2398,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetThingShadowRequest *) noexcept; - /* This needs to be defined so that `GetThingShadowRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetThingShadowRequest` can be used as a + * key in maps. */ bool operator<(const GetThingShadowRequest &) const noexcept; static const char *MODEL_NAME; @@ -2360,7 +2433,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetSecretValueResponse *) noexcept; - /* This needs to be defined so that `GetSecretValueResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetSecretValueResponse` can be used as a + * key in maps. */ bool operator<(const GetSecretValueResponse &) const noexcept; static const char *MODEL_NAME; @@ -2391,7 +2465,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetSecretValueRequest *) noexcept; - /* This needs to be defined so that `GetSecretValueRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetSecretValueRequest` can be used as a + * key in maps. */ bool operator<(const GetSecretValueRequest &) const noexcept; static const char *MODEL_NAME; @@ -2417,7 +2492,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetLocalDeploymentStatusResponse *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be + * used as a key in maps. */ bool operator<(const GetLocalDeploymentStatusResponse &) const noexcept; static const char *MODEL_NAME; @@ -2441,7 +2517,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetLocalDeploymentStatusRequest *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be + * used as a key in maps. */ bool operator<(const GetLocalDeploymentStatusRequest &) const noexcept; static const char *MODEL_NAME; @@ -2467,7 +2544,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetConfigurationResponse *) noexcept; - /* This needs to be defined so that `GetConfigurationResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetConfigurationResponse` can be used as + * a key in maps. */ bool operator<(const GetConfigurationResponse &) const noexcept; static const char *MODEL_NAME; @@ -2494,7 +2572,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetConfigurationRequest *) noexcept; - /* This needs to be defined so that `GetConfigurationRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetConfigurationRequest` can be used as a + * key in maps. */ bool operator<(const GetConfigurationRequest &) const noexcept; static const char *MODEL_NAME; @@ -2522,7 +2601,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetComponentDetailsResponse *) noexcept; - /* This needs to be defined so that `GetComponentDetailsResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetComponentDetailsResponse` can be used + * as a key in maps. */ bool operator<(const GetComponentDetailsResponse &) const noexcept; static const char *MODEL_NAME; @@ -2546,7 +2626,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetComponentDetailsRequest *) noexcept; - /* This needs to be defined so that `GetComponentDetailsRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetComponentDetailsRequest` can be used + * as a key in maps. */ bool operator<(const GetComponentDetailsRequest &) const noexcept; static const char *MODEL_NAME; @@ -2570,7 +2651,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidCredentialError *) noexcept; - /* This needs to be defined so that `InvalidCredentialError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidCredentialError` can be used as a + * key in maps. */ bool operator<(const InvalidCredentialError &) const noexcept; static const char *MODEL_NAME; @@ -2597,7 +2679,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetClientDeviceAuthTokenResponse *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be used as a key in maps. */ + /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be + * used as a key in maps. */ bool operator<(const GetClientDeviceAuthTokenResponse &) const noexcept; static const char *MODEL_NAME; @@ -2621,7 +2704,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetClientDeviceAuthTokenRequest *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be used as a key in maps. */ + /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be + * used as a key in maps. */ bool operator<(const GetClientDeviceAuthTokenRequest &) const noexcept; static const char *MODEL_NAME; @@ -2645,7 +2729,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeleteThingShadowResponse *) noexcept; - /* This needs to be defined so that `DeleteThingShadowResponse` can be used as a key in maps. */ + /* This needs to be defined so that `DeleteThingShadowResponse` can be used as + * a key in maps. */ bool operator<(const DeleteThingShadowResponse &) const noexcept; static const char *MODEL_NAME; @@ -2671,7 +2756,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeleteThingShadowRequest *) noexcept; - /* This needs to be defined so that `DeleteThingShadowRequest` can be used as a key in maps. */ + /* This needs to be defined so that `DeleteThingShadowRequest` can be used as + * a key in maps. */ bool operator<(const DeleteThingShadowRequest &) const noexcept; static const char *MODEL_NAME; @@ -2700,7 +2786,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ResourceNotFoundError *) noexcept; - /* This needs to be defined so that `ResourceNotFoundError` can be used as a key in maps. */ + /* This needs to be defined so that `ResourceNotFoundError` can be used as a + * key in maps. */ bool operator<(const ResourceNotFoundError &) const noexcept; static const char *MODEL_NAME; @@ -2724,7 +2811,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateResponse` can be used as a key in maps. */ + /* This needs to be defined so that `DeferComponentUpdateResponse` can be used + * as a key in maps. */ bool operator<(const DeferComponentUpdateResponse &) const noexcept; static const char *MODEL_NAME; @@ -2751,7 +2839,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateRequest` can be used as a key in maps. */ + /* This needs to be defined so that `DeferComponentUpdateRequest` can be used + * as a key in maps. */ bool operator<(const DeferComponentUpdateRequest &) const noexcept; static const char *MODEL_NAME; @@ -2777,7 +2866,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidArtifactsDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can + * be used as a key in maps. */ bool operator<(const InvalidArtifactsDirectoryPathError &) const noexcept; static const char *MODEL_NAME; @@ -2801,7 +2891,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidRecipeDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be + * used as a key in maps. */ bool operator<(const InvalidRecipeDirectoryPathError &) const noexcept; static const char *MODEL_NAME; @@ -2825,7 +2916,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateLocalDeploymentResponse *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentResponse` can be used as a key in maps. */ + /* This needs to be defined so that `CreateLocalDeploymentResponse` can be + * used as a key in maps. */ bool operator<(const CreateLocalDeploymentResponse &) const noexcept; static const char *MODEL_NAME; @@ -2899,7 +2991,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used as a key in maps. */ + /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used + * as a key in maps. */ bool operator<(const CreateLocalDeploymentRequest &) const noexcept; static const char *MODEL_NAME; @@ -2946,7 +3039,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordResponse` can be used as a key in maps. */ + /* This needs to be defined so that `CreateDebugPasswordResponse` can be used + * as a key in maps. */ bool operator<(const CreateDebugPasswordResponse &) const noexcept; static const char *MODEL_NAME; @@ -2972,7 +3066,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordRequest` can be used as a key in maps. */ + /* This needs to be defined so that `CreateDebugPasswordRequest` can be used + * as a key in maps. */ bool operator<(const CreateDebugPasswordRequest &) const noexcept; static const char *MODEL_NAME; @@ -2995,7 +3090,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidClientDeviceAuthTokenError *) noexcept; - /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be + * used as a key in maps. */ bool operator<(const InvalidClientDeviceAuthTokenError &) const noexcept; static const char *MODEL_NAME; @@ -3019,7 +3115,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(InvalidArgumentsError *) noexcept; - /* This needs to be defined so that `InvalidArgumentsError` can be used as a key in maps. */ + /* This needs to be defined so that `InvalidArgumentsError` can be used as a + * key in maps. */ bool operator<(const InvalidArgumentsError &) const noexcept; static const char *MODEL_NAME; @@ -3043,7 +3140,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in maps. */ + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ bool operator<(const ServiceError &) const noexcept; static const char *MODEL_NAME; @@ -3067,7 +3165,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UnauthorizedError *) noexcept; - /* This needs to be defined so that `UnauthorizedError` can be used as a key in maps. */ + /* This needs to be defined so that `UnauthorizedError` can be used as a key + * in maps. */ bool operator<(const UnauthorizedError &) const noexcept; static const char *MODEL_NAME; @@ -3091,7 +3190,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(AuthorizeClientDeviceActionResponse *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can be used as a key in maps. */ + /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can + * be used as a key in maps. */ bool operator<(const AuthorizeClientDeviceActionResponse &) const noexcept; static const char *MODEL_NAME; @@ -3122,7 +3222,8 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(AuthorizeClientDeviceActionRequest *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can be used as a key in maps. */ + /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can + * be used as a key in maps. */ bool operator<(const AuthorizeClientDeviceActionRequest &) const noexcept; static const char *MODEL_NAME; @@ -3141,8 +3242,10 @@ namespace Aws virtual void OnStreamEvent(IoTCoreMessage *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -3161,7 +3264,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `UnauthorizedError`. + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. * @param operationError The error message being received. */ virtual bool OnStreamError(UnauthorizedError *operationError) @@ -3171,7 +3275,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -3186,7 +3291,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -3241,8 +3347,10 @@ namespace Aws /** * Used to activate a stream for the `SubscribeToIoTCoreOperation` * @param request The request used for the `SubscribeToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToIoTCoreRequest &request, @@ -3304,8 +3412,10 @@ namespace Aws /** * Used to activate a stream for the `ResumeComponentOperation` * @param request The request used for the `ResumeComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const ResumeComponentRequest &request, @@ -3367,8 +3477,10 @@ namespace Aws /** * Used to activate a stream for the `PublishToIoTCoreOperation` * @param request The request used for the `PublishToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const PublishToIoTCoreRequest &request, @@ -3388,8 +3500,10 @@ namespace Aws virtual void OnStreamEvent(ConfigurationUpdateEvents *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -3408,7 +3522,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `ResourceNotFoundError`. + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. * @param operationError The error message being received. */ virtual bool OnStreamError(ResourceNotFoundError *operationError) @@ -3418,7 +3533,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -3433,7 +3549,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -3490,9 +3607,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `SubscribeToConfigurationUpdateOperation` - * @param request The request used for the `SubscribeToConfigurationUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `SubscribeToConfigurationUpdateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToConfigurationUpdateRequest &request, @@ -3554,8 +3674,10 @@ namespace Aws /** * Used to activate a stream for the `DeleteThingShadowOperation` * @param request The request used for the `DeleteThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const DeleteThingShadowRequest &request, @@ -3617,8 +3739,10 @@ namespace Aws /** * Used to activate a stream for the `PutComponentMetricOperation` * @param request The request used for the `PutComponentMetricOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const PutComponentMetricRequest &request, @@ -3682,8 +3806,10 @@ namespace Aws /** * Used to activate a stream for the `DeferComponentUpdateOperation` * @param request The request used for the `DeferComponentUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const DeferComponentUpdateRequest &request, @@ -3703,8 +3829,10 @@ namespace Aws virtual void OnStreamEvent(ValidateConfigurationUpdateEvents *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -3723,7 +3851,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -3738,7 +3867,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -3796,10 +3926,14 @@ namespace Aws const SubscribeToValidateConfigurationUpdatesOperationContext &operationContext, Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** - * Used to activate a stream for the `SubscribeToValidateConfigurationUpdatesOperation` - * @param request The request used for the `SubscribeToValidateConfigurationUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * Used to activate a stream for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param request The request used for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToValidateConfigurationUpdatesRequest &request, @@ -3861,8 +3995,10 @@ namespace Aws /** * Used to activate a stream for the `GetConfigurationOperation` * @param request The request used for the `GetConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetConfigurationRequest &request, @@ -3882,8 +4018,10 @@ namespace Aws virtual void OnStreamEvent(SubscriptionResponseMessage *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -3892,7 +4030,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `InvalidArgumentsError`. + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. * @param operationError The error message being received. */ virtual bool OnStreamError(InvalidArgumentsError *operationError) @@ -3912,7 +4051,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `UnauthorizedError`. + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. * @param operationError The error message being received. */ virtual bool OnStreamError(UnauthorizedError *operationError) @@ -3922,7 +4062,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -3937,7 +4078,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -3992,8 +4134,10 @@ namespace Aws /** * Used to activate a stream for the `SubscribeToTopicOperation` * @param request The request used for the `SubscribeToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToTopicRequest &request, @@ -4055,8 +4199,10 @@ namespace Aws /** * Used to activate a stream for the `GetComponentDetailsOperation` * @param request The request used for the `GetComponentDetailsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetComponentDetailsRequest &request, @@ -4121,8 +4267,10 @@ namespace Aws /** * Used to activate a stream for the `GetClientDeviceAuthTokenOperation` * @param request The request used for the `GetClientDeviceAuthTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetClientDeviceAuthTokenRequest &request, @@ -4184,8 +4332,10 @@ namespace Aws /** * Used to activate a stream for the `PublishToTopicOperation` * @param request The request used for the `PublishToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const PublishToTopicRequest &request, @@ -4205,8 +4355,10 @@ namespace Aws virtual void OnStreamEvent(CertificateUpdateEvent *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -4225,7 +4377,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `UnauthorizedError`. + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. * @param operationError The error message being received. */ virtual bool OnStreamError(UnauthorizedError *operationError) @@ -4235,7 +4388,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `InvalidArgumentsError`. + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. * @param operationError The error message being received. */ virtual bool OnStreamError(InvalidArgumentsError *operationError) @@ -4245,7 +4399,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -4260,7 +4415,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -4317,9 +4473,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `SubscribeToCertificateUpdatesOperation` - * @param request The request used for the `SubscribeToCertificateUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `SubscribeToCertificateUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToCertificateUpdatesRequest &request, @@ -4383,9 +4542,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `VerifyClientDeviceIdentityOperation` - * @param request The request used for the `VerifyClientDeviceIdentityOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `VerifyClientDeviceIdentityOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const VerifyClientDeviceIdentityRequest &request, @@ -4449,9 +4611,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `AuthorizeClientDeviceActionOperation` - * @param request The request used for the `AuthorizeClientDeviceActionOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `AuthorizeClientDeviceActionOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const AuthorizeClientDeviceActionRequest &request, @@ -4513,8 +4678,10 @@ namespace Aws /** * Used to activate a stream for the `ListComponentsOperation` * @param request The request used for the `ListComponentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const ListComponentsRequest &request, @@ -4576,8 +4743,10 @@ namespace Aws /** * Used to activate a stream for the `CreateDebugPasswordOperation` * @param request The request used for the `CreateDebugPasswordOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const CreateDebugPasswordRequest &request, @@ -4639,8 +4808,10 @@ namespace Aws /** * Used to activate a stream for the `GetThingShadowOperation` * @param request The request used for the `GetThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetThingShadowRequest &request, @@ -4703,10 +4874,14 @@ namespace Aws const SendConfigurationValidityReportOperationContext &operationContext, Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** - * Used to activate a stream for the `SendConfigurationValidityReportOperation` - * @param request The request used for the `SendConfigurationValidityReportOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * Used to activate a stream for the + * `SendConfigurationValidityReportOperation` + * @param request The request used for the + * `SendConfigurationValidityReportOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SendConfigurationValidityReportRequest &request, @@ -4768,8 +4943,10 @@ namespace Aws /** * Used to activate a stream for the `UpdateThingShadowOperation` * @param request The request used for the `UpdateThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const UpdateThingShadowRequest &request, @@ -4831,8 +5008,10 @@ namespace Aws /** * Used to activate a stream for the `UpdateConfigurationOperation` * @param request The request used for the `UpdateConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const UpdateConfigurationRequest &request, @@ -4896,9 +5075,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `ValidateAuthorizationTokenOperation` - * @param request The request used for the `ValidateAuthorizationTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `ValidateAuthorizationTokenOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const ValidateAuthorizationTokenRequest &request, @@ -4960,8 +5142,10 @@ namespace Aws /** * Used to activate a stream for the `RestartComponentOperation` * @param request The request used for the `RestartComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const RestartComponentRequest &request, @@ -5026,8 +5210,10 @@ namespace Aws /** * Used to activate a stream for the `GetLocalDeploymentStatusOperation` * @param request The request used for the `GetLocalDeploymentStatusOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetLocalDeploymentStatusRequest &request, @@ -5089,8 +5275,10 @@ namespace Aws /** * Used to activate a stream for the `GetSecretValueOperation` * @param request The request used for the `GetSecretValueOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const GetSecretValueRequest &request, @@ -5152,8 +5340,10 @@ namespace Aws /** * Used to activate a stream for the `UpdateStateOperation` * @param request The request used for the `UpdateStateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const UpdateStateRequest &request, @@ -5218,8 +5408,10 @@ namespace Aws /** * Used to activate a stream for the `ListNamedShadowsForThingOperation` * @param request The request used for the `ListNamedShadowsForThingOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const ListNamedShadowsForThingRequest &request, @@ -5239,8 +5431,10 @@ namespace Aws virtual void OnStreamEvent(ComponentUpdatePolicyEvents *response) { (void)response; } /** - * A callback that is invoked when an error occurs while parsing a message from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT error. + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. */ virtual bool OnStreamError(RpcError rpcError) { @@ -5259,7 +5453,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving an error of type `ResourceNotFoundError`. + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. * @param operationError The error message being received. */ virtual bool OnStreamError(ResourceNotFoundError *operationError) @@ -5269,7 +5464,8 @@ namespace Aws } /** - * A callback that is invoked upon receiving ANY error response from the server. + * A callback that is invoked upon receiving ANY error response from the + * server. * @param operationError The error message being received. */ virtual bool OnStreamError(OperationError *operationError) @@ -5284,7 +5480,8 @@ namespace Aws */ void OnStreamEvent(Aws::Crt::ScopedResource response) override; /** - * Invoked when a message is received on this continuation but results in an error. + * Invoked when a message is received on this continuation but results in an + * error. * * This callback can return true so that the stream is closed afterwards. */ @@ -5341,9 +5538,12 @@ namespace Aws Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; /** * Used to activate a stream for the `SubscribeToComponentUpdatesOperation` - * @param request The request used for the `SubscribeToComponentUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param request The request used for the + * `SubscribeToComponentUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const SubscribeToComponentUpdatesRequest &request, @@ -5407,8 +5607,10 @@ namespace Aws /** * Used to activate a stream for the `ListLocalDeploymentsOperation` * @param request The request used for the `ListLocalDeploymentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const ListLocalDeploymentsRequest &request, @@ -5470,8 +5672,10 @@ namespace Aws /** * Used to activate a stream for the `StopComponentOperation` * @param request The request used for the `StopComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const StopComponentRequest &request, @@ -5533,8 +5737,10 @@ namespace Aws /** * Used to activate a stream for the `PauseComponentOperation` * @param request The request used for the `PauseComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const PauseComponentRequest &request, @@ -5598,8 +5804,10 @@ namespace Aws /** * Used to activate a stream for the `CreateLocalDeploymentOperation` * @param request The request used for the `CreateLocalDeploymentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed. - * @return An `RpcError` that can be used to check whether the stream was activated. + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. */ std::future Activate( const CreateLocalDeploymentRequest &request, diff --git a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp index c9c9eb3ba..84b2dfdb9 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -57,9 +57,15 @@ namespace Aws return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); } - void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } + void GreengrassCoreIpcClient::Close() noexcept + { + m_connection.Close(); + } - GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } + GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept + { + Close(); + } std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToIoTCore( std::shared_ptr streamHandler) noexcept diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index 29db80142..dd5cb6d2a 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -32,7 +32,10 @@ namespace Aws const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; - Aws::Crt::String MessageContext::GetModelName() const noexcept { return MessageContext::MODEL_NAME; } + Aws::Crt::String MessageContext::GetModelName() const noexcept + { + return MessageContext::MODEL_NAME; + } Aws::Crt::ScopedResource MessageContext::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -199,7 +202,10 @@ namespace Aws const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; - Aws::Crt::String MQTTMessage::GetModelName() const noexcept { return MQTTMessage::MODEL_NAME; } + Aws::Crt::String MQTTMessage::GetModelName() const noexcept + { + return MQTTMessage::MODEL_NAME; + } Aws::Crt::ScopedResource MQTTMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -455,7 +461,10 @@ namespace Aws const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; - Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { return CertificateUpdate::MODEL_NAME; } + Aws::Crt::String CertificateUpdate::GetModelName() const noexcept + { + return CertificateUpdate::MODEL_NAME; + } Aws::Crt::ScopedResource CertificateUpdate::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -571,7 +580,10 @@ namespace Aws const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; - Aws::Crt::String Metric::GetModelName() const noexcept { return Metric::MODEL_NAME; } + Aws::Crt::String Metric::GetModelName() const noexcept + { + return Metric::MODEL_NAME; + } Aws::Crt::ScopedResource Metric::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -631,7 +643,10 @@ namespace Aws const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; - Aws::Crt::String BinaryMessage::GetModelName() const noexcept { return BinaryMessage::MODEL_NAME; } + Aws::Crt::String BinaryMessage::GetModelName() const noexcept + { + return BinaryMessage::MODEL_NAME; + } Aws::Crt::ScopedResource BinaryMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -684,7 +699,10 @@ namespace Aws const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; - Aws::Crt::String JsonMessage::GetModelName() const noexcept { return JsonMessage::MODEL_NAME; } + Aws::Crt::String JsonMessage::GetModelName() const noexcept + { + return JsonMessage::MODEL_NAME; + } Aws::Crt::ScopedResource JsonMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -752,7 +770,10 @@ namespace Aws const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; - Aws::Crt::String MQTTCredential::GetModelName() const noexcept { return MQTTCredential::MODEL_NAME; } + Aws::Crt::String MQTTCredential::GetModelName() const noexcept + { + return MQTTCredential::MODEL_NAME; + } Aws::Crt::ScopedResource MQTTCredential::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -813,7 +834,10 @@ namespace Aws const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; - Aws::Crt::String RunWithInfo::GetModelName() const noexcept { return RunWithInfo::MODEL_NAME; } + Aws::Crt::String RunWithInfo::GetModelName() const noexcept + { + return RunWithInfo::MODEL_NAME; + } Aws::Crt::ScopedResource RunWithInfo::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -894,8 +918,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void ValidateConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void ValidateConfigurationUpdateEvents::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && m_validateConfigurationUpdateEvent.has_value()) @@ -1076,7 +1100,10 @@ namespace Aws const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; - Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { return IoTCoreMessage::MODEL_NAME; } + Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept + { + return IoTCoreMessage::MODEL_NAME; + } Aws::Crt::ScopedResource IoTCoreMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1348,7 +1375,10 @@ namespace Aws const char *CertificateOptions::MODEL_NAME = "aws.greengrass#CertificateOptions"; - Aws::Crt::String CertificateOptions::GetModelName() const noexcept { return CertificateOptions::MODEL_NAME; } + Aws::Crt::String CertificateOptions::GetModelName() const noexcept + { + return CertificateOptions::MODEL_NAME; + } Aws::Crt::ScopedResource CertificateOptions::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1520,7 +1550,10 @@ namespace Aws const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; - Aws::Crt::String PublishMessage::GetModelName() const noexcept { return PublishMessage::MODEL_NAME; } + Aws::Crt::String PublishMessage::GetModelName() const noexcept + { + return PublishMessage::MODEL_NAME; + } Aws::Crt::ScopedResource PublishMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1593,7 +1626,10 @@ namespace Aws const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; - Aws::Crt::String SecretValue::GetModelName() const noexcept { return SecretValue::MODEL_NAME; } + Aws::Crt::String SecretValue::GetModelName() const noexcept + { + return SecretValue::MODEL_NAME; + } Aws::Crt::ScopedResource SecretValue::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1690,7 +1726,10 @@ namespace Aws const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; - Aws::Crt::String LocalDeployment::GetModelName() const noexcept { return LocalDeployment::MODEL_NAME; } + Aws::Crt::String LocalDeployment::GetModelName() const noexcept + { + return LocalDeployment::MODEL_NAME; + } Aws::Crt::ScopedResource LocalDeployment::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1832,7 +1871,10 @@ namespace Aws const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; - Aws::Crt::String ComponentDetails::GetModelName() const noexcept { return ComponentDetails::MODEL_NAME; } + Aws::Crt::String ComponentDetails::GetModelName() const noexcept + { + return ComponentDetails::MODEL_NAME; + } Aws::Crt::ScopedResource ComponentDetails::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1890,7 +1932,10 @@ namespace Aws const char *CredentialDocument::MODEL_NAME = "aws.greengrass#CredentialDocument"; - Aws::Crt::String CredentialDocument::GetModelName() const noexcept { return CredentialDocument::MODEL_NAME; } + Aws::Crt::String CredentialDocument::GetModelName() const noexcept + { + return CredentialDocument::MODEL_NAME; + } Aws::Crt::ScopedResource CredentialDocument::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1913,8 +1958,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void VerifyClientDeviceIdentityResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void VerifyClientDeviceIdentityResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_isValidClientDevice.has_value()) { @@ -1963,8 +2008,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void VerifyClientDeviceIdentityRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void VerifyClientDeviceIdentityRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_credential.has_value()) { @@ -2035,7 +2080,10 @@ namespace Aws const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; - Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { return InvalidTokenError::MODEL_NAME; } + Aws::Crt::String InvalidTokenError::GetModelName() const noexcept + { + return InvalidTokenError::MODEL_NAME; + } Aws::Crt::ScopedResource InvalidTokenError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2058,8 +2106,8 @@ namespace Aws OperationError::s_customDeleter(static_cast(shape)); } - void ValidateAuthorizationTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void ValidateAuthorizationTokenResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_isValid.has_value()) { @@ -2107,8 +2155,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void ValidateAuthorizationTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void ValidateAuthorizationTokenRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_token.has_value()) { @@ -2295,7 +2343,10 @@ namespace Aws const char *UpdateStateResponse::MODEL_NAME = "aws.greengrass#UpdateStateResponse"; - Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { return UpdateStateResponse::MODEL_NAME; } + Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept + { + return UpdateStateResponse::MODEL_NAME; + } Aws::Crt::ScopedResource UpdateStateResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2369,7 +2420,10 @@ namespace Aws const char *UpdateStateRequest::MODEL_NAME = "aws.greengrass#UpdateStateRequest"; - Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { return UpdateStateRequest::MODEL_NAME; } + Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept + { + return UpdateStateRequest::MODEL_NAME; + } Aws::Crt::ScopedResource UpdateStateRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2460,7 +2514,10 @@ namespace Aws const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; - Aws::Crt::String ConflictError::GetModelName() const noexcept { return ConflictError::MODEL_NAME; } + Aws::Crt::String ConflictError::GetModelName() const noexcept + { + return ConflictError::MODEL_NAME; + } Aws::Crt::ScopedResource ConflictError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2951,8 +3008,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { (void)payloadObject; } @@ -2996,8 +3053,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_componentName.has_value()) { @@ -3070,8 +3127,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToComponentUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToComponentUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { (void)payloadObject; } @@ -3114,8 +3171,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToComponentUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToComponentUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { (void)payloadObject; } @@ -3158,8 +3215,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { (void)payloadObject; } @@ -3203,8 +3260,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_certificateOptions.has_value()) { @@ -3390,8 +3447,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SendConfigurationValidityReportResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SendConfigurationValidityReportResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { (void)payloadObject; } @@ -3435,8 +3492,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SendConfigurationValidityReportRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void SendConfigurationValidityReportRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_configurationValidityReport.has_value()) { @@ -5553,8 +5610,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void InvalidArtifactsDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void InvalidArtifactsDirectoryPathError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_message.has_value()) { @@ -5989,8 +6046,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void InvalidClientDeviceAuthTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void InvalidClientDeviceAuthTokenError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_message.has_value()) { @@ -6102,7 +6159,10 @@ namespace Aws const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; - Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } + Aws::Crt::String ServiceError::GetModelName() const noexcept + { + return ServiceError::MODEL_NAME; + } Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -6145,7 +6205,10 @@ namespace Aws const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; - Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { return UnauthorizedError::MODEL_NAME; } + Aws::Crt::String UnauthorizedError::GetModelName() const noexcept + { + return UnauthorizedError::MODEL_NAME; + } Aws::Crt::ScopedResource UnauthorizedError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -6168,8 +6231,8 @@ namespace Aws OperationError::s_customDeleter(static_cast(shape)); } - void AuthorizeClientDeviceActionResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void AuthorizeClientDeviceActionResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_isAuthorized.has_value()) { @@ -6218,8 +6281,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void AuthorizeClientDeviceActionRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept + void AuthorizeClientDeviceActionRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { if (m_clientDeviceAuthToken.has_value()) { @@ -6324,15 +6387,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); } @@ -6347,8 +6410,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); } - Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); } @@ -6361,7 +6424,7 @@ namespace Aws std::future SubscribeToIoTCoreOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); } SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( @@ -6399,8 +6462,8 @@ namespace Aws } Aws::Crt::ScopedResource ResumeComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6417,8 +6480,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); } - Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6431,7 +6494,7 @@ namespace Aws std::future ResumeComponentOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); } ResumeComponentOperation::ResumeComponentOperation( @@ -6461,15 +6524,15 @@ namespace Aws } Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6486,8 +6549,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); } - Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6500,7 +6563,7 @@ namespace Aws std::future PublishToIoTCoreOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); } PublishToIoTCoreOperation::PublishToIoTCoreOperation( @@ -6562,15 +6625,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); } @@ -6598,9 +6661,9 @@ namespace Aws std::future SubscribeToConfigurationUpdateOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, + [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); } SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( @@ -6631,15 +6694,15 @@ namespace Aws } Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return DeleteThingShadowResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6656,8 +6719,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); } - Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6670,7 +6733,7 @@ namespace Aws std::future DeleteThingShadowOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); } DeleteThingShadowOperation::DeleteThingShadowOperation( @@ -6700,15 +6763,15 @@ namespace Aws } Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return PutComponentMetricResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6725,8 +6788,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); } - Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6739,7 +6802,7 @@ namespace Aws std::future PutComponentMetricOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); } PutComponentMetricOperation::PutComponentMetricOperation( @@ -6769,15 +6832,15 @@ namespace Aws } Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6794,8 +6857,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); } - Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6808,7 +6871,7 @@ namespace Aws std::future DeferComponentUpdateOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); } DeferComponentUpdateOperation::DeferComponentUpdateOperation( @@ -6865,15 +6928,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); } @@ -6883,8 +6946,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); } - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() const - noexcept + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() + const noexcept { return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); } @@ -6903,9 +6966,9 @@ namespace Aws std::future SubscribeToValidateConfigurationUpdatesOperation:: GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, + [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); } SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( @@ -6936,15 +6999,15 @@ namespace Aws } Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -6961,8 +7024,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); } - Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -6975,7 +7038,7 @@ namespace Aws std::future GetConfigurationOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); } GetConfigurationOperation::GetConfigurationOperation( @@ -7042,15 +7105,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscriptionResponseMessage::s_allocateFromPayload(stringView, allocator); } @@ -7065,8 +7128,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); } - Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); } @@ -7079,7 +7142,7 @@ namespace Aws std::future SubscribeToTopicOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); } SubscribeToTopicOperation::SubscribeToTopicOperation( @@ -7110,15 +7173,15 @@ namespace Aws } Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return GetComponentDetailsResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7135,8 +7198,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); } - Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7149,7 +7212,7 @@ namespace Aws std::future GetComponentDetailsOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); } GetComponentDetailsOperation::GetComponentDetailsOperation( @@ -7179,15 +7242,15 @@ namespace Aws } Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7218,7 +7281,7 @@ namespace Aws std::future GetClientDeviceAuthTokenOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); } GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( @@ -7255,8 +7318,8 @@ namespace Aws } Aws::Crt::ScopedResource PublishToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7273,8 +7336,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); } - Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7287,7 +7350,7 @@ namespace Aws std::future PublishToTopicOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); } PublishToTopicOperation::PublishToTopicOperation( @@ -7355,15 +7418,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); } @@ -7391,9 +7454,9 @@ namespace Aws std::future SubscribeToCertificateUpdatesOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, + [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); } SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( @@ -7424,15 +7487,15 @@ namespace Aws } Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7462,9 +7525,8 @@ namespace Aws std::future VerifyClientDeviceIdentityOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return VerifyClientDeviceIdentityResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); } VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( @@ -7494,15 +7556,15 @@ namespace Aws } Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7532,9 +7594,8 @@ namespace Aws std::future AuthorizeClientDeviceActionOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return AuthorizeClientDeviceActionResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); } AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( @@ -7571,8 +7632,8 @@ namespace Aws } Aws::Crt::ScopedResource ListComponentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7589,8 +7650,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); } - Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7603,7 +7664,7 @@ namespace Aws std::future ListComponentsOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return ListComponentsResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return ListComponentsResult(GetOperationResult().get()); }); } ListComponentsOperation::ListComponentsOperation( @@ -7633,15 +7694,15 @@ namespace Aws } Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7658,8 +7719,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); } - Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7672,7 +7733,7 @@ namespace Aws std::future CreateDebugPasswordOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); } CreateDebugPasswordOperation::CreateDebugPasswordOperation( @@ -7709,8 +7770,8 @@ namespace Aws } Aws::Crt::ScopedResource GetThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7727,8 +7788,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); } - Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7741,7 +7802,7 @@ namespace Aws std::future GetThingShadowOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); } GetThingShadowOperation::GetThingShadowOperation( @@ -7771,15 +7832,15 @@ namespace Aws } Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SendConfigurationValidityReportResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7810,9 +7871,9 @@ namespace Aws std::future SendConfigurationValidityReportOperation:: GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return SendConfigurationValidityReportResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, + [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); } SendConfigurationValidityReportOperation::SendConfigurationValidityReportOperation( @@ -7842,15 +7903,15 @@ namespace Aws } Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return UpdateThingShadowResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7867,8 +7928,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); } - Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7881,7 +7942,7 @@ namespace Aws std::future UpdateThingShadowOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); } UpdateThingShadowOperation::UpdateThingShadowOperation( @@ -7911,15 +7972,15 @@ namespace Aws } Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return UpdateConfigurationResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -7936,8 +7997,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); } - Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -7950,7 +8011,7 @@ namespace Aws std::future UpdateConfigurationOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); } UpdateConfigurationOperation::UpdateConfigurationOperation( @@ -7980,15 +8041,15 @@ namespace Aws } Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8018,9 +8079,8 @@ namespace Aws std::future ValidateAuthorizationTokenOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return ValidateAuthorizationTokenResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); } ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( @@ -8050,15 +8110,15 @@ namespace Aws } Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8075,8 +8135,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); } - Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -8089,7 +8149,7 @@ namespace Aws std::future RestartComponentOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return RestartComponentResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return RestartComponentResult(GetOperationResult().get()); }); } RestartComponentOperation::RestartComponentOperation( @@ -8119,15 +8179,15 @@ namespace Aws } Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8158,7 +8218,7 @@ namespace Aws std::future GetLocalDeploymentStatusOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); } GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( @@ -8195,8 +8255,8 @@ namespace Aws } Aws::Crt::ScopedResource GetSecretValueOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8213,8 +8273,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); } - Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -8227,7 +8287,7 @@ namespace Aws std::future GetSecretValueOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); } GetSecretValueOperation::GetSecretValueOperation( @@ -8294,8 +8354,7 @@ namespace Aws std::future UpdateStateOperation::GetResult() noexcept { - return std::async( - std::launch::deferred, [this]() { return UpdateStateResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return UpdateStateResult(GetOperationResult().get()); }); } UpdateStateOperation::UpdateStateOperation( @@ -8325,15 +8384,15 @@ namespace Aws } Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8364,7 +8423,7 @@ namespace Aws std::future ListNamedShadowsForThingOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); } ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( @@ -8426,15 +8485,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, allocator); } @@ -8462,9 +8521,8 @@ namespace Aws std::future SubscribeToComponentUpdatesOperation::GetResult() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); + return std::async( + std::launch::async, [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); } SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( @@ -8495,15 +8553,15 @@ namespace Aws } Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8520,8 +8578,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); } - Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -8534,7 +8592,7 @@ namespace Aws std::future ListLocalDeploymentsOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); } ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( @@ -8589,8 +8647,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#StopComponentResponse"); } - Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -8602,8 +8660,7 @@ namespace Aws std::future StopComponentOperation::GetResult() noexcept { - return std::async( - std::launch::deferred, [this]() { return StopComponentResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { return StopComponentResult(GetOperationResult().get()); }); } StopComponentOperation::StopComponentOperation( @@ -8640,8 +8697,8 @@ namespace Aws } Aws::Crt::ScopedResource PauseComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8658,8 +8715,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); } - Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() const - noexcept + Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() + const noexcept { return Aws::Crt::Optional(); } @@ -8672,7 +8729,7 @@ namespace Aws std::future PauseComponentOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return PauseComponentResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return PauseComponentResult(GetOperationResult().get()); }); } PauseComponentOperation::PauseComponentOperation( @@ -8702,15 +8759,15 @@ namespace Aws } Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) + const noexcept { (void)stringView; (void)allocator; @@ -8741,7 +8798,7 @@ namespace Aws std::future CreateLocalDeploymentOperation::GetResult() noexcept { return std::async( - std::launch::deferred, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + std::launch::async, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); } CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( From 173435c4e2badf13672082bba78cb5176fd055cc Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 17 Jan 2023 16:04:24 -0800 Subject: [PATCH 2/8] fix format --- eventstream_rpc/tests/EchoTestRpcClient.cpp | 10 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 75 +-- .../source/GreengrassCoreIpcClient.cpp | 10 +- .../source/GreengrassCoreIpcModel.cpp | 505 ++++++++---------- 4 files changed, 246 insertions(+), 354 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index 5316b1a6f..95b6dcbd6 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -20,15 +20,9 @@ namespace Awstest return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); } - void EchoTestRpcClient::Close() noexcept - { - m_connection.Close(); - } + void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } - EchoTestRpcClient::~EchoTestRpcClient() noexcept - { - Close(); - } + EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } std::shared_ptr EchoTestRpcClient::NewGetAllProducts() noexcept { diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index 872d7eeda..b485ad847 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -29,10 +29,7 @@ namespace Awstest const char *Product::MODEL_NAME = "awstest#Product"; - Aws::Crt::String Product::GetModelName() const noexcept - { - return Product::MODEL_NAME; - } + Aws::Crt::String Product::GetModelName() const noexcept { return Product::MODEL_NAME; } Aws::Crt::ScopedResource Product::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -88,10 +85,7 @@ namespace Awstest const char *Customer::MODEL_NAME = "awstest#Customer"; - Aws::Crt::String Customer::GetModelName() const noexcept - { - return Customer::MODEL_NAME; - } + Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::MODEL_NAME; } Aws::Crt::ScopedResource Customer::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -139,10 +133,7 @@ namespace Awstest const char *Pair::MODEL_NAME = "awstest#Pair"; - Aws::Crt::String Pair::GetModelName() const noexcept - { - return Pair::MODEL_NAME; - } + Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::MODEL_NAME; } Aws::Crt::ScopedResource Pair::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -345,10 +336,7 @@ namespace Awstest const char *MessageData::MODEL_NAME = "awstest#MessageData"; - Aws::Crt::String MessageData::GetModelName() const noexcept - { - return MessageData::MODEL_NAME; - } + Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::MODEL_NAME; } Aws::Crt::ScopedResource MessageData::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -424,10 +412,7 @@ namespace Awstest const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; - Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept - { - return EchoStreamingMessage::MODEL_NAME; - } + Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { return EchoStreamingMessage::MODEL_NAME; } Aws::Crt::ScopedResource EchoStreamingMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -525,10 +510,7 @@ namespace Awstest const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; - Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept - { - return GetAllProductsRequest::MODEL_NAME; - } + Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { return GetAllProductsRequest::MODEL_NAME; } Aws::Crt::ScopedResource GetAllProductsRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -677,10 +659,7 @@ namespace Awstest const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; - Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept - { - return EchoMessageResponse::MODEL_NAME; - } + Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { return EchoMessageResponse::MODEL_NAME; } Aws::Crt::ScopedResource EchoMessageResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -726,10 +705,7 @@ namespace Awstest const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; - Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept - { - return EchoMessageRequest::MODEL_NAME; - } + Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::MODEL_NAME; } Aws::Crt::ScopedResource EchoMessageRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -767,10 +743,7 @@ namespace Awstest const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; - Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept - { - return EchoStreamingResponse::MODEL_NAME; - } + Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { return EchoStreamingResponse::MODEL_NAME; } Aws::Crt::ScopedResource EchoStreamingResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -808,10 +781,7 @@ namespace Awstest const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; - Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept - { - return EchoStreamingRequest::MODEL_NAME; - } + Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { return EchoStreamingRequest::MODEL_NAME; } Aws::Crt::ScopedResource EchoStreamingRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -860,10 +830,7 @@ namespace Awstest const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; - Aws::Crt::String ServiceError::GetModelName() const noexcept - { - return ServiceError::MODEL_NAME; - } + Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1066,8 +1033,8 @@ namespace Awstest return Aws::Crt::String("awstest#CauseServiceErrorResponse"); } - Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -1133,15 +1100,15 @@ namespace Awstest } Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); } @@ -1227,8 +1194,8 @@ namespace Awstest } Aws::Crt::ScopedResource EchoStreamMessagesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); } @@ -1243,8 +1210,8 @@ namespace Awstest return Aws::Crt::String("awstest#EchoStreamingResponse"); } - Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::String("awstest#EchoStreamingMessage"); } diff --git a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp index 84b2dfdb9..c9c9eb3ba 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -57,15 +57,9 @@ namespace Aws return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); } - void GreengrassCoreIpcClient::Close() noexcept - { - m_connection.Close(); - } + void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } - GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept - { - Close(); - } + GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToIoTCore( std::shared_ptr streamHandler) noexcept diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index dd5cb6d2a..4cf999968 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -32,10 +32,7 @@ namespace Aws const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; - Aws::Crt::String MessageContext::GetModelName() const noexcept - { - return MessageContext::MODEL_NAME; - } + Aws::Crt::String MessageContext::GetModelName() const noexcept { return MessageContext::MODEL_NAME; } Aws::Crt::ScopedResource MessageContext::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -202,10 +199,7 @@ namespace Aws const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; - Aws::Crt::String MQTTMessage::GetModelName() const noexcept - { - return MQTTMessage::MODEL_NAME; - } + Aws::Crt::String MQTTMessage::GetModelName() const noexcept { return MQTTMessage::MODEL_NAME; } Aws::Crt::ScopedResource MQTTMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -461,10 +455,7 @@ namespace Aws const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; - Aws::Crt::String CertificateUpdate::GetModelName() const noexcept - { - return CertificateUpdate::MODEL_NAME; - } + Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { return CertificateUpdate::MODEL_NAME; } Aws::Crt::ScopedResource CertificateUpdate::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -580,10 +571,7 @@ namespace Aws const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; - Aws::Crt::String Metric::GetModelName() const noexcept - { - return Metric::MODEL_NAME; - } + Aws::Crt::String Metric::GetModelName() const noexcept { return Metric::MODEL_NAME; } Aws::Crt::ScopedResource Metric::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -643,10 +631,7 @@ namespace Aws const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; - Aws::Crt::String BinaryMessage::GetModelName() const noexcept - { - return BinaryMessage::MODEL_NAME; - } + Aws::Crt::String BinaryMessage::GetModelName() const noexcept { return BinaryMessage::MODEL_NAME; } Aws::Crt::ScopedResource BinaryMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -699,10 +684,7 @@ namespace Aws const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; - Aws::Crt::String JsonMessage::GetModelName() const noexcept - { - return JsonMessage::MODEL_NAME; - } + Aws::Crt::String JsonMessage::GetModelName() const noexcept { return JsonMessage::MODEL_NAME; } Aws::Crt::ScopedResource JsonMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -770,10 +752,7 @@ namespace Aws const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; - Aws::Crt::String MQTTCredential::GetModelName() const noexcept - { - return MQTTCredential::MODEL_NAME; - } + Aws::Crt::String MQTTCredential::GetModelName() const noexcept { return MQTTCredential::MODEL_NAME; } Aws::Crt::ScopedResource MQTTCredential::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -834,10 +813,7 @@ namespace Aws const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; - Aws::Crt::String RunWithInfo::GetModelName() const noexcept - { - return RunWithInfo::MODEL_NAME; - } + Aws::Crt::String RunWithInfo::GetModelName() const noexcept { return RunWithInfo::MODEL_NAME; } Aws::Crt::ScopedResource RunWithInfo::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -918,8 +894,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void ValidateConfigurationUpdateEvents::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void ValidateConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && m_validateConfigurationUpdateEvent.has_value()) @@ -1100,10 +1076,7 @@ namespace Aws const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; - Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept - { - return IoTCoreMessage::MODEL_NAME; - } + Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { return IoTCoreMessage::MODEL_NAME; } Aws::Crt::ScopedResource IoTCoreMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1375,10 +1348,7 @@ namespace Aws const char *CertificateOptions::MODEL_NAME = "aws.greengrass#CertificateOptions"; - Aws::Crt::String CertificateOptions::GetModelName() const noexcept - { - return CertificateOptions::MODEL_NAME; - } + Aws::Crt::String CertificateOptions::GetModelName() const noexcept { return CertificateOptions::MODEL_NAME; } Aws::Crt::ScopedResource CertificateOptions::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1550,10 +1520,7 @@ namespace Aws const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; - Aws::Crt::String PublishMessage::GetModelName() const noexcept - { - return PublishMessage::MODEL_NAME; - } + Aws::Crt::String PublishMessage::GetModelName() const noexcept { return PublishMessage::MODEL_NAME; } Aws::Crt::ScopedResource PublishMessage::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1626,10 +1593,7 @@ namespace Aws const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; - Aws::Crt::String SecretValue::GetModelName() const noexcept - { - return SecretValue::MODEL_NAME; - } + Aws::Crt::String SecretValue::GetModelName() const noexcept { return SecretValue::MODEL_NAME; } Aws::Crt::ScopedResource SecretValue::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1726,10 +1690,7 @@ namespace Aws const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; - Aws::Crt::String LocalDeployment::GetModelName() const noexcept - { - return LocalDeployment::MODEL_NAME; - } + Aws::Crt::String LocalDeployment::GetModelName() const noexcept { return LocalDeployment::MODEL_NAME; } Aws::Crt::ScopedResource LocalDeployment::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1871,10 +1832,7 @@ namespace Aws const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; - Aws::Crt::String ComponentDetails::GetModelName() const noexcept - { - return ComponentDetails::MODEL_NAME; - } + Aws::Crt::String ComponentDetails::GetModelName() const noexcept { return ComponentDetails::MODEL_NAME; } Aws::Crt::ScopedResource ComponentDetails::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1932,10 +1890,7 @@ namespace Aws const char *CredentialDocument::MODEL_NAME = "aws.greengrass#CredentialDocument"; - Aws::Crt::String CredentialDocument::GetModelName() const noexcept - { - return CredentialDocument::MODEL_NAME; - } + Aws::Crt::String CredentialDocument::GetModelName() const noexcept { return CredentialDocument::MODEL_NAME; } Aws::Crt::ScopedResource CredentialDocument::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -1958,8 +1913,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void VerifyClientDeviceIdentityResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void VerifyClientDeviceIdentityResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_isValidClientDevice.has_value()) { @@ -2008,8 +1963,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void VerifyClientDeviceIdentityRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void VerifyClientDeviceIdentityRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_credential.has_value()) { @@ -2080,10 +2035,7 @@ namespace Aws const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; - Aws::Crt::String InvalidTokenError::GetModelName() const noexcept - { - return InvalidTokenError::MODEL_NAME; - } + Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { return InvalidTokenError::MODEL_NAME; } Aws::Crt::ScopedResource InvalidTokenError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2106,8 +2058,8 @@ namespace Aws OperationError::s_customDeleter(static_cast(shape)); } - void ValidateAuthorizationTokenResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void ValidateAuthorizationTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_isValid.has_value()) { @@ -2155,8 +2107,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void ValidateAuthorizationTokenRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void ValidateAuthorizationTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_token.has_value()) { @@ -2343,10 +2295,7 @@ namespace Aws const char *UpdateStateResponse::MODEL_NAME = "aws.greengrass#UpdateStateResponse"; - Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept - { - return UpdateStateResponse::MODEL_NAME; - } + Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { return UpdateStateResponse::MODEL_NAME; } Aws::Crt::ScopedResource UpdateStateResponse::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2420,10 +2369,7 @@ namespace Aws const char *UpdateStateRequest::MODEL_NAME = "aws.greengrass#UpdateStateRequest"; - Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept - { - return UpdateStateRequest::MODEL_NAME; - } + Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { return UpdateStateRequest::MODEL_NAME; } Aws::Crt::ScopedResource UpdateStateRequest::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -2514,10 +2460,7 @@ namespace Aws const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; - Aws::Crt::String ConflictError::GetModelName() const noexcept - { - return ConflictError::MODEL_NAME; - } + Aws::Crt::String ConflictError::GetModelName() const noexcept { return ConflictError::MODEL_NAME; } Aws::Crt::ScopedResource ConflictError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -3008,8 +2951,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { (void)payloadObject; } @@ -3053,8 +2996,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_componentName.has_value()) { @@ -3127,8 +3070,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToComponentUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToComponentUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { (void)payloadObject; } @@ -3171,8 +3114,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToComponentUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToComponentUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { (void)payloadObject; } @@ -3215,8 +3158,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { (void)payloadObject; } @@ -3260,8 +3203,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_certificateOptions.has_value()) { @@ -3447,8 +3390,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SendConfigurationValidityReportResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SendConfigurationValidityReportResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { (void)payloadObject; } @@ -3492,8 +3435,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void SendConfigurationValidityReportRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void SendConfigurationValidityReportRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_configurationValidityReport.has_value()) { @@ -5610,8 +5553,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void InvalidArtifactsDirectoryPathError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void InvalidArtifactsDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_message.has_value()) { @@ -6046,8 +5989,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void InvalidClientDeviceAuthTokenError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void InvalidClientDeviceAuthTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_message.has_value()) { @@ -6159,10 +6102,7 @@ namespace Aws const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; - Aws::Crt::String ServiceError::GetModelName() const noexcept - { - return ServiceError::MODEL_NAME; - } + Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -6205,10 +6145,7 @@ namespace Aws const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; - Aws::Crt::String UnauthorizedError::GetModelName() const noexcept - { - return UnauthorizedError::MODEL_NAME; - } + Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { return UnauthorizedError::MODEL_NAME; } Aws::Crt::ScopedResource UnauthorizedError::s_allocateFromPayload( Aws::Crt::StringView stringView, @@ -6231,8 +6168,8 @@ namespace Aws OperationError::s_customDeleter(static_cast(shape)); } - void AuthorizeClientDeviceActionResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void AuthorizeClientDeviceActionResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_isAuthorized.has_value()) { @@ -6281,8 +6218,8 @@ namespace Aws AbstractShapeBase::s_customDeleter(static_cast(shape)); } - void AuthorizeClientDeviceActionRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept + void AuthorizeClientDeviceActionRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept { if (m_clientDeviceAuthToken.has_value()) { @@ -6387,15 +6324,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); } @@ -6410,8 +6347,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); } - Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); } @@ -6462,8 +6399,8 @@ namespace Aws } Aws::Crt::ScopedResource ResumeComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -6480,8 +6417,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); } - Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -6524,15 +6461,15 @@ namespace Aws } Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -6549,8 +6486,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); } - Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -6625,15 +6562,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); } @@ -6661,9 +6598,9 @@ namespace Aws std::future SubscribeToConfigurationUpdateOperation::GetResult() noexcept { - return std::async( - std::launch::async, - [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); } SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( @@ -6694,15 +6631,15 @@ namespace Aws } Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return DeleteThingShadowResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -6719,8 +6656,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); } - Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -6763,15 +6700,15 @@ namespace Aws } Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return PutComponentMetricResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -6788,8 +6725,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); } - Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -6832,15 +6769,15 @@ namespace Aws } Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -6857,8 +6794,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); } - Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -6928,15 +6865,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); } @@ -6946,8 +6883,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); } - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() - const noexcept + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() const + noexcept { return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); } @@ -6966,9 +6903,9 @@ namespace Aws std::future SubscribeToValidateConfigurationUpdatesOperation:: GetResult() noexcept { - return std::async( - std::launch::async, - [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); + }); } SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( @@ -6999,15 +6936,15 @@ namespace Aws } Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7024,8 +6961,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); } - Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7105,15 +7042,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscriptionResponseMessage::s_allocateFromPayload(stringView, allocator); } @@ -7128,8 +7065,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); } - Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); } @@ -7173,15 +7110,15 @@ namespace Aws } Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return GetComponentDetailsResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7198,8 +7135,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); } - Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7242,15 +7179,15 @@ namespace Aws } Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7318,8 +7255,8 @@ namespace Aws } Aws::Crt::ScopedResource PublishToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7336,8 +7273,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); } - Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7418,15 +7355,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); } @@ -7454,9 +7391,9 @@ namespace Aws std::future SubscribeToCertificateUpdatesOperation::GetResult() noexcept { - return std::async( - std::launch::async, - [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); + }); } SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( @@ -7487,15 +7424,15 @@ namespace Aws } Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7556,15 +7493,15 @@ namespace Aws } Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7632,8 +7569,8 @@ namespace Aws } Aws::Crt::ScopedResource ListComponentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7650,8 +7587,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); } - Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7694,15 +7631,15 @@ namespace Aws } Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7719,8 +7656,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); } - Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7770,8 +7707,8 @@ namespace Aws } Aws::Crt::ScopedResource GetThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7788,8 +7725,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); } - Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7832,15 +7769,15 @@ namespace Aws } Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SendConfigurationValidityReportResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7871,9 +7808,9 @@ namespace Aws std::future SendConfigurationValidityReportOperation:: GetResult() noexcept { - return std::async( - std::launch::async, - [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SendConfigurationValidityReportResult(GetOperationResult().get()); + }); } SendConfigurationValidityReportOperation::SendConfigurationValidityReportOperation( @@ -7903,15 +7840,15 @@ namespace Aws } Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return UpdateThingShadowResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7928,8 +7865,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); } - Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -7972,15 +7909,15 @@ namespace Aws } Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return UpdateConfigurationResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -7997,8 +7934,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); } - Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8041,15 +7978,15 @@ namespace Aws } Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8110,15 +8047,15 @@ namespace Aws } Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8135,8 +8072,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); } - Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8179,15 +8116,15 @@ namespace Aws } Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8255,8 +8192,8 @@ namespace Aws } Aws::Crt::ScopedResource GetSecretValueOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8273,8 +8210,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); } - Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8384,15 +8321,15 @@ namespace Aws } Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8485,15 +8422,15 @@ namespace Aws } Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, allocator); } @@ -8553,15 +8490,15 @@ namespace Aws } Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8578,8 +8515,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); } - Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8647,8 +8584,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#StopComponentResponse"); } - Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8697,8 +8634,8 @@ namespace Aws } Aws::Crt::ScopedResource PauseComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; @@ -8715,8 +8652,8 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); } - Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() - const noexcept + Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() const + noexcept { return Aws::Crt::Optional(); } @@ -8759,15 +8696,15 @@ namespace Aws } Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, allocator); } Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) - const noexcept + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept { (void)stringView; (void)allocator; From df273f94be89d7102b9bbb217f0e190d92dd3cb2 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 23 Jan 2023 16:10:11 -0800 Subject: [PATCH 3/8] gg model update: add default argument to enable async model --- eventstream_rpc/tests/EchoTestRpcModel.cpp | 80 ++- .../tests/include/awstest/EchoTestRpcModel.h | 12 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 66 +-- .../source/GreengrassCoreIpcModel.cpp | 498 ++++++++++++++---- 4 files changed, 501 insertions(+), 155 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index b485ad847..7b2007927 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -976,9 +976,18 @@ namespace Awstest return Aws::Crt::String("awstest#GetAllProducts"); } - std::future GetAllProductsOperation::GetResult() noexcept + std::future GetAllProductsOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); + } } GetAllProductsOperation::GetAllProductsOperation( @@ -1044,9 +1053,18 @@ namespace Awstest return Aws::Crt::String("awstest#CauseServiceError"); } - std::future CauseServiceErrorOperation::GetResult() noexcept + std::future CauseServiceErrorOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); + } } CauseServiceErrorOperation::CauseServiceErrorOperation( @@ -1134,10 +1152,19 @@ namespace Awstest return Aws::Crt::String("awstest#CauseStreamServiceToError"); } - std::future CauseStreamServiceToErrorOperation::GetResult() noexcept + std::future CauseStreamServiceToErrorOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + } } CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( @@ -1221,10 +1248,18 @@ namespace Awstest return Aws::Crt::String("awstest#EchoStreamMessages"); } - std::future EchoStreamMessagesOperation::GetResult() noexcept + std::future EchoStreamMessagesOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + } } EchoStreamMessagesOperation::EchoStreamMessagesOperation( @@ -1289,9 +1324,17 @@ namespace Awstest return Aws::Crt::String("awstest#EchoMessage"); } - std::future EchoMessageOperation::GetResult() noexcept + std::future EchoMessageOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return EchoMessageResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async(std::launch::async, [this]() { return EchoMessageResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return EchoMessageResult(GetOperationResult().get()); }); + } } EchoMessageOperation::EchoMessageOperation( @@ -1356,9 +1399,18 @@ namespace Awstest return Aws::Crt::String("awstest#GetAllCustomers"); } - std::future GetAllCustomersOperation::GetResult() noexcept + std::future GetAllCustomersOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); + } } GetAllCustomersOperation::GetAllCustomersOperation( diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index 45e15eb27..6c0635375 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -560,7 +560,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -625,7 +625,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -745,7 +745,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -852,7 +852,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -917,7 +917,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -982,7 +982,7 @@ namespace Awstest /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index ea4fb36f2..343f9a39f 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -3358,7 +3358,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3423,7 +3423,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3488,7 +3488,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3620,7 +3620,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3685,7 +3685,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3750,7 +3750,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3817,7 +3817,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -3941,7 +3941,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4006,7 +4006,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4145,7 +4145,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4210,7 +4210,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4278,7 +4278,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4343,7 +4343,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4486,7 +4486,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4555,7 +4555,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4624,7 +4624,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4689,7 +4689,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4754,7 +4754,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4819,7 +4819,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4889,7 +4889,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -4954,7 +4954,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5019,7 +5019,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5088,7 +5088,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5153,7 +5153,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5221,7 +5221,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5286,7 +5286,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5351,7 +5351,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5419,7 +5419,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5551,7 +5551,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5618,7 +5618,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5683,7 +5683,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5748,7 +5748,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; @@ -5815,7 +5815,7 @@ namespace Aws /** * Retrieve the result from activating the stream. */ - std::future GetResult() noexcept; + std::future GetResult(bool async_mode = false) noexcept; protected: Aws::Crt::String GetModelName() const noexcept override; diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index 4cf999968..6eabf7842 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -6358,10 +6358,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToIoTCore"); } - std::future SubscribeToIoTCoreOperation::GetResult() noexcept + std::future SubscribeToIoTCoreOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + } } SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( @@ -6428,10 +6436,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ResumeComponent"); } - std::future ResumeComponentOperation::GetResult() noexcept + std::future ResumeComponentOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); + } } ResumeComponentOperation::ResumeComponentOperation( @@ -6497,10 +6513,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToIoTCore"); } - std::future PublishToIoTCoreOperation::GetResult() noexcept + std::future PublishToIoTCoreOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); + } } PublishToIoTCoreOperation::PublishToIoTCoreOperation( @@ -6596,11 +6620,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdate"); } - std::future SubscribeToConfigurationUpdateOperation::GetResult() noexcept + std::future SubscribeToConfigurationUpdateOperation::GetResult( + bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); + } } SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( @@ -6667,10 +6701,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeleteThingShadow"); } - std::future DeleteThingShadowOperation::GetResult() noexcept + std::future DeleteThingShadowOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); + } } DeleteThingShadowOperation::DeleteThingShadowOperation( @@ -6736,10 +6778,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PutComponentMetric"); } - std::future PutComponentMetricOperation::GetResult() noexcept + std::future PutComponentMetricOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); + } } PutComponentMetricOperation::PutComponentMetricOperation( @@ -6805,10 +6855,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#DeferComponentUpdate"); } - std::future DeferComponentUpdateOperation::GetResult() noexcept + std::future DeferComponentUpdateOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); + } } DeferComponentUpdateOperation::DeferComponentUpdateOperation( @@ -6901,11 +6959,20 @@ namespace Aws } std::future SubscribeToValidateConfigurationUpdatesOperation:: - GetResult() noexcept + GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { - return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); - }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); + } } SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( @@ -6972,10 +7039,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetConfiguration"); } - std::future GetConfigurationOperation::GetResult() noexcept + std::future GetConfigurationOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); + } } GetConfigurationOperation::GetConfigurationOperation( @@ -7076,10 +7151,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToTopic"); } - std::future SubscribeToTopicOperation::GetResult() noexcept + std::future SubscribeToTopicOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + } } SubscribeToTopicOperation::SubscribeToTopicOperation( @@ -7146,10 +7229,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetComponentDetails"); } - std::future GetComponentDetailsOperation::GetResult() noexcept + std::future GetComponentDetailsOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); + } } GetComponentDetailsOperation::GetComponentDetailsOperation( @@ -7215,10 +7306,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthToken"); } - std::future GetClientDeviceAuthTokenOperation::GetResult() noexcept + std::future GetClientDeviceAuthTokenOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + } } GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( @@ -7284,10 +7386,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PublishToTopic"); } - std::future PublishToTopicOperation::GetResult() noexcept + std::future PublishToTopicOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); + } } PublishToTopicOperation::PublishToTopicOperation( @@ -7389,11 +7499,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdates"); } - std::future SubscribeToCertificateUpdatesOperation::GetResult() noexcept + std::future SubscribeToCertificateUpdatesOperation::GetResult( + bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { - return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); - }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); + } } SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( @@ -7460,10 +7580,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentity"); } - std::future VerifyClientDeviceIdentityOperation::GetResult() noexcept + std::future VerifyClientDeviceIdentityOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + } } VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( @@ -7529,10 +7660,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceAction"); } - std::future AuthorizeClientDeviceActionOperation::GetResult() noexcept + std::future AuthorizeClientDeviceActionOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + } } AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( @@ -7598,10 +7740,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListComponents"); } - std::future ListComponentsOperation::GetResult() noexcept + std::future ListComponentsOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return ListComponentsResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return ListComponentsResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return ListComponentsResult(GetOperationResult().get()); }); + } } ListComponentsOperation::ListComponentsOperation( @@ -7667,10 +7817,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#CreateDebugPassword"); } - std::future CreateDebugPasswordOperation::GetResult() noexcept + std::future CreateDebugPasswordOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); + } } CreateDebugPasswordOperation::CreateDebugPasswordOperation( @@ -7736,10 +7894,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetThingShadow"); } - std::future GetThingShadowOperation::GetResult() noexcept + std::future GetThingShadowOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); + } } GetThingShadowOperation::GetThingShadowOperation( @@ -7805,12 +7971,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReport"); } - std::future SendConfigurationValidityReportOperation:: - GetResult() noexcept + std::future SendConfigurationValidityReportOperation::GetResult( + bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { - return SendConfigurationValidityReportResult(GetOperationResult().get()); - }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); + } } SendConfigurationValidityReportOperation::SendConfigurationValidityReportOperation( @@ -7876,10 +8051,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateThingShadow"); } - std::future UpdateThingShadowOperation::GetResult() noexcept + std::future UpdateThingShadowOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); + } } UpdateThingShadowOperation::UpdateThingShadowOperation( @@ -7945,10 +8128,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateConfiguration"); } - std::future UpdateConfigurationOperation::GetResult() noexcept + std::future UpdateConfigurationOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); + } } UpdateConfigurationOperation::UpdateConfigurationOperation( @@ -8014,10 +8205,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ValidateAuthorizationToken"); } - std::future ValidateAuthorizationTokenOperation::GetResult() noexcept + std::future ValidateAuthorizationTokenOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + } } ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( @@ -8083,10 +8285,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#RestartComponent"); } - std::future RestartComponentOperation::GetResult() noexcept + std::future RestartComponentOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return RestartComponentResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return RestartComponentResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return RestartComponentResult(GetOperationResult().get()); }); + } } RestartComponentOperation::RestartComponentOperation( @@ -8152,10 +8362,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatus"); } - std::future GetLocalDeploymentStatusOperation::GetResult() noexcept + std::future GetLocalDeploymentStatusOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + } } GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( @@ -8221,10 +8442,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#GetSecretValue"); } - std::future GetSecretValueOperation::GetResult() noexcept + std::future GetSecretValueOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); + } } GetSecretValueOperation::GetSecretValueOperation( @@ -8289,9 +8518,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#UpdateState"); } - std::future UpdateStateOperation::GetResult() noexcept + std::future UpdateStateOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return UpdateStateResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return UpdateStateResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return UpdateStateResult(GetOperationResult().get()); }); + } } UpdateStateOperation::UpdateStateOperation( @@ -8357,10 +8595,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThing"); } - std::future ListNamedShadowsForThingOperation::GetResult() noexcept + std::future ListNamedShadowsForThingOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + } } ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( @@ -8456,10 +8705,21 @@ namespace Aws return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdates"); } - std::future SubscribeToComponentUpdatesOperation::GetResult() noexcept + std::future SubscribeToComponentUpdatesOperation::GetResult( + bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, + [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + } } SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( @@ -8526,10 +8786,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#ListLocalDeployments"); } - std::future ListLocalDeploymentsOperation::GetResult() noexcept + std::future ListLocalDeploymentsOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); + } } ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( @@ -8595,9 +8863,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#StopComponent"); } - std::future StopComponentOperation::GetResult() noexcept + std::future StopComponentOperation::GetResult(bool async_mode) noexcept { - return std::async(std::launch::async, [this]() { return StopComponentResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return StopComponentResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return StopComponentResult(GetOperationResult().get()); }); + } } StopComponentOperation::StopComponentOperation( @@ -8663,10 +8940,18 @@ namespace Aws return Aws::Crt::String("aws.greengrass#PauseComponent"); } - std::future PauseComponentOperation::GetResult() noexcept + std::future PauseComponentOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return PauseComponentResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return PauseComponentResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, [this]() { return PauseComponentResult(GetOperationResult().get()); }); + } } PauseComponentOperation::PauseComponentOperation( @@ -8732,10 +9017,19 @@ namespace Aws return Aws::Crt::String("aws.greengrass#CreateLocalDeployment"); } - std::future CreateLocalDeploymentOperation::GetResult() noexcept + std::future CreateLocalDeploymentOperation::GetResult(bool async_mode) noexcept { - return std::async( - std::launch::async, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + if (async_mode) + { + return std::async( + std::launch::async, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + } + else + { + return std::async( + std::launch::deferred, + [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + } } CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( From c59071add259343af919c6ea6169983376fa049b Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 23 Jan 2023 16:53:22 -0800 Subject: [PATCH 4/8] fix format --- eventstream_rpc/tests/EchoTestRpcModel.cpp | 6 +- .../source/GreengrassCoreIpcModel.cpp | 138 +++++++++--------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index 7b2007927..49ba72d96 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1161,9 +1161,9 @@ namespace Awstest } else { - return std::async( - std::launch::deferred, - [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return CauseStreamServiceToErrorResult(GetOperationResult().get()); + }); } } diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index 6eabf7842..cfda2ab87 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -6625,15 +6625,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); } } @@ -6963,15 +6963,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); + }); } } @@ -7311,15 +7311,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return GetClientDeviceAuthTokenResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return GetClientDeviceAuthTokenResult(GetOperationResult().get()); + }); } } @@ -7504,15 +7504,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); + }); } } @@ -7585,15 +7585,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return VerifyClientDeviceIdentityResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return VerifyClientDeviceIdentityResult(GetOperationResult().get()); + }); } } @@ -7665,15 +7665,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return AuthorizeClientDeviceActionResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return AuthorizeClientDeviceActionResult(GetOperationResult().get()); + }); } } @@ -7976,15 +7976,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SendConfigurationValidityReportResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return SendConfigurationValidityReportResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return SendConfigurationValidityReportResult(GetOperationResult().get()); + }); } } @@ -8210,15 +8210,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return ValidateAuthorizationTokenResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return ValidateAuthorizationTokenResult(GetOperationResult().get()); + }); } } @@ -8367,15 +8367,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return GetLocalDeploymentStatusResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return GetLocalDeploymentStatusResult(GetOperationResult().get()); + }); } } @@ -8600,15 +8600,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return ListNamedShadowsForThingResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return ListNamedShadowsForThingResult(GetOperationResult().get()); + }); } } @@ -8710,15 +8710,15 @@ namespace Aws { if (async_mode) { - return std::async( - std::launch::async, - [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::async, [this]() { + return SubscribeToComponentUpdatesResult(GetOperationResult().get()); + }); } else { - return std::async( - std::launch::deferred, - [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return SubscribeToComponentUpdatesResult(GetOperationResult().get()); + }); } } @@ -9026,9 +9026,9 @@ namespace Aws } else { - return std::async( - std::launch::deferred, - [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + return std::async(std::launch::deferred, [this]() { + return CreateLocalDeploymentResult(GetOperationResult().get()); + }); } } From 9947dbf01a3d306ae64fda9f893d26b7a7dba261 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 14 Feb 2023 18:18:24 -0800 Subject: [PATCH 5/8] add asyn launch config --- crt/aws-crt-cpp | 2 +- .../aws/eventstreamrpc/EventStreamClient.h | 2 + eventstream_rpc/source/EventStreamClient.cpp | 11 +- eventstream_rpc/tests/EchoTestRpcClient.cpp | 130 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 2830 ++- .../tests/include/awstest/EchoTestRpcClient.h | 88 +- .../tests/include/awstest/EchoTestRpcModel.h | 2058 +- .../aws/greengrass/GreengrassCoreIpcClient.h | 175 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 12284 ++++++----- .../source/GreengrassCoreIpcClient.cpp | 770 +- .../source/GreengrassCoreIpcModel.cpp | 17602 ++++++++-------- 11 files changed, 18003 insertions(+), 17949 deletions(-) diff --git a/crt/aws-crt-cpp b/crt/aws-crt-cpp index f81587db3..8ee94e268 160000 --- a/crt/aws-crt-cpp +++ b/crt/aws-crt-cpp @@ -1 +1 @@ -Subproject commit f81587db32a2f13764b0378fb069161f6742e376 +Subproject commit 8ee94e26804070e2279dc7451c5ac87d695dba13 diff --git a/eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h b/eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h index aac238ffd..28078d0ad 100644 --- a/eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h +++ b/eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h @@ -505,6 +505,7 @@ namespace Aws std::future Close(OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; std::future GetOperationResult() noexcept; + void WithLaunchMode(std::launch mode) noexcept; protected: std::future Activate( @@ -515,6 +516,7 @@ namespace Aws OnMessageFlushCallback onMessageFlushCallback) noexcept; virtual Crt::String GetModelName() const noexcept = 0; const OperationModelContext &m_operationModelContext; + std::launch m_asyncLaunchMode; private: EventStreamRpcStatusCode HandleData(const Crt::Optional &payload); diff --git a/eventstream_rpc/source/EventStreamClient.cpp b/eventstream_rpc/source/EventStreamClient.cpp index 514fc20f1..d338dd61c 100644 --- a/eventstream_rpc/source/EventStreamClient.cpp +++ b/eventstream_rpc/source/EventStreamClient.cpp @@ -1107,9 +1107,9 @@ namespace Aws std::shared_ptr streamHandler, const OperationModelContext &operationModelContext, Crt::Allocator *allocator) noexcept - : m_operationModelContext(operationModelContext), m_messageCount(0), m_allocator(allocator), - m_streamHandler(streamHandler), m_clientContinuation(connection.NewStream(*this)), m_expectedCloses(0), - m_streamClosedCalled(false) + : m_operationModelContext(operationModelContext), m_asyncLaunchMode(std::launch::deferred), + m_messageCount(0), m_allocator(allocator), m_streamHandler(streamHandler), + m_clientContinuation(connection.NewStream(*this)), m_expectedCloses(0), m_streamClosedCalled(false) { } @@ -1515,6 +1515,11 @@ namespace Aws } } + void ClientOperation::WithLaunchMode(std::launch mode) noexcept + { + m_asyncLaunchMode = mode; + } + std::future ClientOperation::Close(OnMessageFlushCallback onMessageFlushCallback) noexcept { const std::lock_guard lock(m_continuationMutex); diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index 95b6dcbd6..9e5a311e1 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -2,72 +2,86 @@ #include #include -namespace Awstest -{ - EchoTestRpcClient::EchoTestRpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator) noexcept - : m_connection(allocator), m_clientBootstrap(clientBootstrap), m_allocator(allocator) - { - m_echoTestRpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("awstest#ServiceError"), ServiceError::s_allocateFromPayload); - } +namespace Awstest { +EchoTestRpcClient::EchoTestRpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator) noexcept + : m_connection(allocator), m_clientBootstrap(clientBootstrap), + m_allocator(allocator), m_asyncLaunchMode(std::launch::deferred) { + m_echoTestRpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("awstest#ServiceError"), + ServiceError::s_allocateFromPayload); +} - std::future EchoTestRpcClient::Connect( - ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig) noexcept - { - return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); - } +std::future +EchoTestRpcClient::Connect(ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig) noexcept { + return m_connection.Connect(connectionConfig, &lifecycleHandler, + m_clientBootstrap); +} - void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } +void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } - EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } +void EchoTestRpcClient::WithLaunchMode(std::launch mode) noexcept { + m_asyncLaunchMode = mode; +} - std::shared_ptr EchoTestRpcClient::NewGetAllProducts() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); - } +EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } - std::shared_ptr EchoTestRpcClient::NewCauseServiceError() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, m_connection, m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, m_allocator); - } +std::shared_ptr +EchoTestRpcClient::NewGetAllProducts() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} - std::shared_ptr EchoTestRpcClient::NewCauseStreamServiceToError( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, - m_allocator); - } +std::shared_ptr +EchoTestRpcClient::NewCauseServiceError() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} - std::shared_ptr EchoTestRpcClient::NewEchoStreamMessages( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, - m_allocator); - } +std::shared_ptr +EchoTestRpcClient::NewCauseStreamServiceToError( + std::shared_ptr + streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, + m_allocator); +} - std::shared_ptr EchoTestRpcClient::NewEchoMessage() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); - } +std::shared_ptr +EchoTestRpcClient::NewEchoStreamMessages( + std::shared_ptr streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, + m_allocator); +} - std::shared_ptr EchoTestRpcClient::NewGetAllCustomers() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); - } +std::shared_ptr +EchoTestRpcClient::NewEchoMessage() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +EchoTestRpcClient::NewGetAllCustomers() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} } // namespace Awstest diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index 49ba72d96..dab7fcb30 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1,1465 +1,1375 @@ #include #include -namespace Awstest -{ - void Product::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_name.has_value()) - { - payloadObject.WithString("name", m_name.value()); - } - if (m_price.has_value()) - { - payloadObject.WithDouble("price", static_cast(m_price.value())); - } - } - - void Product::s_loadFromJsonView(Product &product, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("name")) - { - product.m_name = Aws::Crt::Optional(jsonView.GetString("name")); - } - if (jsonView.ValueExists("price")) - { - product.m_price = Aws::Crt::Optional(static_cast(jsonView.GetDouble("price"))); - } - } - - const char *Product::MODEL_NAME = "awstest#Product"; - - Aws::Crt::String Product::GetModelName() const noexcept { return Product::MODEL_NAME; } - - Aws::Crt::ScopedResource Product::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Product::s_customDeleter); - shape->m_allocator = allocator; - Product::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void Product::s_customDeleter(Product *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void Customer::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_id.has_value()) - { - payloadObject.WithInt64("id", m_id.value()); - } - if (m_firstName.has_value()) - { - payloadObject.WithString("firstName", m_firstName.value()); - } - if (m_lastName.has_value()) - { - payloadObject.WithString("lastName", m_lastName.value()); - } - } - - void Customer::s_loadFromJsonView(Customer &customer, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("id")) - { - customer.m_id = Aws::Crt::Optional(jsonView.GetInt64("id")); - } - if (jsonView.ValueExists("firstName")) - { - customer.m_firstName = Aws::Crt::Optional(jsonView.GetString("firstName")); - } - if (jsonView.ValueExists("lastName")) - { - customer.m_lastName = Aws::Crt::Optional(jsonView.GetString("lastName")); - } - } - - const char *Customer::MODEL_NAME = "awstest#Customer"; - - Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::MODEL_NAME; } - - Aws::Crt::ScopedResource Customer::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Customer::s_customDeleter); - shape->m_allocator = allocator; - Customer::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void Customer::s_customDeleter(Customer *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void Pair::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_key.has_value()) - { - payloadObject.WithString("key", m_key.value()); - } - if (m_value.has_value()) - { - payloadObject.WithString("value", m_value.value()); - } - } - - void Pair::s_loadFromJsonView(Pair &pair, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("key")) - { - pair.m_key = Aws::Crt::Optional(jsonView.GetString("key")); - } - if (jsonView.ValueExists("value")) - { - pair.m_value = Aws::Crt::Optional(jsonView.GetString("value")); - } - } - - const char *Pair::MODEL_NAME = "awstest#Pair"; - - Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::MODEL_NAME; } - - Aws::Crt::ScopedResource Pair::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Pair::s_customDeleter); - shape->m_allocator = allocator; - Pair::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void Pair::s_customDeleter(Pair *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void MessageData::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_stringMessage.has_value()) - { - payloadObject.WithString("stringMessage", m_stringMessage.value()); - } - if (m_booleanMessage.has_value()) - { - payloadObject.WithBool("booleanMessage", m_booleanMessage.value()); - } - if (m_timeMessage.has_value()) - { - payloadObject.WithDouble("timeMessage", m_timeMessage.value().SecondsWithMSPrecision()); - } - if (m_documentMessage.has_value()) - { - payloadObject.WithObject("documentMessage", m_documentMessage.value()); - } - if (m_enumMessage.has_value()) - { - payloadObject.WithString("enumMessage", m_enumMessage.value()); - } - if (m_blobMessage.has_value()) - { - if (m_blobMessage.value().size() > 0) - { - payloadObject.WithString("blobMessage", Aws::Crt::Base64Encode(m_blobMessage.value())); - } - } - if (m_stringListMessage.has_value()) - { - Aws::Crt::JsonObject stringList; - Aws::Crt::Vector stringListJsonArray; - for (const auto &stringListItem : m_stringListMessage.value()) - { - Aws::Crt::JsonObject stringListJsonArrayItem; - stringListJsonArrayItem.AsString(stringListItem); - stringListJsonArray.emplace_back(std::move(stringListJsonArrayItem)); - } - stringList.AsArray(std::move(stringListJsonArray)); - payloadObject.WithObject("stringListMessage", std::move(stringList)); - } - if (m_keyValuePairList.has_value()) - { - Aws::Crt::JsonObject keyValuePairList; - Aws::Crt::Vector keyValuePairListJsonArray; - for (const auto &keyValuePairListItem : m_keyValuePairList.value()) - { - Aws::Crt::JsonObject keyValuePairListJsonArrayItem; - keyValuePairListItem.SerializeToJsonObject(keyValuePairListJsonArrayItem); - keyValuePairListJsonArray.emplace_back(std::move(keyValuePairListJsonArrayItem)); - } - keyValuePairList.AsArray(std::move(keyValuePairListJsonArray)); - payloadObject.WithObject("keyValuePairList", std::move(keyValuePairList)); - } - if (m_stringToValue.has_value()) - { - Aws::Crt::JsonObject stringToValueValue; - for (const auto &stringToValueItem : m_stringToValue.value()) - { - Aws::Crt::JsonObject stringToValueJsonObject; - stringToValueItem.second.SerializeToJsonObject(stringToValueJsonObject); - stringToValueValue.WithObject(stringToValueItem.first, std::move(stringToValueJsonObject)); - } - payloadObject.WithObject("stringToValue", std::move(stringToValueValue)); - } - } - - void MessageData::s_loadFromJsonView(MessageData &messageData, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("stringMessage")) - { - messageData.m_stringMessage = Aws::Crt::Optional(jsonView.GetString("stringMessage")); - } - if (jsonView.ValueExists("booleanMessage")) - { - messageData.m_booleanMessage = Aws::Crt::Optional(jsonView.GetBool("booleanMessage")); - } - if (jsonView.ValueExists("timeMessage")) - { - messageData.m_timeMessage = - Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timeMessage"))); - } - if (jsonView.ValueExists("documentMessage")) - { - messageData.m_documentMessage = - Aws::Crt::Optional(jsonView.GetJsonObject("documentMessage").Materialize()); - } - if (jsonView.ValueExists("enumMessage")) - { - messageData.m_enumMessage = Aws::Crt::Optional(jsonView.GetString("enumMessage")); - } - if (jsonView.ValueExists("blobMessage")) - { - if (jsonView.GetString("blobMessage").size() > 0) - { - messageData.m_blobMessage = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("blobMessage"))); - } - } - if (jsonView.ValueExists("stringListMessage")) - { - messageData.m_stringListMessage = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &stringListJsonView : jsonView.GetArray("stringListMessage")) - { - Aws::Crt::Optional stringListItem; - stringListItem = Aws::Crt::Optional(stringListJsonView.AsString()); - messageData.m_stringListMessage.value().push_back(stringListItem.value()); - } - } - if (jsonView.ValueExists("keyValuePairList")) - { - messageData.m_keyValuePairList = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyValuePairListJsonView : jsonView.GetArray("keyValuePairList")) - { - Aws::Crt::Optional keyValuePairListItem; - keyValuePairListItem = Pair(); - Pair::s_loadFromJsonView(keyValuePairListItem.value(), keyValuePairListJsonView); - messageData.m_keyValuePairList.value().push_back(keyValuePairListItem.value()); - } - } - if (jsonView.ValueExists("stringToValue")) - { - messageData.m_stringToValue = Aws::Crt::Map(); - for (const auto &stringToValuePair : jsonView.GetJsonObject("stringToValue").GetAllObjects()) - { - Aws::Crt::Optional stringToValueValue; - stringToValueValue = Product(); - Product::s_loadFromJsonView(stringToValueValue.value(), stringToValuePair.second); - messageData.m_stringToValue.value()[stringToValuePair.first] = stringToValueValue.value(); - } - } - } - - void MessageData::SetEnumMessage(FruitEnum enumMessage) noexcept - { - switch (enumMessage) - { - case FRUIT_ENUM_APPLE: - m_enumMessage = Aws::Crt::String("apl"); - break; - case FRUIT_ENUM_ORANGE: - m_enumMessage = Aws::Crt::String("org"); - break; - case FRUIT_ENUM_BANANA: - m_enumMessage = Aws::Crt::String("ban"); - break; - case FRUIT_ENUM_PINEAPPLE: - m_enumMessage = Aws::Crt::String("pin"); - break; - default: - break; - } - } - - Aws::Crt::Optional MessageData::GetEnumMessage() noexcept - { - if (!m_enumMessage.has_value()) - return Aws::Crt::Optional(); - if (m_enumMessage.value() == Aws::Crt::String("apl")) - { - return Aws::Crt::Optional(FRUIT_ENUM_APPLE); - } - if (m_enumMessage.value() == Aws::Crt::String("org")) - { - return Aws::Crt::Optional(FRUIT_ENUM_ORANGE); - } - if (m_enumMessage.value() == Aws::Crt::String("ban")) - { - return Aws::Crt::Optional(FRUIT_ENUM_BANANA); - } - if (m_enumMessage.value() == Aws::Crt::String("pin")) - { - return Aws::Crt::Optional(FRUIT_ENUM_PINEAPPLE); - } - - return Aws::Crt::Optional(); - } - - const char *MessageData::MODEL_NAME = "awstest#MessageData"; - - Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::MODEL_NAME; } - - Aws::Crt::ScopedResource MessageData::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MessageData::s_customDeleter); - shape->m_allocator = allocator; - MessageData::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void MessageData::s_customDeleter(MessageData *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void EchoStreamingMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_STREAM_MESSAGE && m_streamMessage.has_value()) - { - Aws::Crt::JsonObject messageDataValue; - m_streamMessage.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("streamMessage", std::move(messageDataValue)); - } - else if (m_chosenMember == TAG_KEY_VALUE_PAIR && m_keyValuePair.has_value()) - { - Aws::Crt::JsonObject pairValue; - m_keyValuePair.value().SerializeToJsonObject(pairValue); - payloadObject.WithObject("keyValuePair", std::move(pairValue)); - } - } - - void EchoStreamingMessage::s_loadFromJsonView( - EchoStreamingMessage &echoStreamingMessage, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("streamMessage")) - { - echoStreamingMessage.m_streamMessage = MessageData(); - MessageData::s_loadFromJsonView( - echoStreamingMessage.m_streamMessage.value(), jsonView.GetJsonObject("streamMessage")); - echoStreamingMessage.m_chosenMember = TAG_STREAM_MESSAGE; - } - else if (jsonView.ValueExists("keyValuePair")) - { - echoStreamingMessage.m_keyValuePair = Pair(); - Pair::s_loadFromJsonView( - echoStreamingMessage.m_keyValuePair.value(), jsonView.GetJsonObject("keyValuePair")); - echoStreamingMessage.m_chosenMember = TAG_KEY_VALUE_PAIR; - } - } - - EchoStreamingMessage &EchoStreamingMessage::operator=(const EchoStreamingMessage &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_STREAM_MESSAGE) - { - m_streamMessage = objectToCopy.m_streamMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - else if (objectToCopy.m_chosenMember == TAG_KEY_VALUE_PAIR) - { - m_keyValuePair = objectToCopy.m_keyValuePair; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; - - Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { return EchoStreamingMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource EchoStreamingMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), EchoStreamingMessage::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void EchoStreamingMessage::s_customDeleter(EchoStreamingMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetAllProductsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_products.has_value()) - { - Aws::Crt::JsonObject productMapValue; - for (const auto &productMapItem : m_products.value()) - { - Aws::Crt::JsonObject productMapJsonObject; - productMapItem.second.SerializeToJsonObject(productMapJsonObject); - productMapValue.WithObject(productMapItem.first, std::move(productMapJsonObject)); - } - payloadObject.WithObject("products", std::move(productMapValue)); - } - } - - void GetAllProductsResponse::s_loadFromJsonView( - GetAllProductsResponse &getAllProductsResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("products")) - { - getAllProductsResponse.m_products = Aws::Crt::Map(); - for (const auto &productMapPair : jsonView.GetJsonObject("products").GetAllObjects()) - { - Aws::Crt::Optional productMapValue; - productMapValue = Product(); - Product::s_loadFromJsonView(productMapValue.value(), productMapPair.second); - getAllProductsResponse.m_products.value()[productMapPair.first] = productMapValue.value(); - } - } - } - - const char *GetAllProductsResponse::MODEL_NAME = "awstest#GetAllProductsResponse"; - - Aws::Crt::String GetAllProductsResponse::GetModelName() const noexcept - { - return GetAllProductsResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetAllProductsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetAllProductsResponse::s_customDeleter); - shape->m_allocator = allocator; - GetAllProductsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetAllProductsResponse::s_customDeleter(GetAllProductsResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetAllProductsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void GetAllProductsRequest::s_loadFromJsonView( - GetAllProductsRequest &getAllProductsRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)getAllProductsRequest; - (void)jsonView; - } - - const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; - - Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { return GetAllProductsRequest::MODEL_NAME; } - - Aws::Crt::ScopedResource GetAllProductsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetAllProductsRequest::s_customDeleter); - shape->m_allocator = allocator; - GetAllProductsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetAllProductsRequest::s_customDeleter(GetAllProductsRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetAllCustomersResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_customers.has_value()) - { - Aws::Crt::JsonObject customerList; - Aws::Crt::Vector customerListJsonArray; - for (const auto &customerListItem : m_customers.value()) - { - Aws::Crt::JsonObject customerListJsonArrayItem; - customerListItem.SerializeToJsonObject(customerListJsonArrayItem); - customerListJsonArray.emplace_back(std::move(customerListJsonArrayItem)); - } - customerList.AsArray(std::move(customerListJsonArray)); - payloadObject.WithObject("customers", std::move(customerList)); - } - } - - void GetAllCustomersResponse::s_loadFromJsonView( - GetAllCustomersResponse &getAllCustomersResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("customers")) - { - getAllCustomersResponse.m_customers = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &customerListJsonView : jsonView.GetArray("customers")) - { - Aws::Crt::Optional customerListItem; - customerListItem = Customer(); - Customer::s_loadFromJsonView(customerListItem.value(), customerListJsonView); - getAllCustomersResponse.m_customers.value().push_back(customerListItem.value()); - } - } - } - - const char *GetAllCustomersResponse::MODEL_NAME = "awstest#GetAllCustomersResponse"; - - Aws::Crt::String GetAllCustomersResponse::GetModelName() const noexcept - { - return GetAllCustomersResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetAllCustomersResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetAllCustomersResponse::s_customDeleter); - shape->m_allocator = allocator; - GetAllCustomersResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetAllCustomersResponse::s_customDeleter(GetAllCustomersResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetAllCustomersRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void GetAllCustomersRequest::s_loadFromJsonView( - GetAllCustomersRequest &getAllCustomersRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)getAllCustomersRequest; - (void)jsonView; - } - - const char *GetAllCustomersRequest::MODEL_NAME = "awstest#GetAllCustomersRequest"; - - Aws::Crt::String GetAllCustomersRequest::GetModelName() const noexcept - { - return GetAllCustomersRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetAllCustomersRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetAllCustomersRequest::s_customDeleter); - shape->m_allocator = allocator; - GetAllCustomersRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetAllCustomersRequest::s_customDeleter(GetAllCustomersRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void EchoMessageResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - Aws::Crt::JsonObject messageDataValue; - m_message.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("message", std::move(messageDataValue)); - } - } - - void EchoMessageResponse::s_loadFromJsonView( - EchoMessageResponse &echoMessageResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - echoMessageResponse.m_message = MessageData(); - MessageData::s_loadFromJsonView(echoMessageResponse.m_message.value(), jsonView.GetJsonObject("message")); - } - } - - const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; - - Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { return EchoMessageResponse::MODEL_NAME; } - - Aws::Crt::ScopedResource EchoMessageResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), EchoMessageResponse::s_customDeleter); - shape->m_allocator = allocator; - EchoMessageResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void EchoMessageResponse::s_customDeleter(EchoMessageResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void EchoMessageRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - Aws::Crt::JsonObject messageDataValue; - m_message.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("message", std::move(messageDataValue)); - } - } - - void EchoMessageRequest::s_loadFromJsonView( - EchoMessageRequest &echoMessageRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - echoMessageRequest.m_message = MessageData(); - MessageData::s_loadFromJsonView(echoMessageRequest.m_message.value(), jsonView.GetJsonObject("message")); - } - } - - const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; - - Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::MODEL_NAME; } - - Aws::Crt::ScopedResource EchoMessageRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), EchoMessageRequest::s_customDeleter); - shape->m_allocator = allocator; - EchoMessageRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void EchoMessageRequest::s_customDeleter(EchoMessageRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void EchoStreamingResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void EchoStreamingResponse::s_loadFromJsonView( - EchoStreamingResponse &echoStreamingResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)echoStreamingResponse; - (void)jsonView; - } - - const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; - - Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { return EchoStreamingResponse::MODEL_NAME; } - - Aws::Crt::ScopedResource EchoStreamingResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), EchoStreamingResponse::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void EchoStreamingResponse::s_customDeleter(EchoStreamingResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void EchoStreamingRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void EchoStreamingRequest::s_loadFromJsonView( - EchoStreamingRequest &echoStreamingRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)echoStreamingRequest; - (void)jsonView; - } - - const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; - - Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { return EchoStreamingRequest::MODEL_NAME; } - - Aws::Crt::ScopedResource EchoStreamingRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), EchoStreamingRequest::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void EchoStreamingRequest::s_customDeleter(EchoStreamingRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ServiceError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - if (m_value.has_value()) - { - payloadObject.WithString("value", m_value.value()); - } - } - - void ServiceError::s_loadFromJsonView(ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - serviceError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("value")) - { - serviceError.m_value = Aws::Crt::Optional(jsonView.GetString("value")); - } - } - - const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; - - Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } - - Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ServiceError::s_customDeleter); - shape->m_allocator = allocator; - ServiceError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void ServiceError::s_customDeleter(ServiceError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void CauseServiceErrorResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void CauseServiceErrorResponse::s_loadFromJsonView( - CauseServiceErrorResponse &causeServiceErrorResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)causeServiceErrorResponse; - (void)jsonView; - } - - const char *CauseServiceErrorResponse::MODEL_NAME = "awstest#CauseServiceErrorResponse"; - - Aws::Crt::String CauseServiceErrorResponse::GetModelName() const noexcept - { - return CauseServiceErrorResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource CauseServiceErrorResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CauseServiceErrorResponse::s_customDeleter); - shape->m_allocator = allocator; - CauseServiceErrorResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CauseServiceErrorResponse::s_customDeleter(CauseServiceErrorResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CauseServiceErrorRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void CauseServiceErrorRequest::s_loadFromJsonView( - CauseServiceErrorRequest &causeServiceErrorRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)causeServiceErrorRequest; - (void)jsonView; - } - - const char *CauseServiceErrorRequest::MODEL_NAME = "awstest#CauseServiceErrorRequest"; - - Aws::Crt::String CauseServiceErrorRequest::GetModelName() const noexcept - { - return CauseServiceErrorRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource CauseServiceErrorRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CauseServiceErrorRequest::s_customDeleter); - shape->m_allocator = allocator; - CauseServiceErrorRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CauseServiceErrorRequest::s_customDeleter(CauseServiceErrorRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - GetAllProductsOperationContext::GetAllProductsOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetAllProductsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return GetAllProductsResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetAllProductsOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetAllProductsOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#GetAllProductsRequest"); - } - - Aws::Crt::String GetAllProductsOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#GetAllProductsResponse"); - } - - Aws::Crt::Optional GetAllProductsOperationContext::GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetAllProductsOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#GetAllProducts"); - } - - std::future GetAllProductsOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); - } - } - - GetAllProductsOperation::GetAllProductsOperation( - ClientConnection &connection, - const GetAllProductsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetAllProductsOperation::Activate( - const GetAllProductsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetAllProductsOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - CauseServiceErrorOperationContext::CauseServiceErrorOperationContext( +namespace Awstest { +void Product::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_name.has_value()) { + payloadObject.WithString("name", m_name.value()); + } + if (m_price.has_value()) { + payloadObject.WithDouble("price", static_cast(m_price.value())); + } +} + +void Product::s_loadFromJsonView(Product &product, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("name")) { + product.m_name = + Aws::Crt::Optional(jsonView.GetString("name")); + } + if (jsonView.ValueExists("price")) { + product.m_price = Aws::Crt::Optional( + static_cast(jsonView.GetDouble("price"))); + } +} + +const char *Product::MODEL_NAME = "awstest#Product"; + +Aws::Crt::String Product::GetModelName() const noexcept { + return Product::MODEL_NAME; +} + +Aws::Crt::ScopedResource +Product::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), + Product::s_customDeleter); + shape->m_allocator = allocator; + Product::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void Product::s_customDeleter(Product *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void Customer::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_id.has_value()) { + payloadObject.WithInt64("id", m_id.value()); + } + if (m_firstName.has_value()) { + payloadObject.WithString("firstName", m_firstName.value()); + } + if (m_lastName.has_value()) { + payloadObject.WithString("lastName", m_lastName.value()); + } +} + +void Customer::s_loadFromJsonView(Customer &customer, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("id")) { + customer.m_id = Aws::Crt::Optional(jsonView.GetInt64("id")); + } + if (jsonView.ValueExists("firstName")) { + customer.m_firstName = + Aws::Crt::Optional(jsonView.GetString("firstName")); + } + if (jsonView.ValueExists("lastName")) { + customer.m_lastName = + Aws::Crt::Optional(jsonView.GetString("lastName")); + } +} + +const char *Customer::MODEL_NAME = "awstest#Customer"; + +Aws::Crt::String Customer::GetModelName() const noexcept { + return Customer::MODEL_NAME; +} + +Aws::Crt::ScopedResource +Customer::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), + Customer::s_customDeleter); + shape->m_allocator = allocator; + Customer::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void Customer::s_customDeleter(Customer *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void Pair::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_key.has_value()) { + payloadObject.WithString("key", m_key.value()); + } + if (m_value.has_value()) { + payloadObject.WithString("value", m_value.value()); + } +} + +void Pair::s_loadFromJsonView(Pair &pair, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("key")) { + pair.m_key = + Aws::Crt::Optional(jsonView.GetString("key")); + } + if (jsonView.ValueExists("value")) { + pair.m_value = + Aws::Crt::Optional(jsonView.GetString("value")); + } +} + +const char *Pair::MODEL_NAME = "awstest#Pair"; + +Aws::Crt::String Pair::GetModelName() const noexcept { + return Pair::MODEL_NAME; +} + +Aws::Crt::ScopedResource +Pair::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), + Pair::s_customDeleter); + shape->m_allocator = allocator; + Pair::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void Pair::s_customDeleter(Pair *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void MessageData::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_stringMessage.has_value()) { + payloadObject.WithString("stringMessage", m_stringMessage.value()); + } + if (m_booleanMessage.has_value()) { + payloadObject.WithBool("booleanMessage", m_booleanMessage.value()); + } + if (m_timeMessage.has_value()) { + payloadObject.WithDouble("timeMessage", + m_timeMessage.value().SecondsWithMSPrecision()); + } + if (m_documentMessage.has_value()) { + payloadObject.WithObject("documentMessage", m_documentMessage.value()); + } + if (m_enumMessage.has_value()) { + payloadObject.WithString("enumMessage", m_enumMessage.value()); + } + if (m_blobMessage.has_value()) { + if (m_blobMessage.value().size() > 0) { + payloadObject.WithString("blobMessage", + Aws::Crt::Base64Encode(m_blobMessage.value())); + } + } + if (m_stringListMessage.has_value()) { + Aws::Crt::JsonObject stringList; + Aws::Crt::Vector stringListJsonArray; + for (const auto &stringListItem : m_stringListMessage.value()) { + Aws::Crt::JsonObject stringListJsonArrayItem; + stringListJsonArrayItem.AsString(stringListItem); + stringListJsonArray.emplace_back(std::move(stringListJsonArrayItem)); + } + stringList.AsArray(std::move(stringListJsonArray)); + payloadObject.WithObject("stringListMessage", std::move(stringList)); + } + if (m_keyValuePairList.has_value()) { + Aws::Crt::JsonObject keyValuePairList; + Aws::Crt::Vector keyValuePairListJsonArray; + for (const auto &keyValuePairListItem : m_keyValuePairList.value()) { + Aws::Crt::JsonObject keyValuePairListJsonArrayItem; + keyValuePairListItem.SerializeToJsonObject(keyValuePairListJsonArrayItem); + keyValuePairListJsonArray.emplace_back( + std::move(keyValuePairListJsonArrayItem)); + } + keyValuePairList.AsArray(std::move(keyValuePairListJsonArray)); + payloadObject.WithObject("keyValuePairList", std::move(keyValuePairList)); + } + if (m_stringToValue.has_value()) { + Aws::Crt::JsonObject stringToValueValue; + for (const auto &stringToValueItem : m_stringToValue.value()) { + Aws::Crt::JsonObject stringToValueJsonObject; + stringToValueItem.second.SerializeToJsonObject(stringToValueJsonObject); + stringToValueValue.WithObject(stringToValueItem.first, + std::move(stringToValueJsonObject)); + } + payloadObject.WithObject("stringToValue", std::move(stringToValueValue)); + } +} + +void MessageData::s_loadFromJsonView( + MessageData &messageData, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("stringMessage")) { + messageData.m_stringMessage = Aws::Crt::Optional( + jsonView.GetString("stringMessage")); + } + if (jsonView.ValueExists("booleanMessage")) { + messageData.m_booleanMessage = + Aws::Crt::Optional(jsonView.GetBool("booleanMessage")); + } + if (jsonView.ValueExists("timeMessage")) { + messageData.m_timeMessage = Aws::Crt::Optional( + Aws::Crt::DateTime(jsonView.GetDouble("timeMessage"))); + } + if (jsonView.ValueExists("documentMessage")) { + messageData.m_documentMessage = Aws::Crt::Optional( + jsonView.GetJsonObject("documentMessage").Materialize()); + } + if (jsonView.ValueExists("enumMessage")) { + messageData.m_enumMessage = + Aws::Crt::Optional(jsonView.GetString("enumMessage")); + } + if (jsonView.ValueExists("blobMessage")) { + if (jsonView.GetString("blobMessage").size() > 0) { + messageData.m_blobMessage = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("blobMessage"))); + } + } + if (jsonView.ValueExists("stringListMessage")) { + messageData.m_stringListMessage = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &stringListJsonView : + jsonView.GetArray("stringListMessage")) { + Aws::Crt::Optional stringListItem; + stringListItem = + Aws::Crt::Optional(stringListJsonView.AsString()); + messageData.m_stringListMessage.value().push_back(stringListItem.value()); + } + } + if (jsonView.ValueExists("keyValuePairList")) { + messageData.m_keyValuePairList = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyValuePairListJsonView : + jsonView.GetArray("keyValuePairList")) { + Aws::Crt::Optional keyValuePairListItem; + keyValuePairListItem = Pair(); + Pair::s_loadFromJsonView(keyValuePairListItem.value(), + keyValuePairListJsonView); + messageData.m_keyValuePairList.value().push_back( + keyValuePairListItem.value()); + } + } + if (jsonView.ValueExists("stringToValue")) { + messageData.m_stringToValue = Aws::Crt::Map(); + for (const auto &stringToValuePair : + jsonView.GetJsonObject("stringToValue").GetAllObjects()) { + Aws::Crt::Optional stringToValueValue; + stringToValueValue = Product(); + Product::s_loadFromJsonView(stringToValueValue.value(), + stringToValuePair.second); + messageData.m_stringToValue.value()[stringToValuePair.first] = + stringToValueValue.value(); + } + } +} + +void MessageData::SetEnumMessage(FruitEnum enumMessage) noexcept { + switch (enumMessage) { + case FRUIT_ENUM_APPLE: + m_enumMessage = Aws::Crt::String("apl"); + break; + case FRUIT_ENUM_ORANGE: + m_enumMessage = Aws::Crt::String("org"); + break; + case FRUIT_ENUM_BANANA: + m_enumMessage = Aws::Crt::String("ban"); + break; + case FRUIT_ENUM_PINEAPPLE: + m_enumMessage = Aws::Crt::String("pin"); + break; + default: + break; + } +} + +Aws::Crt::Optional MessageData::GetEnumMessage() noexcept { + if (!m_enumMessage.has_value()) + return Aws::Crt::Optional(); + if (m_enumMessage.value() == Aws::Crt::String("apl")) { + return Aws::Crt::Optional(FRUIT_ENUM_APPLE); + } + if (m_enumMessage.value() == Aws::Crt::String("org")) { + return Aws::Crt::Optional(FRUIT_ENUM_ORANGE); + } + if (m_enumMessage.value() == Aws::Crt::String("ban")) { + return Aws::Crt::Optional(FRUIT_ENUM_BANANA); + } + if (m_enumMessage.value() == Aws::Crt::String("pin")) { + return Aws::Crt::Optional(FRUIT_ENUM_PINEAPPLE); + } + + return Aws::Crt::Optional(); +} + +const char *MessageData::MODEL_NAME = "awstest#MessageData"; + +Aws::Crt::String MessageData::GetModelName() const noexcept { + return MessageData::MODEL_NAME; +} + +Aws::Crt::ScopedResource +MessageData::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MessageData::s_customDeleter); + shape->m_allocator = allocator; + MessageData::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void MessageData::s_customDeleter(MessageData *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void EchoStreamingMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_STREAM_MESSAGE && m_streamMessage.has_value()) { + Aws::Crt::JsonObject messageDataValue; + m_streamMessage.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("streamMessage", std::move(messageDataValue)); + } else if (m_chosenMember == TAG_KEY_VALUE_PAIR && + m_keyValuePair.has_value()) { + Aws::Crt::JsonObject pairValue; + m_keyValuePair.value().SerializeToJsonObject(pairValue); + payloadObject.WithObject("keyValuePair", std::move(pairValue)); + } +} + +void EchoStreamingMessage::s_loadFromJsonView( + EchoStreamingMessage &echoStreamingMessage, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("streamMessage")) { + echoStreamingMessage.m_streamMessage = MessageData(); + MessageData::s_loadFromJsonView( + echoStreamingMessage.m_streamMessage.value(), + jsonView.GetJsonObject("streamMessage")); + echoStreamingMessage.m_chosenMember = TAG_STREAM_MESSAGE; + } else if (jsonView.ValueExists("keyValuePair")) { + echoStreamingMessage.m_keyValuePair = Pair(); + Pair::s_loadFromJsonView(echoStreamingMessage.m_keyValuePair.value(), + jsonView.GetJsonObject("keyValuePair")); + echoStreamingMessage.m_chosenMember = TAG_KEY_VALUE_PAIR; + } +} + +EchoStreamingMessage &EchoStreamingMessage::operator=( + const EchoStreamingMessage &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_STREAM_MESSAGE) { + m_streamMessage = objectToCopy.m_streamMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } else if (objectToCopy.m_chosenMember == TAG_KEY_VALUE_PAIR) { + m_keyValuePair = objectToCopy.m_keyValuePair; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; + +Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { + return EchoStreamingMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +EchoStreamingMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + EchoStreamingMessage::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void EchoStreamingMessage::s_customDeleter( + EchoStreamingMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetAllProductsResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_products.has_value()) { + Aws::Crt::JsonObject productMapValue; + for (const auto &productMapItem : m_products.value()) { + Aws::Crt::JsonObject productMapJsonObject; + productMapItem.second.SerializeToJsonObject(productMapJsonObject); + productMapValue.WithObject(productMapItem.first, + std::move(productMapJsonObject)); + } + payloadObject.WithObject("products", std::move(productMapValue)); + } +} + +void GetAllProductsResponse::s_loadFromJsonView( + GetAllProductsResponse &getAllProductsResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("products")) { + getAllProductsResponse.m_products = + Aws::Crt::Map(); + for (const auto &productMapPair : + jsonView.GetJsonObject("products").GetAllObjects()) { + Aws::Crt::Optional productMapValue; + productMapValue = Product(); + Product::s_loadFromJsonView(productMapValue.value(), + productMapPair.second); + getAllProductsResponse.m_products.value()[productMapPair.first] = + productMapValue.value(); + } + } +} + +const char *GetAllProductsResponse::MODEL_NAME = + "awstest#GetAllProductsResponse"; + +Aws::Crt::String GetAllProductsResponse::GetModelName() const noexcept { + return GetAllProductsResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetAllProductsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetAllProductsResponse::s_customDeleter); + shape->m_allocator = allocator; + GetAllProductsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetAllProductsResponse::s_customDeleter( + GetAllProductsResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetAllProductsRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void GetAllProductsRequest::s_loadFromJsonView( + GetAllProductsRequest &getAllProductsRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)getAllProductsRequest; + (void)jsonView; +} + +const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; + +Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { + return GetAllProductsRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetAllProductsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetAllProductsRequest::s_customDeleter); + shape->m_allocator = allocator; + GetAllProductsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetAllProductsRequest::s_customDeleter( + GetAllProductsRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetAllCustomersResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_customers.has_value()) { + Aws::Crt::JsonObject customerList; + Aws::Crt::Vector customerListJsonArray; + for (const auto &customerListItem : m_customers.value()) { + Aws::Crt::JsonObject customerListJsonArrayItem; + customerListItem.SerializeToJsonObject(customerListJsonArrayItem); + customerListJsonArray.emplace_back(std::move(customerListJsonArrayItem)); + } + customerList.AsArray(std::move(customerListJsonArray)); + payloadObject.WithObject("customers", std::move(customerList)); + } +} + +void GetAllCustomersResponse::s_loadFromJsonView( + GetAllCustomersResponse &getAllCustomersResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("customers")) { + getAllCustomersResponse.m_customers = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &customerListJsonView : + jsonView.GetArray("customers")) { + Aws::Crt::Optional customerListItem; + customerListItem = Customer(); + Customer::s_loadFromJsonView(customerListItem.value(), + customerListJsonView); + getAllCustomersResponse.m_customers.value().push_back( + customerListItem.value()); + } + } +} + +const char *GetAllCustomersResponse::MODEL_NAME = + "awstest#GetAllCustomersResponse"; + +Aws::Crt::String GetAllCustomersResponse::GetModelName() const noexcept { + return GetAllCustomersResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetAllCustomersResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetAllCustomersResponse::s_customDeleter); + shape->m_allocator = allocator; + GetAllCustomersResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetAllCustomersResponse::s_customDeleter( + GetAllCustomersResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetAllCustomersRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void GetAllCustomersRequest::s_loadFromJsonView( + GetAllCustomersRequest &getAllCustomersRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)getAllCustomersRequest; + (void)jsonView; +} + +const char *GetAllCustomersRequest::MODEL_NAME = + "awstest#GetAllCustomersRequest"; + +Aws::Crt::String GetAllCustomersRequest::GetModelName() const noexcept { + return GetAllCustomersRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetAllCustomersRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetAllCustomersRequest::s_customDeleter); + shape->m_allocator = allocator; + GetAllCustomersRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetAllCustomersRequest::s_customDeleter( + GetAllCustomersRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void EchoMessageResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + Aws::Crt::JsonObject messageDataValue; + m_message.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("message", std::move(messageDataValue)); + } +} + +void EchoMessageResponse::s_loadFromJsonView( + EchoMessageResponse &echoMessageResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + echoMessageResponse.m_message = MessageData(); + MessageData::s_loadFromJsonView(echoMessageResponse.m_message.value(), + jsonView.GetJsonObject("message")); + } +} + +const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; + +Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { + return EchoMessageResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +EchoMessageResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + EchoMessageResponse::s_customDeleter); + shape->m_allocator = allocator; + EchoMessageResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void EchoMessageResponse::s_customDeleter(EchoMessageResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void EchoMessageRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + Aws::Crt::JsonObject messageDataValue; + m_message.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("message", std::move(messageDataValue)); + } +} + +void EchoMessageRequest::s_loadFromJsonView( + EchoMessageRequest &echoMessageRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + echoMessageRequest.m_message = MessageData(); + MessageData::s_loadFromJsonView(echoMessageRequest.m_message.value(), + jsonView.GetJsonObject("message")); + } +} + +const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; + +Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { + return EchoMessageRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +EchoMessageRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + EchoMessageRequest::s_customDeleter); + shape->m_allocator = allocator; + EchoMessageRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void EchoMessageRequest::s_customDeleter(EchoMessageRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void EchoStreamingResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void EchoStreamingResponse::s_loadFromJsonView( + EchoStreamingResponse &echoStreamingResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)echoStreamingResponse; + (void)jsonView; +} + +const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; + +Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { + return EchoStreamingResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +EchoStreamingResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + EchoStreamingResponse::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void EchoStreamingResponse::s_customDeleter( + EchoStreamingResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void EchoStreamingRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void EchoStreamingRequest::s_loadFromJsonView( + EchoStreamingRequest &echoStreamingRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)echoStreamingRequest; + (void)jsonView; +} + +const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; + +Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { + return EchoStreamingRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +EchoStreamingRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + EchoStreamingRequest::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void EchoStreamingRequest::s_customDeleter( + EchoStreamingRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ServiceError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } + if (m_value.has_value()) { + payloadObject.WithString("value", m_value.value()); + } +} + +void ServiceError::s_loadFromJsonView( + ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + serviceError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("value")) { + serviceError.m_value = + Aws::Crt::Optional(jsonView.GetString("value")); + } +} + +const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; + +Aws::Crt::String ServiceError::GetModelName() const noexcept { + return ServiceError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ServiceError::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ServiceError::s_customDeleter); + shape->m_allocator = allocator; + ServiceError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void ServiceError::s_customDeleter(ServiceError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void CauseServiceErrorResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void CauseServiceErrorResponse::s_loadFromJsonView( + CauseServiceErrorResponse &causeServiceErrorResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)causeServiceErrorResponse; + (void)jsonView; +} + +const char *CauseServiceErrorResponse::MODEL_NAME = + "awstest#CauseServiceErrorResponse"; + +Aws::Crt::String CauseServiceErrorResponse::GetModelName() const noexcept { + return CauseServiceErrorResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CauseServiceErrorResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CauseServiceErrorResponse::s_customDeleter); + shape->m_allocator = allocator; + CauseServiceErrorResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CauseServiceErrorResponse::s_customDeleter( + CauseServiceErrorResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CauseServiceErrorRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void CauseServiceErrorRequest::s_loadFromJsonView( + CauseServiceErrorRequest &causeServiceErrorRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)causeServiceErrorRequest; + (void)jsonView; +} + +const char *CauseServiceErrorRequest::MODEL_NAME = + "awstest#CauseServiceErrorRequest"; + +Aws::Crt::String CauseServiceErrorRequest::GetModelName() const noexcept { + return CauseServiceErrorRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CauseServiceErrorRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CauseServiceErrorRequest::s_customDeleter); + shape->m_allocator = allocator; + CauseServiceErrorRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CauseServiceErrorRequest::s_customDeleter( + CauseServiceErrorRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +GetAllProductsOperationContext::GetAllProductsOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetAllProductsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetAllProductsResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +GetAllProductsOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetAllProductsOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("awstest#GetAllProductsRequest"); +} + +Aws::Crt::String +GetAllProductsOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("awstest#GetAllProductsResponse"); +} + +Aws::Crt::Optional +GetAllProductsOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetAllProductsOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#GetAllProducts"); +} + +std::future +GetAllProductsOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetAllProductsResult(GetOperationResult().get()); + }); +} + +GetAllProductsOperation::GetAllProductsOperation( + ClientConnection &connection, + const GetAllProductsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetAllProductsOperation::Activate( + const GetAllProductsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetAllProductsOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +CauseServiceErrorOperationContext::CauseServiceErrorOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +CauseServiceErrorOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return CauseServiceErrorResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +CauseServiceErrorOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +CauseServiceErrorOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("awstest#CauseServiceErrorRequest"); +} + +Aws::Crt::String +CauseServiceErrorOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("awstest#CauseServiceErrorResponse"); +} + +Aws::Crt::Optional +CauseServiceErrorOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +CauseServiceErrorOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#CauseServiceError"); +} + +std::future +CauseServiceErrorOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return CauseServiceErrorResult(GetOperationResult().get()); + }); +} + +CauseServiceErrorOperation::CauseServiceErrorOperation( + ClientConnection &connection, + const CauseServiceErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future CauseServiceErrorOperation::Activate( + const CauseServiceErrorRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String CauseServiceErrorOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void CauseStreamServiceToErrorStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool CauseStreamServiceToErrorStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("awstest#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +CauseStreamServiceToErrorOperationContext:: + CauseStreamServiceToErrorOperationContext( const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource CauseServiceErrorOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return CauseServiceErrorResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource CauseServiceErrorOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String CauseServiceErrorOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#CauseServiceErrorRequest"); - } - - Aws::Crt::String CauseServiceErrorOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#CauseServiceErrorResponse"); - } - - Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String CauseServiceErrorOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#CauseServiceError"); - } - - std::future CauseServiceErrorOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); - } - } - - CauseServiceErrorOperation::CauseServiceErrorOperation( - ClientConnection &connection, - const CauseServiceErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future CauseServiceErrorOperation::Activate( - const CauseServiceErrorRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String CauseServiceErrorOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void CauseStreamServiceToErrorStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool CauseStreamServiceToErrorStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && operationError->GetModelName() == Aws::Crt::String("awstest#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - CauseStreamServiceToErrorOperationContext::CauseStreamServiceToErrorOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoStreamingRequest"); - } - - Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoStreamingResponse"); - } - - Aws::Crt::Optional CauseStreamServiceToErrorOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::String("awstest#EchoStreamingMessage"); - } - - Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#CauseStreamServiceToError"); - } - - std::future CauseStreamServiceToErrorOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return CauseStreamServiceToErrorResult(GetOperationResult().get()); - }); - } - } - - CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const CauseStreamServiceToErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future CauseStreamServiceToErrorOperation::Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String CauseStreamServiceToErrorOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void EchoStreamMessagesStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool EchoStreamMessagesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - EchoStreamMessagesOperationContext::EchoStreamMessagesOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource EchoStreamMessagesOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource EchoStreamMessagesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String EchoStreamMessagesOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoStreamingRequest"); - } - - Aws::Crt::String EchoStreamMessagesOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoStreamingResponse"); - } - - Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::String("awstest#EchoStreamingMessage"); - } - - Aws::Crt::String EchoStreamMessagesOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#EchoStreamMessages"); - } - - std::future EchoStreamMessagesOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); - } - } - - EchoStreamMessagesOperation::EchoStreamMessagesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const EchoStreamMessagesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future EchoStreamMessagesOperation::Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String EchoStreamMessagesOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - EchoMessageOperationContext::EchoMessageOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource EchoMessageOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return EchoMessageResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource EchoMessageOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String EchoMessageOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoMessageRequest"); - } - - Aws::Crt::String EchoMessageOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#EchoMessageResponse"); - } - - Aws::Crt::Optional EchoMessageOperationContext::GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String EchoMessageOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#EchoMessage"); - } - - std::future EchoMessageOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { return EchoMessageResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return EchoMessageResult(GetOperationResult().get()); }); - } - } - - EchoMessageOperation::EchoMessageOperation( - ClientConnection &connection, - const EchoMessageOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future EchoMessageOperation::Activate( - const EchoMessageRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String EchoMessageOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetAllCustomersOperationContext::GetAllCustomersOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetAllCustomersOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return GetAllCustomersResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetAllCustomersOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetAllCustomersOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("awstest#GetAllCustomersRequest"); - } - - Aws::Crt::String GetAllCustomersOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("awstest#GetAllCustomersResponse"); - } - - Aws::Crt::Optional GetAllCustomersOperationContext::GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetAllCustomersOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("awstest#GetAllCustomers"); - } - - std::future GetAllCustomersOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); - } - } - - GetAllCustomersOperation::GetAllCustomersOperation( - ClientConnection &connection, - const GetAllCustomersOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetAllCustomersOperation::Activate( - const GetAllCustomersRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetAllCustomersOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - EchoTestRpcServiceModel::EchoTestRpcServiceModel() noexcept - : m_getAllProductsOperationContext(*this), m_causeServiceErrorOperationContext(*this), - m_causeStreamServiceToErrorOperationContext(*this), m_echoStreamMessagesOperationContext(*this), - m_echoMessageOperationContext(*this), m_getAllCustomersOperationContext(*this) - { - } - - Aws::Crt::ScopedResource EchoTestRpcServiceModel::AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - auto it = m_modelNameToErrorResponse.find(errorModelName); - if (it == m_modelNameToErrorResponse.end()) - { - return nullptr; - } - else - { - return it->second(stringView, allocator); - } - } - - void EchoTestRpcServiceModel::AssignModelNameToErrorResponse( - Aws::Crt::String modelName, - ErrorResponseFactory factory) noexcept - { - m_modelNameToErrorResponse[modelName] = factory; - } + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +CauseStreamServiceToErrorOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +CauseStreamServiceToErrorOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::String +CauseStreamServiceToErrorOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String("awstest#EchoStreamingRequest"); +} + +Aws::Crt::String +CauseStreamServiceToErrorOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("awstest#EchoStreamingResponse"); +} + +Aws::Crt::Optional +CauseStreamServiceToErrorOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("awstest#EchoStreamingMessage"); +} + +Aws::Crt::String +CauseStreamServiceToErrorOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#CauseStreamServiceToError"); +} + +std::future +CauseStreamServiceToErrorOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return CauseStreamServiceToErrorResult(GetOperationResult().get()); + }); +} + +CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const CauseStreamServiceToErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future CauseStreamServiceToErrorOperation::Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +CauseStreamServiceToErrorOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void EchoStreamMessagesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool EchoStreamMessagesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +EchoStreamMessagesOperationContext::EchoStreamMessagesOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +EchoStreamMessagesOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +EchoStreamMessagesOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::String +EchoStreamMessagesOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("awstest#EchoStreamingRequest"); +} + +Aws::Crt::String +EchoStreamMessagesOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("awstest#EchoStreamingResponse"); +} + +Aws::Crt::Optional +EchoStreamMessagesOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("awstest#EchoStreamingMessage"); +} + +Aws::Crt::String +EchoStreamMessagesOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#EchoStreamMessages"); +} + +std::future +EchoStreamMessagesOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return EchoStreamMessagesResult(GetOperationResult().get()); + }); +} + +EchoStreamMessagesOperation::EchoStreamMessagesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const EchoStreamMessagesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future EchoStreamMessagesOperation::Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String EchoStreamMessagesOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +EchoMessageOperationContext::EchoMessageOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +EchoMessageOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return EchoMessageResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +EchoMessageOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +EchoMessageOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("awstest#EchoMessageRequest"); +} + +Aws::Crt::String +EchoMessageOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("awstest#EchoMessageResponse"); +} + +Aws::Crt::Optional +EchoMessageOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +EchoMessageOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#EchoMessage"); +} + +std::future EchoMessageOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return EchoMessageResult(GetOperationResult().get()); + }); +} + +EchoMessageOperation::EchoMessageOperation( + ClientConnection &connection, + const EchoMessageOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future EchoMessageOperation::Activate( + const EchoMessageRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String EchoMessageOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetAllCustomersOperationContext::GetAllCustomersOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetAllCustomersOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetAllCustomersResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +GetAllCustomersOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetAllCustomersOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("awstest#GetAllCustomersRequest"); +} + +Aws::Crt::String +GetAllCustomersOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("awstest#GetAllCustomersResponse"); +} + +Aws::Crt::Optional +GetAllCustomersOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetAllCustomersOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("awstest#GetAllCustomers"); +} + +std::future +GetAllCustomersOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetAllCustomersResult(GetOperationResult().get()); + }); +} + +GetAllCustomersOperation::GetAllCustomersOperation( + ClientConnection &connection, + const GetAllCustomersOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetAllCustomersOperation::Activate( + const GetAllCustomersRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetAllCustomersOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +EchoTestRpcServiceModel::EchoTestRpcServiceModel() noexcept + : m_getAllProductsOperationContext(*this), + m_causeServiceErrorOperationContext(*this), + m_causeStreamServiceToErrorOperationContext(*this), + m_echoStreamMessagesOperationContext(*this), + m_echoMessageOperationContext(*this), + m_getAllCustomersOperationContext(*this) {} + +Aws::Crt::ScopedResource +EchoTestRpcServiceModel::AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + auto it = m_modelNameToErrorResponse.find(errorModelName); + if (it == m_modelNameToErrorResponse.end()) { + return nullptr; + } else { + return it->second(stringView, allocator); + } +} + +void EchoTestRpcServiceModel::AssignModelNameToErrorResponse( + Aws::Crt::String modelName, ErrorResponseFactory factory) noexcept { + m_modelNameToErrorResponse[modelName] = factory; +} } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index d1e54db99..80a73707b 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -12,55 +12,57 @@ using namespace Aws::Eventstreamrpc; -namespace Awstest -{ - class DefaultConnectionConfig : public ConnectionConfig - { - public: - DefaultConnectionConfig() noexcept; - }; +namespace Awstest { +class DefaultConnectionConfig : public ConnectionConfig { +public: + DefaultConnectionConfig() noexcept; +}; - class EchoTestRpcClient - { - public: - EchoTestRpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle - * events relating to the connection occur. - * @param connectionConfig The configuration parameters used for establishing - * the connection. - * @return An `RpcError` that can be used to check whether the connection was - * established. - */ - std::future Connect( - ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig = DefaultConnectionConfig()) noexcept; - bool IsConnected() const noexcept { return m_connection.IsOpen(); } - void Close() noexcept; - std::shared_ptr NewGetAllProducts() noexcept; +class EchoTestRpcClient { +public: + EchoTestRpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Connect the client to the server + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. + */ + std::future Connect(ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig = + DefaultConnectionConfig()) noexcept; + bool IsConnected() const noexcept { return m_connection.IsOpen(); } + void Close() noexcept; + void WithLaunchMode(std::launch mode) noexcept; - std::shared_ptr NewCauseServiceError() noexcept; + std::shared_ptr NewGetAllProducts() noexcept; - std::shared_ptr NewCauseStreamServiceToError( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewCauseServiceError() noexcept; - std::shared_ptr NewEchoStreamMessages( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr + NewCauseStreamServiceToError( + std::shared_ptr + streamHandler) noexcept; - std::shared_ptr NewEchoMessage() noexcept; + std::shared_ptr NewEchoStreamMessages( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewGetAllCustomers() noexcept; + std::shared_ptr NewEchoMessage() noexcept; - ~EchoTestRpcClient() noexcept; + std::shared_ptr NewGetAllCustomers() noexcept; - private: - EchoTestRpcServiceModel m_echoTestRpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - }; + ~EchoTestRpcClient() noexcept; + +private: + EchoTestRpcServiceModel m_echoTestRpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + std::launch m_asyncLaunchMode; +}; } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index 6c0635375..c99cb380f 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -15,997 +15,1069 @@ using namespace Aws::Eventstreamrpc; -namespace Awstest -{ - class EchoTestRpcClient; - class EchoTestRpcServiceModel; - class Product : public AbstractShapeBase - { - public: - Product() noexcept {} - Product(const Product &) = default; - void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } - Aws::Crt::Optional GetName() noexcept { return m_name; } - void SetPrice(const float &price) noexcept { m_price = price; } - Aws::Crt::Optional GetPrice() noexcept { return m_price; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Product &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Product *) noexcept; - /* This needs to be defined so that `Product` can be used as a key in maps. */ - bool operator<(const Product &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_name; - Aws::Crt::Optional m_price; - }; - - class Customer : public AbstractShapeBase - { - public: - Customer() noexcept {} - Customer(const Customer &) = default; - void SetId(const int64_t &id) noexcept { m_id = id; } - Aws::Crt::Optional GetId() noexcept { return m_id; } - void SetFirstName(const Aws::Crt::String &firstName) noexcept { m_firstName = firstName; } - Aws::Crt::Optional GetFirstName() noexcept { return m_firstName; } - void SetLastName(const Aws::Crt::String &lastName) noexcept { m_lastName = lastName; } - Aws::Crt::Optional GetLastName() noexcept { return m_lastName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Customer &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Customer *) noexcept; - /* This needs to be defined so that `Customer` can be used as a key in maps. - */ - bool operator<(const Customer &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_id; - Aws::Crt::Optional m_firstName; - Aws::Crt::Optional m_lastName; - }; - - enum FruitEnum - { - FRUIT_ENUM_APPLE, - FRUIT_ENUM_ORANGE, - FRUIT_ENUM_BANANA, - FRUIT_ENUM_PINEAPPLE - }; - - class Pair : public AbstractShapeBase - { - public: - Pair() noexcept {} - Pair(const Pair &) = default; - void SetKey(const Aws::Crt::String &key) noexcept { m_key = key; } - Aws::Crt::Optional GetKey() noexcept { return m_key; } - void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Pair &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Pair *) noexcept; - /* This needs to be defined so that `Pair` can be used as a key in maps. */ - bool operator<(const Pair &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_key; - Aws::Crt::Optional m_value; - }; - - class MessageData : public AbstractShapeBase - { - public: - MessageData() noexcept {} - MessageData(const MessageData &) = default; - void SetStringMessage(const Aws::Crt::String &stringMessage) noexcept { m_stringMessage = stringMessage; } - Aws::Crt::Optional GetStringMessage() noexcept { return m_stringMessage; } - void SetBooleanMessage(const bool &booleanMessage) noexcept { m_booleanMessage = booleanMessage; } - Aws::Crt::Optional GetBooleanMessage() noexcept { return m_booleanMessage; } - void SetTimeMessage(const Aws::Crt::DateTime &timeMessage) noexcept { m_timeMessage = timeMessage; } - Aws::Crt::Optional GetTimeMessage() noexcept { return m_timeMessage; } - void SetDocumentMessage(const Aws::Crt::JsonObject &documentMessage) noexcept - { - m_documentMessage = documentMessage; - } - Aws::Crt::Optional GetDocumentMessage() noexcept { return m_documentMessage; } - void SetEnumMessage(FruitEnum enumMessage) noexcept; - Aws::Crt::Optional GetEnumMessage() noexcept; - void SetBlobMessage(const Aws::Crt::Vector &blobMessage) noexcept { m_blobMessage = blobMessage; } - Aws::Crt::Optional> GetBlobMessage() noexcept { return m_blobMessage; } - void SetStringListMessage(const Aws::Crt::Vector &stringListMessage) noexcept - { - m_stringListMessage = stringListMessage; - } - Aws::Crt::Optional> GetStringListMessage() noexcept - { - return m_stringListMessage; - } - void SetKeyValuePairList(const Aws::Crt::Vector &keyValuePairList) noexcept - { - m_keyValuePairList = keyValuePairList; - } - Aws::Crt::Optional> GetKeyValuePairList() noexcept { return m_keyValuePairList; } - void SetStringToValue(const Aws::Crt::Map &stringToValue) noexcept - { - m_stringToValue = stringToValue; - } - Aws::Crt::Optional> GetStringToValue() noexcept - { - return m_stringToValue; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MessageData &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MessageData *) noexcept; - /* This needs to be defined so that `MessageData` can be used as a key in - * maps. */ - bool operator<(const MessageData &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_stringMessage; - Aws::Crt::Optional m_booleanMessage; - Aws::Crt::Optional m_timeMessage; - Aws::Crt::Optional m_documentMessage; - Aws::Crt::Optional m_enumMessage; - Aws::Crt::Optional> m_blobMessage; - Aws::Crt::Optional> m_stringListMessage; - Aws::Crt::Optional> m_keyValuePairList; - Aws::Crt::Optional> m_stringToValue; - }; - - class EchoStreamingMessage : public AbstractShapeBase - { - public: - EchoStreamingMessage() noexcept {} - EchoStreamingMessage &operator=(const EchoStreamingMessage &) noexcept; - EchoStreamingMessage(const EchoStreamingMessage &objectToCopy) { *this = objectToCopy; } - void SetStreamMessage(const MessageData &streamMessage) noexcept - { - m_streamMessage = streamMessage; - m_chosenMember = TAG_STREAM_MESSAGE; - } - Aws::Crt::Optional GetStreamMessage() noexcept - { - if (m_chosenMember == TAG_STREAM_MESSAGE) - { - return m_streamMessage; - } - else - { - return Aws::Crt::Optional(); - } - } - void SetKeyValuePair(const Pair &keyValuePair) noexcept - { - m_keyValuePair = keyValuePair; - m_chosenMember = TAG_KEY_VALUE_PAIR; - } - Aws::Crt::Optional GetKeyValuePair() noexcept - { - if (m_chosenMember == TAG_KEY_VALUE_PAIR) - { - return m_keyValuePair; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingMessage *) noexcept; - /* This needs to be defined so that `EchoStreamingMessage` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_STREAM_MESSAGE, - TAG_KEY_VALUE_PAIR - } m_chosenMember; - Aws::Crt::Optional m_streamMessage; - Aws::Crt::Optional m_keyValuePair; - }; - - class GetAllProductsResponse : public AbstractShapeBase - { - public: - GetAllProductsResponse() noexcept {} - GetAllProductsResponse(const GetAllProductsResponse &) = default; - void SetProducts(const Aws::Crt::Map &products) noexcept { m_products = products; } - Aws::Crt::Optional> GetProducts() noexcept { return m_products; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllProductsResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllProductsResponse *) noexcept; - /* This needs to be defined so that `GetAllProductsResponse` can be used as a - * key in maps. */ - bool operator<(const GetAllProductsResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_products; - }; - - class GetAllProductsRequest : public AbstractShapeBase - { - public: - GetAllProductsRequest() noexcept {} - GetAllProductsRequest(const GetAllProductsRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllProductsRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllProductsRequest *) noexcept; - /* This needs to be defined so that `GetAllProductsRequest` can be used as a - * key in maps. */ - bool operator<(const GetAllProductsRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class GetAllCustomersResponse : public AbstractShapeBase - { - public: - GetAllCustomersResponse() noexcept {} - GetAllCustomersResponse(const GetAllCustomersResponse &) = default; - void SetCustomers(const Aws::Crt::Vector &customers) noexcept { m_customers = customers; } - Aws::Crt::Optional> GetCustomers() noexcept { return m_customers; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllCustomersResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllCustomersResponse *) noexcept; - /* This needs to be defined so that `GetAllCustomersResponse` can be used as a - * key in maps. */ - bool operator<(const GetAllCustomersResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_customers; - }; - - class GetAllCustomersRequest : public AbstractShapeBase - { - public: - GetAllCustomersRequest() noexcept {} - GetAllCustomersRequest(const GetAllCustomersRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllCustomersRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllCustomersRequest *) noexcept; - /* This needs to be defined so that `GetAllCustomersRequest` can be used as a - * key in maps. */ - bool operator<(const GetAllCustomersRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class EchoMessageResponse : public AbstractShapeBase - { - public: - EchoMessageResponse() noexcept {} - EchoMessageResponse(const EchoMessageResponse &) = default; - void SetMessage(const MessageData &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoMessageResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoMessageResponse *) noexcept; - /* This needs to be defined so that `EchoMessageResponse` can be used as a key - * in maps. */ - bool operator<(const EchoMessageResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class EchoMessageRequest : public AbstractShapeBase - { - public: - EchoMessageRequest() noexcept {} - EchoMessageRequest(const EchoMessageRequest &) = default; - void SetMessage(const MessageData &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoMessageRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoMessageRequest *) noexcept; - /* This needs to be defined so that `EchoMessageRequest` can be used as a key - * in maps. */ - bool operator<(const EchoMessageRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class EchoStreamingResponse : public AbstractShapeBase - { - public: - EchoStreamingResponse() noexcept {} - EchoStreamingResponse(const EchoStreamingResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingResponse *) noexcept; - /* This needs to be defined so that `EchoStreamingResponse` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class EchoStreamingRequest : public AbstractShapeBase - { - public: - EchoStreamingRequest() noexcept {} - EchoStreamingRequest(const EchoStreamingRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingRequest *) noexcept; - /* This needs to be defined so that `EchoStreamingRequest` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class ServiceError : public OperationError - { - public: - ServiceError() noexcept {} - ServiceError(const ServiceError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ServiceError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in - * maps. */ - bool operator<(const ServiceError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_value; - }; - - class CauseServiceErrorResponse : public AbstractShapeBase - { - public: - CauseServiceErrorResponse() noexcept {} - CauseServiceErrorResponse(const CauseServiceErrorResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CauseServiceErrorResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CauseServiceErrorResponse *) noexcept; - /* This needs to be defined so that `CauseServiceErrorResponse` can be used as - * a key in maps. */ - bool operator<(const CauseServiceErrorResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class CauseServiceErrorRequest : public AbstractShapeBase - { - public: - CauseServiceErrorRequest() noexcept {} - CauseServiceErrorRequest(const CauseServiceErrorRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CauseServiceErrorRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CauseServiceErrorRequest *) noexcept; - /* This needs to be defined so that `CauseServiceErrorRequest` can be used as - * a key in maps. */ - bool operator<(const CauseServiceErrorRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class GetAllProductsOperationContext : public OperationModelContext - { - public: - GetAllProductsOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetAllProductsResult - { - public: - GetAllProductsResult() noexcept {} - GetAllProductsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetAllProductsResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetAllProductsOperation : public ClientOperation - { - public: - GetAllProductsOperation( - ClientConnection &connection, - const GetAllProductsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetAllProductsOperation` - * @param request The request used for the `GetAllProductsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetAllProductsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class CauseServiceErrorOperationContext : public OperationModelContext - { - public: - CauseServiceErrorOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class CauseServiceErrorResult - { - public: - CauseServiceErrorResult() noexcept {} - CauseServiceErrorResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - CauseServiceErrorResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class CauseServiceErrorOperation : public ClientOperation - { - public: - CauseServiceErrorOperation( - ClientConnection &connection, - const CauseServiceErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CauseServiceErrorOperation` - * @param request The request used for the `CauseServiceErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const CauseServiceErrorRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class CauseStreamServiceToErrorStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class CauseStreamServiceToErrorOperationContext : public OperationModelContext - { - public: - CauseStreamServiceToErrorOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class CauseStreamServiceToErrorResult - { - public: - CauseStreamServiceToErrorResult() noexcept {} - CauseStreamServiceToErrorResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) - { - } - EchoStreamingResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class CauseStreamServiceToErrorOperation : public ClientOperation - { - public: - CauseStreamServiceToErrorOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const CauseStreamServiceToErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CauseStreamServiceToErrorOperation` - * @param request The request used for the - * `CauseStreamServiceToErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class EchoStreamMessagesStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class EchoStreamMessagesOperationContext : public OperationModelContext - { - public: - EchoStreamMessagesOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class EchoStreamMessagesResult - { - public: - EchoStreamMessagesResult() noexcept {} - EchoStreamMessagesResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - EchoStreamingResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class EchoStreamMessagesOperation : public ClientOperation - { - public: - EchoStreamMessagesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const EchoStreamMessagesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `EchoStreamMessagesOperation` - * @param request The request used for the `EchoStreamMessagesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class EchoMessageOperationContext : public OperationModelContext - { - public: - EchoMessageOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class EchoMessageResult - { - public: - EchoMessageResult() noexcept {} - EchoMessageResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - EchoMessageResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class EchoMessageOperation : public ClientOperation - { - public: - EchoMessageOperation( - ClientConnection &connection, - const EchoMessageOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `EchoMessageOperation` - * @param request The request used for the `EchoMessageOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const EchoMessageRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetAllCustomersOperationContext : public OperationModelContext - { - public: - GetAllCustomersOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetAllCustomersResult - { - public: - GetAllCustomersResult() noexcept {} - GetAllCustomersResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetAllCustomersResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetAllCustomersOperation : public ClientOperation - { - public: - GetAllCustomersOperation( - ClientConnection &connection, - const GetAllCustomersOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetAllCustomersOperation` - * @param request The request used for the `GetAllCustomersOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetAllCustomersRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class EchoTestRpcServiceModel : public ServiceModel - { - public: - EchoTestRpcServiceModel() noexcept; - Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - void AssignModelNameToErrorResponse(Aws::Crt::String, ErrorResponseFactory) noexcept; - - private: - friend class EchoTestRpcClient; - GetAllProductsOperationContext m_getAllProductsOperationContext; - CauseServiceErrorOperationContext m_causeServiceErrorOperationContext; - CauseStreamServiceToErrorOperationContext m_causeStreamServiceToErrorOperationContext; - EchoStreamMessagesOperationContext m_echoStreamMessagesOperationContext; - EchoMessageOperationContext m_echoMessageOperationContext; - GetAllCustomersOperationContext m_getAllCustomersOperationContext; - Aws::Crt::Map m_modelNameToErrorResponse; - }; +namespace Awstest { +class EchoTestRpcClient; +class EchoTestRpcServiceModel; +class Product : public AbstractShapeBase { +public: + Product() noexcept {} + Product(const Product &) = default; + void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } + Aws::Crt::Optional GetName() noexcept { return m_name; } + void SetPrice(const float &price) noexcept { m_price = price; } + Aws::Crt::Optional GetPrice() noexcept { return m_price; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Product &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Product *) noexcept; + /* This needs to be defined so that `Product` can be used as a key in maps. */ + bool operator<(const Product &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_name; + Aws::Crt::Optional m_price; +}; + +class Customer : public AbstractShapeBase { +public: + Customer() noexcept {} + Customer(const Customer &) = default; + void SetId(const int64_t &id) noexcept { m_id = id; } + Aws::Crt::Optional GetId() noexcept { return m_id; } + void SetFirstName(const Aws::Crt::String &firstName) noexcept { + m_firstName = firstName; + } + Aws::Crt::Optional GetFirstName() noexcept { + return m_firstName; + } + void SetLastName(const Aws::Crt::String &lastName) noexcept { + m_lastName = lastName; + } + Aws::Crt::Optional GetLastName() noexcept { + return m_lastName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Customer &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Customer *) noexcept; + /* This needs to be defined so that `Customer` can be used as a key in maps. + */ + bool operator<(const Customer &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_id; + Aws::Crt::Optional m_firstName; + Aws::Crt::Optional m_lastName; +}; + +enum FruitEnum { + FRUIT_ENUM_APPLE, + FRUIT_ENUM_ORANGE, + FRUIT_ENUM_BANANA, + FRUIT_ENUM_PINEAPPLE +}; + +class Pair : public AbstractShapeBase { +public: + Pair() noexcept {} + Pair(const Pair &) = default; + void SetKey(const Aws::Crt::String &key) noexcept { m_key = key; } + Aws::Crt::Optional GetKey() noexcept { return m_key; } + void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Pair &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Pair *) noexcept; + /* This needs to be defined so that `Pair` can be used as a key in maps. */ + bool operator<(const Pair &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_key; + Aws::Crt::Optional m_value; +}; + +class MessageData : public AbstractShapeBase { +public: + MessageData() noexcept {} + MessageData(const MessageData &) = default; + void SetStringMessage(const Aws::Crt::String &stringMessage) noexcept { + m_stringMessage = stringMessage; + } + Aws::Crt::Optional GetStringMessage() noexcept { + return m_stringMessage; + } + void SetBooleanMessage(const bool &booleanMessage) noexcept { + m_booleanMessage = booleanMessage; + } + Aws::Crt::Optional GetBooleanMessage() noexcept { + return m_booleanMessage; + } + void SetTimeMessage(const Aws::Crt::DateTime &timeMessage) noexcept { + m_timeMessage = timeMessage; + } + Aws::Crt::Optional GetTimeMessage() noexcept { + return m_timeMessage; + } + void + SetDocumentMessage(const Aws::Crt::JsonObject &documentMessage) noexcept { + m_documentMessage = documentMessage; + } + Aws::Crt::Optional GetDocumentMessage() noexcept { + return m_documentMessage; + } + void SetEnumMessage(FruitEnum enumMessage) noexcept; + Aws::Crt::Optional GetEnumMessage() noexcept; + void SetBlobMessage(const Aws::Crt::Vector &blobMessage) noexcept { + m_blobMessage = blobMessage; + } + Aws::Crt::Optional> GetBlobMessage() noexcept { + return m_blobMessage; + } + void SetStringListMessage( + const Aws::Crt::Vector &stringListMessage) noexcept { + m_stringListMessage = stringListMessage; + } + Aws::Crt::Optional> + GetStringListMessage() noexcept { + return m_stringListMessage; + } + void + SetKeyValuePairList(const Aws::Crt::Vector &keyValuePairList) noexcept { + m_keyValuePairList = keyValuePairList; + } + Aws::Crt::Optional> GetKeyValuePairList() noexcept { + return m_keyValuePairList; + } + void SetStringToValue( + const Aws::Crt::Map &stringToValue) noexcept { + m_stringToValue = stringToValue; + } + Aws::Crt::Optional> + GetStringToValue() noexcept { + return m_stringToValue; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MessageData &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MessageData *) noexcept; + /* This needs to be defined so that `MessageData` can be used as a key in + * maps. */ + bool operator<(const MessageData &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_stringMessage; + Aws::Crt::Optional m_booleanMessage; + Aws::Crt::Optional m_timeMessage; + Aws::Crt::Optional m_documentMessage; + Aws::Crt::Optional m_enumMessage; + Aws::Crt::Optional> m_blobMessage; + Aws::Crt::Optional> m_stringListMessage; + Aws::Crt::Optional> m_keyValuePairList; + Aws::Crt::Optional> m_stringToValue; +}; + +class EchoStreamingMessage : public AbstractShapeBase { +public: + EchoStreamingMessage() noexcept {} + EchoStreamingMessage &operator=(const EchoStreamingMessage &) noexcept; + EchoStreamingMessage(const EchoStreamingMessage &objectToCopy) { + *this = objectToCopy; + } + void SetStreamMessage(const MessageData &streamMessage) noexcept { + m_streamMessage = streamMessage; + m_chosenMember = TAG_STREAM_MESSAGE; + } + Aws::Crt::Optional GetStreamMessage() noexcept { + if (m_chosenMember == TAG_STREAM_MESSAGE) { + return m_streamMessage; + } else { + return Aws::Crt::Optional(); + } + } + void SetKeyValuePair(const Pair &keyValuePair) noexcept { + m_keyValuePair = keyValuePair; + m_chosenMember = TAG_KEY_VALUE_PAIR; + } + Aws::Crt::Optional GetKeyValuePair() noexcept { + if (m_chosenMember == TAG_KEY_VALUE_PAIR) { + return m_keyValuePair; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingMessage *) noexcept; + /* This needs to be defined so that `EchoStreamingMessage` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_STREAM_MESSAGE, TAG_KEY_VALUE_PAIR } m_chosenMember; + Aws::Crt::Optional m_streamMessage; + Aws::Crt::Optional m_keyValuePair; +}; + +class GetAllProductsResponse : public AbstractShapeBase { +public: + GetAllProductsResponse() noexcept {} + GetAllProductsResponse(const GetAllProductsResponse &) = default; + void SetProducts( + const Aws::Crt::Map &products) noexcept { + m_products = products; + } + Aws::Crt::Optional> + GetProducts() noexcept { + return m_products; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllProductsResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllProductsResponse *) noexcept; + /* This needs to be defined so that `GetAllProductsResponse` can be used as a + * key in maps. */ + bool operator<(const GetAllProductsResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_products; +}; + +class GetAllProductsRequest : public AbstractShapeBase { +public: + GetAllProductsRequest() noexcept {} + GetAllProductsRequest(const GetAllProductsRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllProductsRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllProductsRequest *) noexcept; + /* This needs to be defined so that `GetAllProductsRequest` can be used as a + * key in maps. */ + bool operator<(const GetAllProductsRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class GetAllCustomersResponse : public AbstractShapeBase { +public: + GetAllCustomersResponse() noexcept {} + GetAllCustomersResponse(const GetAllCustomersResponse &) = default; + void SetCustomers(const Aws::Crt::Vector &customers) noexcept { + m_customers = customers; + } + Aws::Crt::Optional> GetCustomers() noexcept { + return m_customers; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllCustomersResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllCustomersResponse *) noexcept; + /* This needs to be defined so that `GetAllCustomersResponse` can be used as a + * key in maps. */ + bool operator<(const GetAllCustomersResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_customers; +}; + +class GetAllCustomersRequest : public AbstractShapeBase { +public: + GetAllCustomersRequest() noexcept {} + GetAllCustomersRequest(const GetAllCustomersRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllCustomersRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllCustomersRequest *) noexcept; + /* This needs to be defined so that `GetAllCustomersRequest` can be used as a + * key in maps. */ + bool operator<(const GetAllCustomersRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class EchoMessageResponse : public AbstractShapeBase { +public: + EchoMessageResponse() noexcept {} + EchoMessageResponse(const EchoMessageResponse &) = default; + void SetMessage(const MessageData &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoMessageResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoMessageResponse *) noexcept; + /* This needs to be defined so that `EchoMessageResponse` can be used as a key + * in maps. */ + bool operator<(const EchoMessageResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class EchoMessageRequest : public AbstractShapeBase { +public: + EchoMessageRequest() noexcept {} + EchoMessageRequest(const EchoMessageRequest &) = default; + void SetMessage(const MessageData &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoMessageRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoMessageRequest *) noexcept; + /* This needs to be defined so that `EchoMessageRequest` can be used as a key + * in maps. */ + bool operator<(const EchoMessageRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class EchoStreamingResponse : public AbstractShapeBase { +public: + EchoStreamingResponse() noexcept {} + EchoStreamingResponse(const EchoStreamingResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingResponse *) noexcept; + /* This needs to be defined so that `EchoStreamingResponse` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class EchoStreamingRequest : public AbstractShapeBase { +public: + EchoStreamingRequest() noexcept {} + EchoStreamingRequest(const EchoStreamingRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingRequest *) noexcept; + /* This needs to be defined so that `EchoStreamingRequest` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class ServiceError : public OperationError { +public: + ServiceError() noexcept {} + ServiceError(const ServiceError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ServiceError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ServiceError *) noexcept; + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ + bool operator<(const ServiceError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_value; +}; + +class CauseServiceErrorResponse : public AbstractShapeBase { +public: + CauseServiceErrorResponse() noexcept {} + CauseServiceErrorResponse(const CauseServiceErrorResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CauseServiceErrorResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CauseServiceErrorResponse *) noexcept; + /* This needs to be defined so that `CauseServiceErrorResponse` can be used as + * a key in maps. */ + bool operator<(const CauseServiceErrorResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class CauseServiceErrorRequest : public AbstractShapeBase { +public: + CauseServiceErrorRequest() noexcept {} + CauseServiceErrorRequest(const CauseServiceErrorRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CauseServiceErrorRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CauseServiceErrorRequest *) noexcept; + /* This needs to be defined so that `CauseServiceErrorRequest` can be used as + * a key in maps. */ + bool operator<(const CauseServiceErrorRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class GetAllProductsOperationContext : public OperationModelContext { +public: + GetAllProductsOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetAllProductsResult { +public: + GetAllProductsResult() noexcept {} + GetAllProductsResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetAllProductsResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetAllProductsOperation : public ClientOperation { +public: + GetAllProductsOperation( + ClientConnection &connection, + const GetAllProductsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetAllProductsOperation` + * @param request The request used for the `GetAllProductsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetAllProductsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class CauseServiceErrorOperationContext : public OperationModelContext { +public: + CauseServiceErrorOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class CauseServiceErrorResult { +public: + CauseServiceErrorResult() noexcept {} + CauseServiceErrorResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + CauseServiceErrorResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class CauseServiceErrorOperation : public ClientOperation { +public: + CauseServiceErrorOperation( + ClientConnection &connection, + const CauseServiceErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CauseServiceErrorOperation` + * @param request The request used for the `CauseServiceErrorOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const CauseServiceErrorRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class CauseStreamServiceToErrorStreamHandler : public StreamResponseHandler { +public: + virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class CauseStreamServiceToErrorOperationContext : public OperationModelContext { +public: + CauseStreamServiceToErrorOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class CauseStreamServiceToErrorResult { +public: + CauseStreamServiceToErrorResult() noexcept {} + CauseStreamServiceToErrorResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + EchoStreamingResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class CauseStreamServiceToErrorOperation : public ClientOperation { +public: + CauseStreamServiceToErrorOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const CauseStreamServiceToErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CauseStreamServiceToErrorOperation` + * @param request The request used for the + * `CauseStreamServiceToErrorOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class EchoStreamMessagesStreamHandler : public StreamResponseHandler { +public: + virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class EchoStreamMessagesOperationContext : public OperationModelContext { +public: + EchoStreamMessagesOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class EchoStreamMessagesResult { +public: + EchoStreamMessagesResult() noexcept {} + EchoStreamMessagesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + EchoStreamingResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class EchoStreamMessagesOperation : public ClientOperation { +public: + EchoStreamMessagesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const EchoStreamMessagesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `EchoStreamMessagesOperation` + * @param request The request used for the `EchoStreamMessagesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class EchoMessageOperationContext : public OperationModelContext { +public: + EchoMessageOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class EchoMessageResult { +public: + EchoMessageResult() noexcept {} + EchoMessageResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + EchoMessageResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class EchoMessageOperation : public ClientOperation { +public: + EchoMessageOperation( + ClientConnection &connection, + const EchoMessageOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `EchoMessageOperation` + * @param request The request used for the `EchoMessageOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const EchoMessageRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetAllCustomersOperationContext : public OperationModelContext { +public: + GetAllCustomersOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetAllCustomersResult { +public: + GetAllCustomersResult() noexcept {} + GetAllCustomersResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetAllCustomersResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetAllCustomersOperation : public ClientOperation { +public: + GetAllCustomersOperation( + ClientConnection &connection, + const GetAllCustomersOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetAllCustomersOperation` + * @param request The request used for the `GetAllCustomersOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetAllCustomersRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class EchoTestRpcServiceModel : public ServiceModel { +public: + EchoTestRpcServiceModel() noexcept; + Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + void AssignModelNameToErrorResponse(Aws::Crt::String, + ErrorResponseFactory) noexcept; + +private: + friend class EchoTestRpcClient; + GetAllProductsOperationContext m_getAllProductsOperationContext; + CauseServiceErrorOperationContext m_causeServiceErrorOperationContext; + CauseStreamServiceToErrorOperationContext + m_causeStreamServiceToErrorOperationContext; + EchoStreamMessagesOperationContext m_echoStreamMessagesOperationContext; + EchoMessageOperationContext m_echoMessageOperationContext; + GetAllCustomersOperationContext m_getAllCustomersOperationContext; + Aws::Crt::Map + m_modelNameToErrorResponse; +}; } // namespace Awstest diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h index ce29e7444..7fea02759 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -12,117 +12,136 @@ using namespace Aws::Eventstreamrpc; -namespace Aws -{ - namespace Greengrass - { - class DefaultConnectionConfig : public ConnectionConfig - { - public: - DefaultConnectionConfig() noexcept; - }; +namespace Aws { +namespace Greengrass { +class DefaultConnectionConfig : public ConnectionConfig { +public: + DefaultConnectionConfig() noexcept; +}; - class GreengrassCoreIpcClient - { - public: - GreengrassCoreIpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle - * events relating to the connection occur. - * @param connectionConfig The configuration parameters used for establishing - * the connection. - * @return An `RpcError` that can be used to check whether the connection was - * established. - */ - std::future Connect( - ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig = DefaultConnectionConfig()) noexcept; - bool IsConnected() const noexcept { return m_connection.IsOpen(); } - void Close() noexcept; - std::shared_ptr NewSubscribeToIoTCore( - std::shared_ptr streamHandler) noexcept; +class GreengrassCoreIpcClient { +public: + GreengrassCoreIpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Connect the client to the server + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. + */ + std::future Connect(ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig = + DefaultConnectionConfig()) noexcept; + bool IsConnected() const noexcept { return m_connection.IsOpen(); } + void Close() noexcept; + void WithLaunchMode(std::launch mode) noexcept; - std::shared_ptr NewResumeComponent() noexcept; + std::shared_ptr NewSubscribeToIoTCore( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewPublishToIoTCore() noexcept; + std::shared_ptr NewResumeComponent() noexcept; - std::shared_ptr NewSubscribeToConfigurationUpdate( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewPublishToIoTCore() noexcept; - std::shared_ptr NewDeleteThingShadow() noexcept; + std::shared_ptr + NewSubscribeToConfigurationUpdate( + std::shared_ptr + streamHandler) noexcept; - std::shared_ptr NewPutComponentMetric() noexcept; + std::shared_ptr NewDeleteThingShadow() noexcept; - std::shared_ptr NewDeferComponentUpdate() noexcept; + std::shared_ptr NewPutComponentMetric() noexcept; - std::shared_ptr - NewSubscribeToValidateConfigurationUpdates( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr + NewDeferComponentUpdate() noexcept; - std::shared_ptr NewGetConfiguration() noexcept; + std::shared_ptr + NewSubscribeToValidateConfigurationUpdates( + std::shared_ptr + streamHandler) noexcept; - std::shared_ptr NewSubscribeToTopic( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewGetConfiguration() noexcept; - std::shared_ptr NewGetComponentDetails() noexcept; + std::shared_ptr NewSubscribeToTopic( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewGetClientDeviceAuthToken() noexcept; + std::shared_ptr + NewGetComponentDetails() noexcept; - std::shared_ptr NewPublishToTopic() noexcept; + std::shared_ptr + NewGetClientDeviceAuthToken() noexcept; - std::shared_ptr NewSubscribeToCertificateUpdates( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewPublishToTopic() noexcept; - std::shared_ptr NewVerifyClientDeviceIdentity() noexcept; + std::shared_ptr + NewSubscribeToCertificateUpdates( + std::shared_ptr + streamHandler) noexcept; - std::shared_ptr NewAuthorizeClientDeviceAction() noexcept; + std::shared_ptr + NewVerifyClientDeviceIdentity() noexcept; - std::shared_ptr NewListComponents() noexcept; + std::shared_ptr + NewAuthorizeClientDeviceAction() noexcept; - std::shared_ptr NewCreateDebugPassword() noexcept; + std::shared_ptr NewListComponents() noexcept; - std::shared_ptr NewGetThingShadow() noexcept; + std::shared_ptr + NewCreateDebugPassword() noexcept; - std::shared_ptr NewSendConfigurationValidityReport() noexcept; + std::shared_ptr NewGetThingShadow() noexcept; - std::shared_ptr NewUpdateThingShadow() noexcept; + std::shared_ptr + NewSendConfigurationValidityReport() noexcept; - std::shared_ptr NewUpdateConfiguration() noexcept; + std::shared_ptr NewUpdateThingShadow() noexcept; - std::shared_ptr NewValidateAuthorizationToken() noexcept; + std::shared_ptr + NewUpdateConfiguration() noexcept; - std::shared_ptr NewRestartComponent() noexcept; + std::shared_ptr + NewValidateAuthorizationToken() noexcept; - std::shared_ptr NewGetLocalDeploymentStatus() noexcept; + std::shared_ptr NewRestartComponent() noexcept; - std::shared_ptr NewGetSecretValue() noexcept; + std::shared_ptr + NewGetLocalDeploymentStatus() noexcept; - std::shared_ptr NewUpdateState() noexcept; + std::shared_ptr NewGetSecretValue() noexcept; - std::shared_ptr NewListNamedShadowsForThing() noexcept; + std::shared_ptr NewUpdateState() noexcept; - std::shared_ptr NewSubscribeToComponentUpdates( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr + NewListNamedShadowsForThing() noexcept; - std::shared_ptr NewListLocalDeployments() noexcept; + std::shared_ptr + NewSubscribeToComponentUpdates( + std::shared_ptr + streamHandler) noexcept; - std::shared_ptr NewStopComponent() noexcept; + std::shared_ptr + NewListLocalDeployments() noexcept; - std::shared_ptr NewPauseComponent() noexcept; + std::shared_ptr NewStopComponent() noexcept; - std::shared_ptr NewCreateLocalDeployment() noexcept; + std::shared_ptr NewPauseComponent() noexcept; - ~GreengrassCoreIpcClient() noexcept; + std::shared_ptr + NewCreateLocalDeployment() noexcept; - private: - GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - }; - } // namespace Greengrass + ~GreengrassCoreIpcClient() noexcept; + +private: + GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + std::launch m_asyncLaunchMode; +}; +} // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index 343f9a39f..bf53d67de 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -15,5859 +15,6433 @@ using namespace Aws::Eventstreamrpc; -namespace Aws -{ - namespace Greengrass - { - class GreengrassCoreIpcClient; - class GreengrassCoreIpcServiceModel; - enum MetricUnitType - { - METRIC_UNIT_TYPE_BYTES, - METRIC_UNIT_TYPE_BYTES_PER_SECOND, - METRIC_UNIT_TYPE_COUNT, - METRIC_UNIT_TYPE_COUNT_PER_SECOND, - METRIC_UNIT_TYPE_MEGABYTES, - METRIC_UNIT_TYPE_SECONDS - }; - - class MessageContext : public AbstractShapeBase - { - public: - MessageContext() noexcept {} - MessageContext(const MessageContext &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MessageContext &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MessageContext *) noexcept; - /* This needs to be defined so that `MessageContext` can be used as a key in - * maps. */ - bool operator<(const MessageContext &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topic; - }; - - class SystemResourceLimits : public AbstractShapeBase - { - public: - SystemResourceLimits() noexcept {} - SystemResourceLimits(const SystemResourceLimits &) = default; - void SetMemory(const int64_t &memory) noexcept { m_memory = memory; } - Aws::Crt::Optional GetMemory() noexcept { return m_memory; } - void SetCpus(const double &cpus) noexcept { m_cpus = cpus; } - Aws::Crt::Optional GetCpus() noexcept { return m_cpus; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SystemResourceLimits &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SystemResourceLimits *) noexcept; - /* This needs to be defined so that `SystemResourceLimits` can be used as a - * key in maps. */ - bool operator<(const SystemResourceLimits &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_memory; - Aws::Crt::Optional m_cpus; - }; - - class ValidateConfigurationUpdateEvent : public AbstractShapeBase - { - public: - ValidateConfigurationUpdateEvent() noexcept {} - ValidateConfigurationUpdateEvent(const ValidateConfigurationUpdateEvent &) = default; - void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept - { - m_configuration = configuration; - } - Aws::Crt::Optional GetConfiguration() noexcept { return m_configuration; } - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateConfigurationUpdateEvent &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be - * used as a key in maps. */ - bool operator<(const ValidateConfigurationUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_configuration; - Aws::Crt::Optional m_deploymentId; - }; - - class MQTTMessage : public AbstractShapeBase - { - public: - MQTTMessage() noexcept {} - MQTTMessage(const MQTTMessage &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } - Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MQTTMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MQTTMessage *) noexcept; - /* This needs to be defined so that `MQTTMessage` can be used as a key in - * maps. */ - bool operator<(const MQTTMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional> m_payload; - }; - - class ConfigurationUpdateEvent : public AbstractShapeBase - { - public: - ConfigurationUpdateEvent() noexcept {} - ConfigurationUpdateEvent(const ConfigurationUpdateEvent &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } - Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationUpdateEvent &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as - * a key in maps. */ - bool operator<(const ConfigurationUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; - }; - - class PostComponentUpdateEvent : public AbstractShapeBase - { - public: - PostComponentUpdateEvent() noexcept {} - PostComponentUpdateEvent(const PostComponentUpdateEvent &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PostComponentUpdateEvent &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PostComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PostComponentUpdateEvent` can be used as - * a key in maps. */ - bool operator<(const PostComponentUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - }; - - class PreComponentUpdateEvent : public AbstractShapeBase - { - public: - PreComponentUpdateEvent() noexcept {} - PreComponentUpdateEvent(const PreComponentUpdateEvent &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SetIsGgcRestarting(const bool &isGgcRestarting) noexcept { m_isGgcRestarting = isGgcRestarting; } - Aws::Crt::Optional GetIsGgcRestarting() noexcept { return m_isGgcRestarting; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PreComponentUpdateEvent &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PreComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a - * key in maps. */ - bool operator<(const PreComponentUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_isGgcRestarting; - }; - - class CertificateUpdate : public AbstractShapeBase - { - public: - CertificateUpdate() noexcept {} - CertificateUpdate(const CertificateUpdate &) = default; - void SetPrivateKey(const Aws::Crt::String &privateKey) noexcept { m_privateKey = privateKey; } - Aws::Crt::Optional GetPrivateKey() noexcept { return m_privateKey; } - void SetPublicKey(const Aws::Crt::String &publicKey) noexcept { m_publicKey = publicKey; } - Aws::Crt::Optional GetPublicKey() noexcept { return m_publicKey; } - void SetCertificate(const Aws::Crt::String &certificate) noexcept { m_certificate = certificate; } - Aws::Crt::Optional GetCertificate() noexcept { return m_certificate; } - void SetCaCertificates(const Aws::Crt::Vector &caCertificates) noexcept - { - m_caCertificates = caCertificates; - } - Aws::Crt::Optional> GetCaCertificates() noexcept - { - return m_caCertificates; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateUpdate &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateUpdate *) noexcept; - /* This needs to be defined so that `CertificateUpdate` can be used as a key - * in maps. */ - bool operator<(const CertificateUpdate &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_privateKey; - Aws::Crt::Optional m_publicKey; - Aws::Crt::Optional m_certificate; - Aws::Crt::Optional> m_caCertificates; - }; - - enum CertificateType - { - CERTIFICATE_TYPE_SERVER - }; - - enum ConfigurationValidityStatus - { - CONFIGURATION_VALIDITY_STATUS_ACCEPTED, - CONFIGURATION_VALIDITY_STATUS_REJECTED - }; - - class Metric : public AbstractShapeBase - { - public: - Metric() noexcept {} - Metric(const Metric &) = default; - void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } - Aws::Crt::Optional GetName() noexcept { return m_name; } - void SetUnit(MetricUnitType unit) noexcept; - Aws::Crt::Optional GetUnit() noexcept; - void SetValue(const double &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Metric &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Metric *) noexcept; - /* This needs to be defined so that `Metric` can be used as a key in maps. */ - bool operator<(const Metric &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_name; - Aws::Crt::Optional m_unit; - Aws::Crt::Optional m_value; - }; - - class BinaryMessage : public AbstractShapeBase - { - public: - BinaryMessage() noexcept {} - BinaryMessage(const BinaryMessage &) = default; - void SetMessage(const Aws::Crt::Vector &message) noexcept { m_message = message; } - Aws::Crt::Optional> GetMessage() noexcept { return m_message; } - /* The context is ignored if used in PublishMessage. */ - void SetContext(const MessageContext &context) noexcept { m_context = context; } - /* The context is ignored if used in PublishMessage. */ - Aws::Crt::Optional GetContext() noexcept { return m_context; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(BinaryMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(BinaryMessage *) noexcept; - /* This needs to be defined so that `BinaryMessage` can be used as a key in - * maps. */ - bool operator<(const BinaryMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_message; - Aws::Crt::Optional m_context; - }; - - class JsonMessage : public AbstractShapeBase - { - public: - JsonMessage() noexcept {} - JsonMessage(const JsonMessage &) = default; - void SetMessage(const Aws::Crt::JsonObject &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - /* The context is ignored if used in PublishMessage. */ - void SetContext(const MessageContext &context) noexcept { m_context = context; } - /* The context is ignored if used in PublishMessage. */ - Aws::Crt::Optional GetContext() noexcept { return m_context; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(JsonMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(JsonMessage *) noexcept; - /* This needs to be defined so that `JsonMessage` can be used as a key in - * maps. */ - bool operator<(const JsonMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_context; - }; - - enum DeploymentStatus - { - DEPLOYMENT_STATUS_QUEUED, - DEPLOYMENT_STATUS_IN_PROGRESS, - DEPLOYMENT_STATUS_SUCCEEDED, - DEPLOYMENT_STATUS_FAILED - }; - - enum LifecycleState - { - LIFECYCLE_STATE_RUNNING, - LIFECYCLE_STATE_ERRORED, - LIFECYCLE_STATE_NEW, - LIFECYCLE_STATE_FINISHED, - LIFECYCLE_STATE_INSTALLED, - LIFECYCLE_STATE_BROKEN, - LIFECYCLE_STATE_STARTING, - LIFECYCLE_STATE_STOPPING - }; - - class MQTTCredential : public AbstractShapeBase - { - public: - MQTTCredential() noexcept {} - MQTTCredential(const MQTTCredential &) = default; - void SetClientId(const Aws::Crt::String &clientId) noexcept { m_clientId = clientId; } - Aws::Crt::Optional GetClientId() noexcept { return m_clientId; } - void SetCertificatePem(const Aws::Crt::String &certificatePem) noexcept - { - m_certificatePem = certificatePem; - } - Aws::Crt::Optional GetCertificatePem() noexcept { return m_certificatePem; } - void SetUsername(const Aws::Crt::String &username) noexcept { m_username = username; } - Aws::Crt::Optional GetUsername() noexcept { return m_username; } - void SetPassword(const Aws::Crt::String &password) noexcept { m_password = password; } - Aws::Crt::Optional GetPassword() noexcept { return m_password; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MQTTCredential &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MQTTCredential *) noexcept; - /* This needs to be defined so that `MQTTCredential` can be used as a key in - * maps. */ - bool operator<(const MQTTCredential &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_clientId; - Aws::Crt::Optional m_certificatePem; - Aws::Crt::Optional m_username; - Aws::Crt::Optional m_password; - }; - - class RunWithInfo : public AbstractShapeBase - { - public: - RunWithInfo() noexcept {} - RunWithInfo(const RunWithInfo &) = default; - void SetPosixUser(const Aws::Crt::String &posixUser) noexcept { m_posixUser = posixUser; } - Aws::Crt::Optional GetPosixUser() noexcept { return m_posixUser; } - void SetWindowsUser(const Aws::Crt::String &windowsUser) noexcept { m_windowsUser = windowsUser; } - Aws::Crt::Optional GetWindowsUser() noexcept { return m_windowsUser; } - void SetSystemResourceLimits(const SystemResourceLimits &systemResourceLimits) noexcept - { - m_systemResourceLimits = systemResourceLimits; - } - Aws::Crt::Optional GetSystemResourceLimits() noexcept - { - return m_systemResourceLimits; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RunWithInfo &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RunWithInfo *) noexcept; - /* This needs to be defined so that `RunWithInfo` can be used as a key in - * maps. */ - bool operator<(const RunWithInfo &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_posixUser; - Aws::Crt::Optional m_windowsUser; - Aws::Crt::Optional m_systemResourceLimits; - }; - - class ClientDeviceCredential : public AbstractShapeBase - { - public: - ClientDeviceCredential() noexcept {} - ClientDeviceCredential &operator=(const ClientDeviceCredential &) noexcept; - ClientDeviceCredential(const ClientDeviceCredential &objectToCopy) { *this = objectToCopy; } - void SetClientDeviceCertificate(const Aws::Crt::String &clientDeviceCertificate) noexcept - { - m_clientDeviceCertificate = clientDeviceCertificate; - m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; - } - Aws::Crt::Optional GetClientDeviceCertificate() noexcept - { - if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) - { - return m_clientDeviceCertificate; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ClientDeviceCredential &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ClientDeviceCredential *) noexcept; - /* This needs to be defined so that `ClientDeviceCredential` can be used as a - * key in maps. */ - bool operator<(const ClientDeviceCredential &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_CLIENT_DEVICE_CERTIFICATE - } m_chosenMember; - Aws::Crt::Optional m_clientDeviceCertificate; - }; - - enum ReportedLifecycleState - { - REPORTED_LIFECYCLE_STATE_RUNNING, - REPORTED_LIFECYCLE_STATE_ERRORED - }; - - class ValidateConfigurationUpdateEvents : public AbstractShapeBase - { - public: - ValidateConfigurationUpdateEvents() noexcept {} - ValidateConfigurationUpdateEvents &operator=(const ValidateConfigurationUpdateEvents &) noexcept; - ValidateConfigurationUpdateEvents(const ValidateConfigurationUpdateEvents &objectToCopy) - { - *this = objectToCopy; - } - void SetValidateConfigurationUpdateEvent( - const ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent) noexcept - { - m_validateConfigurationUpdateEvent = validateConfigurationUpdateEvent; - m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; - } - Aws::Crt::Optional GetValidateConfigurationUpdateEvent() noexcept - { - if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) - { - return m_validateConfigurationUpdateEvent; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateConfigurationUpdateEvents &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be - * used as a key in maps. */ - bool operator<(const ValidateConfigurationUpdateEvents &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT - } m_chosenMember; - Aws::Crt::Optional m_validateConfigurationUpdateEvent; - }; - - class SubscriptionResponseMessage : public AbstractShapeBase - { - public: - SubscriptionResponseMessage() noexcept {} - SubscriptionResponseMessage &operator=(const SubscriptionResponseMessage &) noexcept; - SubscriptionResponseMessage(const SubscriptionResponseMessage &objectToCopy) { *this = objectToCopy; } - void SetJsonMessage(const JsonMessage &jsonMessage) noexcept - { - m_jsonMessage = jsonMessage; - m_chosenMember = TAG_JSON_MESSAGE; - } - Aws::Crt::Optional GetJsonMessage() noexcept - { - if (m_chosenMember == TAG_JSON_MESSAGE) - { - return m_jsonMessage; - } - else - { - return Aws::Crt::Optional(); - } - } - void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept - { - m_binaryMessage = binaryMessage; - m_chosenMember = TAG_BINARY_MESSAGE; - } - Aws::Crt::Optional GetBinaryMessage() noexcept - { - if (m_chosenMember == TAG_BINARY_MESSAGE) - { - return m_binaryMessage; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscriptionResponseMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscriptionResponseMessage *) noexcept; - /* This needs to be defined so that `SubscriptionResponseMessage` can be used - * as a key in maps. */ - bool operator<(const SubscriptionResponseMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_JSON_MESSAGE, - TAG_BINARY_MESSAGE - } m_chosenMember; - Aws::Crt::Optional m_jsonMessage; - Aws::Crt::Optional m_binaryMessage; - }; - - enum ReceiveMode - { - RECEIVE_MODE_RECEIVE_ALL_MESSAGES, - RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS - }; - - class IoTCoreMessage : public AbstractShapeBase - { - public: - IoTCoreMessage() noexcept {} - IoTCoreMessage &operator=(const IoTCoreMessage &) noexcept; - IoTCoreMessage(const IoTCoreMessage &objectToCopy) { *this = objectToCopy; } - void SetMessage(const MQTTMessage &message) noexcept - { - m_message = message; - m_chosenMember = TAG_MESSAGE; - } - Aws::Crt::Optional GetMessage() noexcept - { - if (m_chosenMember == TAG_MESSAGE) - { - return m_message; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(IoTCoreMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(IoTCoreMessage *) noexcept; - /* This needs to be defined so that `IoTCoreMessage` can be used as a key in - * maps. */ - bool operator<(const IoTCoreMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_MESSAGE - } m_chosenMember; - Aws::Crt::Optional m_message; - }; - - class ConfigurationUpdateEvents : public AbstractShapeBase - { - public: - ConfigurationUpdateEvents() noexcept {} - ConfigurationUpdateEvents &operator=(const ConfigurationUpdateEvents &) noexcept; - ConfigurationUpdateEvents(const ConfigurationUpdateEvents &objectToCopy) { *this = objectToCopy; } - void SetConfigurationUpdateEvent(const ConfigurationUpdateEvent &configurationUpdateEvent) noexcept - { - m_configurationUpdateEvent = configurationUpdateEvent; - m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; - } - Aws::Crt::Optional GetConfigurationUpdateEvent() noexcept - { - if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) - { - return m_configurationUpdateEvent; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationUpdateEvents &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as - * a key in maps. */ - bool operator<(const ConfigurationUpdateEvents &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_CONFIGURATION_UPDATE_EVENT - } m_chosenMember; - Aws::Crt::Optional m_configurationUpdateEvent; - }; - - class ComponentUpdatePolicyEvents : public AbstractShapeBase - { - public: - ComponentUpdatePolicyEvents() noexcept {} - ComponentUpdatePolicyEvents &operator=(const ComponentUpdatePolicyEvents &) noexcept; - ComponentUpdatePolicyEvents(const ComponentUpdatePolicyEvents &objectToCopy) { *this = objectToCopy; } - void SetPreUpdateEvent(const PreComponentUpdateEvent &preUpdateEvent) noexcept - { - m_preUpdateEvent = preUpdateEvent; - m_chosenMember = TAG_PRE_UPDATE_EVENT; - } - Aws::Crt::Optional GetPreUpdateEvent() noexcept - { - if (m_chosenMember == TAG_PRE_UPDATE_EVENT) - { - return m_preUpdateEvent; - } - else - { - return Aws::Crt::Optional(); - } - } - void SetPostUpdateEvent(const PostComponentUpdateEvent &postUpdateEvent) noexcept - { - m_postUpdateEvent = postUpdateEvent; - m_chosenMember = TAG_POST_UPDATE_EVENT; - } - Aws::Crt::Optional GetPostUpdateEvent() noexcept - { - if (m_chosenMember == TAG_POST_UPDATE_EVENT) - { - return m_postUpdateEvent; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentUpdatePolicyEvents &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; - /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used - * as a key in maps. */ - bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_PRE_UPDATE_EVENT, - TAG_POST_UPDATE_EVENT - } m_chosenMember; - Aws::Crt::Optional m_preUpdateEvent; - Aws::Crt::Optional m_postUpdateEvent; - }; - - class CertificateUpdateEvent : public AbstractShapeBase - { - public: - CertificateUpdateEvent() noexcept {} - CertificateUpdateEvent &operator=(const CertificateUpdateEvent &) noexcept; - CertificateUpdateEvent(const CertificateUpdateEvent &objectToCopy) { *this = objectToCopy; } - void SetCertificateUpdate(const CertificateUpdate &certificateUpdate) noexcept - { - m_certificateUpdate = certificateUpdate; - m_chosenMember = TAG_CERTIFICATE_UPDATE; - } - Aws::Crt::Optional GetCertificateUpdate() noexcept - { - if (m_chosenMember == TAG_CERTIFICATE_UPDATE) - { - return m_certificateUpdate; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateUpdateEvent &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateUpdateEvent *) noexcept; - /* This needs to be defined so that `CertificateUpdateEvent` can be used as a - * key in maps. */ - bool operator<(const CertificateUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_CERTIFICATE_UPDATE - } m_chosenMember; - Aws::Crt::Optional m_certificateUpdate; - }; - - class CertificateOptions : public AbstractShapeBase - { - public: - CertificateOptions() noexcept {} - CertificateOptions(const CertificateOptions &) = default; - void SetCertificateType(CertificateType certificateType) noexcept; - Aws::Crt::Optional GetCertificateType() noexcept; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateOptions &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateOptions *) noexcept; - /* This needs to be defined so that `CertificateOptions` can be used as a key - * in maps. */ - bool operator<(const CertificateOptions &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_certificateType; - }; - - class ConfigurationValidityReport : public AbstractShapeBase - { - public: - ConfigurationValidityReport() noexcept {} - ConfigurationValidityReport(const ConfigurationValidityReport &) = default; - void SetStatus(ConfigurationValidityStatus status) noexcept; - Aws::Crt::Optional GetStatus() noexcept; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationValidityReport &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationValidityReport *) noexcept; - /* This needs to be defined so that `ConfigurationValidityReport` can be used - * as a key in maps. */ - bool operator<(const ConfigurationValidityReport &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_status; - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_message; - }; - - enum RequestStatus - { - REQUEST_STATUS_SUCCEEDED, - REQUEST_STATUS_FAILED - }; - - class PublishMessage : public AbstractShapeBase - { - public: - PublishMessage() noexcept {} - PublishMessage &operator=(const PublishMessage &) noexcept; - PublishMessage(const PublishMessage &objectToCopy) { *this = objectToCopy; } - void SetJsonMessage(const JsonMessage &jsonMessage) noexcept - { - m_jsonMessage = jsonMessage; - m_chosenMember = TAG_JSON_MESSAGE; - } - Aws::Crt::Optional GetJsonMessage() noexcept - { - if (m_chosenMember == TAG_JSON_MESSAGE) - { - return m_jsonMessage; - } - else - { - return Aws::Crt::Optional(); - } - } - void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept - { - m_binaryMessage = binaryMessage; - m_chosenMember = TAG_BINARY_MESSAGE; - } - Aws::Crt::Optional GetBinaryMessage() noexcept - { - if (m_chosenMember == TAG_BINARY_MESSAGE) - { - return m_binaryMessage; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishMessage &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishMessage *) noexcept; - /* This needs to be defined so that `PublishMessage` can be used as a key in - * maps. */ - bool operator<(const PublishMessage &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_JSON_MESSAGE, - TAG_BINARY_MESSAGE - } m_chosenMember; - Aws::Crt::Optional m_jsonMessage; - Aws::Crt::Optional m_binaryMessage; - }; - - enum QOS - { - QOS_AT_MOST_ONCE, - QOS_AT_LEAST_ONCE - }; - - class SecretValue : public AbstractShapeBase - { - public: - SecretValue() noexcept {} - SecretValue &operator=(const SecretValue &) noexcept; - SecretValue(const SecretValue &objectToCopy) { *this = objectToCopy; } - void SetSecretString(const Aws::Crt::String &secretString) noexcept - { - m_secretString = secretString; - m_chosenMember = TAG_SECRET_STRING; - } - Aws::Crt::Optional GetSecretString() noexcept - { - if (m_chosenMember == TAG_SECRET_STRING) - { - return m_secretString; - } - else - { - return Aws::Crt::Optional(); - } - } - void SetSecretBinary(const Aws::Crt::Vector &secretBinary) noexcept - { - m_secretBinary = secretBinary; - m_chosenMember = TAG_SECRET_BINARY; - } - Aws::Crt::Optional> GetSecretBinary() noexcept - { - if (m_chosenMember == TAG_SECRET_BINARY) - { - return m_secretBinary; - } - else - { - return Aws::Crt::Optional>(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SecretValue &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SecretValue *) noexcept; - /* This needs to be defined so that `SecretValue` can be used as a key in - * maps. */ - bool operator<(const SecretValue &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_SECRET_STRING, - TAG_SECRET_BINARY - } m_chosenMember; - Aws::Crt::Optional m_secretString; - Aws::Crt::Optional> m_secretBinary; - }; - - class LocalDeployment : public AbstractShapeBase - { - public: - LocalDeployment() noexcept {} - LocalDeployment(const LocalDeployment &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SetStatus(DeploymentStatus status) noexcept; - Aws::Crt::Optional GetStatus() noexcept; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(LocalDeployment &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(LocalDeployment *) noexcept; - /* This needs to be defined so that `LocalDeployment` can be used as a key in - * maps. */ - bool operator<(const LocalDeployment &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_status; - }; - - class ComponentDetails : public AbstractShapeBase - { - public: - ComponentDetails() noexcept {} - ComponentDetails(const ComponentDetails &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SetVersion(const Aws::Crt::String &version) noexcept { m_version = version; } - Aws::Crt::Optional GetVersion() noexcept { return m_version; } - void SetState(LifecycleState state) noexcept; - Aws::Crt::Optional GetState() noexcept; - void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept - { - m_configuration = configuration; - } - Aws::Crt::Optional GetConfiguration() noexcept { return m_configuration; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentDetails &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentDetails *) noexcept; - /* This needs to be defined so that `ComponentDetails` can be used as a key in - * maps. */ - bool operator<(const ComponentDetails &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional m_version; - Aws::Crt::Optional m_state; - Aws::Crt::Optional m_configuration; - }; - - class CredentialDocument : public AbstractShapeBase - { - public: - CredentialDocument() noexcept {} - CredentialDocument &operator=(const CredentialDocument &) noexcept; - CredentialDocument(const CredentialDocument &objectToCopy) { *this = objectToCopy; } - void SetMqttCredential(const MQTTCredential &mqttCredential) noexcept - { - m_mqttCredential = mqttCredential; - m_chosenMember = TAG_MQTT_CREDENTIAL; - } - Aws::Crt::Optional GetMqttCredential() noexcept - { - if (m_chosenMember == TAG_MQTT_CREDENTIAL) - { - return m_mqttCredential; - } - else - { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CredentialDocument &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CredentialDocument *) noexcept; - /* This needs to be defined so that `CredentialDocument` can be used as a key - * in maps. */ - bool operator<(const CredentialDocument &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - enum ChosenMember - { - TAG_MQTT_CREDENTIAL - } m_chosenMember; - Aws::Crt::Optional m_mqttCredential; - }; - - class VerifyClientDeviceIdentityResponse : public AbstractShapeBase - { - public: - VerifyClientDeviceIdentityResponse() noexcept {} - VerifyClientDeviceIdentityResponse(const VerifyClientDeviceIdentityResponse &) = default; - void SetIsValidClientDevice(const bool &isValidClientDevice) noexcept - { - m_isValidClientDevice = isValidClientDevice; - } - Aws::Crt::Optional GetIsValidClientDevice() noexcept { return m_isValidClientDevice; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(VerifyClientDeviceIdentityResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(VerifyClientDeviceIdentityResponse *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can - * be used as a key in maps. */ - bool operator<(const VerifyClientDeviceIdentityResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_isValidClientDevice; - }; - - class VerifyClientDeviceIdentityRequest : public AbstractShapeBase - { - public: - VerifyClientDeviceIdentityRequest() noexcept {} - VerifyClientDeviceIdentityRequest(const VerifyClientDeviceIdentityRequest &) = default; - void SetCredential(const ClientDeviceCredential &credential) noexcept { m_credential = credential; } - Aws::Crt::Optional GetCredential() noexcept { return m_credential; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(VerifyClientDeviceIdentityRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(VerifyClientDeviceIdentityRequest *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be - * used as a key in maps. */ - bool operator<(const VerifyClientDeviceIdentityRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_credential; - }; - - class InvalidTokenError : public OperationError - { - public: - InvalidTokenError() noexcept {} - InvalidTokenError(const InvalidTokenError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidTokenError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidTokenError *) noexcept; - /* This needs to be defined so that `InvalidTokenError` can be used as a key - * in maps. */ - bool operator<(const InvalidTokenError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class ValidateAuthorizationTokenResponse : public AbstractShapeBase - { - public: - ValidateAuthorizationTokenResponse() noexcept {} - ValidateAuthorizationTokenResponse(const ValidateAuthorizationTokenResponse &) = default; - void SetIsValid(const bool &isValid) noexcept { m_isValid = isValid; } - Aws::Crt::Optional GetIsValid() noexcept { return m_isValid; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateAuthorizationTokenResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateAuthorizationTokenResponse *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can - * be used as a key in maps. */ - bool operator<(const ValidateAuthorizationTokenResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_isValid; - }; - - class ValidateAuthorizationTokenRequest : public AbstractShapeBase - { - public: - ValidateAuthorizationTokenRequest() noexcept {} - ValidateAuthorizationTokenRequest(const ValidateAuthorizationTokenRequest &) = default; - void SetToken(const Aws::Crt::String &token) noexcept { m_token = token; } - Aws::Crt::Optional GetToken() noexcept { return m_token; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateAuthorizationTokenRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateAuthorizationTokenRequest *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be - * used as a key in maps. */ - bool operator<(const ValidateAuthorizationTokenRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_token; - }; - - class UpdateThingShadowResponse : public AbstractShapeBase - { - public: - UpdateThingShadowResponse() noexcept {} - UpdateThingShadowResponse(const UpdateThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateThingShadowResponse *) noexcept; - /* This needs to be defined so that `UpdateThingShadowResponse` can be used as - * a key in maps. */ - bool operator<(const UpdateThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_payload; - }; - - class UpdateThingShadowRequest : public AbstractShapeBase - { - public: - UpdateThingShadowRequest() noexcept {} - UpdateThingShadowRequest(const UpdateThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } - Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } - Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateThingShadowRequest *) noexcept; - /* This needs to be defined so that `UpdateThingShadowRequest` can be used as - * a key in maps. */ - bool operator<(const UpdateThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; - Aws::Crt::Optional> m_payload; - }; - - class UpdateStateResponse : public AbstractShapeBase - { - public: - UpdateStateResponse() noexcept {} - UpdateStateResponse(const UpdateStateResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateStateResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateStateResponse *) noexcept; - /* This needs to be defined so that `UpdateStateResponse` can be used as a key - * in maps. */ - bool operator<(const UpdateStateResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class UpdateStateRequest : public AbstractShapeBase - { - public: - UpdateStateRequest() noexcept {} - UpdateStateRequest(const UpdateStateRequest &) = default; - void SetState(ReportedLifecycleState state) noexcept; - Aws::Crt::Optional GetState() noexcept; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateStateRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateStateRequest *) noexcept; - /* This needs to be defined so that `UpdateStateRequest` can be used as a key - * in maps. */ - bool operator<(const UpdateStateRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_state; - }; - - class FailedUpdateConditionCheckError : public OperationError - { - public: - FailedUpdateConditionCheckError() noexcept {} - FailedUpdateConditionCheckError(const FailedUpdateConditionCheckError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(FailedUpdateConditionCheckError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(FailedUpdateConditionCheckError *) noexcept; - /* This needs to be defined so that `FailedUpdateConditionCheckError` can be - * used as a key in maps. */ - bool operator<(const FailedUpdateConditionCheckError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class ConflictError : public OperationError - { - public: - ConflictError() noexcept {} - ConflictError(const ConflictError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConflictError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConflictError *) noexcept; - /* This needs to be defined so that `ConflictError` can be used as a key in - * maps. */ - bool operator<(const ConflictError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class UpdateConfigurationResponse : public AbstractShapeBase - { - public: - UpdateConfigurationResponse() noexcept {} - UpdateConfigurationResponse(const UpdateConfigurationResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateConfigurationResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateConfigurationResponse *) noexcept; - /* This needs to be defined so that `UpdateConfigurationResponse` can be used - * as a key in maps. */ - bool operator<(const UpdateConfigurationResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class UpdateConfigurationRequest : public AbstractShapeBase - { - public: - UpdateConfigurationRequest() noexcept {} - UpdateConfigurationRequest(const UpdateConfigurationRequest &) = default; - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } - Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } - void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { m_timestamp = timestamp; } - Aws::Crt::Optional GetTimestamp() noexcept { return m_timestamp; } - void SetValueToMerge(const Aws::Crt::JsonObject &valueToMerge) noexcept { m_valueToMerge = valueToMerge; } - Aws::Crt::Optional GetValueToMerge() noexcept { return m_valueToMerge; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateConfigurationRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateConfigurationRequest *) noexcept; - /* This needs to be defined so that `UpdateConfigurationRequest` can be used - * as a key in maps. */ - bool operator<(const UpdateConfigurationRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_keyPath; - Aws::Crt::Optional m_timestamp; - Aws::Crt::Optional m_valueToMerge; - }; - - class SubscribeToValidateConfigurationUpdatesResponse : public AbstractShapeBase - { - public: - SubscribeToValidateConfigurationUpdatesResponse() noexcept {} - SubscribeToValidateConfigurationUpdatesResponse(const SubscribeToValidateConfigurationUpdatesResponse &) = - default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToValidateConfigurationUpdatesResponse *) noexcept; - /* This needs to be defined so that - * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in - * maps. */ - bool operator<(const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToValidateConfigurationUpdatesRequest : public AbstractShapeBase - { - public: - SubscribeToValidateConfigurationUpdatesRequest() noexcept {} - SubscribeToValidateConfigurationUpdatesRequest(const SubscribeToValidateConfigurationUpdatesRequest &) = - default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToValidateConfigurationUpdatesRequest *) noexcept; - /* This needs to be defined so that - * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in - * maps. */ - bool operator<(const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToTopicResponse : public AbstractShapeBase - { - public: - SubscribeToTopicResponse() noexcept {} - SubscribeToTopicResponse(const SubscribeToTopicResponse &) = default; - /* Deprecated No longer used */ - void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } - /* Deprecated No longer used */ - Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToTopicResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToTopicResponse *) noexcept; - /* This needs to be defined so that `SubscribeToTopicResponse` can be used as - * a key in maps. */ - bool operator<(const SubscribeToTopicResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topicName; - }; - - class SubscribeToTopicRequest : public AbstractShapeBase - { - public: - SubscribeToTopicRequest() noexcept {} - SubscribeToTopicRequest(const SubscribeToTopicRequest &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SetReceiveMode(ReceiveMode receiveMode) noexcept; - Aws::Crt::Optional GetReceiveMode() noexcept; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToTopicRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToTopicRequest *) noexcept; - /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a - * key in maps. */ - bool operator<(const SubscribeToTopicRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topic; - Aws::Crt::Optional m_receiveMode; - }; - - class SubscribeToIoTCoreResponse : public AbstractShapeBase - { - public: - SubscribeToIoTCoreResponse() noexcept {} - SubscribeToIoTCoreResponse(const SubscribeToIoTCoreResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToIoTCoreResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used - * as a key in maps. */ - bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToIoTCoreRequest : public AbstractShapeBase - { - public: - SubscribeToIoTCoreRequest() noexcept {} - SubscribeToIoTCoreRequest(const SubscribeToIoTCoreRequest &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } - Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } - void SetQos(QOS qos) noexcept; - Aws::Crt::Optional GetQos() noexcept; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToIoTCoreRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as - * a key in maps. */ - bool operator<(const SubscribeToIoTCoreRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional m_qos; - }; - - class SubscribeToConfigurationUpdateResponse : public AbstractShapeBase - { - public: - SubscribeToConfigurationUpdateResponse() noexcept {} - SubscribeToConfigurationUpdateResponse(const SubscribeToConfigurationUpdateResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SubscribeToConfigurationUpdateResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToConfigurationUpdateResponse *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` - * can be used as a key in maps. */ - bool operator<(const SubscribeToConfigurationUpdateResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToConfigurationUpdateRequest : public AbstractShapeBase - { - public: - SubscribeToConfigurationUpdateRequest() noexcept {} - SubscribeToConfigurationUpdateRequest(const SubscribeToConfigurationUpdateRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } - Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SubscribeToConfigurationUpdateRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToConfigurationUpdateRequest *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` - * can be used as a key in maps. */ - bool operator<(const SubscribeToConfigurationUpdateRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; - }; - - class SubscribeToComponentUpdatesResponse : public AbstractShapeBase - { - public: - SubscribeToComponentUpdatesResponse() noexcept {} - SubscribeToComponentUpdatesResponse(const SubscribeToComponentUpdatesResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToComponentUpdatesResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToComponentUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can - * be used as a key in maps. */ - bool operator<(const SubscribeToComponentUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToComponentUpdatesRequest : public AbstractShapeBase - { - public: - SubscribeToComponentUpdatesRequest() noexcept {} - SubscribeToComponentUpdatesRequest(const SubscribeToComponentUpdatesRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToComponentUpdatesRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToComponentUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can - * be used as a key in maps. */ - bool operator<(const SubscribeToComponentUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToCertificateUpdatesResponse : public AbstractShapeBase - { - public: - SubscribeToCertificateUpdatesResponse() noexcept {} - SubscribeToCertificateUpdatesResponse(const SubscribeToCertificateUpdatesResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SubscribeToCertificateUpdatesResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToCertificateUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` - * can be used as a key in maps. */ - bool operator<(const SubscribeToCertificateUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SubscribeToCertificateUpdatesRequest : public AbstractShapeBase - { - public: - SubscribeToCertificateUpdatesRequest() noexcept {} - SubscribeToCertificateUpdatesRequest(const SubscribeToCertificateUpdatesRequest &) = default; - void SetCertificateOptions(const CertificateOptions &certificateOptions) noexcept - { - m_certificateOptions = certificateOptions; - } - Aws::Crt::Optional GetCertificateOptions() noexcept { return m_certificateOptions; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToCertificateUpdatesRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToCertificateUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can - * be used as a key in maps. */ - bool operator<(const SubscribeToCertificateUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_certificateOptions; - }; - - class StopComponentResponse : public AbstractShapeBase - { - public: - StopComponentResponse() noexcept {} - StopComponentResponse(const StopComponentResponse &) = default; - void SetStopStatus(RequestStatus stopStatus) noexcept; - Aws::Crt::Optional GetStopStatus() noexcept; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(StopComponentResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(StopComponentResponse *) noexcept; - /* This needs to be defined so that `StopComponentResponse` can be used as a - * key in maps. */ - bool operator<(const StopComponentResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_stopStatus; - Aws::Crt::Optional m_message; - }; - - class StopComponentRequest : public AbstractShapeBase - { - public: - StopComponentRequest() noexcept {} - StopComponentRequest(const StopComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(StopComponentRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(StopComponentRequest *) noexcept; - /* This needs to be defined so that `StopComponentRequest` can be used as a - * key in maps. */ - bool operator<(const StopComponentRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - }; - - class SendConfigurationValidityReportResponse : public AbstractShapeBase - { - public: - SendConfigurationValidityReportResponse() noexcept {} - SendConfigurationValidityReportResponse(const SendConfigurationValidityReportResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SendConfigurationValidityReportResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SendConfigurationValidityReportResponse *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportResponse` - * can be used as a key in maps. */ - bool operator<(const SendConfigurationValidityReportResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class SendConfigurationValidityReportRequest : public AbstractShapeBase - { - public: - SendConfigurationValidityReportRequest() noexcept {} - SendConfigurationValidityReportRequest(const SendConfigurationValidityReportRequest &) = default; - void SetConfigurationValidityReport(const ConfigurationValidityReport &configurationValidityReport) noexcept - { - m_configurationValidityReport = configurationValidityReport; - } - Aws::Crt::Optional GetConfigurationValidityReport() noexcept - { - return m_configurationValidityReport; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView( - SendConfigurationValidityReportRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SendConfigurationValidityReportRequest *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportRequest` - * can be used as a key in maps. */ - bool operator<(const SendConfigurationValidityReportRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_configurationValidityReport; - }; - - class ResumeComponentResponse : public AbstractShapeBase - { - public: - ResumeComponentResponse() noexcept {} - ResumeComponentResponse(const ResumeComponentResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResumeComponentResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResumeComponentResponse *) noexcept; - /* This needs to be defined so that `ResumeComponentResponse` can be used as a - * key in maps. */ - bool operator<(const ResumeComponentResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class ResumeComponentRequest : public AbstractShapeBase - { - public: - ResumeComponentRequest() noexcept {} - ResumeComponentRequest(const ResumeComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResumeComponentRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResumeComponentRequest *) noexcept; - /* This needs to be defined so that `ResumeComponentRequest` can be used as a - * key in maps. */ - bool operator<(const ResumeComponentRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - }; - - class ComponentNotFoundError : public OperationError - { - public: - ComponentNotFoundError() noexcept {} - ComponentNotFoundError(const ComponentNotFoundError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentNotFoundError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentNotFoundError *) noexcept; - /* This needs to be defined so that `ComponentNotFoundError` can be used as a - * key in maps. */ - bool operator<(const ComponentNotFoundError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class RestartComponentResponse : public AbstractShapeBase - { - public: - RestartComponentResponse() noexcept {} - RestartComponentResponse(const RestartComponentResponse &) = default; - void SetRestartStatus(RequestStatus restartStatus) noexcept; - Aws::Crt::Optional GetRestartStatus() noexcept; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RestartComponentResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RestartComponentResponse *) noexcept; - /* This needs to be defined so that `RestartComponentResponse` can be used as - * a key in maps. */ - bool operator<(const RestartComponentResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_restartStatus; - Aws::Crt::Optional m_message; - }; - - class RestartComponentRequest : public AbstractShapeBase - { - public: - RestartComponentRequest() noexcept {} - RestartComponentRequest(const RestartComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RestartComponentRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RestartComponentRequest *) noexcept; - /* This needs to be defined so that `RestartComponentRequest` can be used as a - * key in maps. */ - bool operator<(const RestartComponentRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - }; - - class PutComponentMetricResponse : public AbstractShapeBase - { - public: - PutComponentMetricResponse() noexcept {} - PutComponentMetricResponse(const PutComponentMetricResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PutComponentMetricResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PutComponentMetricResponse *) noexcept; - /* This needs to be defined so that `PutComponentMetricResponse` can be used - * as a key in maps. */ - bool operator<(const PutComponentMetricResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class PutComponentMetricRequest : public AbstractShapeBase - { - public: - PutComponentMetricRequest() noexcept {} - PutComponentMetricRequest(const PutComponentMetricRequest &) = default; - void SetMetrics(const Aws::Crt::Vector &metrics) noexcept { m_metrics = metrics; } - Aws::Crt::Optional> GetMetrics() noexcept { return m_metrics; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PutComponentMetricRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PutComponentMetricRequest *) noexcept; - /* This needs to be defined so that `PutComponentMetricRequest` can be used as - * a key in maps. */ - bool operator<(const PutComponentMetricRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_metrics; - }; - - class PublishToTopicResponse : public AbstractShapeBase - { - public: - PublishToTopicResponse() noexcept {} - PublishToTopicResponse(const PublishToTopicResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToTopicResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToTopicResponse *) noexcept; - /* This needs to be defined so that `PublishToTopicResponse` can be used as a - * key in maps. */ - bool operator<(const PublishToTopicResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class PublishToTopicRequest : public AbstractShapeBase - { - public: - PublishToTopicRequest() noexcept {} - PublishToTopicRequest(const PublishToTopicRequest &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SetPublishMessage(const PublishMessage &publishMessage) noexcept { m_publishMessage = publishMessage; } - Aws::Crt::Optional GetPublishMessage() noexcept { return m_publishMessage; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToTopicRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToTopicRequest *) noexcept; - /* This needs to be defined so that `PublishToTopicRequest` can be used as a - * key in maps. */ - bool operator<(const PublishToTopicRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topic; - Aws::Crt::Optional m_publishMessage; - }; - - class PublishToIoTCoreResponse : public AbstractShapeBase - { - public: - PublishToIoTCoreResponse() noexcept {} - PublishToIoTCoreResponse(const PublishToIoTCoreResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToIoTCoreResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as - * a key in maps. */ - bool operator<(const PublishToIoTCoreResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class PublishToIoTCoreRequest : public AbstractShapeBase - { - public: - PublishToIoTCoreRequest() noexcept {} - PublishToIoTCoreRequest(const PublishToIoTCoreRequest &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } - Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } - void SetQos(QOS qos) noexcept; - Aws::Crt::Optional GetQos() noexcept; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToIoTCoreRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a - * key in maps. */ - bool operator<(const PublishToIoTCoreRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional m_qos; - Aws::Crt::Optional> m_payload; - }; - - class PauseComponentResponse : public AbstractShapeBase - { - public: - PauseComponentResponse() noexcept {} - PauseComponentResponse(const PauseComponentResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PauseComponentResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PauseComponentResponse *) noexcept; - /* This needs to be defined so that `PauseComponentResponse` can be used as a - * key in maps. */ - bool operator<(const PauseComponentResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class PauseComponentRequest : public AbstractShapeBase - { - public: - PauseComponentRequest() noexcept {} - PauseComponentRequest(const PauseComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PauseComponentRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PauseComponentRequest *) noexcept; - /* This needs to be defined so that `PauseComponentRequest` can be used as a - * key in maps. */ - bool operator<(const PauseComponentRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - }; - - class ListNamedShadowsForThingResponse : public AbstractShapeBase - { - public: - ListNamedShadowsForThingResponse() noexcept {} - ListNamedShadowsForThingResponse(const ListNamedShadowsForThingResponse &) = default; - void SetResults(const Aws::Crt::Vector &results) noexcept { m_results = results; } - Aws::Crt::Optional> GetResults() noexcept { return m_results; } - void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { m_timestamp = timestamp; } - Aws::Crt::Optional GetTimestamp() noexcept { return m_timestamp; } - void SetNextToken(const Aws::Crt::String &nextToken) noexcept { m_nextToken = nextToken; } - Aws::Crt::Optional GetNextToken() noexcept { return m_nextToken; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListNamedShadowsForThingResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListNamedShadowsForThingResponse *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be - * used as a key in maps. */ - bool operator<(const ListNamedShadowsForThingResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_results; - Aws::Crt::Optional m_timestamp; - Aws::Crt::Optional m_nextToken; - }; - - class ListNamedShadowsForThingRequest : public AbstractShapeBase - { - public: - ListNamedShadowsForThingRequest() noexcept {} - ListNamedShadowsForThingRequest(const ListNamedShadowsForThingRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } - Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } - void SetNextToken(const Aws::Crt::String &nextToken) noexcept { m_nextToken = nextToken; } - Aws::Crt::Optional GetNextToken() noexcept { return m_nextToken; } - void SetPageSize(const int &pageSize) noexcept { m_pageSize = pageSize; } - Aws::Crt::Optional GetPageSize() noexcept { return m_pageSize; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListNamedShadowsForThingRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListNamedShadowsForThingRequest *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be - * used as a key in maps. */ - bool operator<(const ListNamedShadowsForThingRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_nextToken; - Aws::Crt::Optional m_pageSize; - }; - - class ListLocalDeploymentsResponse : public AbstractShapeBase - { - public: - ListLocalDeploymentsResponse() noexcept {} - ListLocalDeploymentsResponse(const ListLocalDeploymentsResponse &) = default; - void SetLocalDeployments(const Aws::Crt::Vector &localDeployments) noexcept - { - m_localDeployments = localDeployments; - } - Aws::Crt::Optional> GetLocalDeployments() noexcept - { - return m_localDeployments; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListLocalDeploymentsResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used - * as a key in maps. */ - bool operator<(const ListLocalDeploymentsResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_localDeployments; - }; - - class ListLocalDeploymentsRequest : public AbstractShapeBase - { - public: - ListLocalDeploymentsRequest() noexcept {} - ListLocalDeploymentsRequest(const ListLocalDeploymentsRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListLocalDeploymentsRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used - * as a key in maps. */ - bool operator<(const ListLocalDeploymentsRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class ListComponentsResponse : public AbstractShapeBase - { - public: - ListComponentsResponse() noexcept {} - ListComponentsResponse(const ListComponentsResponse &) = default; - void SetComponents(const Aws::Crt::Vector &components) noexcept - { - m_components = components; - } - Aws::Crt::Optional> GetComponents() noexcept { return m_components; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListComponentsResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListComponentsResponse *) noexcept; - /* This needs to be defined so that `ListComponentsResponse` can be used as a - * key in maps. */ - bool operator<(const ListComponentsResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_components; - }; - - class ListComponentsRequest : public AbstractShapeBase - { - public: - ListComponentsRequest() noexcept {} - ListComponentsRequest(const ListComponentsRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListComponentsRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListComponentsRequest *) noexcept; - /* This needs to be defined so that `ListComponentsRequest` can be used as a - * key in maps. */ - bool operator<(const ListComponentsRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class GetThingShadowResponse : public AbstractShapeBase - { - public: - GetThingShadowResponse() noexcept {} - GetThingShadowResponse(const GetThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetThingShadowResponse *) noexcept; - /* This needs to be defined so that `GetThingShadowResponse` can be used as a - * key in maps. */ - bool operator<(const GetThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_payload; - }; - - class GetThingShadowRequest : public AbstractShapeBase - { - public: - GetThingShadowRequest() noexcept {} - GetThingShadowRequest(const GetThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } - Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } - Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetThingShadowRequest *) noexcept; - /* This needs to be defined so that `GetThingShadowRequest` can be used as a - * key in maps. */ - bool operator<(const GetThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; - }; - - class GetSecretValueResponse : public AbstractShapeBase - { - public: - GetSecretValueResponse() noexcept {} - GetSecretValueResponse(const GetSecretValueResponse &) = default; - void SetSecretId(const Aws::Crt::String &secretId) noexcept { m_secretId = secretId; } - Aws::Crt::Optional GetSecretId() noexcept { return m_secretId; } - void SetVersionId(const Aws::Crt::String &versionId) noexcept { m_versionId = versionId; } - Aws::Crt::Optional GetVersionId() noexcept { return m_versionId; } - void SetVersionStage(const Aws::Crt::Vector &versionStage) noexcept - { - m_versionStage = versionStage; - } - Aws::Crt::Optional> GetVersionStage() noexcept { return m_versionStage; } - void SetSecretValue(const SecretValue &secretValue) noexcept { m_secretValue = secretValue; } - Aws::Crt::Optional GetSecretValue() noexcept { return m_secretValue; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetSecretValueResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetSecretValueResponse *) noexcept; - /* This needs to be defined so that `GetSecretValueResponse` can be used as a - * key in maps. */ - bool operator<(const GetSecretValueResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_secretId; - Aws::Crt::Optional m_versionId; - Aws::Crt::Optional> m_versionStage; - Aws::Crt::Optional m_secretValue; - }; - - class GetSecretValueRequest : public AbstractShapeBase - { - public: - GetSecretValueRequest() noexcept {} - GetSecretValueRequest(const GetSecretValueRequest &) = default; - void SetSecretId(const Aws::Crt::String &secretId) noexcept { m_secretId = secretId; } - Aws::Crt::Optional GetSecretId() noexcept { return m_secretId; } - void SetVersionId(const Aws::Crt::String &versionId) noexcept { m_versionId = versionId; } - Aws::Crt::Optional GetVersionId() noexcept { return m_versionId; } - void SetVersionStage(const Aws::Crt::String &versionStage) noexcept { m_versionStage = versionStage; } - Aws::Crt::Optional GetVersionStage() noexcept { return m_versionStage; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetSecretValueRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetSecretValueRequest *) noexcept; - /* This needs to be defined so that `GetSecretValueRequest` can be used as a - * key in maps. */ - bool operator<(const GetSecretValueRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_secretId; - Aws::Crt::Optional m_versionId; - Aws::Crt::Optional m_versionStage; - }; - - class GetLocalDeploymentStatusResponse : public AbstractShapeBase - { - public: - GetLocalDeploymentStatusResponse() noexcept {} - GetLocalDeploymentStatusResponse(const GetLocalDeploymentStatusResponse &) = default; - void SetDeployment(const LocalDeployment &deployment) noexcept { m_deployment = deployment; } - Aws::Crt::Optional GetDeployment() noexcept { return m_deployment; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetLocalDeploymentStatusResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetLocalDeploymentStatusResponse *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be - * used as a key in maps. */ - bool operator<(const GetLocalDeploymentStatusResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deployment; - }; - - class GetLocalDeploymentStatusRequest : public AbstractShapeBase - { - public: - GetLocalDeploymentStatusRequest() noexcept {} - GetLocalDeploymentStatusRequest(const GetLocalDeploymentStatusRequest &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetLocalDeploymentStatusRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetLocalDeploymentStatusRequest *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be - * used as a key in maps. */ - bool operator<(const GetLocalDeploymentStatusRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - }; - - class GetConfigurationResponse : public AbstractShapeBase - { - public: - GetConfigurationResponse() noexcept {} - GetConfigurationResponse(const GetConfigurationResponse &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SetValue(const Aws::Crt::JsonObject &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetConfigurationResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetConfigurationResponse *) noexcept; - /* This needs to be defined so that `GetConfigurationResponse` can be used as - * a key in maps. */ - bool operator<(const GetConfigurationResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional m_value; - }; - - class GetConfigurationRequest : public AbstractShapeBase - { - public: - GetConfigurationRequest() noexcept {} - GetConfigurationRequest(const GetConfigurationRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } - Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetConfigurationRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetConfigurationRequest *) noexcept; - /* This needs to be defined so that `GetConfigurationRequest` can be used as a - * key in maps. */ - bool operator<(const GetConfigurationRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; - }; - - class GetComponentDetailsResponse : public AbstractShapeBase - { - public: - GetComponentDetailsResponse() noexcept {} - GetComponentDetailsResponse(const GetComponentDetailsResponse &) = default; - void SetComponentDetails(const ComponentDetails &componentDetails) noexcept - { - m_componentDetails = componentDetails; - } - Aws::Crt::Optional GetComponentDetails() noexcept { return m_componentDetails; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetComponentDetailsResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetComponentDetailsResponse *) noexcept; - /* This needs to be defined so that `GetComponentDetailsResponse` can be used - * as a key in maps. */ - bool operator<(const GetComponentDetailsResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentDetails; - }; - - class GetComponentDetailsRequest : public AbstractShapeBase - { - public: - GetComponentDetailsRequest() noexcept {} - GetComponentDetailsRequest(const GetComponentDetailsRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } - Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetComponentDetailsRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetComponentDetailsRequest *) noexcept; - /* This needs to be defined so that `GetComponentDetailsRequest` can be used - * as a key in maps. */ - bool operator<(const GetComponentDetailsRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_componentName; - }; - - class InvalidCredentialError : public OperationError - { - public: - InvalidCredentialError() noexcept {} - InvalidCredentialError(const InvalidCredentialError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidCredentialError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidCredentialError *) noexcept; - /* This needs to be defined so that `InvalidCredentialError` can be used as a - * key in maps. */ - bool operator<(const InvalidCredentialError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class GetClientDeviceAuthTokenResponse : public AbstractShapeBase - { - public: - GetClientDeviceAuthTokenResponse() noexcept {} - GetClientDeviceAuthTokenResponse(const GetClientDeviceAuthTokenResponse &) = default; - void SetClientDeviceAuthToken(const Aws::Crt::String &clientDeviceAuthToken) noexcept - { - m_clientDeviceAuthToken = clientDeviceAuthToken; - } - Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { return m_clientDeviceAuthToken; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetClientDeviceAuthTokenResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetClientDeviceAuthTokenResponse *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be - * used as a key in maps. */ - bool operator<(const GetClientDeviceAuthTokenResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_clientDeviceAuthToken; - }; - - class GetClientDeviceAuthTokenRequest : public AbstractShapeBase - { - public: - GetClientDeviceAuthTokenRequest() noexcept {} - GetClientDeviceAuthTokenRequest(const GetClientDeviceAuthTokenRequest &) = default; - void SetCredential(const CredentialDocument &credential) noexcept { m_credential = credential; } - Aws::Crt::Optional GetCredential() noexcept { return m_credential; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetClientDeviceAuthTokenRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetClientDeviceAuthTokenRequest *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be - * used as a key in maps. */ - bool operator<(const GetClientDeviceAuthTokenRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_credential; - }; - - class DeleteThingShadowResponse : public AbstractShapeBase - { - public: - DeleteThingShadowResponse() noexcept {} - DeleteThingShadowResponse(const DeleteThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } - Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeleteThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeleteThingShadowResponse *) noexcept; - /* This needs to be defined so that `DeleteThingShadowResponse` can be used as - * a key in maps. */ - bool operator<(const DeleteThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional> m_payload; - }; - - class DeleteThingShadowRequest : public AbstractShapeBase - { - public: - DeleteThingShadowRequest() noexcept {} - DeleteThingShadowRequest(const DeleteThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } - Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } - Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeleteThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeleteThingShadowRequest *) noexcept; - /* This needs to be defined so that `DeleteThingShadowRequest` can be used as - * a key in maps. */ - bool operator<(const DeleteThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; - }; - - class ResourceNotFoundError : public OperationError - { - public: - ResourceNotFoundError() noexcept {} - ResourceNotFoundError(const ResourceNotFoundError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SetResourceType(const Aws::Crt::String &resourceType) noexcept { m_resourceType = resourceType; } - Aws::Crt::Optional GetResourceType() noexcept { return m_resourceType; } - void SetResourceName(const Aws::Crt::String &resourceName) noexcept { m_resourceName = resourceName; } - Aws::Crt::Optional GetResourceName() noexcept { return m_resourceName; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResourceNotFoundError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResourceNotFoundError *) noexcept; - /* This needs to be defined so that `ResourceNotFoundError` can be used as a - * key in maps. */ - bool operator<(const ResourceNotFoundError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_resourceType; - Aws::Crt::Optional m_resourceName; - }; - - class DeferComponentUpdateResponse : public AbstractShapeBase - { - public: - DeferComponentUpdateResponse() noexcept {} - DeferComponentUpdateResponse(const DeferComponentUpdateResponse &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeferComponentUpdateResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateResponse` can be used - * as a key in maps. */ - bool operator<(const DeferComponentUpdateResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class DeferComponentUpdateRequest : public AbstractShapeBase - { - public: - DeferComponentUpdateRequest() noexcept {} - DeferComponentUpdateRequest(const DeferComponentUpdateRequest &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SetRecheckAfterMs(const int64_t &recheckAfterMs) noexcept { m_recheckAfterMs = recheckAfterMs; } - Aws::Crt::Optional GetRecheckAfterMs() noexcept { return m_recheckAfterMs; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeferComponentUpdateRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateRequest` can be used - * as a key in maps. */ - bool operator<(const DeferComponentUpdateRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_recheckAfterMs; - }; - - class InvalidArtifactsDirectoryPathError : public OperationError - { - public: - InvalidArtifactsDirectoryPathError() noexcept {} - InvalidArtifactsDirectoryPathError(const InvalidArtifactsDirectoryPathError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidArtifactsDirectoryPathError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidArtifactsDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can - * be used as a key in maps. */ - bool operator<(const InvalidArtifactsDirectoryPathError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class InvalidRecipeDirectoryPathError : public OperationError - { - public: - InvalidRecipeDirectoryPathError() noexcept {} - InvalidRecipeDirectoryPathError(const InvalidRecipeDirectoryPathError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidRecipeDirectoryPathError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidRecipeDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be - * used as a key in maps. */ - bool operator<(const InvalidRecipeDirectoryPathError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class CreateLocalDeploymentResponse : public AbstractShapeBase - { - public: - CreateLocalDeploymentResponse() noexcept {} - CreateLocalDeploymentResponse(const CreateLocalDeploymentResponse &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } - Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateLocalDeploymentResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateLocalDeploymentResponse *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentResponse` can be - * used as a key in maps. */ - bool operator<(const CreateLocalDeploymentResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_deploymentId; - }; - - class CreateLocalDeploymentRequest : public AbstractShapeBase - { - public: - CreateLocalDeploymentRequest() noexcept {} - CreateLocalDeploymentRequest(const CreateLocalDeploymentRequest &) = default; - void SetGroupName(const Aws::Crt::String &groupName) noexcept { m_groupName = groupName; } - Aws::Crt::Optional GetGroupName() noexcept { return m_groupName; } - void SetRootComponentVersionsToAdd( - const Aws::Crt::Map &rootComponentVersionsToAdd) noexcept - { - m_rootComponentVersionsToAdd = rootComponentVersionsToAdd; - } - Aws::Crt::Optional> - GetRootComponentVersionsToAdd() noexcept - { - return m_rootComponentVersionsToAdd; - } - void SetRootComponentsToRemove(const Aws::Crt::Vector &rootComponentsToRemove) noexcept - { - m_rootComponentsToRemove = rootComponentsToRemove; - } - Aws::Crt::Optional> GetRootComponentsToRemove() noexcept - { - return m_rootComponentsToRemove; - } - void SetComponentToConfiguration( - const Aws::Crt::Map &componentToConfiguration) noexcept - { - m_componentToConfiguration = componentToConfiguration; - } - Aws::Crt::Optional> - GetComponentToConfiguration() noexcept - { - return m_componentToConfiguration; - } - void SetComponentToRunWithInfo( - const Aws::Crt::Map &componentToRunWithInfo) noexcept - { - m_componentToRunWithInfo = componentToRunWithInfo; - } - Aws::Crt::Optional> GetComponentToRunWithInfo() noexcept - { - return m_componentToRunWithInfo; - } - void SetRecipeDirectoryPath(const Aws::Crt::String &recipeDirectoryPath) noexcept - { - m_recipeDirectoryPath = recipeDirectoryPath; - } - Aws::Crt::Optional GetRecipeDirectoryPath() noexcept { return m_recipeDirectoryPath; } - void SetArtifactsDirectoryPath(const Aws::Crt::String &artifactsDirectoryPath) noexcept - { - m_artifactsDirectoryPath = artifactsDirectoryPath; - } - Aws::Crt::Optional GetArtifactsDirectoryPath() noexcept - { - return m_artifactsDirectoryPath; - } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateLocalDeploymentRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used - * as a key in maps. */ - bool operator<(const CreateLocalDeploymentRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_groupName; - Aws::Crt::Optional> m_rootComponentVersionsToAdd; - Aws::Crt::Optional> m_rootComponentsToRemove; - Aws::Crt::Optional> m_componentToConfiguration; - Aws::Crt::Optional> m_componentToRunWithInfo; - Aws::Crt::Optional m_recipeDirectoryPath; - Aws::Crt::Optional m_artifactsDirectoryPath; - }; - - class CreateDebugPasswordResponse : public AbstractShapeBase - { - public: - CreateDebugPasswordResponse() noexcept {} - CreateDebugPasswordResponse(const CreateDebugPasswordResponse &) = default; - void SetPassword(const Aws::Crt::String &password) noexcept { m_password = password; } - Aws::Crt::Optional GetPassword() noexcept { return m_password; } - void SetUsername(const Aws::Crt::String &username) noexcept { m_username = username; } - Aws::Crt::Optional GetUsername() noexcept { return m_username; } - void SetPasswordExpiration(const Aws::Crt::DateTime &passwordExpiration) noexcept - { - m_passwordExpiration = passwordExpiration; - } - Aws::Crt::Optional GetPasswordExpiration() noexcept { return m_passwordExpiration; } - void SetCertificateSHA256Hash(const Aws::Crt::String &certificateSHA256Hash) noexcept - { - m_certificateSHA256Hash = certificateSHA256Hash; - } - Aws::Crt::Optional GetCertificateSHA256Hash() noexcept { return m_certificateSHA256Hash; } - void SetCertificateSHA1Hash(const Aws::Crt::String &certificateSHA1Hash) noexcept - { - m_certificateSHA1Hash = certificateSHA1Hash; - } - Aws::Crt::Optional GetCertificateSHA1Hash() noexcept { return m_certificateSHA1Hash; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateDebugPasswordResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordResponse` can be used - * as a key in maps. */ - bool operator<(const CreateDebugPasswordResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_password; - Aws::Crt::Optional m_username; - Aws::Crt::Optional m_passwordExpiration; - Aws::Crt::Optional m_certificateSHA256Hash; - Aws::Crt::Optional m_certificateSHA1Hash; - }; - - class CreateDebugPasswordRequest : public AbstractShapeBase - { - public: - CreateDebugPasswordRequest() noexcept {} - CreateDebugPasswordRequest(const CreateDebugPasswordRequest &) = default; - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateDebugPasswordRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordRequest` can be used - * as a key in maps. */ - bool operator<(const CreateDebugPasswordRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - }; - - class InvalidClientDeviceAuthTokenError : public OperationError - { - public: - InvalidClientDeviceAuthTokenError() noexcept {} - InvalidClientDeviceAuthTokenError(const InvalidClientDeviceAuthTokenError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidClientDeviceAuthTokenError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidClientDeviceAuthTokenError *) noexcept; - /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be - * used as a key in maps. */ - bool operator<(const InvalidClientDeviceAuthTokenError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class InvalidArgumentsError : public OperationError - { - public: - InvalidArgumentsError() noexcept {} - InvalidArgumentsError(const InvalidArgumentsError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidArgumentsError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidArgumentsError *) noexcept; - /* This needs to be defined so that `InvalidArgumentsError` can be used as a - * key in maps. */ - bool operator<(const InvalidArgumentsError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class ServiceError : public OperationError - { - public: - ServiceError() noexcept {} - ServiceError(const ServiceError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ServiceError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in - * maps. */ - bool operator<(const ServiceError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class UnauthorizedError : public OperationError - { - public: - UnauthorizedError() noexcept {} - UnauthorizedError(const UnauthorizedError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept override { return m_message; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UnauthorizedError &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UnauthorizedError *) noexcept; - /* This needs to be defined so that `UnauthorizedError` can be used as a key - * in maps. */ - bool operator<(const UnauthorizedError &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_message; - }; - - class AuthorizeClientDeviceActionResponse : public AbstractShapeBase - { - public: - AuthorizeClientDeviceActionResponse() noexcept {} - AuthorizeClientDeviceActionResponse(const AuthorizeClientDeviceActionResponse &) = default; - void SetIsAuthorized(const bool &isAuthorized) noexcept { m_isAuthorized = isAuthorized; } - Aws::Crt::Optional GetIsAuthorized() noexcept { return m_isAuthorized; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(AuthorizeClientDeviceActionResponse &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(AuthorizeClientDeviceActionResponse *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can - * be used as a key in maps. */ - bool operator<(const AuthorizeClientDeviceActionResponse &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_isAuthorized; - }; - - class AuthorizeClientDeviceActionRequest : public AbstractShapeBase - { - public: - AuthorizeClientDeviceActionRequest() noexcept {} - AuthorizeClientDeviceActionRequest(const AuthorizeClientDeviceActionRequest &) = default; - void SetClientDeviceAuthToken(const Aws::Crt::String &clientDeviceAuthToken) noexcept - { - m_clientDeviceAuthToken = clientDeviceAuthToken; - } - Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { return m_clientDeviceAuthToken; } - void SetOperation(const Aws::Crt::String &operation) noexcept { m_operation = operation; } - Aws::Crt::Optional GetOperation() noexcept { return m_operation; } - void SetResource(const Aws::Crt::String &resource) noexcept { m_resource = resource; } - Aws::Crt::Optional GetResource() noexcept { return m_resource; } - void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(AuthorizeClientDeviceActionRequest &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource s_allocateFromPayload( - Aws::Crt::StringView, - Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(AuthorizeClientDeviceActionRequest *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can - * be used as a key in maps. */ - bool operator<(const AuthorizeClientDeviceActionRequest &) const noexcept; - static const char *MODEL_NAME; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - - private: - Aws::Crt::Optional m_clientDeviceAuthToken; - Aws::Crt::Optional m_operation; - Aws::Crt::Optional m_resource; - }; - - class SubscribeToIoTCoreStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(IoTCoreMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToIoTCoreOperationContext : public OperationModelContext - { - public: - SubscribeToIoTCoreOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToIoTCoreResult - { - public: - SubscribeToIoTCoreResult() noexcept {} - SubscribeToIoTCoreResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - SubscribeToIoTCoreResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToIoTCoreOperation : public ClientOperation - { - public: - SubscribeToIoTCoreOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToIoTCoreOperation` - * @param request The request used for the `SubscribeToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class ResumeComponentOperationContext : public OperationModelContext - { - public: - ResumeComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class ResumeComponentResult - { - public: - ResumeComponentResult() noexcept {} - ResumeComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - ResumeComponentResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class ResumeComponentOperation : public ClientOperation - { - public: - ResumeComponentOperation( - ClientConnection &connection, - const ResumeComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ResumeComponentOperation` - * @param request The request used for the `ResumeComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const ResumeComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class PublishToIoTCoreOperationContext : public OperationModelContext - { - public: - PublishToIoTCoreOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class PublishToIoTCoreResult - { - public: - PublishToIoTCoreResult() noexcept {} - PublishToIoTCoreResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - PublishToIoTCoreResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class PublishToIoTCoreOperation : public ClientOperation - { - public: - PublishToIoTCoreOperation( - ClientConnection &connection, - const PublishToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PublishToIoTCoreOperation` - * @param request The request used for the `PublishToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const PublishToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SubscribeToConfigurationUpdateStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(ConfigurationUpdateEvents *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `ResourceNotFoundError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ResourceNotFoundError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToConfigurationUpdateOperationContext : public OperationModelContext - { - public: - SubscribeToConfigurationUpdateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToConfigurationUpdateResult - { - public: - SubscribeToConfigurationUpdateResult() noexcept {} - SubscribeToConfigurationUpdateResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - SubscribeToConfigurationUpdateResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToConfigurationUpdateOperation : public ClientOperation - { - public: - SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToConfigurationUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToConfigurationUpdateOperation` - * @param request The request used for the - * `SubscribeToConfigurationUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToConfigurationUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class DeleteThingShadowOperationContext : public OperationModelContext - { - public: - DeleteThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class DeleteThingShadowResult - { - public: - DeleteThingShadowResult() noexcept {} - DeleteThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - DeleteThingShadowResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class DeleteThingShadowOperation : public ClientOperation - { - public: - DeleteThingShadowOperation( - ClientConnection &connection, - const DeleteThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `DeleteThingShadowOperation` - * @param request The request used for the `DeleteThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const DeleteThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class PutComponentMetricOperationContext : public OperationModelContext - { - public: - PutComponentMetricOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class PutComponentMetricResult - { - public: - PutComponentMetricResult() noexcept {} - PutComponentMetricResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - PutComponentMetricResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class PutComponentMetricOperation : public ClientOperation - { - public: - PutComponentMetricOperation( - ClientConnection &connection, - const PutComponentMetricOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PutComponentMetricOperation` - * @param request The request used for the `PutComponentMetricOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const PutComponentMetricRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class DeferComponentUpdateOperationContext : public OperationModelContext - { - public: - DeferComponentUpdateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class DeferComponentUpdateResult - { - public: - DeferComponentUpdateResult() noexcept {} - DeferComponentUpdateResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) - { - } - DeferComponentUpdateResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class DeferComponentUpdateOperation : public ClientOperation - { - public: - DeferComponentUpdateOperation( - ClientConnection &connection, - const DeferComponentUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `DeferComponentUpdateOperation` - * @param request The request used for the `DeferComponentUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const DeferComponentUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SubscribeToValidateConfigurationUpdatesStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(ValidateConfigurationUpdateEvents *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToValidateConfigurationUpdatesOperationContext : public OperationModelContext - { - public: - SubscribeToValidateConfigurationUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToValidateConfigurationUpdatesResult - { - public: - SubscribeToValidateConfigurationUpdatesResult() noexcept {} - SubscribeToValidateConfigurationUpdatesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - SubscribeToValidateConfigurationUpdatesResponse *GetOperationResponse() const noexcept - { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToValidateConfigurationUpdatesOperation : public ClientOperation - { - public: - SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToValidateConfigurationUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the - * `SubscribeToValidateConfigurationUpdatesOperation` - * @param request The request used for the - * `SubscribeToValidateConfigurationUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToValidateConfigurationUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetConfigurationOperationContext : public OperationModelContext - { - public: - GetConfigurationOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetConfigurationResult - { - public: - GetConfigurationResult() noexcept {} - GetConfigurationResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetConfigurationResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetConfigurationOperation : public ClientOperation - { - public: - GetConfigurationOperation( - ClientConnection &connection, - const GetConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetConfigurationOperation` - * @param request The request used for the `GetConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SubscribeToTopicStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(SubscriptionResponseMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `InvalidArgumentsError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(InvalidArgumentsError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToTopicOperationContext : public OperationModelContext - { - public: - SubscribeToTopicOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToTopicResult - { - public: - SubscribeToTopicResult() noexcept {} - SubscribeToTopicResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - SubscribeToTopicResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToTopicOperation : public ClientOperation - { - public: - SubscribeToTopicOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToTopicOperation` - * @param request The request used for the `SubscribeToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetComponentDetailsOperationContext : public OperationModelContext - { - public: - GetComponentDetailsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetComponentDetailsResult - { - public: - GetComponentDetailsResult() noexcept {} - GetComponentDetailsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetComponentDetailsResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetComponentDetailsOperation : public ClientOperation - { - public: - GetComponentDetailsOperation( - ClientConnection &connection, - const GetComponentDetailsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetComponentDetailsOperation` - * @param request The request used for the `GetComponentDetailsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetComponentDetailsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetClientDeviceAuthTokenOperationContext : public OperationModelContext - { - public: - GetClientDeviceAuthTokenOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetClientDeviceAuthTokenResult - { - public: - GetClientDeviceAuthTokenResult() noexcept {} - GetClientDeviceAuthTokenResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - GetClientDeviceAuthTokenResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetClientDeviceAuthTokenOperation : public ClientOperation - { - public: - GetClientDeviceAuthTokenOperation( - ClientConnection &connection, - const GetClientDeviceAuthTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetClientDeviceAuthTokenOperation` - * @param request The request used for the `GetClientDeviceAuthTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetClientDeviceAuthTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class PublishToTopicOperationContext : public OperationModelContext - { - public: - PublishToTopicOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class PublishToTopicResult - { - public: - PublishToTopicResult() noexcept {} - PublishToTopicResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - PublishToTopicResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class PublishToTopicOperation : public ClientOperation - { - public: - PublishToTopicOperation( - ClientConnection &connection, - const PublishToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PublishToTopicOperation` - * @param request The request used for the `PublishToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const PublishToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SubscribeToCertificateUpdatesStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(CertificateUpdateEvent *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `InvalidArgumentsError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(InvalidArgumentsError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToCertificateUpdatesOperationContext : public OperationModelContext - { - public: - SubscribeToCertificateUpdatesOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToCertificateUpdatesResult - { - public: - SubscribeToCertificateUpdatesResult() noexcept {} - SubscribeToCertificateUpdatesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - SubscribeToCertificateUpdatesResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToCertificateUpdatesOperation : public ClientOperation - { - public: - SubscribeToCertificateUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToCertificateUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToCertificateUpdatesOperation` - * @param request The request used for the - * `SubscribeToCertificateUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToCertificateUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class VerifyClientDeviceIdentityOperationContext : public OperationModelContext - { - public: - VerifyClientDeviceIdentityOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class VerifyClientDeviceIdentityResult - { - public: - VerifyClientDeviceIdentityResult() noexcept {} - VerifyClientDeviceIdentityResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - VerifyClientDeviceIdentityResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class VerifyClientDeviceIdentityOperation : public ClientOperation - { - public: - VerifyClientDeviceIdentityOperation( - ClientConnection &connection, - const VerifyClientDeviceIdentityOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `VerifyClientDeviceIdentityOperation` - * @param request The request used for the - * `VerifyClientDeviceIdentityOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const VerifyClientDeviceIdentityRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class AuthorizeClientDeviceActionOperationContext : public OperationModelContext - { - public: - AuthorizeClientDeviceActionOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class AuthorizeClientDeviceActionResult - { - public: - AuthorizeClientDeviceActionResult() noexcept {} - AuthorizeClientDeviceActionResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - AuthorizeClientDeviceActionResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class AuthorizeClientDeviceActionOperation : public ClientOperation - { - public: - AuthorizeClientDeviceActionOperation( - ClientConnection &connection, - const AuthorizeClientDeviceActionOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `AuthorizeClientDeviceActionOperation` - * @param request The request used for the - * `AuthorizeClientDeviceActionOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const AuthorizeClientDeviceActionRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class ListComponentsOperationContext : public OperationModelContext - { - public: - ListComponentsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class ListComponentsResult - { - public: - ListComponentsResult() noexcept {} - ListComponentsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - ListComponentsResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class ListComponentsOperation : public ClientOperation - { - public: - ListComponentsOperation( - ClientConnection &connection, - const ListComponentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListComponentsOperation` - * @param request The request used for the `ListComponentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const ListComponentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class CreateDebugPasswordOperationContext : public OperationModelContext - { - public: - CreateDebugPasswordOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class CreateDebugPasswordResult - { - public: - CreateDebugPasswordResult() noexcept {} - CreateDebugPasswordResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - CreateDebugPasswordResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class CreateDebugPasswordOperation : public ClientOperation - { - public: - CreateDebugPasswordOperation( - ClientConnection &connection, - const CreateDebugPasswordOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CreateDebugPasswordOperation` - * @param request The request used for the `CreateDebugPasswordOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const CreateDebugPasswordRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetThingShadowOperationContext : public OperationModelContext - { - public: - GetThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetThingShadowResult - { - public: - GetThingShadowResult() noexcept {} - GetThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetThingShadowResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetThingShadowOperation : public ClientOperation - { - public: - GetThingShadowOperation( - ClientConnection &connection, - const GetThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetThingShadowOperation` - * @param request The request used for the `GetThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SendConfigurationValidityReportOperationContext : public OperationModelContext - { - public: - SendConfigurationValidityReportOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SendConfigurationValidityReportResult - { - public: - SendConfigurationValidityReportResult() noexcept {} - SendConfigurationValidityReportResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - SendConfigurationValidityReportResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SendConfigurationValidityReportOperation : public ClientOperation - { - public: - SendConfigurationValidityReportOperation( - ClientConnection &connection, - const SendConfigurationValidityReportOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the - * `SendConfigurationValidityReportOperation` - * @param request The request used for the - * `SendConfigurationValidityReportOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SendConfigurationValidityReportRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class UpdateThingShadowOperationContext : public OperationModelContext - { - public: - UpdateThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class UpdateThingShadowResult - { - public: - UpdateThingShadowResult() noexcept {} - UpdateThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - UpdateThingShadowResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class UpdateThingShadowOperation : public ClientOperation - { - public: - UpdateThingShadowOperation( - ClientConnection &connection, - const UpdateThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateThingShadowOperation` - * @param request The request used for the `UpdateThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const UpdateThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class UpdateConfigurationOperationContext : public OperationModelContext - { - public: - UpdateConfigurationOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class UpdateConfigurationResult - { - public: - UpdateConfigurationResult() noexcept {} - UpdateConfigurationResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - UpdateConfigurationResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class UpdateConfigurationOperation : public ClientOperation - { - public: - UpdateConfigurationOperation( - ClientConnection &connection, - const UpdateConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateConfigurationOperation` - * @param request The request used for the `UpdateConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const UpdateConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class ValidateAuthorizationTokenOperationContext : public OperationModelContext - { - public: - ValidateAuthorizationTokenOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class ValidateAuthorizationTokenResult - { - public: - ValidateAuthorizationTokenResult() noexcept {} - ValidateAuthorizationTokenResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - ValidateAuthorizationTokenResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class ValidateAuthorizationTokenOperation : public ClientOperation - { - public: - ValidateAuthorizationTokenOperation( - ClientConnection &connection, - const ValidateAuthorizationTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ValidateAuthorizationTokenOperation` - * @param request The request used for the - * `ValidateAuthorizationTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const ValidateAuthorizationTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class RestartComponentOperationContext : public OperationModelContext - { - public: - RestartComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class RestartComponentResult - { - public: - RestartComponentResult() noexcept {} - RestartComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - RestartComponentResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class RestartComponentOperation : public ClientOperation - { - public: - RestartComponentOperation( - ClientConnection &connection, - const RestartComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `RestartComponentOperation` - * @param request The request used for the `RestartComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const RestartComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetLocalDeploymentStatusOperationContext : public OperationModelContext - { - public: - GetLocalDeploymentStatusOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetLocalDeploymentStatusResult - { - public: - GetLocalDeploymentStatusResult() noexcept {} - GetLocalDeploymentStatusResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - GetLocalDeploymentStatusResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetLocalDeploymentStatusOperation : public ClientOperation - { - public: - GetLocalDeploymentStatusOperation( - ClientConnection &connection, - const GetLocalDeploymentStatusOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetLocalDeploymentStatusOperation` - * @param request The request used for the `GetLocalDeploymentStatusOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetLocalDeploymentStatusRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GetSecretValueOperationContext : public OperationModelContext - { - public: - GetSecretValueOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class GetSecretValueResult - { - public: - GetSecretValueResult() noexcept {} - GetSecretValueResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - GetSecretValueResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class GetSecretValueOperation : public ClientOperation - { - public: - GetSecretValueOperation( - ClientConnection &connection, - const GetSecretValueOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetSecretValueOperation` - * @param request The request used for the `GetSecretValueOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const GetSecretValueRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class UpdateStateOperationContext : public OperationModelContext - { - public: - UpdateStateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class UpdateStateResult - { - public: - UpdateStateResult() noexcept {} - UpdateStateResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - UpdateStateResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class UpdateStateOperation : public ClientOperation - { - public: - UpdateStateOperation( - ClientConnection &connection, - const UpdateStateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateStateOperation` - * @param request The request used for the `UpdateStateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const UpdateStateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class ListNamedShadowsForThingOperationContext : public OperationModelContext - { - public: - ListNamedShadowsForThingOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class ListNamedShadowsForThingResult - { - public: - ListNamedShadowsForThingResult() noexcept {} - ListNamedShadowsForThingResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - ListNamedShadowsForThingResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class ListNamedShadowsForThingOperation : public ClientOperation - { - public: - ListNamedShadowsForThingOperation( - ClientConnection &connection, - const ListNamedShadowsForThingOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListNamedShadowsForThingOperation` - * @param request The request used for the `ListNamedShadowsForThingOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const ListNamedShadowsForThingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class SubscribeToComponentUpdatesStreamHandler : public StreamResponseHandler - { - public: - virtual void OnStreamEvent(ComponentUpdatePolicyEvents *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) - { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `ResourceNotFoundError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ResourceNotFoundError *operationError) - { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) - { - (void)operationError; - return true; - } - - private: - /** - * Invoked when a message is received on this continuation. - */ - void OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; - }; - class SubscribeToComponentUpdatesOperationContext : public OperationModelContext - { - public: - SubscribeToComponentUpdatesOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class SubscribeToComponentUpdatesResult - { - public: - SubscribeToComponentUpdatesResult() noexcept {} - SubscribeToComponentUpdatesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) - { - } - SubscribeToComponentUpdatesResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class SubscribeToComponentUpdatesOperation : public ClientOperation - { - public: - SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToComponentUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToComponentUpdatesOperation` - * @param request The request used for the - * `SubscribeToComponentUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const SubscribeToComponentUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class ListLocalDeploymentsOperationContext : public OperationModelContext - { - public: - ListLocalDeploymentsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class ListLocalDeploymentsResult - { - public: - ListLocalDeploymentsResult() noexcept {} - ListLocalDeploymentsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) - { - } - ListLocalDeploymentsResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class ListLocalDeploymentsOperation : public ClientOperation - { - public: - ListLocalDeploymentsOperation( - ClientConnection &connection, - const ListLocalDeploymentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListLocalDeploymentsOperation` - * @param request The request used for the `ListLocalDeploymentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const ListLocalDeploymentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class StopComponentOperationContext : public OperationModelContext - { - public: - StopComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class StopComponentResult - { - public: - StopComponentResult() noexcept {} - StopComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - StopComponentResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class StopComponentOperation : public ClientOperation - { - public: - StopComponentOperation( - ClientConnection &connection, - const StopComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `StopComponentOperation` - * @param request The request used for the `StopComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const StopComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class PauseComponentOperationContext : public OperationModelContext - { - public: - PauseComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class PauseComponentResult - { - public: - PauseComponentResult() noexcept {} - PauseComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} - PauseComponentResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class PauseComponentOperation : public ClientOperation - { - public: - PauseComponentOperation( - ClientConnection &connection, - const PauseComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PauseComponentOperation` - * @param request The request used for the `PauseComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const PauseComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class CreateLocalDeploymentOperationContext : public OperationModelContext - { - public: - CreateLocalDeploymentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; - }; - - class CreateLocalDeploymentResult - { - public: - CreateLocalDeploymentResult() noexcept {} - CreateLocalDeploymentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) - { - } - CreateLocalDeploymentResponse *GetOperationResponse() const noexcept - { - return static_cast(m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } - - private: - TaggedResult m_taggedResult; - }; - - class CreateLocalDeploymentOperation : public ClientOperation - { - public: - CreateLocalDeploymentOperation( - ClientConnection &connection, - const CreateLocalDeploymentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CreateLocalDeploymentOperation` - * @param request The request used for the `CreateLocalDeploymentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future Activate( - const CreateLocalDeploymentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult(bool async_mode = false) noexcept; - - protected: - Aws::Crt::String GetModelName() const noexcept override; - }; - - class GreengrassCoreIpcServiceModel : public ServiceModel - { - public: - GreengrassCoreIpcServiceModel() noexcept; - Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; - void AssignModelNameToErrorResponse(Aws::Crt::String, ErrorResponseFactory) noexcept; - - private: - friend class GreengrassCoreIpcClient; - SubscribeToIoTCoreOperationContext m_subscribeToIoTCoreOperationContext; - ResumeComponentOperationContext m_resumeComponentOperationContext; - PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext; - SubscribeToConfigurationUpdateOperationContext m_subscribeToConfigurationUpdateOperationContext; - DeleteThingShadowOperationContext m_deleteThingShadowOperationContext; - PutComponentMetricOperationContext m_putComponentMetricOperationContext; - DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; - SubscribeToValidateConfigurationUpdatesOperationContext - m_subscribeToValidateConfigurationUpdatesOperationContext; - GetConfigurationOperationContext m_getConfigurationOperationContext; - SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; - GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; - GetClientDeviceAuthTokenOperationContext m_getClientDeviceAuthTokenOperationContext; - PublishToTopicOperationContext m_publishToTopicOperationContext; - SubscribeToCertificateUpdatesOperationContext m_subscribeToCertificateUpdatesOperationContext; - VerifyClientDeviceIdentityOperationContext m_verifyClientDeviceIdentityOperationContext; - AuthorizeClientDeviceActionOperationContext m_authorizeClientDeviceActionOperationContext; - ListComponentsOperationContext m_listComponentsOperationContext; - CreateDebugPasswordOperationContext m_createDebugPasswordOperationContext; - GetThingShadowOperationContext m_getThingShadowOperationContext; - SendConfigurationValidityReportOperationContext m_sendConfigurationValidityReportOperationContext; - UpdateThingShadowOperationContext m_updateThingShadowOperationContext; - UpdateConfigurationOperationContext m_updateConfigurationOperationContext; - ValidateAuthorizationTokenOperationContext m_validateAuthorizationTokenOperationContext; - RestartComponentOperationContext m_restartComponentOperationContext; - GetLocalDeploymentStatusOperationContext m_getLocalDeploymentStatusOperationContext; - GetSecretValueOperationContext m_getSecretValueOperationContext; - UpdateStateOperationContext m_updateStateOperationContext; - ListNamedShadowsForThingOperationContext m_listNamedShadowsForThingOperationContext; - SubscribeToComponentUpdatesOperationContext m_subscribeToComponentUpdatesOperationContext; - ListLocalDeploymentsOperationContext m_listLocalDeploymentsOperationContext; - StopComponentOperationContext m_stopComponentOperationContext; - PauseComponentOperationContext m_pauseComponentOperationContext; - CreateLocalDeploymentOperationContext m_createLocalDeploymentOperationContext; - Aws::Crt::Map m_modelNameToErrorResponse; - }; - } // namespace Greengrass +namespace Aws { +namespace Greengrass { +class GreengrassCoreIpcClient; +class GreengrassCoreIpcServiceModel; +enum MetricUnitType { + METRIC_UNIT_TYPE_BYTES, + METRIC_UNIT_TYPE_BYTES_PER_SECOND, + METRIC_UNIT_TYPE_COUNT, + METRIC_UNIT_TYPE_COUNT_PER_SECOND, + METRIC_UNIT_TYPE_MEGABYTES, + METRIC_UNIT_TYPE_SECONDS +}; + +class MessageContext : public AbstractShapeBase { +public: + MessageContext() noexcept {} + MessageContext(const MessageContext &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MessageContext &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MessageContext *) noexcept; + /* This needs to be defined so that `MessageContext` can be used as a key in + * maps. */ + bool operator<(const MessageContext &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topic; +}; + +class SystemResourceLimits : public AbstractShapeBase { +public: + SystemResourceLimits() noexcept {} + SystemResourceLimits(const SystemResourceLimits &) = default; + void SetMemory(const int64_t &memory) noexcept { m_memory = memory; } + Aws::Crt::Optional GetMemory() noexcept { return m_memory; } + void SetCpus(const double &cpus) noexcept { m_cpus = cpus; } + Aws::Crt::Optional GetCpus() noexcept { return m_cpus; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SystemResourceLimits &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SystemResourceLimits *) noexcept; + /* This needs to be defined so that `SystemResourceLimits` can be used as a + * key in maps. */ + bool operator<(const SystemResourceLimits &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_memory; + Aws::Crt::Optional m_cpus; +}; + +class ValidateConfigurationUpdateEvent : public AbstractShapeBase { +public: + ValidateConfigurationUpdateEvent() noexcept {} + ValidateConfigurationUpdateEvent(const ValidateConfigurationUpdateEvent &) = + default; + void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept { + m_configuration = configuration; + } + Aws::Crt::Optional GetConfiguration() noexcept { + return m_configuration; + } + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateConfigurationUpdateEvent &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateConfigurationUpdateEvent *) noexcept; + /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be + * used as a key in maps. */ + bool operator<(const ValidateConfigurationUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_configuration; + Aws::Crt::Optional m_deploymentId; +}; + +class MQTTMessage : public AbstractShapeBase { +public: + MQTTMessage() noexcept {} + MQTTMessage(const MQTTMessage &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { + m_topicName = topicName; + } + Aws::Crt::Optional GetTopicName() noexcept { + return m_topicName; + } + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MQTTMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MQTTMessage *) noexcept; + /* This needs to be defined so that `MQTTMessage` can be used as a key in + * maps. */ + bool operator<(const MQTTMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional> m_payload; +}; + +class ConfigurationUpdateEvent : public AbstractShapeBase { +public: + ConfigurationUpdateEvent() noexcept {} + ConfigurationUpdateEvent(const ConfigurationUpdateEvent &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { + m_keyPath = keyPath; + } + Aws::Crt::Optional> GetKeyPath() noexcept { + return m_keyPath; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationUpdateEvent &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationUpdateEvent *) noexcept; + /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as + * a key in maps. */ + bool operator<(const ConfigurationUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; +}; + +class PostComponentUpdateEvent : public AbstractShapeBase { +public: + PostComponentUpdateEvent() noexcept {} + PostComponentUpdateEvent(const PostComponentUpdateEvent &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PostComponentUpdateEvent &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PostComponentUpdateEvent *) noexcept; + /* This needs to be defined so that `PostComponentUpdateEvent` can be used as + * a key in maps. */ + bool operator<(const PostComponentUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; +}; + +class PreComponentUpdateEvent : public AbstractShapeBase { +public: + PreComponentUpdateEvent() noexcept {} + PreComponentUpdateEvent(const PreComponentUpdateEvent &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SetIsGgcRestarting(const bool &isGgcRestarting) noexcept { + m_isGgcRestarting = isGgcRestarting; + } + Aws::Crt::Optional GetIsGgcRestarting() noexcept { + return m_isGgcRestarting; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PreComponentUpdateEvent &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PreComponentUpdateEvent *) noexcept; + /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a + * key in maps. */ + bool operator<(const PreComponentUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_isGgcRestarting; +}; + +class CertificateUpdate : public AbstractShapeBase { +public: + CertificateUpdate() noexcept {} + CertificateUpdate(const CertificateUpdate &) = default; + void SetPrivateKey(const Aws::Crt::String &privateKey) noexcept { + m_privateKey = privateKey; + } + Aws::Crt::Optional GetPrivateKey() noexcept { + return m_privateKey; + } + void SetPublicKey(const Aws::Crt::String &publicKey) noexcept { + m_publicKey = publicKey; + } + Aws::Crt::Optional GetPublicKey() noexcept { + return m_publicKey; + } + void SetCertificate(const Aws::Crt::String &certificate) noexcept { + m_certificate = certificate; + } + Aws::Crt::Optional GetCertificate() noexcept { + return m_certificate; + } + void SetCaCertificates( + const Aws::Crt::Vector &caCertificates) noexcept { + m_caCertificates = caCertificates; + } + Aws::Crt::Optional> + GetCaCertificates() noexcept { + return m_caCertificates; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateUpdate &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateUpdate *) noexcept; + /* This needs to be defined so that `CertificateUpdate` can be used as a key + * in maps. */ + bool operator<(const CertificateUpdate &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_privateKey; + Aws::Crt::Optional m_publicKey; + Aws::Crt::Optional m_certificate; + Aws::Crt::Optional> m_caCertificates; +}; + +enum CertificateType { CERTIFICATE_TYPE_SERVER }; + +enum ConfigurationValidityStatus { + CONFIGURATION_VALIDITY_STATUS_ACCEPTED, + CONFIGURATION_VALIDITY_STATUS_REJECTED +}; + +class Metric : public AbstractShapeBase { +public: + Metric() noexcept {} + Metric(const Metric &) = default; + void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } + Aws::Crt::Optional GetName() noexcept { return m_name; } + void SetUnit(MetricUnitType unit) noexcept; + Aws::Crt::Optional GetUnit() noexcept; + void SetValue(const double &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Metric &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Metric *) noexcept; + /* This needs to be defined so that `Metric` can be used as a key in maps. */ + bool operator<(const Metric &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_name; + Aws::Crt::Optional m_unit; + Aws::Crt::Optional m_value; +}; + +class BinaryMessage : public AbstractShapeBase { +public: + BinaryMessage() noexcept {} + BinaryMessage(const BinaryMessage &) = default; + void SetMessage(const Aws::Crt::Vector &message) noexcept { + m_message = message; + } + Aws::Crt::Optional> GetMessage() noexcept { + return m_message; + } + /* The context is ignored if used in PublishMessage. */ + void SetContext(const MessageContext &context) noexcept { + m_context = context; + } + /* The context is ignored if used in PublishMessage. */ + Aws::Crt::Optional GetContext() noexcept { return m_context; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(BinaryMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(BinaryMessage *) noexcept; + /* This needs to be defined so that `BinaryMessage` can be used as a key in + * maps. */ + bool operator<(const BinaryMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_message; + Aws::Crt::Optional m_context; +}; + +class JsonMessage : public AbstractShapeBase { +public: + JsonMessage() noexcept {} + JsonMessage(const JsonMessage &) = default; + void SetMessage(const Aws::Crt::JsonObject &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept { + return m_message; + } + /* The context is ignored if used in PublishMessage. */ + void SetContext(const MessageContext &context) noexcept { + m_context = context; + } + /* The context is ignored if used in PublishMessage. */ + Aws::Crt::Optional GetContext() noexcept { return m_context; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(JsonMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(JsonMessage *) noexcept; + /* This needs to be defined so that `JsonMessage` can be used as a key in + * maps. */ + bool operator<(const JsonMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_context; +}; + +enum DeploymentStatus { + DEPLOYMENT_STATUS_QUEUED, + DEPLOYMENT_STATUS_IN_PROGRESS, + DEPLOYMENT_STATUS_SUCCEEDED, + DEPLOYMENT_STATUS_FAILED +}; + +enum LifecycleState { + LIFECYCLE_STATE_RUNNING, + LIFECYCLE_STATE_ERRORED, + LIFECYCLE_STATE_NEW, + LIFECYCLE_STATE_FINISHED, + LIFECYCLE_STATE_INSTALLED, + LIFECYCLE_STATE_BROKEN, + LIFECYCLE_STATE_STARTING, + LIFECYCLE_STATE_STOPPING +}; + +class MQTTCredential : public AbstractShapeBase { +public: + MQTTCredential() noexcept {} + MQTTCredential(const MQTTCredential &) = default; + void SetClientId(const Aws::Crt::String &clientId) noexcept { + m_clientId = clientId; + } + Aws::Crt::Optional GetClientId() noexcept { + return m_clientId; + } + void SetCertificatePem(const Aws::Crt::String &certificatePem) noexcept { + m_certificatePem = certificatePem; + } + Aws::Crt::Optional GetCertificatePem() noexcept { + return m_certificatePem; + } + void SetUsername(const Aws::Crt::String &username) noexcept { + m_username = username; + } + Aws::Crt::Optional GetUsername() noexcept { + return m_username; + } + void SetPassword(const Aws::Crt::String &password) noexcept { + m_password = password; + } + Aws::Crt::Optional GetPassword() noexcept { + return m_password; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MQTTCredential &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MQTTCredential *) noexcept; + /* This needs to be defined so that `MQTTCredential` can be used as a key in + * maps. */ + bool operator<(const MQTTCredential &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_clientId; + Aws::Crt::Optional m_certificatePem; + Aws::Crt::Optional m_username; + Aws::Crt::Optional m_password; +}; + +class RunWithInfo : public AbstractShapeBase { +public: + RunWithInfo() noexcept {} + RunWithInfo(const RunWithInfo &) = default; + void SetPosixUser(const Aws::Crt::String &posixUser) noexcept { + m_posixUser = posixUser; + } + Aws::Crt::Optional GetPosixUser() noexcept { + return m_posixUser; + } + void SetWindowsUser(const Aws::Crt::String &windowsUser) noexcept { + m_windowsUser = windowsUser; + } + Aws::Crt::Optional GetWindowsUser() noexcept { + return m_windowsUser; + } + void SetSystemResourceLimits( + const SystemResourceLimits &systemResourceLimits) noexcept { + m_systemResourceLimits = systemResourceLimits; + } + Aws::Crt::Optional GetSystemResourceLimits() noexcept { + return m_systemResourceLimits; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RunWithInfo &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RunWithInfo *) noexcept; + /* This needs to be defined so that `RunWithInfo` can be used as a key in + * maps. */ + bool operator<(const RunWithInfo &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_posixUser; + Aws::Crt::Optional m_windowsUser; + Aws::Crt::Optional m_systemResourceLimits; +}; + +class ClientDeviceCredential : public AbstractShapeBase { +public: + ClientDeviceCredential() noexcept {} + ClientDeviceCredential &operator=(const ClientDeviceCredential &) noexcept; + ClientDeviceCredential(const ClientDeviceCredential &objectToCopy) { + *this = objectToCopy; + } + void SetClientDeviceCertificate( + const Aws::Crt::String &clientDeviceCertificate) noexcept { + m_clientDeviceCertificate = clientDeviceCertificate; + m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; + } + Aws::Crt::Optional GetClientDeviceCertificate() noexcept { + if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) { + return m_clientDeviceCertificate; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ClientDeviceCredential &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ClientDeviceCredential *) noexcept; + /* This needs to be defined so that `ClientDeviceCredential` can be used as a + * key in maps. */ + bool operator<(const ClientDeviceCredential &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_CLIENT_DEVICE_CERTIFICATE } m_chosenMember; + Aws::Crt::Optional m_clientDeviceCertificate; +}; + +enum ReportedLifecycleState { + REPORTED_LIFECYCLE_STATE_RUNNING, + REPORTED_LIFECYCLE_STATE_ERRORED +}; + +class ValidateConfigurationUpdateEvents : public AbstractShapeBase { +public: + ValidateConfigurationUpdateEvents() noexcept {} + ValidateConfigurationUpdateEvents & + operator=(const ValidateConfigurationUpdateEvents &) noexcept; + ValidateConfigurationUpdateEvents( + const ValidateConfigurationUpdateEvents &objectToCopy) { + *this = objectToCopy; + } + void SetValidateConfigurationUpdateEvent( + const ValidateConfigurationUpdateEvent + &validateConfigurationUpdateEvent) noexcept { + m_validateConfigurationUpdateEvent = validateConfigurationUpdateEvent; + m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; + } + Aws::Crt::Optional + GetValidateConfigurationUpdateEvent() noexcept { + if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) { + return m_validateConfigurationUpdateEvent; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateConfigurationUpdateEvents &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateConfigurationUpdateEvents *) noexcept; + /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be + * used as a key in maps. */ + bool operator<(const ValidateConfigurationUpdateEvents &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT } m_chosenMember; + Aws::Crt::Optional + m_validateConfigurationUpdateEvent; +}; + +class SubscriptionResponseMessage : public AbstractShapeBase { +public: + SubscriptionResponseMessage() noexcept {} + SubscriptionResponseMessage & + operator=(const SubscriptionResponseMessage &) noexcept; + SubscriptionResponseMessage(const SubscriptionResponseMessage &objectToCopy) { + *this = objectToCopy; + } + void SetJsonMessage(const JsonMessage &jsonMessage) noexcept { + m_jsonMessage = jsonMessage; + m_chosenMember = TAG_JSON_MESSAGE; + } + Aws::Crt::Optional GetJsonMessage() noexcept { + if (m_chosenMember == TAG_JSON_MESSAGE) { + return m_jsonMessage; + } else { + return Aws::Crt::Optional(); + } + } + void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept { + m_binaryMessage = binaryMessage; + m_chosenMember = TAG_BINARY_MESSAGE; + } + Aws::Crt::Optional GetBinaryMessage() noexcept { + if (m_chosenMember == TAG_BINARY_MESSAGE) { + return m_binaryMessage; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscriptionResponseMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscriptionResponseMessage *) noexcept; + /* This needs to be defined so that `SubscriptionResponseMessage` can be used + * as a key in maps. */ + bool operator<(const SubscriptionResponseMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_JSON_MESSAGE, TAG_BINARY_MESSAGE } m_chosenMember; + Aws::Crt::Optional m_jsonMessage; + Aws::Crt::Optional m_binaryMessage; +}; + +enum ReceiveMode { + RECEIVE_MODE_RECEIVE_ALL_MESSAGES, + RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS +}; + +class IoTCoreMessage : public AbstractShapeBase { +public: + IoTCoreMessage() noexcept {} + IoTCoreMessage &operator=(const IoTCoreMessage &) noexcept; + IoTCoreMessage(const IoTCoreMessage &objectToCopy) { *this = objectToCopy; } + void SetMessage(const MQTTMessage &message) noexcept { + m_message = message; + m_chosenMember = TAG_MESSAGE; + } + Aws::Crt::Optional GetMessage() noexcept { + if (m_chosenMember == TAG_MESSAGE) { + return m_message; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(IoTCoreMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(IoTCoreMessage *) noexcept; + /* This needs to be defined so that `IoTCoreMessage` can be used as a key in + * maps. */ + bool operator<(const IoTCoreMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_MESSAGE } m_chosenMember; + Aws::Crt::Optional m_message; +}; + +class ConfigurationUpdateEvents : public AbstractShapeBase { +public: + ConfigurationUpdateEvents() noexcept {} + ConfigurationUpdateEvents & + operator=(const ConfigurationUpdateEvents &) noexcept; + ConfigurationUpdateEvents(const ConfigurationUpdateEvents &objectToCopy) { + *this = objectToCopy; + } + void SetConfigurationUpdateEvent( + const ConfigurationUpdateEvent &configurationUpdateEvent) noexcept { + m_configurationUpdateEvent = configurationUpdateEvent; + m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; + } + Aws::Crt::Optional + GetConfigurationUpdateEvent() noexcept { + if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) { + return m_configurationUpdateEvent; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationUpdateEvents &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationUpdateEvents *) noexcept; + /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as + * a key in maps. */ + bool operator<(const ConfigurationUpdateEvents &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_CONFIGURATION_UPDATE_EVENT } m_chosenMember; + Aws::Crt::Optional m_configurationUpdateEvent; +}; + +class ComponentUpdatePolicyEvents : public AbstractShapeBase { +public: + ComponentUpdatePolicyEvents() noexcept {} + ComponentUpdatePolicyEvents & + operator=(const ComponentUpdatePolicyEvents &) noexcept; + ComponentUpdatePolicyEvents(const ComponentUpdatePolicyEvents &objectToCopy) { + *this = objectToCopy; + } + void + SetPreUpdateEvent(const PreComponentUpdateEvent &preUpdateEvent) noexcept { + m_preUpdateEvent = preUpdateEvent; + m_chosenMember = TAG_PRE_UPDATE_EVENT; + } + Aws::Crt::Optional GetPreUpdateEvent() noexcept { + if (m_chosenMember == TAG_PRE_UPDATE_EVENT) { + return m_preUpdateEvent; + } else { + return Aws::Crt::Optional(); + } + } + void + SetPostUpdateEvent(const PostComponentUpdateEvent &postUpdateEvent) noexcept { + m_postUpdateEvent = postUpdateEvent; + m_chosenMember = TAG_POST_UPDATE_EVENT; + } + Aws::Crt::Optional GetPostUpdateEvent() noexcept { + if (m_chosenMember == TAG_POST_UPDATE_EVENT) { + return m_postUpdateEvent; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentUpdatePolicyEvents &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; + /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used + * as a key in maps. */ + bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { + TAG_PRE_UPDATE_EVENT, + TAG_POST_UPDATE_EVENT + } m_chosenMember; + Aws::Crt::Optional m_preUpdateEvent; + Aws::Crt::Optional m_postUpdateEvent; +}; + +class CertificateUpdateEvent : public AbstractShapeBase { +public: + CertificateUpdateEvent() noexcept {} + CertificateUpdateEvent &operator=(const CertificateUpdateEvent &) noexcept; + CertificateUpdateEvent(const CertificateUpdateEvent &objectToCopy) { + *this = objectToCopy; + } + void + SetCertificateUpdate(const CertificateUpdate &certificateUpdate) noexcept { + m_certificateUpdate = certificateUpdate; + m_chosenMember = TAG_CERTIFICATE_UPDATE; + } + Aws::Crt::Optional GetCertificateUpdate() noexcept { + if (m_chosenMember == TAG_CERTIFICATE_UPDATE) { + return m_certificateUpdate; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateUpdateEvent &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateUpdateEvent *) noexcept; + /* This needs to be defined so that `CertificateUpdateEvent` can be used as a + * key in maps. */ + bool operator<(const CertificateUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_CERTIFICATE_UPDATE } m_chosenMember; + Aws::Crt::Optional m_certificateUpdate; +}; + +class CertificateOptions : public AbstractShapeBase { +public: + CertificateOptions() noexcept {} + CertificateOptions(const CertificateOptions &) = default; + void SetCertificateType(CertificateType certificateType) noexcept; + Aws::Crt::Optional GetCertificateType() noexcept; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateOptions &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateOptions *) noexcept; + /* This needs to be defined so that `CertificateOptions` can be used as a key + * in maps. */ + bool operator<(const CertificateOptions &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_certificateType; +}; + +class ConfigurationValidityReport : public AbstractShapeBase { +public: + ConfigurationValidityReport() noexcept {} + ConfigurationValidityReport(const ConfigurationValidityReport &) = default; + void SetStatus(ConfigurationValidityStatus status) noexcept; + Aws::Crt::Optional GetStatus() noexcept; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationValidityReport &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationValidityReport *) noexcept; + /* This needs to be defined so that `ConfigurationValidityReport` can be used + * as a key in maps. */ + bool operator<(const ConfigurationValidityReport &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_status; + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_message; +}; + +enum RequestStatus { REQUEST_STATUS_SUCCEEDED, REQUEST_STATUS_FAILED }; + +class PublishMessage : public AbstractShapeBase { +public: + PublishMessage() noexcept {} + PublishMessage &operator=(const PublishMessage &) noexcept; + PublishMessage(const PublishMessage &objectToCopy) { *this = objectToCopy; } + void SetJsonMessage(const JsonMessage &jsonMessage) noexcept { + m_jsonMessage = jsonMessage; + m_chosenMember = TAG_JSON_MESSAGE; + } + Aws::Crt::Optional GetJsonMessage() noexcept { + if (m_chosenMember == TAG_JSON_MESSAGE) { + return m_jsonMessage; + } else { + return Aws::Crt::Optional(); + } + } + void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept { + m_binaryMessage = binaryMessage; + m_chosenMember = TAG_BINARY_MESSAGE; + } + Aws::Crt::Optional GetBinaryMessage() noexcept { + if (m_chosenMember == TAG_BINARY_MESSAGE) { + return m_binaryMessage; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishMessage &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishMessage *) noexcept; + /* This needs to be defined so that `PublishMessage` can be used as a key in + * maps. */ + bool operator<(const PublishMessage &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_JSON_MESSAGE, TAG_BINARY_MESSAGE } m_chosenMember; + Aws::Crt::Optional m_jsonMessage; + Aws::Crt::Optional m_binaryMessage; +}; + +enum QOS { QOS_AT_MOST_ONCE, QOS_AT_LEAST_ONCE }; + +class SecretValue : public AbstractShapeBase { +public: + SecretValue() noexcept {} + SecretValue &operator=(const SecretValue &) noexcept; + SecretValue(const SecretValue &objectToCopy) { *this = objectToCopy; } + void SetSecretString(const Aws::Crt::String &secretString) noexcept { + m_secretString = secretString; + m_chosenMember = TAG_SECRET_STRING; + } + Aws::Crt::Optional GetSecretString() noexcept { + if (m_chosenMember == TAG_SECRET_STRING) { + return m_secretString; + } else { + return Aws::Crt::Optional(); + } + } + void SetSecretBinary(const Aws::Crt::Vector &secretBinary) noexcept { + m_secretBinary = secretBinary; + m_chosenMember = TAG_SECRET_BINARY; + } + Aws::Crt::Optional> GetSecretBinary() noexcept { + if (m_chosenMember == TAG_SECRET_BINARY) { + return m_secretBinary; + } else { + return Aws::Crt::Optional>(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SecretValue &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SecretValue *) noexcept; + /* This needs to be defined so that `SecretValue` can be used as a key in + * maps. */ + bool operator<(const SecretValue &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_SECRET_STRING, TAG_SECRET_BINARY } m_chosenMember; + Aws::Crt::Optional m_secretString; + Aws::Crt::Optional> m_secretBinary; +}; + +class LocalDeployment : public AbstractShapeBase { +public: + LocalDeployment() noexcept {} + LocalDeployment(const LocalDeployment &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SetStatus(DeploymentStatus status) noexcept; + Aws::Crt::Optional GetStatus() noexcept; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(LocalDeployment &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(LocalDeployment *) noexcept; + /* This needs to be defined so that `LocalDeployment` can be used as a key in + * maps. */ + bool operator<(const LocalDeployment &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_status; +}; + +class ComponentDetails : public AbstractShapeBase { +public: + ComponentDetails() noexcept {} + ComponentDetails(const ComponentDetails &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SetVersion(const Aws::Crt::String &version) noexcept { + m_version = version; + } + Aws::Crt::Optional GetVersion() noexcept { + return m_version; + } + void SetState(LifecycleState state) noexcept; + Aws::Crt::Optional GetState() noexcept; + void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept { + m_configuration = configuration; + } + Aws::Crt::Optional GetConfiguration() noexcept { + return m_configuration; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentDetails &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentDetails *) noexcept; + /* This needs to be defined so that `ComponentDetails` can be used as a key in + * maps. */ + bool operator<(const ComponentDetails &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional m_version; + Aws::Crt::Optional m_state; + Aws::Crt::Optional m_configuration; +}; + +class CredentialDocument : public AbstractShapeBase { +public: + CredentialDocument() noexcept {} + CredentialDocument &operator=(const CredentialDocument &) noexcept; + CredentialDocument(const CredentialDocument &objectToCopy) { + *this = objectToCopy; + } + void SetMqttCredential(const MQTTCredential &mqttCredential) noexcept { + m_mqttCredential = mqttCredential; + m_chosenMember = TAG_MQTT_CREDENTIAL; + } + Aws::Crt::Optional GetMqttCredential() noexcept { + if (m_chosenMember == TAG_MQTT_CREDENTIAL) { + return m_mqttCredential; + } else { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CredentialDocument &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CredentialDocument *) noexcept; + /* This needs to be defined so that `CredentialDocument` can be used as a key + * in maps. */ + bool operator<(const CredentialDocument &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + enum ChosenMember { TAG_MQTT_CREDENTIAL } m_chosenMember; + Aws::Crt::Optional m_mqttCredential; +}; + +class VerifyClientDeviceIdentityResponse : public AbstractShapeBase { +public: + VerifyClientDeviceIdentityResponse() noexcept {} + VerifyClientDeviceIdentityResponse( + const VerifyClientDeviceIdentityResponse &) = default; + void SetIsValidClientDevice(const bool &isValidClientDevice) noexcept { + m_isValidClientDevice = isValidClientDevice; + } + Aws::Crt::Optional GetIsValidClientDevice() noexcept { + return m_isValidClientDevice; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(VerifyClientDeviceIdentityResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(VerifyClientDeviceIdentityResponse *) noexcept; + /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can + * be used as a key in maps. */ + bool operator<(const VerifyClientDeviceIdentityResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_isValidClientDevice; +}; + +class VerifyClientDeviceIdentityRequest : public AbstractShapeBase { +public: + VerifyClientDeviceIdentityRequest() noexcept {} + VerifyClientDeviceIdentityRequest(const VerifyClientDeviceIdentityRequest &) = + default; + void SetCredential(const ClientDeviceCredential &credential) noexcept { + m_credential = credential; + } + Aws::Crt::Optional GetCredential() noexcept { + return m_credential; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(VerifyClientDeviceIdentityRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(VerifyClientDeviceIdentityRequest *) noexcept; + /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be + * used as a key in maps. */ + bool operator<(const VerifyClientDeviceIdentityRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_credential; +}; + +class InvalidTokenError : public OperationError { +public: + InvalidTokenError() noexcept {} + InvalidTokenError(const InvalidTokenError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidTokenError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidTokenError *) noexcept; + /* This needs to be defined so that `InvalidTokenError` can be used as a key + * in maps. */ + bool operator<(const InvalidTokenError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class ValidateAuthorizationTokenResponse : public AbstractShapeBase { +public: + ValidateAuthorizationTokenResponse() noexcept {} + ValidateAuthorizationTokenResponse( + const ValidateAuthorizationTokenResponse &) = default; + void SetIsValid(const bool &isValid) noexcept { m_isValid = isValid; } + Aws::Crt::Optional GetIsValid() noexcept { return m_isValid; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateAuthorizationTokenResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateAuthorizationTokenResponse *) noexcept; + /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can + * be used as a key in maps. */ + bool operator<(const ValidateAuthorizationTokenResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_isValid; +}; + +class ValidateAuthorizationTokenRequest : public AbstractShapeBase { +public: + ValidateAuthorizationTokenRequest() noexcept {} + ValidateAuthorizationTokenRequest(const ValidateAuthorizationTokenRequest &) = + default; + void SetToken(const Aws::Crt::String &token) noexcept { m_token = token; } + Aws::Crt::Optional GetToken() noexcept { return m_token; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateAuthorizationTokenRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateAuthorizationTokenRequest *) noexcept; + /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be + * used as a key in maps. */ + bool operator<(const ValidateAuthorizationTokenRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_token; +}; + +class UpdateThingShadowResponse : public AbstractShapeBase { +public: + UpdateThingShadowResponse() noexcept {} + UpdateThingShadowResponse(const UpdateThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateThingShadowResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateThingShadowResponse *) noexcept; + /* This needs to be defined so that `UpdateThingShadowResponse` can be used as + * a key in maps. */ + bool operator<(const UpdateThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_payload; +}; + +class UpdateThingShadowRequest : public AbstractShapeBase { +public: + UpdateThingShadowRequest() noexcept {} + UpdateThingShadowRequest(const UpdateThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { + m_thingName = thingName; + } + Aws::Crt::Optional GetThingName() noexcept { + return m_thingName; + } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { + m_shadowName = shadowName; + } + Aws::Crt::Optional GetShadowName() noexcept { + return m_shadowName; + } + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateThingShadowRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateThingShadowRequest *) noexcept; + /* This needs to be defined so that `UpdateThingShadowRequest` can be used as + * a key in maps. */ + bool operator<(const UpdateThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; + Aws::Crt::Optional> m_payload; +}; + +class UpdateStateResponse : public AbstractShapeBase { +public: + UpdateStateResponse() noexcept {} + UpdateStateResponse(const UpdateStateResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateStateResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateStateResponse *) noexcept; + /* This needs to be defined so that `UpdateStateResponse` can be used as a key + * in maps. */ + bool operator<(const UpdateStateResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class UpdateStateRequest : public AbstractShapeBase { +public: + UpdateStateRequest() noexcept {} + UpdateStateRequest(const UpdateStateRequest &) = default; + void SetState(ReportedLifecycleState state) noexcept; + Aws::Crt::Optional GetState() noexcept; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateStateRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateStateRequest *) noexcept; + /* This needs to be defined so that `UpdateStateRequest` can be used as a key + * in maps. */ + bool operator<(const UpdateStateRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_state; +}; + +class FailedUpdateConditionCheckError : public OperationError { +public: + FailedUpdateConditionCheckError() noexcept {} + FailedUpdateConditionCheckError(const FailedUpdateConditionCheckError &) = + default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(FailedUpdateConditionCheckError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(FailedUpdateConditionCheckError *) noexcept; + /* This needs to be defined so that `FailedUpdateConditionCheckError` can be + * used as a key in maps. */ + bool operator<(const FailedUpdateConditionCheckError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class ConflictError : public OperationError { +public: + ConflictError() noexcept {} + ConflictError(const ConflictError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConflictError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConflictError *) noexcept; + /* This needs to be defined so that `ConflictError` can be used as a key in + * maps. */ + bool operator<(const ConflictError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class UpdateConfigurationResponse : public AbstractShapeBase { +public: + UpdateConfigurationResponse() noexcept {} + UpdateConfigurationResponse(const UpdateConfigurationResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateConfigurationResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateConfigurationResponse *) noexcept; + /* This needs to be defined so that `UpdateConfigurationResponse` can be used + * as a key in maps. */ + bool operator<(const UpdateConfigurationResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class UpdateConfigurationRequest : public AbstractShapeBase { +public: + UpdateConfigurationRequest() noexcept {} + UpdateConfigurationRequest(const UpdateConfigurationRequest &) = default; + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { + m_keyPath = keyPath; + } + Aws::Crt::Optional> GetKeyPath() noexcept { + return m_keyPath; + } + void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { + m_timestamp = timestamp; + } + Aws::Crt::Optional GetTimestamp() noexcept { + return m_timestamp; + } + void SetValueToMerge(const Aws::Crt::JsonObject &valueToMerge) noexcept { + m_valueToMerge = valueToMerge; + } + Aws::Crt::Optional GetValueToMerge() noexcept { + return m_valueToMerge; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateConfigurationRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateConfigurationRequest *) noexcept; + /* This needs to be defined so that `UpdateConfigurationRequest` can be used + * as a key in maps. */ + bool operator<(const UpdateConfigurationRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_keyPath; + Aws::Crt::Optional m_timestamp; + Aws::Crt::Optional m_valueToMerge; +}; + +class SubscribeToValidateConfigurationUpdatesResponse + : public AbstractShapeBase { +public: + SubscribeToValidateConfigurationUpdatesResponse() noexcept {} + SubscribeToValidateConfigurationUpdatesResponse( + const SubscribeToValidateConfigurationUpdatesResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void + s_loadFromJsonView(SubscribeToValidateConfigurationUpdatesResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void + s_customDeleter(SubscribeToValidateConfigurationUpdatesResponse *) noexcept; + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in + * maps. */ + bool operator<( + const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToValidateConfigurationUpdatesRequest + : public AbstractShapeBase { +public: + SubscribeToValidateConfigurationUpdatesRequest() noexcept {} + SubscribeToValidateConfigurationUpdatesRequest( + const SubscribeToValidateConfigurationUpdatesRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void + s_loadFromJsonView(SubscribeToValidateConfigurationUpdatesRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void + s_customDeleter(SubscribeToValidateConfigurationUpdatesRequest *) noexcept; + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in + * maps. */ + bool operator<( + const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToTopicResponse : public AbstractShapeBase { +public: + SubscribeToTopicResponse() noexcept {} + SubscribeToTopicResponse(const SubscribeToTopicResponse &) = default; + /* Deprecated No longer used */ + void SetTopicName(const Aws::Crt::String &topicName) noexcept { + m_topicName = topicName; + } + /* Deprecated No longer used */ + Aws::Crt::Optional GetTopicName() noexcept { + return m_topicName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToTopicResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToTopicResponse *) noexcept; + /* This needs to be defined so that `SubscribeToTopicResponse` can be used as + * a key in maps. */ + bool operator<(const SubscribeToTopicResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topicName; +}; + +class SubscribeToTopicRequest : public AbstractShapeBase { +public: + SubscribeToTopicRequest() noexcept {} + SubscribeToTopicRequest(const SubscribeToTopicRequest &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SetReceiveMode(ReceiveMode receiveMode) noexcept; + Aws::Crt::Optional GetReceiveMode() noexcept; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToTopicRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToTopicRequest *) noexcept; + /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a + * key in maps. */ + bool operator<(const SubscribeToTopicRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topic; + Aws::Crt::Optional m_receiveMode; +}; + +class SubscribeToIoTCoreResponse : public AbstractShapeBase { +public: + SubscribeToIoTCoreResponse() noexcept {} + SubscribeToIoTCoreResponse(const SubscribeToIoTCoreResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToIoTCoreResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; + /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used + * as a key in maps. */ + bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToIoTCoreRequest : public AbstractShapeBase { +public: + SubscribeToIoTCoreRequest() noexcept {} + SubscribeToIoTCoreRequest(const SubscribeToIoTCoreRequest &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { + m_topicName = topicName; + } + Aws::Crt::Optional GetTopicName() noexcept { + return m_topicName; + } + void SetQos(QOS qos) noexcept; + Aws::Crt::Optional GetQos() noexcept; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToIoTCoreRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToIoTCoreRequest *) noexcept; + /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as + * a key in maps. */ + bool operator<(const SubscribeToIoTCoreRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional m_qos; +}; + +class SubscribeToConfigurationUpdateResponse : public AbstractShapeBase { +public: + SubscribeToConfigurationUpdateResponse() noexcept {} + SubscribeToConfigurationUpdateResponse( + const SubscribeToConfigurationUpdateResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToConfigurationUpdateResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void + s_customDeleter(SubscribeToConfigurationUpdateResponse *) noexcept; + /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` + * can be used as a key in maps. */ + bool operator<(const SubscribeToConfigurationUpdateResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToConfigurationUpdateRequest : public AbstractShapeBase { +public: + SubscribeToConfigurationUpdateRequest() noexcept {} + SubscribeToConfigurationUpdateRequest( + const SubscribeToConfigurationUpdateRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { + m_keyPath = keyPath; + } + Aws::Crt::Optional> GetKeyPath() noexcept { + return m_keyPath; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToConfigurationUpdateRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToConfigurationUpdateRequest *) noexcept; + /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` + * can be used as a key in maps. */ + bool operator<(const SubscribeToConfigurationUpdateRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; +}; + +class SubscribeToComponentUpdatesResponse : public AbstractShapeBase { +public: + SubscribeToComponentUpdatesResponse() noexcept {} + SubscribeToComponentUpdatesResponse( + const SubscribeToComponentUpdatesResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToComponentUpdatesResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToComponentUpdatesResponse *) noexcept; + /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can + * be used as a key in maps. */ + bool operator<(const SubscribeToComponentUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToComponentUpdatesRequest : public AbstractShapeBase { +public: + SubscribeToComponentUpdatesRequest() noexcept {} + SubscribeToComponentUpdatesRequest( + const SubscribeToComponentUpdatesRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToComponentUpdatesRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToComponentUpdatesRequest *) noexcept; + /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can + * be used as a key in maps. */ + bool operator<(const SubscribeToComponentUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToCertificateUpdatesResponse : public AbstractShapeBase { +public: + SubscribeToCertificateUpdatesResponse() noexcept {} + SubscribeToCertificateUpdatesResponse( + const SubscribeToCertificateUpdatesResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToCertificateUpdatesResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToCertificateUpdatesResponse *) noexcept; + /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` + * can be used as a key in maps. */ + bool operator<(const SubscribeToCertificateUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SubscribeToCertificateUpdatesRequest : public AbstractShapeBase { +public: + SubscribeToCertificateUpdatesRequest() noexcept {} + SubscribeToCertificateUpdatesRequest( + const SubscribeToCertificateUpdatesRequest &) = default; + void + SetCertificateOptions(const CertificateOptions &certificateOptions) noexcept { + m_certificateOptions = certificateOptions; + } + Aws::Crt::Optional GetCertificateOptions() noexcept { + return m_certificateOptions; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToCertificateUpdatesRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToCertificateUpdatesRequest *) noexcept; + /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can + * be used as a key in maps. */ + bool operator<(const SubscribeToCertificateUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_certificateOptions; +}; + +class StopComponentResponse : public AbstractShapeBase { +public: + StopComponentResponse() noexcept {} + StopComponentResponse(const StopComponentResponse &) = default; + void SetStopStatus(RequestStatus stopStatus) noexcept; + Aws::Crt::Optional GetStopStatus() noexcept; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(StopComponentResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(StopComponentResponse *) noexcept; + /* This needs to be defined so that `StopComponentResponse` can be used as a + * key in maps. */ + bool operator<(const StopComponentResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_stopStatus; + Aws::Crt::Optional m_message; +}; + +class StopComponentRequest : public AbstractShapeBase { +public: + StopComponentRequest() noexcept {} + StopComponentRequest(const StopComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(StopComponentRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(StopComponentRequest *) noexcept; + /* This needs to be defined so that `StopComponentRequest` can be used as a + * key in maps. */ + bool operator<(const StopComponentRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; +}; + +class SendConfigurationValidityReportResponse : public AbstractShapeBase { +public: + SendConfigurationValidityReportResponse() noexcept {} + SendConfigurationValidityReportResponse( + const SendConfigurationValidityReportResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SendConfigurationValidityReportResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void + s_customDeleter(SendConfigurationValidityReportResponse *) noexcept; + /* This needs to be defined so that `SendConfigurationValidityReportResponse` + * can be used as a key in maps. */ + bool + operator<(const SendConfigurationValidityReportResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class SendConfigurationValidityReportRequest : public AbstractShapeBase { +public: + SendConfigurationValidityReportRequest() noexcept {} + SendConfigurationValidityReportRequest( + const SendConfigurationValidityReportRequest &) = default; + void SetConfigurationValidityReport( + const ConfigurationValidityReport &configurationValidityReport) noexcept { + m_configurationValidityReport = configurationValidityReport; + } + Aws::Crt::Optional + GetConfigurationValidityReport() noexcept { + return m_configurationValidityReport; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SendConfigurationValidityReportRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void + s_customDeleter(SendConfigurationValidityReportRequest *) noexcept; + /* This needs to be defined so that `SendConfigurationValidityReportRequest` + * can be used as a key in maps. */ + bool operator<(const SendConfigurationValidityReportRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_configurationValidityReport; +}; + +class ResumeComponentResponse : public AbstractShapeBase { +public: + ResumeComponentResponse() noexcept {} + ResumeComponentResponse(const ResumeComponentResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResumeComponentResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResumeComponentResponse *) noexcept; + /* This needs to be defined so that `ResumeComponentResponse` can be used as a + * key in maps. */ + bool operator<(const ResumeComponentResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class ResumeComponentRequest : public AbstractShapeBase { +public: + ResumeComponentRequest() noexcept {} + ResumeComponentRequest(const ResumeComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResumeComponentRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResumeComponentRequest *) noexcept; + /* This needs to be defined so that `ResumeComponentRequest` can be used as a + * key in maps. */ + bool operator<(const ResumeComponentRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; +}; + +class ComponentNotFoundError : public OperationError { +public: + ComponentNotFoundError() noexcept {} + ComponentNotFoundError(const ComponentNotFoundError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentNotFoundError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentNotFoundError *) noexcept; + /* This needs to be defined so that `ComponentNotFoundError` can be used as a + * key in maps. */ + bool operator<(const ComponentNotFoundError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class RestartComponentResponse : public AbstractShapeBase { +public: + RestartComponentResponse() noexcept {} + RestartComponentResponse(const RestartComponentResponse &) = default; + void SetRestartStatus(RequestStatus restartStatus) noexcept; + Aws::Crt::Optional GetRestartStatus() noexcept; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RestartComponentResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RestartComponentResponse *) noexcept; + /* This needs to be defined so that `RestartComponentResponse` can be used as + * a key in maps. */ + bool operator<(const RestartComponentResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_restartStatus; + Aws::Crt::Optional m_message; +}; + +class RestartComponentRequest : public AbstractShapeBase { +public: + RestartComponentRequest() noexcept {} + RestartComponentRequest(const RestartComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RestartComponentRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RestartComponentRequest *) noexcept; + /* This needs to be defined so that `RestartComponentRequest` can be used as a + * key in maps. */ + bool operator<(const RestartComponentRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; +}; + +class PutComponentMetricResponse : public AbstractShapeBase { +public: + PutComponentMetricResponse() noexcept {} + PutComponentMetricResponse(const PutComponentMetricResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PutComponentMetricResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PutComponentMetricResponse *) noexcept; + /* This needs to be defined so that `PutComponentMetricResponse` can be used + * as a key in maps. */ + bool operator<(const PutComponentMetricResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class PutComponentMetricRequest : public AbstractShapeBase { +public: + PutComponentMetricRequest() noexcept {} + PutComponentMetricRequest(const PutComponentMetricRequest &) = default; + void SetMetrics(const Aws::Crt::Vector &metrics) noexcept { + m_metrics = metrics; + } + Aws::Crt::Optional> GetMetrics() noexcept { + return m_metrics; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PutComponentMetricRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PutComponentMetricRequest *) noexcept; + /* This needs to be defined so that `PutComponentMetricRequest` can be used as + * a key in maps. */ + bool operator<(const PutComponentMetricRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_metrics; +}; + +class PublishToTopicResponse : public AbstractShapeBase { +public: + PublishToTopicResponse() noexcept {} + PublishToTopicResponse(const PublishToTopicResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToTopicResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToTopicResponse *) noexcept; + /* This needs to be defined so that `PublishToTopicResponse` can be used as a + * key in maps. */ + bool operator<(const PublishToTopicResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class PublishToTopicRequest : public AbstractShapeBase { +public: + PublishToTopicRequest() noexcept {} + PublishToTopicRequest(const PublishToTopicRequest &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SetPublishMessage(const PublishMessage &publishMessage) noexcept { + m_publishMessage = publishMessage; + } + Aws::Crt::Optional GetPublishMessage() noexcept { + return m_publishMessage; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToTopicRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToTopicRequest *) noexcept; + /* This needs to be defined so that `PublishToTopicRequest` can be used as a + * key in maps. */ + bool operator<(const PublishToTopicRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topic; + Aws::Crt::Optional m_publishMessage; +}; + +class PublishToIoTCoreResponse : public AbstractShapeBase { +public: + PublishToIoTCoreResponse() noexcept {} + PublishToIoTCoreResponse(const PublishToIoTCoreResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToIoTCoreResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToIoTCoreResponse *) noexcept; + /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as + * a key in maps. */ + bool operator<(const PublishToIoTCoreResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class PublishToIoTCoreRequest : public AbstractShapeBase { +public: + PublishToIoTCoreRequest() noexcept {} + PublishToIoTCoreRequest(const PublishToIoTCoreRequest &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { + m_topicName = topicName; + } + Aws::Crt::Optional GetTopicName() noexcept { + return m_topicName; + } + void SetQos(QOS qos) noexcept; + Aws::Crt::Optional GetQos() noexcept; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToIoTCoreRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToIoTCoreRequest *) noexcept; + /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a + * key in maps. */ + bool operator<(const PublishToIoTCoreRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional m_qos; + Aws::Crt::Optional> m_payload; +}; + +class PauseComponentResponse : public AbstractShapeBase { +public: + PauseComponentResponse() noexcept {} + PauseComponentResponse(const PauseComponentResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PauseComponentResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PauseComponentResponse *) noexcept; + /* This needs to be defined so that `PauseComponentResponse` can be used as a + * key in maps. */ + bool operator<(const PauseComponentResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class PauseComponentRequest : public AbstractShapeBase { +public: + PauseComponentRequest() noexcept {} + PauseComponentRequest(const PauseComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PauseComponentRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PauseComponentRequest *) noexcept; + /* This needs to be defined so that `PauseComponentRequest` can be used as a + * key in maps. */ + bool operator<(const PauseComponentRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; +}; + +class ListNamedShadowsForThingResponse : public AbstractShapeBase { +public: + ListNamedShadowsForThingResponse() noexcept {} + ListNamedShadowsForThingResponse(const ListNamedShadowsForThingResponse &) = + default; + void SetResults(const Aws::Crt::Vector &results) noexcept { + m_results = results; + } + Aws::Crt::Optional> GetResults() noexcept { + return m_results; + } + void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { + m_timestamp = timestamp; + } + Aws::Crt::Optional GetTimestamp() noexcept { + return m_timestamp; + } + void SetNextToken(const Aws::Crt::String &nextToken) noexcept { + m_nextToken = nextToken; + } + Aws::Crt::Optional GetNextToken() noexcept { + return m_nextToken; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListNamedShadowsForThingResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListNamedShadowsForThingResponse *) noexcept; + /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be + * used as a key in maps. */ + bool operator<(const ListNamedShadowsForThingResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_results; + Aws::Crt::Optional m_timestamp; + Aws::Crt::Optional m_nextToken; +}; + +class ListNamedShadowsForThingRequest : public AbstractShapeBase { +public: + ListNamedShadowsForThingRequest() noexcept {} + ListNamedShadowsForThingRequest(const ListNamedShadowsForThingRequest &) = + default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { + m_thingName = thingName; + } + Aws::Crt::Optional GetThingName() noexcept { + return m_thingName; + } + void SetNextToken(const Aws::Crt::String &nextToken) noexcept { + m_nextToken = nextToken; + } + Aws::Crt::Optional GetNextToken() noexcept { + return m_nextToken; + } + void SetPageSize(const int &pageSize) noexcept { m_pageSize = pageSize; } + Aws::Crt::Optional GetPageSize() noexcept { return m_pageSize; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListNamedShadowsForThingRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListNamedShadowsForThingRequest *) noexcept; + /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be + * used as a key in maps. */ + bool operator<(const ListNamedShadowsForThingRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_nextToken; + Aws::Crt::Optional m_pageSize; +}; + +class ListLocalDeploymentsResponse : public AbstractShapeBase { +public: + ListLocalDeploymentsResponse() noexcept {} + ListLocalDeploymentsResponse(const ListLocalDeploymentsResponse &) = default; + void SetLocalDeployments( + const Aws::Crt::Vector &localDeployments) noexcept { + m_localDeployments = localDeployments; + } + Aws::Crt::Optional> + GetLocalDeployments() noexcept { + return m_localDeployments; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListLocalDeploymentsResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; + /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used + * as a key in maps. */ + bool operator<(const ListLocalDeploymentsResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_localDeployments; +}; + +class ListLocalDeploymentsRequest : public AbstractShapeBase { +public: + ListLocalDeploymentsRequest() noexcept {} + ListLocalDeploymentsRequest(const ListLocalDeploymentsRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListLocalDeploymentsRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; + /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used + * as a key in maps. */ + bool operator<(const ListLocalDeploymentsRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class ListComponentsResponse : public AbstractShapeBase { +public: + ListComponentsResponse() noexcept {} + ListComponentsResponse(const ListComponentsResponse &) = default; + void + SetComponents(const Aws::Crt::Vector &components) noexcept { + m_components = components; + } + Aws::Crt::Optional> + GetComponents() noexcept { + return m_components; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListComponentsResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListComponentsResponse *) noexcept; + /* This needs to be defined so that `ListComponentsResponse` can be used as a + * key in maps. */ + bool operator<(const ListComponentsResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_components; +}; + +class ListComponentsRequest : public AbstractShapeBase { +public: + ListComponentsRequest() noexcept {} + ListComponentsRequest(const ListComponentsRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListComponentsRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListComponentsRequest *) noexcept; + /* This needs to be defined so that `ListComponentsRequest` can be used as a + * key in maps. */ + bool operator<(const ListComponentsRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class GetThingShadowResponse : public AbstractShapeBase { +public: + GetThingShadowResponse() noexcept {} + GetThingShadowResponse(const GetThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetThingShadowResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetThingShadowResponse *) noexcept; + /* This needs to be defined so that `GetThingShadowResponse` can be used as a + * key in maps. */ + bool operator<(const GetThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_payload; +}; + +class GetThingShadowRequest : public AbstractShapeBase { +public: + GetThingShadowRequest() noexcept {} + GetThingShadowRequest(const GetThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { + m_thingName = thingName; + } + Aws::Crt::Optional GetThingName() noexcept { + return m_thingName; + } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { + m_shadowName = shadowName; + } + Aws::Crt::Optional GetShadowName() noexcept { + return m_shadowName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetThingShadowRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetThingShadowRequest *) noexcept; + /* This needs to be defined so that `GetThingShadowRequest` can be used as a + * key in maps. */ + bool operator<(const GetThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; +}; + +class GetSecretValueResponse : public AbstractShapeBase { +public: + GetSecretValueResponse() noexcept {} + GetSecretValueResponse(const GetSecretValueResponse &) = default; + void SetSecretId(const Aws::Crt::String &secretId) noexcept { + m_secretId = secretId; + } + Aws::Crt::Optional GetSecretId() noexcept { + return m_secretId; + } + void SetVersionId(const Aws::Crt::String &versionId) noexcept { + m_versionId = versionId; + } + Aws::Crt::Optional GetVersionId() noexcept { + return m_versionId; + } + void SetVersionStage( + const Aws::Crt::Vector &versionStage) noexcept { + m_versionStage = versionStage; + } + Aws::Crt::Optional> + GetVersionStage() noexcept { + return m_versionStage; + } + void SetSecretValue(const SecretValue &secretValue) noexcept { + m_secretValue = secretValue; + } + Aws::Crt::Optional GetSecretValue() noexcept { + return m_secretValue; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetSecretValueResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetSecretValueResponse *) noexcept; + /* This needs to be defined so that `GetSecretValueResponse` can be used as a + * key in maps. */ + bool operator<(const GetSecretValueResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_secretId; + Aws::Crt::Optional m_versionId; + Aws::Crt::Optional> m_versionStage; + Aws::Crt::Optional m_secretValue; +}; + +class GetSecretValueRequest : public AbstractShapeBase { +public: + GetSecretValueRequest() noexcept {} + GetSecretValueRequest(const GetSecretValueRequest &) = default; + void SetSecretId(const Aws::Crt::String &secretId) noexcept { + m_secretId = secretId; + } + Aws::Crt::Optional GetSecretId() noexcept { + return m_secretId; + } + void SetVersionId(const Aws::Crt::String &versionId) noexcept { + m_versionId = versionId; + } + Aws::Crt::Optional GetVersionId() noexcept { + return m_versionId; + } + void SetVersionStage(const Aws::Crt::String &versionStage) noexcept { + m_versionStage = versionStage; + } + Aws::Crt::Optional GetVersionStage() noexcept { + return m_versionStage; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetSecretValueRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetSecretValueRequest *) noexcept; + /* This needs to be defined so that `GetSecretValueRequest` can be used as a + * key in maps. */ + bool operator<(const GetSecretValueRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_secretId; + Aws::Crt::Optional m_versionId; + Aws::Crt::Optional m_versionStage; +}; + +class GetLocalDeploymentStatusResponse : public AbstractShapeBase { +public: + GetLocalDeploymentStatusResponse() noexcept {} + GetLocalDeploymentStatusResponse(const GetLocalDeploymentStatusResponse &) = + default; + void SetDeployment(const LocalDeployment &deployment) noexcept { + m_deployment = deployment; + } + Aws::Crt::Optional GetDeployment() noexcept { + return m_deployment; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetLocalDeploymentStatusResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetLocalDeploymentStatusResponse *) noexcept; + /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be + * used as a key in maps. */ + bool operator<(const GetLocalDeploymentStatusResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deployment; +}; + +class GetLocalDeploymentStatusRequest : public AbstractShapeBase { +public: + GetLocalDeploymentStatusRequest() noexcept {} + GetLocalDeploymentStatusRequest(const GetLocalDeploymentStatusRequest &) = + default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetLocalDeploymentStatusRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetLocalDeploymentStatusRequest *) noexcept; + /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be + * used as a key in maps. */ + bool operator<(const GetLocalDeploymentStatusRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; +}; + +class GetConfigurationResponse : public AbstractShapeBase { +public: + GetConfigurationResponse() noexcept {} + GetConfigurationResponse(const GetConfigurationResponse &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SetValue(const Aws::Crt::JsonObject &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { + return m_value; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetConfigurationResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetConfigurationResponse *) noexcept; + /* This needs to be defined so that `GetConfigurationResponse` can be used as + * a key in maps. */ + bool operator<(const GetConfigurationResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional m_value; +}; + +class GetConfigurationRequest : public AbstractShapeBase { +public: + GetConfigurationRequest() noexcept {} + GetConfigurationRequest(const GetConfigurationRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { + m_keyPath = keyPath; + } + Aws::Crt::Optional> GetKeyPath() noexcept { + return m_keyPath; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetConfigurationRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetConfigurationRequest *) noexcept; + /* This needs to be defined so that `GetConfigurationRequest` can be used as a + * key in maps. */ + bool operator<(const GetConfigurationRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; +}; + +class GetComponentDetailsResponse : public AbstractShapeBase { +public: + GetComponentDetailsResponse() noexcept {} + GetComponentDetailsResponse(const GetComponentDetailsResponse &) = default; + void SetComponentDetails(const ComponentDetails &componentDetails) noexcept { + m_componentDetails = componentDetails; + } + Aws::Crt::Optional GetComponentDetails() noexcept { + return m_componentDetails; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetComponentDetailsResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetComponentDetailsResponse *) noexcept; + /* This needs to be defined so that `GetComponentDetailsResponse` can be used + * as a key in maps. */ + bool operator<(const GetComponentDetailsResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentDetails; +}; + +class GetComponentDetailsRequest : public AbstractShapeBase { +public: + GetComponentDetailsRequest() noexcept {} + GetComponentDetailsRequest(const GetComponentDetailsRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { + m_componentName = componentName; + } + Aws::Crt::Optional GetComponentName() noexcept { + return m_componentName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetComponentDetailsRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetComponentDetailsRequest *) noexcept; + /* This needs to be defined so that `GetComponentDetailsRequest` can be used + * as a key in maps. */ + bool operator<(const GetComponentDetailsRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_componentName; +}; + +class InvalidCredentialError : public OperationError { +public: + InvalidCredentialError() noexcept {} + InvalidCredentialError(const InvalidCredentialError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidCredentialError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidCredentialError *) noexcept; + /* This needs to be defined so that `InvalidCredentialError` can be used as a + * key in maps. */ + bool operator<(const InvalidCredentialError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class GetClientDeviceAuthTokenResponse : public AbstractShapeBase { +public: + GetClientDeviceAuthTokenResponse() noexcept {} + GetClientDeviceAuthTokenResponse(const GetClientDeviceAuthTokenResponse &) = + default; + void SetClientDeviceAuthToken( + const Aws::Crt::String &clientDeviceAuthToken) noexcept { + m_clientDeviceAuthToken = clientDeviceAuthToken; + } + Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { + return m_clientDeviceAuthToken; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetClientDeviceAuthTokenResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetClientDeviceAuthTokenResponse *) noexcept; + /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be + * used as a key in maps. */ + bool operator<(const GetClientDeviceAuthTokenResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_clientDeviceAuthToken; +}; + +class GetClientDeviceAuthTokenRequest : public AbstractShapeBase { +public: + GetClientDeviceAuthTokenRequest() noexcept {} + GetClientDeviceAuthTokenRequest(const GetClientDeviceAuthTokenRequest &) = + default; + void SetCredential(const CredentialDocument &credential) noexcept { + m_credential = credential; + } + Aws::Crt::Optional GetCredential() noexcept { + return m_credential; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetClientDeviceAuthTokenRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetClientDeviceAuthTokenRequest *) noexcept; + /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be + * used as a key in maps. */ + bool operator<(const GetClientDeviceAuthTokenRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_credential; +}; + +class DeleteThingShadowResponse : public AbstractShapeBase { +public: + DeleteThingShadowResponse() noexcept {} + DeleteThingShadowResponse(const DeleteThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { + m_payload = payload; + } + Aws::Crt::Optional> GetPayload() noexcept { + return m_payload; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeleteThingShadowResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeleteThingShadowResponse *) noexcept; + /* This needs to be defined so that `DeleteThingShadowResponse` can be used as + * a key in maps. */ + bool operator<(const DeleteThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional> m_payload; +}; + +class DeleteThingShadowRequest : public AbstractShapeBase { +public: + DeleteThingShadowRequest() noexcept {} + DeleteThingShadowRequest(const DeleteThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { + m_thingName = thingName; + } + Aws::Crt::Optional GetThingName() noexcept { + return m_thingName; + } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { + m_shadowName = shadowName; + } + Aws::Crt::Optional GetShadowName() noexcept { + return m_shadowName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeleteThingShadowRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeleteThingShadowRequest *) noexcept; + /* This needs to be defined so that `DeleteThingShadowRequest` can be used as + * a key in maps. */ + bool operator<(const DeleteThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; +}; + +class ResourceNotFoundError : public OperationError { +public: + ResourceNotFoundError() noexcept {} + ResourceNotFoundError(const ResourceNotFoundError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SetResourceType(const Aws::Crt::String &resourceType) noexcept { + m_resourceType = resourceType; + } + Aws::Crt::Optional GetResourceType() noexcept { + return m_resourceType; + } + void SetResourceName(const Aws::Crt::String &resourceName) noexcept { + m_resourceName = resourceName; + } + Aws::Crt::Optional GetResourceName() noexcept { + return m_resourceName; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResourceNotFoundError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResourceNotFoundError *) noexcept; + /* This needs to be defined so that `ResourceNotFoundError` can be used as a + * key in maps. */ + bool operator<(const ResourceNotFoundError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_resourceType; + Aws::Crt::Optional m_resourceName; +}; + +class DeferComponentUpdateResponse : public AbstractShapeBase { +public: + DeferComponentUpdateResponse() noexcept {} + DeferComponentUpdateResponse(const DeferComponentUpdateResponse &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeferComponentUpdateResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; + /* This needs to be defined so that `DeferComponentUpdateResponse` can be used + * as a key in maps. */ + bool operator<(const DeferComponentUpdateResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class DeferComponentUpdateRequest : public AbstractShapeBase { +public: + DeferComponentUpdateRequest() noexcept {} + DeferComponentUpdateRequest(const DeferComponentUpdateRequest &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept { + return m_message; + } + void SetRecheckAfterMs(const int64_t &recheckAfterMs) noexcept { + m_recheckAfterMs = recheckAfterMs; + } + Aws::Crt::Optional GetRecheckAfterMs() noexcept { + return m_recheckAfterMs; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeferComponentUpdateRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; + /* This needs to be defined so that `DeferComponentUpdateRequest` can be used + * as a key in maps. */ + bool operator<(const DeferComponentUpdateRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_recheckAfterMs; +}; + +class InvalidArtifactsDirectoryPathError : public OperationError { +public: + InvalidArtifactsDirectoryPathError() noexcept {} + InvalidArtifactsDirectoryPathError( + const InvalidArtifactsDirectoryPathError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidArtifactsDirectoryPathError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidArtifactsDirectoryPathError *) noexcept; + /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can + * be used as a key in maps. */ + bool operator<(const InvalidArtifactsDirectoryPathError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class InvalidRecipeDirectoryPathError : public OperationError { +public: + InvalidRecipeDirectoryPathError() noexcept {} + InvalidRecipeDirectoryPathError(const InvalidRecipeDirectoryPathError &) = + default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidRecipeDirectoryPathError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidRecipeDirectoryPathError *) noexcept; + /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be + * used as a key in maps. */ + bool operator<(const InvalidRecipeDirectoryPathError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class CreateLocalDeploymentResponse : public AbstractShapeBase { +public: + CreateLocalDeploymentResponse() noexcept {} + CreateLocalDeploymentResponse(const CreateLocalDeploymentResponse &) = + default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { + m_deploymentId = deploymentId; + } + Aws::Crt::Optional GetDeploymentId() noexcept { + return m_deploymentId; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateLocalDeploymentResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateLocalDeploymentResponse *) noexcept; + /* This needs to be defined so that `CreateLocalDeploymentResponse` can be + * used as a key in maps. */ + bool operator<(const CreateLocalDeploymentResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_deploymentId; +}; + +class CreateLocalDeploymentRequest : public AbstractShapeBase { +public: + CreateLocalDeploymentRequest() noexcept {} + CreateLocalDeploymentRequest(const CreateLocalDeploymentRequest &) = default; + void SetGroupName(const Aws::Crt::String &groupName) noexcept { + m_groupName = groupName; + } + Aws::Crt::Optional GetGroupName() noexcept { + return m_groupName; + } + void SetRootComponentVersionsToAdd( + const Aws::Crt::Map + &rootComponentVersionsToAdd) noexcept { + m_rootComponentVersionsToAdd = rootComponentVersionsToAdd; + } + Aws::Crt::Optional> + GetRootComponentVersionsToAdd() noexcept { + return m_rootComponentVersionsToAdd; + } + void SetRootComponentsToRemove(const Aws::Crt::Vector + &rootComponentsToRemove) noexcept { + m_rootComponentsToRemove = rootComponentsToRemove; + } + Aws::Crt::Optional> + GetRootComponentsToRemove() noexcept { + return m_rootComponentsToRemove; + } + void SetComponentToConfiguration( + const Aws::Crt::Map + &componentToConfiguration) noexcept { + m_componentToConfiguration = componentToConfiguration; + } + Aws::Crt::Optional> + GetComponentToConfiguration() noexcept { + return m_componentToConfiguration; + } + void + SetComponentToRunWithInfo(const Aws::Crt::Map + &componentToRunWithInfo) noexcept { + m_componentToRunWithInfo = componentToRunWithInfo; + } + Aws::Crt::Optional> + GetComponentToRunWithInfo() noexcept { + return m_componentToRunWithInfo; + } + void + SetRecipeDirectoryPath(const Aws::Crt::String &recipeDirectoryPath) noexcept { + m_recipeDirectoryPath = recipeDirectoryPath; + } + Aws::Crt::Optional GetRecipeDirectoryPath() noexcept { + return m_recipeDirectoryPath; + } + void SetArtifactsDirectoryPath( + const Aws::Crt::String &artifactsDirectoryPath) noexcept { + m_artifactsDirectoryPath = artifactsDirectoryPath; + } + Aws::Crt::Optional GetArtifactsDirectoryPath() noexcept { + return m_artifactsDirectoryPath; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateLocalDeploymentRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; + /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used + * as a key in maps. */ + bool operator<(const CreateLocalDeploymentRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_groupName; + Aws::Crt::Optional> + m_rootComponentVersionsToAdd; + Aws::Crt::Optional> + m_rootComponentsToRemove; + Aws::Crt::Optional> + m_componentToConfiguration; + Aws::Crt::Optional> + m_componentToRunWithInfo; + Aws::Crt::Optional m_recipeDirectoryPath; + Aws::Crt::Optional m_artifactsDirectoryPath; +}; + +class CreateDebugPasswordResponse : public AbstractShapeBase { +public: + CreateDebugPasswordResponse() noexcept {} + CreateDebugPasswordResponse(const CreateDebugPasswordResponse &) = default; + void SetPassword(const Aws::Crt::String &password) noexcept { + m_password = password; + } + Aws::Crt::Optional GetPassword() noexcept { + return m_password; + } + void SetUsername(const Aws::Crt::String &username) noexcept { + m_username = username; + } + Aws::Crt::Optional GetUsername() noexcept { + return m_username; + } + void + SetPasswordExpiration(const Aws::Crt::DateTime &passwordExpiration) noexcept { + m_passwordExpiration = passwordExpiration; + } + Aws::Crt::Optional GetPasswordExpiration() noexcept { + return m_passwordExpiration; + } + void SetCertificateSHA256Hash( + const Aws::Crt::String &certificateSHA256Hash) noexcept { + m_certificateSHA256Hash = certificateSHA256Hash; + } + Aws::Crt::Optional GetCertificateSHA256Hash() noexcept { + return m_certificateSHA256Hash; + } + void + SetCertificateSHA1Hash(const Aws::Crt::String &certificateSHA1Hash) noexcept { + m_certificateSHA1Hash = certificateSHA1Hash; + } + Aws::Crt::Optional GetCertificateSHA1Hash() noexcept { + return m_certificateSHA1Hash; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateDebugPasswordResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; + /* This needs to be defined so that `CreateDebugPasswordResponse` can be used + * as a key in maps. */ + bool operator<(const CreateDebugPasswordResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_password; + Aws::Crt::Optional m_username; + Aws::Crt::Optional m_passwordExpiration; + Aws::Crt::Optional m_certificateSHA256Hash; + Aws::Crt::Optional m_certificateSHA1Hash; +}; + +class CreateDebugPasswordRequest : public AbstractShapeBase { +public: + CreateDebugPasswordRequest() noexcept {} + CreateDebugPasswordRequest(const CreateDebugPasswordRequest &) = default; + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateDebugPasswordRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; + /* This needs to be defined so that `CreateDebugPasswordRequest` can be used + * as a key in maps. */ + bool operator<(const CreateDebugPasswordRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: +}; + +class InvalidClientDeviceAuthTokenError : public OperationError { +public: + InvalidClientDeviceAuthTokenError() noexcept {} + InvalidClientDeviceAuthTokenError(const InvalidClientDeviceAuthTokenError &) = + default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidClientDeviceAuthTokenError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidClientDeviceAuthTokenError *) noexcept; + /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be + * used as a key in maps. */ + bool operator<(const InvalidClientDeviceAuthTokenError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class InvalidArgumentsError : public OperationError { +public: + InvalidArgumentsError() noexcept {} + InvalidArgumentsError(const InvalidArgumentsError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidArgumentsError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidArgumentsError *) noexcept; + /* This needs to be defined so that `InvalidArgumentsError` can be used as a + * key in maps. */ + bool operator<(const InvalidArgumentsError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class ServiceError : public OperationError { +public: + ServiceError() noexcept {} + ServiceError(const ServiceError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ServiceError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ServiceError *) noexcept; + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ + bool operator<(const ServiceError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class UnauthorizedError : public OperationError { +public: + UnauthorizedError() noexcept {} + UnauthorizedError(const UnauthorizedError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { + m_message = message; + } + Aws::Crt::Optional GetMessage() noexcept override { + return m_message; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UnauthorizedError &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UnauthorizedError *) noexcept; + /* This needs to be defined so that `UnauthorizedError` can be used as a key + * in maps. */ + bool operator<(const UnauthorizedError &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_message; +}; + +class AuthorizeClientDeviceActionResponse : public AbstractShapeBase { +public: + AuthorizeClientDeviceActionResponse() noexcept {} + AuthorizeClientDeviceActionResponse( + const AuthorizeClientDeviceActionResponse &) = default; + void SetIsAuthorized(const bool &isAuthorized) noexcept { + m_isAuthorized = isAuthorized; + } + Aws::Crt::Optional GetIsAuthorized() noexcept { return m_isAuthorized; } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(AuthorizeClientDeviceActionResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(AuthorizeClientDeviceActionResponse *) noexcept; + /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can + * be used as a key in maps. */ + bool operator<(const AuthorizeClientDeviceActionResponse &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_isAuthorized; +}; + +class AuthorizeClientDeviceActionRequest : public AbstractShapeBase { +public: + AuthorizeClientDeviceActionRequest() noexcept {} + AuthorizeClientDeviceActionRequest( + const AuthorizeClientDeviceActionRequest &) = default; + void SetClientDeviceAuthToken( + const Aws::Crt::String &clientDeviceAuthToken) noexcept { + m_clientDeviceAuthToken = clientDeviceAuthToken; + } + Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { + return m_clientDeviceAuthToken; + } + void SetOperation(const Aws::Crt::String &operation) noexcept { + m_operation = operation; + } + Aws::Crt::Optional GetOperation() noexcept { + return m_operation; + } + void SetResource(const Aws::Crt::String &resource) noexcept { + m_resource = resource; + } + Aws::Crt::Optional GetResource() noexcept { + return m_resource; + } + void SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(AuthorizeClientDeviceActionRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource + s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(AuthorizeClientDeviceActionRequest *) noexcept; + /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can + * be used as a key in maps. */ + bool operator<(const AuthorizeClientDeviceActionRequest &) const noexcept; + static const char *MODEL_NAME; + +protected: + Aws::Crt::String GetModelName() const noexcept override; + +private: + Aws::Crt::Optional m_clientDeviceAuthToken; + Aws::Crt::Optional m_operation; + Aws::Crt::Optional m_resource; +}; + +class SubscribeToIoTCoreStreamHandler : public StreamResponseHandler { +public: + virtual void OnStreamEvent(IoTCoreMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToIoTCoreOperationContext : public OperationModelContext { +public: + SubscribeToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToIoTCoreResult { +public: + SubscribeToIoTCoreResult() noexcept {} + SubscribeToIoTCoreResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToIoTCoreResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToIoTCoreOperation : public ClientOperation { +public: + SubscribeToIoTCoreOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToIoTCoreOperation` + * @param request The request used for the `SubscribeToIoTCoreOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class ResumeComponentOperationContext : public OperationModelContext { +public: + ResumeComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class ResumeComponentResult { +public: + ResumeComponentResult() noexcept {} + ResumeComponentResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + ResumeComponentResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class ResumeComponentOperation : public ClientOperation { +public: + ResumeComponentOperation( + ClientConnection &connection, + const ResumeComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ResumeComponentOperation` + * @param request The request used for the `ResumeComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const ResumeComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class PublishToIoTCoreOperationContext : public OperationModelContext { +public: + PublishToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class PublishToIoTCoreResult { +public: + PublishToIoTCoreResult() noexcept {} + PublishToIoTCoreResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + PublishToIoTCoreResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class PublishToIoTCoreOperation : public ClientOperation { +public: + PublishToIoTCoreOperation( + ClientConnection &connection, + const PublishToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PublishToIoTCoreOperation` + * @param request The request used for the `PublishToIoTCoreOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const PublishToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SubscribeToConfigurationUpdateStreamHandler + : public StreamResponseHandler { +public: + virtual void OnStreamEvent(ConfigurationUpdateEvents *response) { + (void)response; + } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ResourceNotFoundError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToConfigurationUpdateOperationContext + : public OperationModelContext { +public: + SubscribeToConfigurationUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToConfigurationUpdateResult { +public: + SubscribeToConfigurationUpdateResult() noexcept {} + SubscribeToConfigurationUpdateResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToConfigurationUpdateResponse * + GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToConfigurationUpdateOperation : public ClientOperation { +public: + SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + std::shared_ptr + streamHandler, + const SubscribeToConfigurationUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToConfigurationUpdateOperation` + * @param request The request used for the + * `SubscribeToConfigurationUpdateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToConfigurationUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class DeleteThingShadowOperationContext : public OperationModelContext { +public: + DeleteThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class DeleteThingShadowResult { +public: + DeleteThingShadowResult() noexcept {} + DeleteThingShadowResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + DeleteThingShadowResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class DeleteThingShadowOperation : public ClientOperation { +public: + DeleteThingShadowOperation( + ClientConnection &connection, + const DeleteThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `DeleteThingShadowOperation` + * @param request The request used for the `DeleteThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const DeleteThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class PutComponentMetricOperationContext : public OperationModelContext { +public: + PutComponentMetricOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class PutComponentMetricResult { +public: + PutComponentMetricResult() noexcept {} + PutComponentMetricResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + PutComponentMetricResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class PutComponentMetricOperation : public ClientOperation { +public: + PutComponentMetricOperation( + ClientConnection &connection, + const PutComponentMetricOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PutComponentMetricOperation` + * @param request The request used for the `PutComponentMetricOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const PutComponentMetricRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class DeferComponentUpdateOperationContext : public OperationModelContext { +public: + DeferComponentUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class DeferComponentUpdateResult { +public: + DeferComponentUpdateResult() noexcept {} + DeferComponentUpdateResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + DeferComponentUpdateResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class DeferComponentUpdateOperation : public ClientOperation { +public: + DeferComponentUpdateOperation( + ClientConnection &connection, + const DeferComponentUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `DeferComponentUpdateOperation` + * @param request The request used for the `DeferComponentUpdateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const DeferComponentUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SubscribeToValidateConfigurationUpdatesStreamHandler + : public StreamResponseHandler { +public: + virtual void OnStreamEvent(ValidateConfigurationUpdateEvents *response) { + (void)response; + } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToValidateConfigurationUpdatesOperationContext + : public OperationModelContext { +public: + SubscribeToValidateConfigurationUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToValidateConfigurationUpdatesResult { +public: + SubscribeToValidateConfigurationUpdatesResult() noexcept {} + SubscribeToValidateConfigurationUpdatesResult( + TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToValidateConfigurationUpdatesResponse * + GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToValidateConfigurationUpdatesOperation + : public ClientOperation { +public: + SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + std::shared_ptr + streamHandler, + const SubscribeToValidateConfigurationUpdatesOperationContext + &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param request The request used for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToValidateConfigurationUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future + GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetConfigurationOperationContext : public OperationModelContext { +public: + GetConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetConfigurationResult { +public: + GetConfigurationResult() noexcept {} + GetConfigurationResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetConfigurationResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetConfigurationOperation : public ClientOperation { +public: + GetConfigurationOperation( + ClientConnection &connection, + const GetConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetConfigurationOperation` + * @param request The request used for the `GetConfigurationOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SubscribeToTopicStreamHandler : public StreamResponseHandler { +public: + virtual void OnStreamEvent(SubscriptionResponseMessage *response) { + (void)response; + } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(InvalidArgumentsError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToTopicOperationContext : public OperationModelContext { +public: + SubscribeToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToTopicResult { +public: + SubscribeToTopicResult() noexcept {} + SubscribeToTopicResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToTopicResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToTopicOperation : public ClientOperation { +public: + SubscribeToTopicOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToTopicOperation` + * @param request The request used for the `SubscribeToTopicOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetComponentDetailsOperationContext : public OperationModelContext { +public: + GetComponentDetailsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetComponentDetailsResult { +public: + GetComponentDetailsResult() noexcept {} + GetComponentDetailsResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetComponentDetailsResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetComponentDetailsOperation : public ClientOperation { +public: + GetComponentDetailsOperation( + ClientConnection &connection, + const GetComponentDetailsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetComponentDetailsOperation` + * @param request The request used for the `GetComponentDetailsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetComponentDetailsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetClientDeviceAuthTokenOperationContext : public OperationModelContext { +public: + GetClientDeviceAuthTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetClientDeviceAuthTokenResult { +public: + GetClientDeviceAuthTokenResult() noexcept {} + GetClientDeviceAuthTokenResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetClientDeviceAuthTokenResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetClientDeviceAuthTokenOperation : public ClientOperation { +public: + GetClientDeviceAuthTokenOperation( + ClientConnection &connection, + const GetClientDeviceAuthTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetClientDeviceAuthTokenOperation` + * @param request The request used for the `GetClientDeviceAuthTokenOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetClientDeviceAuthTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class PublishToTopicOperationContext : public OperationModelContext { +public: + PublishToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class PublishToTopicResult { +public: + PublishToTopicResult() noexcept {} + PublishToTopicResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + PublishToTopicResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class PublishToTopicOperation : public ClientOperation { +public: + PublishToTopicOperation( + ClientConnection &connection, + const PublishToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PublishToTopicOperation` + * @param request The request used for the `PublishToTopicOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const PublishToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SubscribeToCertificateUpdatesStreamHandler + : public StreamResponseHandler { +public: + virtual void OnStreamEvent(CertificateUpdateEvent *response) { + (void)response; + } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(InvalidArgumentsError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToCertificateUpdatesOperationContext + : public OperationModelContext { +public: + SubscribeToCertificateUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToCertificateUpdatesResult { +public: + SubscribeToCertificateUpdatesResult() noexcept {} + SubscribeToCertificateUpdatesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToCertificateUpdatesResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToCertificateUpdatesOperation : public ClientOperation { +public: + SubscribeToCertificateUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToCertificateUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToCertificateUpdatesOperation` + * @param request The request used for the + * `SubscribeToCertificateUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToCertificateUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class VerifyClientDeviceIdentityOperationContext + : public OperationModelContext { +public: + VerifyClientDeviceIdentityOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class VerifyClientDeviceIdentityResult { +public: + VerifyClientDeviceIdentityResult() noexcept {} + VerifyClientDeviceIdentityResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + VerifyClientDeviceIdentityResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class VerifyClientDeviceIdentityOperation : public ClientOperation { +public: + VerifyClientDeviceIdentityOperation( + ClientConnection &connection, + const VerifyClientDeviceIdentityOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `VerifyClientDeviceIdentityOperation` + * @param request The request used for the + * `VerifyClientDeviceIdentityOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const VerifyClientDeviceIdentityRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class AuthorizeClientDeviceActionOperationContext + : public OperationModelContext { +public: + AuthorizeClientDeviceActionOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class AuthorizeClientDeviceActionResult { +public: + AuthorizeClientDeviceActionResult() noexcept {} + AuthorizeClientDeviceActionResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + AuthorizeClientDeviceActionResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class AuthorizeClientDeviceActionOperation : public ClientOperation { +public: + AuthorizeClientDeviceActionOperation( + ClientConnection &connection, + const AuthorizeClientDeviceActionOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `AuthorizeClientDeviceActionOperation` + * @param request The request used for the + * `AuthorizeClientDeviceActionOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const AuthorizeClientDeviceActionRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class ListComponentsOperationContext : public OperationModelContext { +public: + ListComponentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class ListComponentsResult { +public: + ListComponentsResult() noexcept {} + ListComponentsResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + ListComponentsResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class ListComponentsOperation : public ClientOperation { +public: + ListComponentsOperation( + ClientConnection &connection, + const ListComponentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListComponentsOperation` + * @param request The request used for the `ListComponentsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const ListComponentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class CreateDebugPasswordOperationContext : public OperationModelContext { +public: + CreateDebugPasswordOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class CreateDebugPasswordResult { +public: + CreateDebugPasswordResult() noexcept {} + CreateDebugPasswordResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + CreateDebugPasswordResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class CreateDebugPasswordOperation : public ClientOperation { +public: + CreateDebugPasswordOperation( + ClientConnection &connection, + const CreateDebugPasswordOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CreateDebugPasswordOperation` + * @param request The request used for the `CreateDebugPasswordOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const CreateDebugPasswordRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetThingShadowOperationContext : public OperationModelContext { +public: + GetThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetThingShadowResult { +public: + GetThingShadowResult() noexcept {} + GetThingShadowResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetThingShadowResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetThingShadowOperation : public ClientOperation { +public: + GetThingShadowOperation( + ClientConnection &connection, + const GetThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetThingShadowOperation` + * @param request The request used for the `GetThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SendConfigurationValidityReportOperationContext + : public OperationModelContext { +public: + SendConfigurationValidityReportOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SendConfigurationValidityReportResult { +public: + SendConfigurationValidityReportResult() noexcept {} + SendConfigurationValidityReportResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SendConfigurationValidityReportResponse * + GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SendConfigurationValidityReportOperation : public ClientOperation { +public: + SendConfigurationValidityReportOperation( + ClientConnection &connection, + const SendConfigurationValidityReportOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the + * `SendConfigurationValidityReportOperation` + * @param request The request used for the + * `SendConfigurationValidityReportOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SendConfigurationValidityReportRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class UpdateThingShadowOperationContext : public OperationModelContext { +public: + UpdateThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class UpdateThingShadowResult { +public: + UpdateThingShadowResult() noexcept {} + UpdateThingShadowResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + UpdateThingShadowResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class UpdateThingShadowOperation : public ClientOperation { +public: + UpdateThingShadowOperation( + ClientConnection &connection, + const UpdateThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateThingShadowOperation` + * @param request The request used for the `UpdateThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const UpdateThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class UpdateConfigurationOperationContext : public OperationModelContext { +public: + UpdateConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class UpdateConfigurationResult { +public: + UpdateConfigurationResult() noexcept {} + UpdateConfigurationResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + UpdateConfigurationResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class UpdateConfigurationOperation : public ClientOperation { +public: + UpdateConfigurationOperation( + ClientConnection &connection, + const UpdateConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateConfigurationOperation` + * @param request The request used for the `UpdateConfigurationOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const UpdateConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class ValidateAuthorizationTokenOperationContext + : public OperationModelContext { +public: + ValidateAuthorizationTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class ValidateAuthorizationTokenResult { +public: + ValidateAuthorizationTokenResult() noexcept {} + ValidateAuthorizationTokenResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + ValidateAuthorizationTokenResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class ValidateAuthorizationTokenOperation : public ClientOperation { +public: + ValidateAuthorizationTokenOperation( + ClientConnection &connection, + const ValidateAuthorizationTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ValidateAuthorizationTokenOperation` + * @param request The request used for the + * `ValidateAuthorizationTokenOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const ValidateAuthorizationTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class RestartComponentOperationContext : public OperationModelContext { +public: + RestartComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class RestartComponentResult { +public: + RestartComponentResult() noexcept {} + RestartComponentResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + RestartComponentResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class RestartComponentOperation : public ClientOperation { +public: + RestartComponentOperation( + ClientConnection &connection, + const RestartComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `RestartComponentOperation` + * @param request The request used for the `RestartComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const RestartComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetLocalDeploymentStatusOperationContext : public OperationModelContext { +public: + GetLocalDeploymentStatusOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetLocalDeploymentStatusResult { +public: + GetLocalDeploymentStatusResult() noexcept {} + GetLocalDeploymentStatusResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetLocalDeploymentStatusResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetLocalDeploymentStatusOperation : public ClientOperation { +public: + GetLocalDeploymentStatusOperation( + ClientConnection &connection, + const GetLocalDeploymentStatusOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetLocalDeploymentStatusOperation` + * @param request The request used for the `GetLocalDeploymentStatusOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetLocalDeploymentStatusRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GetSecretValueOperationContext : public OperationModelContext { +public: + GetSecretValueOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class GetSecretValueResult { +public: + GetSecretValueResult() noexcept {} + GetSecretValueResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + GetSecretValueResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class GetSecretValueOperation : public ClientOperation { +public: + GetSecretValueOperation( + ClientConnection &connection, + const GetSecretValueOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetSecretValueOperation` + * @param request The request used for the `GetSecretValueOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const GetSecretValueRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class UpdateStateOperationContext : public OperationModelContext { +public: + UpdateStateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class UpdateStateResult { +public: + UpdateStateResult() noexcept {} + UpdateStateResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + UpdateStateResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class UpdateStateOperation : public ClientOperation { +public: + UpdateStateOperation( + ClientConnection &connection, + const UpdateStateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateStateOperation` + * @param request The request used for the `UpdateStateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const UpdateStateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class ListNamedShadowsForThingOperationContext : public OperationModelContext { +public: + ListNamedShadowsForThingOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class ListNamedShadowsForThingResult { +public: + ListNamedShadowsForThingResult() noexcept {} + ListNamedShadowsForThingResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + ListNamedShadowsForThingResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class ListNamedShadowsForThingOperation : public ClientOperation { +public: + ListNamedShadowsForThingOperation( + ClientConnection &connection, + const ListNamedShadowsForThingOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListNamedShadowsForThingOperation` + * @param request The request used for the `ListNamedShadowsForThingOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const ListNamedShadowsForThingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class SubscribeToComponentUpdatesStreamHandler : public StreamResponseHandler { +public: + virtual void OnStreamEvent(ComponentUpdatePolicyEvents *response) { + (void)response; + } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ResourceNotFoundError *operationError) { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) { + (void)operationError; + return true; + } + +private: + /** + * Invoked when a message is received on this continuation. + */ + void + OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, + RpcError rpcError) override; +}; +class SubscribeToComponentUpdatesOperationContext + : public OperationModelContext { +public: + SubscribeToComponentUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class SubscribeToComponentUpdatesResult { +public: + SubscribeToComponentUpdatesResult() noexcept {} + SubscribeToComponentUpdatesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + SubscribeToComponentUpdatesResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class SubscribeToComponentUpdatesOperation : public ClientOperation { +public: + SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToComponentUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToComponentUpdatesOperation` + * @param request The request used for the + * `SubscribeToComponentUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const SubscribeToComponentUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class ListLocalDeploymentsOperationContext : public OperationModelContext { +public: + ListLocalDeploymentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class ListLocalDeploymentsResult { +public: + ListLocalDeploymentsResult() noexcept {} + ListLocalDeploymentsResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + ListLocalDeploymentsResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class ListLocalDeploymentsOperation : public ClientOperation { +public: + ListLocalDeploymentsOperation( + ClientConnection &connection, + const ListLocalDeploymentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListLocalDeploymentsOperation` + * @param request The request used for the `ListLocalDeploymentsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const ListLocalDeploymentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class StopComponentOperationContext : public OperationModelContext { +public: + StopComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class StopComponentResult { +public: + StopComponentResult() noexcept {} + StopComponentResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + StopComponentResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class StopComponentOperation : public ClientOperation { +public: + StopComponentOperation( + ClientConnection &connection, + const StopComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `StopComponentOperation` + * @param request The request used for the `StopComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const StopComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class PauseComponentOperationContext : public OperationModelContext { +public: + PauseComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class PauseComponentResult { +public: + PauseComponentResult() noexcept {} + PauseComponentResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + PauseComponentResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class PauseComponentOperation : public ClientOperation { +public: + PauseComponentOperation( + ClientConnection &connection, + const PauseComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PauseComponentOperation` + * @param request The request used for the `PauseComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const PauseComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class CreateLocalDeploymentOperationContext : public OperationModelContext { +public: + CreateLocalDeploymentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional + GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; +}; + +class CreateLocalDeploymentResult { +public: + CreateLocalDeploymentResult() noexcept {} + CreateLocalDeploymentResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) {} + CreateLocalDeploymentResponse *GetOperationResponse() const noexcept { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { + return m_taggedResult.GetOperationError(); + } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { + return m_taggedResult.GetResultType(); + } + +private: + TaggedResult m_taggedResult; +}; + +class CreateLocalDeploymentOperation : public ClientOperation { +public: + CreateLocalDeploymentOperation( + ClientConnection &connection, + const CreateLocalDeploymentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CreateLocalDeploymentOperation` + * @param request The request used for the `CreateLocalDeploymentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future + Activate(const CreateLocalDeploymentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + +protected: + Aws::Crt::String GetModelName() const noexcept override; +}; + +class GreengrassCoreIpcServiceModel : public ServiceModel { +public: + GreengrassCoreIpcServiceModel() noexcept; + Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = + Aws::Crt::g_allocator) const noexcept override; + void AssignModelNameToErrorResponse(Aws::Crt::String, + ErrorResponseFactory) noexcept; + +private: + friend class GreengrassCoreIpcClient; + SubscribeToIoTCoreOperationContext m_subscribeToIoTCoreOperationContext; + ResumeComponentOperationContext m_resumeComponentOperationContext; + PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext; + SubscribeToConfigurationUpdateOperationContext + m_subscribeToConfigurationUpdateOperationContext; + DeleteThingShadowOperationContext m_deleteThingShadowOperationContext; + PutComponentMetricOperationContext m_putComponentMetricOperationContext; + DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; + SubscribeToValidateConfigurationUpdatesOperationContext + m_subscribeToValidateConfigurationUpdatesOperationContext; + GetConfigurationOperationContext m_getConfigurationOperationContext; + SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; + GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; + GetClientDeviceAuthTokenOperationContext + m_getClientDeviceAuthTokenOperationContext; + PublishToTopicOperationContext m_publishToTopicOperationContext; + SubscribeToCertificateUpdatesOperationContext + m_subscribeToCertificateUpdatesOperationContext; + VerifyClientDeviceIdentityOperationContext + m_verifyClientDeviceIdentityOperationContext; + AuthorizeClientDeviceActionOperationContext + m_authorizeClientDeviceActionOperationContext; + ListComponentsOperationContext m_listComponentsOperationContext; + CreateDebugPasswordOperationContext m_createDebugPasswordOperationContext; + GetThingShadowOperationContext m_getThingShadowOperationContext; + SendConfigurationValidityReportOperationContext + m_sendConfigurationValidityReportOperationContext; + UpdateThingShadowOperationContext m_updateThingShadowOperationContext; + UpdateConfigurationOperationContext m_updateConfigurationOperationContext; + ValidateAuthorizationTokenOperationContext + m_validateAuthorizationTokenOperationContext; + RestartComponentOperationContext m_restartComponentOperationContext; + GetLocalDeploymentStatusOperationContext + m_getLocalDeploymentStatusOperationContext; + GetSecretValueOperationContext m_getSecretValueOperationContext; + UpdateStateOperationContext m_updateStateOperationContext; + ListNamedShadowsForThingOperationContext + m_listNamedShadowsForThingOperationContext; + SubscribeToComponentUpdatesOperationContext + m_subscribeToComponentUpdatesOperationContext; + ListLocalDeploymentsOperationContext m_listLocalDeploymentsOperationContext; + StopComponentOperationContext m_stopComponentOperationContext; + PauseComponentOperationContext m_pauseComponentOperationContext; + CreateLocalDeploymentOperationContext m_createLocalDeploymentOperationContext; + Aws::Crt::Map + m_modelNameToErrorResponse; +}; +} // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp index c9c9eb3ba..21926939a 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -9,373 +9,405 @@ #include #include -namespace Aws -{ - namespace Greengrass - { - GreengrassCoreIpcClient::GreengrassCoreIpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator) noexcept - : m_connection(allocator), m_clientBootstrap(clientBootstrap), m_allocator(allocator) - { - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidTokenError"), InvalidTokenError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#FailedUpdateConditionCheckError"), - FailedUpdateConditionCheckError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ConflictError"), ConflictError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ComponentNotFoundError"), - ComponentNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidCredentialError"), - InvalidCredentialError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ResourceNotFoundError"), ResourceNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArtifactsDirectoryPathError"), - InvalidArtifactsDirectoryPathError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidRecipeDirectoryPathError"), - InvalidRecipeDirectoryPathError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidClientDeviceAuthTokenError"), - InvalidClientDeviceAuthTokenError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), InvalidArgumentsError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ServiceError"), ServiceError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#UnauthorizedError"), UnauthorizedError::s_allocateFromPayload); - } - - std::future GreengrassCoreIpcClient::Connect( - ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig) noexcept - { - return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); - } - - void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } - - GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } - - std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToIoTCore( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewResumeComponent() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewSubscribeToConfigurationUpdate( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToConfigurationUpdateOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewPutComponentMetric() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_putComponentMetricOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewSubscribeToValidateConfigurationUpdates( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToValidateConfigurationUpdatesOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewGetConfiguration() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToTopic( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewGetComponentDetails() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewGetClientDeviceAuthToken() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getClientDeviceAuthTokenOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewPublishToTopic() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewSubscribeToCertificateUpdates( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToCertificateUpdatesOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewVerifyClientDeviceIdentity() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_verifyClientDeviceIdentityOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewAuthorizeClientDeviceAction() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_authorizeClientDeviceActionOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewListComponents() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewGetThingShadow() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewSendConfigurationValidityReport() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_sendConfigurationValidityReportOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewValidateAuthorizationToken() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_validateAuthorizationTokenOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewRestartComponent() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewGetLocalDeploymentStatus() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getLocalDeploymentStatusOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewGetSecretValue() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewUpdateState() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, m_connection, m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient:: - NewListNamedShadowsForThing() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_listNamedShadowsForThingOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( - std::shared_ptr streamHandler) noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToComponentUpdatesOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewListLocalDeployments() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewStopComponent() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewPauseComponent() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, - m_allocator); - } - - std::shared_ptr GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept - { - return Aws::Crt::MakeShared( - m_allocator, - m_connection, - m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, - m_allocator); - } - - } // namespace Greengrass +namespace Aws { +namespace Greengrass { +GreengrassCoreIpcClient::GreengrassCoreIpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator) noexcept + : m_connection(allocator), m_clientBootstrap(clientBootstrap), + m_allocator(allocator), m_asyncLaunchMode(std::launch::deferred) { + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidTokenError"), + InvalidTokenError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#FailedUpdateConditionCheckError"), + FailedUpdateConditionCheckError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ConflictError"), + ConflictError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ComponentNotFoundError"), + ComponentNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidCredentialError"), + InvalidCredentialError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ResourceNotFoundError"), + ResourceNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArtifactsDirectoryPathError"), + InvalidArtifactsDirectoryPathError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidRecipeDirectoryPathError"), + InvalidRecipeDirectoryPathError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidClientDeviceAuthTokenError"), + InvalidClientDeviceAuthTokenError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), + InvalidArgumentsError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ServiceError"), + ServiceError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#UnauthorizedError"), + UnauthorizedError::s_allocateFromPayload); +} + +std::future GreengrassCoreIpcClient::Connect( + ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig) noexcept { + return m_connection.Connect(connectionConfig, &lifecycleHandler, + m_clientBootstrap); +} + +void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } + +void GreengrassCoreIpcClient::WithLaunchMode(std::launch mode) noexcept { + m_asyncLaunchMode = mode; +} + +GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToIoTCore( + std::shared_ptr streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewResumeComponent() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( + std::shared_ptr + streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel + .m_subscribeToConfigurationUpdateOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewPutComponentMetric() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_putComponentMetricOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToValidateConfigurationUpdates( + std::shared_ptr + streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel + .m_subscribeToValidateConfigurationUpdatesOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetConfiguration() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToTopic( + std::shared_ptr streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetComponentDetails() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetClientDeviceAuthToken() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_getClientDeviceAuthTokenOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewPublishToTopic() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToCertificateUpdates( + std::shared_ptr + streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel + .m_subscribeToCertificateUpdatesOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewVerifyClientDeviceIdentity() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_verifyClientDeviceIdentityOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewAuthorizeClientDeviceAction() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_authorizeClientDeviceActionOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewListComponents() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetThingShadow() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept { + auto operation = + Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_sendConfigurationValidityReportOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_validateAuthorizationTokenOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewRestartComponent() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_getLocalDeploymentStatusOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewGetSecretValue() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewUpdateState() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel + .m_listNamedShadowsForThingOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( + std::shared_ptr + streamHandler) noexcept { + return Aws::Crt::MakeShared( + m_allocator, m_connection, std::move(streamHandler), + m_greengrassCoreIpcServiceModel + .m_subscribeToComponentUpdatesOperationContext, + m_allocator); +} + +std::shared_ptr +GreengrassCoreIpcClient::NewListLocalDeployments() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewStopComponent() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewPauseComponent() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +std::shared_ptr +GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, + m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; +} + +} // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index cfda2ab87..3103e94c9 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -8,9093 +8,8517 @@ #include #include -namespace Aws -{ - namespace Greengrass - { - void MessageContext::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topic.has_value()) - { - payloadObject.WithString("topic", m_topic.value()); - } - } - - void MessageContext::s_loadFromJsonView( - MessageContext &messageContext, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topic")) - { - messageContext.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); - } - } - - const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; - - Aws::Crt::String MessageContext::GetModelName() const noexcept { return MessageContext::MODEL_NAME; } - - Aws::Crt::ScopedResource MessageContext::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MessageContext::s_customDeleter); - shape->m_allocator = allocator; - MessageContext::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void MessageContext::s_customDeleter(MessageContext *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SystemResourceLimits::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_memory.has_value()) - { - payloadObject.WithInt64("memory", m_memory.value()); - } - if (m_cpus.has_value()) - { - payloadObject.WithDouble("cpus", m_cpus.value()); - } - } - - void SystemResourceLimits::s_loadFromJsonView( - SystemResourceLimits &systemResourceLimits, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("memory")) - { - systemResourceLimits.m_memory = Aws::Crt::Optional(jsonView.GetInt64("memory")); - } - if (jsonView.ValueExists("cpus")) - { - systemResourceLimits.m_cpus = Aws::Crt::Optional(jsonView.GetDouble("cpus")); - } - } - - const char *SystemResourceLimits::MODEL_NAME = "aws.greengrass#SystemResourceLimits"; - - Aws::Crt::String SystemResourceLimits::GetModelName() const noexcept - { - return SystemResourceLimits::MODEL_NAME; - } - - Aws::Crt::ScopedResource SystemResourceLimits::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SystemResourceLimits::s_customDeleter); - shape->m_allocator = allocator; - SystemResourceLimits::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SystemResourceLimits::s_customDeleter(SystemResourceLimits *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ValidateConfigurationUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_configuration.has_value()) - { - payloadObject.WithObject("configuration", m_configuration.value()); - } - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - } - - void ValidateConfigurationUpdateEvent::s_loadFromJsonView( - ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("configuration")) - { - validateConfigurationUpdateEvent.m_configuration = - Aws::Crt::Optional(jsonView.GetJsonObject("configuration").Materialize()); - } - if (jsonView.ValueExists("deploymentId")) - { - validateConfigurationUpdateEvent.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - } - - const char *ValidateConfigurationUpdateEvent::MODEL_NAME = "aws.greengrass#ValidateConfigurationUpdateEvent"; - - Aws::Crt::String ValidateConfigurationUpdateEvent::GetModelName() const noexcept - { - return ValidateConfigurationUpdateEvent::MODEL_NAME; - } - - Aws::Crt::ScopedResource ValidateConfigurationUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateConfigurationUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - ValidateConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ValidateConfigurationUpdateEvent::s_customDeleter(ValidateConfigurationUpdateEvent *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void MQTTMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topicName.has_value()) - { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void MQTTMessage::s_loadFromJsonView(MQTTMessage &mQTTMessage, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topicName")) - { - mQTTMessage.m_topicName = Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - mQTTMessage.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; - - Aws::Crt::String MQTTMessage::GetModelName() const noexcept { return MQTTMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource MQTTMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MQTTMessage::s_customDeleter); - shape->m_allocator = allocator; - MQTTMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void MQTTMessage::s_customDeleter(MQTTMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ConfigurationUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) - { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) - { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } - } - - void ConfigurationUpdateEvent::s_loadFromJsonView( - ConfigurationUpdateEvent &configurationUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - configurationUpdateEvent.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) - { - configurationUpdateEvent.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) - { - Aws::Crt::Optional keyPathItem; - keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); - configurationUpdateEvent.m_keyPath.value().push_back(keyPathItem.value()); - } - } - } - - const char *ConfigurationUpdateEvent::MODEL_NAME = "aws.greengrass#ConfigurationUpdateEvent"; - - Aws::Crt::String ConfigurationUpdateEvent::GetModelName() const noexcept - { - return ConfigurationUpdateEvent::MODEL_NAME; - } - - Aws::Crt::ScopedResource ConfigurationUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ConfigurationUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ConfigurationUpdateEvent::s_customDeleter(ConfigurationUpdateEvent *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PostComponentUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - } - - void PostComponentUpdateEvent::s_loadFromJsonView( - PostComponentUpdateEvent &postComponentUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - postComponentUpdateEvent.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - } - - const char *PostComponentUpdateEvent::MODEL_NAME = "aws.greengrass#PostComponentUpdateEvent"; - - Aws::Crt::String PostComponentUpdateEvent::GetModelName() const noexcept - { - return PostComponentUpdateEvent::MODEL_NAME; - } - - Aws::Crt::ScopedResource PostComponentUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PostComponentUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - PostComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PostComponentUpdateEvent::s_customDeleter(PostComponentUpdateEvent *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PreComponentUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_isGgcRestarting.has_value()) - { - payloadObject.WithBool("isGgcRestarting", m_isGgcRestarting.value()); - } - } - - void PreComponentUpdateEvent::s_loadFromJsonView( - PreComponentUpdateEvent &preComponentUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - preComponentUpdateEvent.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("isGgcRestarting")) - { - preComponentUpdateEvent.m_isGgcRestarting = - Aws::Crt::Optional(jsonView.GetBool("isGgcRestarting")); - } - } - - const char *PreComponentUpdateEvent::MODEL_NAME = "aws.greengrass#PreComponentUpdateEvent"; - - Aws::Crt::String PreComponentUpdateEvent::GetModelName() const noexcept - { - return PreComponentUpdateEvent::MODEL_NAME; - } - - Aws::Crt::ScopedResource PreComponentUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PreComponentUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - PreComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PreComponentUpdateEvent::s_customDeleter(PreComponentUpdateEvent *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CertificateUpdate::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_privateKey.has_value()) - { - payloadObject.WithString("privateKey", m_privateKey.value()); - } - if (m_publicKey.has_value()) - { - payloadObject.WithString("publicKey", m_publicKey.value()); - } - if (m_certificate.has_value()) - { - payloadObject.WithString("certificate", m_certificate.value()); - } - if (m_caCertificates.has_value()) - { - Aws::Crt::JsonObject cACertificates; - Aws::Crt::Vector cACertificatesJsonArray; - for (const auto &cACertificatesItem : m_caCertificates.value()) - { - Aws::Crt::JsonObject cACertificatesJsonArrayItem; - cACertificatesJsonArrayItem.AsString(cACertificatesItem); - cACertificatesJsonArray.emplace_back(std::move(cACertificatesJsonArrayItem)); - } - cACertificates.AsArray(std::move(cACertificatesJsonArray)); - payloadObject.WithObject("caCertificates", std::move(cACertificates)); - } - } - - void CertificateUpdate::s_loadFromJsonView( - CertificateUpdate &certificateUpdate, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("privateKey")) - { - certificateUpdate.m_privateKey = Aws::Crt::Optional(jsonView.GetString("privateKey")); - } - if (jsonView.ValueExists("publicKey")) - { - certificateUpdate.m_publicKey = Aws::Crt::Optional(jsonView.GetString("publicKey")); - } - if (jsonView.ValueExists("certificate")) - { - certificateUpdate.m_certificate = - Aws::Crt::Optional(jsonView.GetString("certificate")); - } - if (jsonView.ValueExists("caCertificates")) - { - certificateUpdate.m_caCertificates = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &cACertificatesJsonView : jsonView.GetArray("caCertificates")) - { - Aws::Crt::Optional cACertificatesItem; - cACertificatesItem = Aws::Crt::Optional(cACertificatesJsonView.AsString()); - certificateUpdate.m_caCertificates.value().push_back(cACertificatesItem.value()); - } - } - } - - const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; - - Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { return CertificateUpdate::MODEL_NAME; } - - Aws::Crt::ScopedResource CertificateUpdate::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CertificateUpdate::s_customDeleter); - shape->m_allocator = allocator; - CertificateUpdate::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CertificateUpdate::s_customDeleter(CertificateUpdate *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void Metric::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_name.has_value()) - { - payloadObject.WithString("name", m_name.value()); - } - if (m_unit.has_value()) - { - payloadObject.WithString("unit", m_unit.value()); - } - if (m_value.has_value()) - { - payloadObject.WithDouble("value", m_value.value()); - } - } - - void Metric::s_loadFromJsonView(Metric &metric, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("name")) - { - metric.m_name = Aws::Crt::Optional(jsonView.GetString("name")); - } - if (jsonView.ValueExists("unit")) - { - metric.m_unit = Aws::Crt::Optional(jsonView.GetString("unit")); - } - if (jsonView.ValueExists("value")) - { - metric.m_value = Aws::Crt::Optional(jsonView.GetDouble("value")); - } - } - - void Metric::SetUnit(MetricUnitType unit) noexcept - { - switch (unit) - { - case METRIC_UNIT_TYPE_BYTES: - m_unit = Aws::Crt::String("BYTES"); - break; - case METRIC_UNIT_TYPE_BYTES_PER_SECOND: - m_unit = Aws::Crt::String("BYTES_PER_SECOND"); - break; - case METRIC_UNIT_TYPE_COUNT: - m_unit = Aws::Crt::String("COUNT"); - break; - case METRIC_UNIT_TYPE_COUNT_PER_SECOND: - m_unit = Aws::Crt::String("COUNT_PER_SECOND"); - break; - case METRIC_UNIT_TYPE_MEGABYTES: - m_unit = Aws::Crt::String("MEGABYTES"); - break; - case METRIC_UNIT_TYPE_SECONDS: - m_unit = Aws::Crt::String("SECONDS"); - break; - default: - break; - } - } - - Aws::Crt::Optional Metric::GetUnit() noexcept - { - if (!m_unit.has_value()) - return Aws::Crt::Optional(); - if (m_unit.value() == Aws::Crt::String("BYTES")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES); - } - if (m_unit.value() == Aws::Crt::String("BYTES_PER_SECOND")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES_PER_SECOND); - } - if (m_unit.value() == Aws::Crt::String("COUNT")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT); - } - if (m_unit.value() == Aws::Crt::String("COUNT_PER_SECOND")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT_PER_SECOND); - } - if (m_unit.value() == Aws::Crt::String("MEGABYTES")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_MEGABYTES); - } - if (m_unit.value() == Aws::Crt::String("SECONDS")) - { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_SECONDS); - } - - return Aws::Crt::Optional(); - } - - const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; - - Aws::Crt::String Metric::GetModelName() const noexcept { return Metric::MODEL_NAME; } - - Aws::Crt::ScopedResource Metric::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Metric::s_customDeleter); - shape->m_allocator = allocator; - Metric::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void Metric::s_customDeleter(Metric *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void BinaryMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - if (m_message.value().size() > 0) - { - payloadObject.WithString("message", Aws::Crt::Base64Encode(m_message.value())); - } - } - if (m_context.has_value()) - { - Aws::Crt::JsonObject messageContextValue; - m_context.value().SerializeToJsonObject(messageContextValue); - payloadObject.WithObject("context", std::move(messageContextValue)); - } - } - - void BinaryMessage::s_loadFromJsonView( - BinaryMessage &binaryMessage, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - if (jsonView.GetString("message").size() > 0) - { - binaryMessage.m_message = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("message"))); - } - } - if (jsonView.ValueExists("context")) - { - binaryMessage.m_context = MessageContext(); - MessageContext::s_loadFromJsonView(binaryMessage.m_context.value(), jsonView.GetJsonObject("context")); - } - } - - const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; - - Aws::Crt::String BinaryMessage::GetModelName() const noexcept { return BinaryMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource BinaryMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), BinaryMessage::s_customDeleter); - shape->m_allocator = allocator; - BinaryMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void BinaryMessage::s_customDeleter(BinaryMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void JsonMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithObject("message", m_message.value()); - } - if (m_context.has_value()) - { - Aws::Crt::JsonObject messageContextValue; - m_context.value().SerializeToJsonObject(messageContextValue); - payloadObject.WithObject("context", std::move(messageContextValue)); - } - } - - void JsonMessage::s_loadFromJsonView(JsonMessage &jsonMessage, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - jsonMessage.m_message = - Aws::Crt::Optional(jsonView.GetJsonObject("message").Materialize()); - } - if (jsonView.ValueExists("context")) - { - jsonMessage.m_context = MessageContext(); - MessageContext::s_loadFromJsonView(jsonMessage.m_context.value(), jsonView.GetJsonObject("context")); - } - } - - const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; - - Aws::Crt::String JsonMessage::GetModelName() const noexcept { return JsonMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource JsonMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), JsonMessage::s_customDeleter); - shape->m_allocator = allocator; - JsonMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void JsonMessage::s_customDeleter(JsonMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void MQTTCredential::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_clientId.has_value()) - { - payloadObject.WithString("clientId", m_clientId.value()); - } - if (m_certificatePem.has_value()) - { - payloadObject.WithString("certificatePem", m_certificatePem.value()); - } - if (m_username.has_value()) - { - payloadObject.WithString("username", m_username.value()); - } - if (m_password.has_value()) - { - payloadObject.WithString("password", m_password.value()); - } - } - - void MQTTCredential::s_loadFromJsonView( - MQTTCredential &mQTTCredential, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("clientId")) - { - mQTTCredential.m_clientId = Aws::Crt::Optional(jsonView.GetString("clientId")); - } - if (jsonView.ValueExists("certificatePem")) - { - mQTTCredential.m_certificatePem = - Aws::Crt::Optional(jsonView.GetString("certificatePem")); - } - if (jsonView.ValueExists("username")) - { - mQTTCredential.m_username = Aws::Crt::Optional(jsonView.GetString("username")); - } - if (jsonView.ValueExists("password")) - { - mQTTCredential.m_password = Aws::Crt::Optional(jsonView.GetString("password")); - } - } - - const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; - - Aws::Crt::String MQTTCredential::GetModelName() const noexcept { return MQTTCredential::MODEL_NAME; } - - Aws::Crt::ScopedResource MQTTCredential::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MQTTCredential::s_customDeleter); - shape->m_allocator = allocator; - MQTTCredential::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void MQTTCredential::s_customDeleter(MQTTCredential *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void RunWithInfo::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_posixUser.has_value()) - { - payloadObject.WithString("posixUser", m_posixUser.value()); - } - if (m_windowsUser.has_value()) - { - payloadObject.WithString("windowsUser", m_windowsUser.value()); - } - if (m_systemResourceLimits.has_value()) - { - Aws::Crt::JsonObject systemResourceLimitsValue; - m_systemResourceLimits.value().SerializeToJsonObject(systemResourceLimitsValue); - payloadObject.WithObject("systemResourceLimits", std::move(systemResourceLimitsValue)); - } - } - - void RunWithInfo::s_loadFromJsonView(RunWithInfo &runWithInfo, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("posixUser")) - { - runWithInfo.m_posixUser = Aws::Crt::Optional(jsonView.GetString("posixUser")); - } - if (jsonView.ValueExists("windowsUser")) - { - runWithInfo.m_windowsUser = Aws::Crt::Optional(jsonView.GetString("windowsUser")); - } - if (jsonView.ValueExists("systemResourceLimits")) - { - runWithInfo.m_systemResourceLimits = SystemResourceLimits(); - SystemResourceLimits::s_loadFromJsonView( - runWithInfo.m_systemResourceLimits.value(), jsonView.GetJsonObject("systemResourceLimits")); - } - } - - const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; - - Aws::Crt::String RunWithInfo::GetModelName() const noexcept { return RunWithInfo::MODEL_NAME; } - - Aws::Crt::ScopedResource RunWithInfo::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), RunWithInfo::s_customDeleter); - shape->m_allocator = allocator; - RunWithInfo::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void RunWithInfo::s_customDeleter(RunWithInfo *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ClientDeviceCredential::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE && m_clientDeviceCertificate.has_value()) - { - payloadObject.WithString("clientDeviceCertificate", m_clientDeviceCertificate.value()); - } - } - - void ClientDeviceCredential::s_loadFromJsonView( - ClientDeviceCredential &clientDeviceCredential, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("clientDeviceCertificate")) - { - clientDeviceCredential.m_clientDeviceCertificate = - Aws::Crt::Optional(jsonView.GetString("clientDeviceCertificate")); - clientDeviceCredential.m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; - } - } - - ClientDeviceCredential &ClientDeviceCredential::operator=(const ClientDeviceCredential &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) - { - m_clientDeviceCertificate = objectToCopy.m_clientDeviceCertificate; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *ClientDeviceCredential::MODEL_NAME = "aws.greengrass#ClientDeviceCredential"; - - Aws::Crt::String ClientDeviceCredential::GetModelName() const noexcept - { - return ClientDeviceCredential::MODEL_NAME; - } - - Aws::Crt::ScopedResource ClientDeviceCredential::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ClientDeviceCredential::s_customDeleter); - shape->m_allocator = allocator; - ClientDeviceCredential::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ClientDeviceCredential::s_customDeleter(ClientDeviceCredential *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ValidateConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && - m_validateConfigurationUpdateEvent.has_value()) - { - Aws::Crt::JsonObject validateConfigurationUpdateEventValue; - m_validateConfigurationUpdateEvent.value().SerializeToJsonObject(validateConfigurationUpdateEventValue); - payloadObject.WithObject( - "validateConfigurationUpdateEvent", std::move(validateConfigurationUpdateEventValue)); - } - } - - void ValidateConfigurationUpdateEvents::s_loadFromJsonView( - ValidateConfigurationUpdateEvents &validateConfigurationUpdateEvents, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("validateConfigurationUpdateEvent")) - { - validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent = - ValidateConfigurationUpdateEvent(); - ValidateConfigurationUpdateEvent::s_loadFromJsonView( - validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent.value(), - jsonView.GetJsonObject("validateConfigurationUpdateEvent")); - validateConfigurationUpdateEvents.m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; - } - } - - ValidateConfigurationUpdateEvents &ValidateConfigurationUpdateEvents::operator=( - const ValidateConfigurationUpdateEvents &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) - { - m_validateConfigurationUpdateEvent = objectToCopy.m_validateConfigurationUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *ValidateConfigurationUpdateEvents::MODEL_NAME = "aws.greengrass#ValidateConfigurationUpdateEvents"; - - Aws::Crt::String ValidateConfigurationUpdateEvents::GetModelName() const noexcept - { - return ValidateConfigurationUpdateEvents::MODEL_NAME; - } - - Aws::Crt::ScopedResource ValidateConfigurationUpdateEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateConfigurationUpdateEvents::s_customDeleter); - shape->m_allocator = allocator; - ValidateConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ValidateConfigurationUpdateEvents::s_customDeleter(ValidateConfigurationUpdateEvents *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscriptionResponseMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) - { - Aws::Crt::JsonObject jsonMessageValue; - m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); - payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); - } - else if (m_chosenMember == TAG_BINARY_MESSAGE && m_binaryMessage.has_value()) - { - Aws::Crt::JsonObject binaryMessageValue; - m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); - payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); - } - } - - void SubscriptionResponseMessage::s_loadFromJsonView( - SubscriptionResponseMessage &subscriptionResponseMessage, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("jsonMessage")) - { - subscriptionResponseMessage.m_jsonMessage = JsonMessage(); - JsonMessage::s_loadFromJsonView( - subscriptionResponseMessage.m_jsonMessage.value(), jsonView.GetJsonObject("jsonMessage")); - subscriptionResponseMessage.m_chosenMember = TAG_JSON_MESSAGE; - } - else if (jsonView.ValueExists("binaryMessage")) - { - subscriptionResponseMessage.m_binaryMessage = BinaryMessage(); - BinaryMessage::s_loadFromJsonView( - subscriptionResponseMessage.m_binaryMessage.value(), jsonView.GetJsonObject("binaryMessage")); - subscriptionResponseMessage.m_chosenMember = TAG_BINARY_MESSAGE; - } - } - - SubscriptionResponseMessage &SubscriptionResponseMessage::operator=( - const SubscriptionResponseMessage &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) - { - m_jsonMessage = objectToCopy.m_jsonMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) - { - m_binaryMessage = objectToCopy.m_binaryMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *SubscriptionResponseMessage::MODEL_NAME = "aws.greengrass#SubscriptionResponseMessage"; - - Aws::Crt::String SubscriptionResponseMessage::GetModelName() const noexcept - { - return SubscriptionResponseMessage::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscriptionResponseMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SubscriptionResponseMessage::s_customDeleter); - shape->m_allocator = allocator; - SubscriptionResponseMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscriptionResponseMessage::s_customDeleter(SubscriptionResponseMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void IoTCoreMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_MESSAGE && m_message.has_value()) - { - Aws::Crt::JsonObject mQTTMessageValue; - m_message.value().SerializeToJsonObject(mQTTMessageValue); - payloadObject.WithObject("message", std::move(mQTTMessageValue)); - } - } - - void IoTCoreMessage::s_loadFromJsonView( - IoTCoreMessage &ioTCoreMessage, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - ioTCoreMessage.m_message = MQTTMessage(); - MQTTMessage::s_loadFromJsonView(ioTCoreMessage.m_message.value(), jsonView.GetJsonObject("message")); - ioTCoreMessage.m_chosenMember = TAG_MESSAGE; - } - } - - IoTCoreMessage &IoTCoreMessage::operator=(const IoTCoreMessage &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_MESSAGE) - { - m_message = objectToCopy.m_message; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; - - Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { return IoTCoreMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource IoTCoreMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), IoTCoreMessage::s_customDeleter); - shape->m_allocator = allocator; - IoTCoreMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void IoTCoreMessage::s_customDeleter(IoTCoreMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT && m_configurationUpdateEvent.has_value()) - { - Aws::Crt::JsonObject configurationUpdateEventValue; - m_configurationUpdateEvent.value().SerializeToJsonObject(configurationUpdateEventValue); - payloadObject.WithObject("configurationUpdateEvent", std::move(configurationUpdateEventValue)); - } - } - - void ConfigurationUpdateEvents::s_loadFromJsonView( - ConfigurationUpdateEvents &configurationUpdateEvents, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("configurationUpdateEvent")) - { - configurationUpdateEvents.m_configurationUpdateEvent = ConfigurationUpdateEvent(); - ConfigurationUpdateEvent::s_loadFromJsonView( - configurationUpdateEvents.m_configurationUpdateEvent.value(), - jsonView.GetJsonObject("configurationUpdateEvent")); - configurationUpdateEvents.m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; - } - } - - ConfigurationUpdateEvents &ConfigurationUpdateEvents::operator=( - const ConfigurationUpdateEvents &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) - { - m_configurationUpdateEvent = objectToCopy.m_configurationUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *ConfigurationUpdateEvents::MODEL_NAME = "aws.greengrass#ConfigurationUpdateEvents"; - - Aws::Crt::String ConfigurationUpdateEvents::GetModelName() const noexcept - { - return ConfigurationUpdateEvents::MODEL_NAME; - } - - Aws::Crt::ScopedResource ConfigurationUpdateEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ConfigurationUpdateEvents::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ConfigurationUpdateEvents::s_customDeleter(ConfigurationUpdateEvents *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ComponentUpdatePolicyEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_PRE_UPDATE_EVENT && m_preUpdateEvent.has_value()) - { - Aws::Crt::JsonObject preComponentUpdateEventValue; - m_preUpdateEvent.value().SerializeToJsonObject(preComponentUpdateEventValue); - payloadObject.WithObject("preUpdateEvent", std::move(preComponentUpdateEventValue)); - } - else if (m_chosenMember == TAG_POST_UPDATE_EVENT && m_postUpdateEvent.has_value()) - { - Aws::Crt::JsonObject postComponentUpdateEventValue; - m_postUpdateEvent.value().SerializeToJsonObject(postComponentUpdateEventValue); - payloadObject.WithObject("postUpdateEvent", std::move(postComponentUpdateEventValue)); - } - } - - void ComponentUpdatePolicyEvents::s_loadFromJsonView( - ComponentUpdatePolicyEvents &componentUpdatePolicyEvents, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("preUpdateEvent")) - { - componentUpdatePolicyEvents.m_preUpdateEvent = PreComponentUpdateEvent(); - PreComponentUpdateEvent::s_loadFromJsonView( - componentUpdatePolicyEvents.m_preUpdateEvent.value(), jsonView.GetJsonObject("preUpdateEvent")); - componentUpdatePolicyEvents.m_chosenMember = TAG_PRE_UPDATE_EVENT; - } - else if (jsonView.ValueExists("postUpdateEvent")) - { - componentUpdatePolicyEvents.m_postUpdateEvent = PostComponentUpdateEvent(); - PostComponentUpdateEvent::s_loadFromJsonView( - componentUpdatePolicyEvents.m_postUpdateEvent.value(), jsonView.GetJsonObject("postUpdateEvent")); - componentUpdatePolicyEvents.m_chosenMember = TAG_POST_UPDATE_EVENT; - } - } - - ComponentUpdatePolicyEvents &ComponentUpdatePolicyEvents::operator=( - const ComponentUpdatePolicyEvents &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_PRE_UPDATE_EVENT) - { - m_preUpdateEvent = objectToCopy.m_preUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - else if (objectToCopy.m_chosenMember == TAG_POST_UPDATE_EVENT) - { - m_postUpdateEvent = objectToCopy.m_postUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *ComponentUpdatePolicyEvents::MODEL_NAME = "aws.greengrass#ComponentUpdatePolicyEvents"; - - Aws::Crt::String ComponentUpdatePolicyEvents::GetModelName() const noexcept - { - return ComponentUpdatePolicyEvents::MODEL_NAME; - } - - Aws::Crt::ScopedResource ComponentUpdatePolicyEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ComponentUpdatePolicyEvents::s_customDeleter); - shape->m_allocator = allocator; - ComponentUpdatePolicyEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ComponentUpdatePolicyEvents::s_customDeleter(ComponentUpdatePolicyEvents *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CertificateUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_CERTIFICATE_UPDATE && m_certificateUpdate.has_value()) - { - Aws::Crt::JsonObject certificateUpdateValue; - m_certificateUpdate.value().SerializeToJsonObject(certificateUpdateValue); - payloadObject.WithObject("certificateUpdate", std::move(certificateUpdateValue)); - } - } - - void CertificateUpdateEvent::s_loadFromJsonView( - CertificateUpdateEvent &certificateUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("certificateUpdate")) - { - certificateUpdateEvent.m_certificateUpdate = CertificateUpdate(); - CertificateUpdate::s_loadFromJsonView( - certificateUpdateEvent.m_certificateUpdate.value(), jsonView.GetJsonObject("certificateUpdate")); - certificateUpdateEvent.m_chosenMember = TAG_CERTIFICATE_UPDATE; - } - } - - CertificateUpdateEvent &CertificateUpdateEvent::operator=(const CertificateUpdateEvent &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_CERTIFICATE_UPDATE) - { - m_certificateUpdate = objectToCopy.m_certificateUpdate; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *CertificateUpdateEvent::MODEL_NAME = "aws.greengrass#CertificateUpdateEvent"; - - Aws::Crt::String CertificateUpdateEvent::GetModelName() const noexcept - { - return CertificateUpdateEvent::MODEL_NAME; - } - - Aws::Crt::ScopedResource CertificateUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CertificateUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - CertificateUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CertificateUpdateEvent::s_customDeleter(CertificateUpdateEvent *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CertificateOptions::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_certificateType.has_value()) - { - payloadObject.WithString("certificateType", m_certificateType.value()); - } - } - - void CertificateOptions::s_loadFromJsonView( - CertificateOptions &certificateOptions, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("certificateType")) - { - certificateOptions.m_certificateType = - Aws::Crt::Optional(jsonView.GetString("certificateType")); - } - } - - void CertificateOptions::SetCertificateType(CertificateType certificateType) noexcept - { - switch (certificateType) - { - case CERTIFICATE_TYPE_SERVER: - m_certificateType = Aws::Crt::String("SERVER"); - break; - default: - break; - } - } - - Aws::Crt::Optional CertificateOptions::GetCertificateType() noexcept - { - if (!m_certificateType.has_value()) - return Aws::Crt::Optional(); - if (m_certificateType.value() == Aws::Crt::String("SERVER")) - { - return Aws::Crt::Optional(CERTIFICATE_TYPE_SERVER); - } - - return Aws::Crt::Optional(); - } - - const char *CertificateOptions::MODEL_NAME = "aws.greengrass#CertificateOptions"; - - Aws::Crt::String CertificateOptions::GetModelName() const noexcept { return CertificateOptions::MODEL_NAME; } - - Aws::Crt::ScopedResource CertificateOptions::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CertificateOptions::s_customDeleter); - shape->m_allocator = allocator; - CertificateOptions::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CertificateOptions::s_customDeleter(CertificateOptions *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ConfigurationValidityReport::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_status.has_value()) - { - payloadObject.WithString("status", m_status.value()); - } - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void ConfigurationValidityReport::s_loadFromJsonView( - ConfigurationValidityReport &configurationValidityReport, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("status")) - { - configurationValidityReport.m_status = - Aws::Crt::Optional(jsonView.GetString("status")); - } - if (jsonView.ValueExists("deploymentId")) - { - configurationValidityReport.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("message")) - { - configurationValidityReport.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - void ConfigurationValidityReport::SetStatus(ConfigurationValidityStatus status) noexcept - { - switch (status) - { - case CONFIGURATION_VALIDITY_STATUS_ACCEPTED: - m_status = Aws::Crt::String("ACCEPTED"); - break; - case CONFIGURATION_VALIDITY_STATUS_REJECTED: - m_status = Aws::Crt::String("REJECTED"); - break; - default: - break; - } - } - - Aws::Crt::Optional ConfigurationValidityReport::GetStatus() noexcept - { - if (!m_status.has_value()) - return Aws::Crt::Optional(); - if (m_status.value() == Aws::Crt::String("ACCEPTED")) - { - return Aws::Crt::Optional(CONFIGURATION_VALIDITY_STATUS_ACCEPTED); - } - if (m_status.value() == Aws::Crt::String("REJECTED")) - { - return Aws::Crt::Optional(CONFIGURATION_VALIDITY_STATUS_REJECTED); - } - - return Aws::Crt::Optional(); - } - - const char *ConfigurationValidityReport::MODEL_NAME = "aws.greengrass#ConfigurationValidityReport"; - - Aws::Crt::String ConfigurationValidityReport::GetModelName() const noexcept - { - return ConfigurationValidityReport::MODEL_NAME; - } - - Aws::Crt::ScopedResource ConfigurationValidityReport::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ConfigurationValidityReport::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationValidityReport::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ConfigurationValidityReport::s_customDeleter(ConfigurationValidityReport *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PublishMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) - { - Aws::Crt::JsonObject jsonMessageValue; - m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); - payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); - } - else if (m_chosenMember == TAG_BINARY_MESSAGE && m_binaryMessage.has_value()) - { - Aws::Crt::JsonObject binaryMessageValue; - m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); - payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); - } - } - - void PublishMessage::s_loadFromJsonView( - PublishMessage &publishMessage, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("jsonMessage")) - { - publishMessage.m_jsonMessage = JsonMessage(); - JsonMessage::s_loadFromJsonView( - publishMessage.m_jsonMessage.value(), jsonView.GetJsonObject("jsonMessage")); - publishMessage.m_chosenMember = TAG_JSON_MESSAGE; - } - else if (jsonView.ValueExists("binaryMessage")) - { - publishMessage.m_binaryMessage = BinaryMessage(); - BinaryMessage::s_loadFromJsonView( - publishMessage.m_binaryMessage.value(), jsonView.GetJsonObject("binaryMessage")); - publishMessage.m_chosenMember = TAG_BINARY_MESSAGE; - } - } - - PublishMessage &PublishMessage::operator=(const PublishMessage &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) - { - m_jsonMessage = objectToCopy.m_jsonMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) - { - m_binaryMessage = objectToCopy.m_binaryMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; - - Aws::Crt::String PublishMessage::GetModelName() const noexcept { return PublishMessage::MODEL_NAME; } - - Aws::Crt::ScopedResource PublishMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PublishMessage::s_customDeleter); - shape->m_allocator = allocator; - PublishMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PublishMessage::s_customDeleter(PublishMessage *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SecretValue::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_SECRET_STRING && m_secretString.has_value()) - { - payloadObject.WithString("secretString", m_secretString.value()); - } - else if (m_chosenMember == TAG_SECRET_BINARY && m_secretBinary.has_value()) - { - if (m_secretBinary.value().size() > 0) - { - payloadObject.WithString("secretBinary", Aws::Crt::Base64Encode(m_secretBinary.value())); - } - } - } - - void SecretValue::s_loadFromJsonView(SecretValue &secretValue, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("secretString")) - { - secretValue.m_secretString = Aws::Crt::Optional(jsonView.GetString("secretString")); - secretValue.m_chosenMember = TAG_SECRET_STRING; - } - else if (jsonView.ValueExists("secretBinary")) - { - if (jsonView.GetString("secretBinary").size() > 0) - { - secretValue.m_secretBinary = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("secretBinary"))); - } - secretValue.m_chosenMember = TAG_SECRET_BINARY; - } - } - - SecretValue &SecretValue::operator=(const SecretValue &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_SECRET_STRING) - { - m_secretString = objectToCopy.m_secretString; - m_chosenMember = objectToCopy.m_chosenMember; - } - else if (objectToCopy.m_chosenMember == TAG_SECRET_BINARY) - { - m_secretBinary = objectToCopy.m_secretBinary; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; - - Aws::Crt::String SecretValue::GetModelName() const noexcept { return SecretValue::MODEL_NAME; } - - Aws::Crt::ScopedResource SecretValue::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SecretValue::s_customDeleter); - shape->m_allocator = allocator; - SecretValue::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SecretValue::s_customDeleter(SecretValue *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void LocalDeployment::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_status.has_value()) - { - payloadObject.WithString("status", m_status.value()); - } - } - - void LocalDeployment::s_loadFromJsonView( - LocalDeployment &localDeployment, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - localDeployment.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("status")) - { - localDeployment.m_status = Aws::Crt::Optional(jsonView.GetString("status")); - } - } - - void LocalDeployment::SetStatus(DeploymentStatus status) noexcept - { - switch (status) - { - case DEPLOYMENT_STATUS_QUEUED: - m_status = Aws::Crt::String("QUEUED"); - break; - case DEPLOYMENT_STATUS_IN_PROGRESS: - m_status = Aws::Crt::String("IN_PROGRESS"); - break; - case DEPLOYMENT_STATUS_SUCCEEDED: - m_status = Aws::Crt::String("SUCCEEDED"); - break; - case DEPLOYMENT_STATUS_FAILED: - m_status = Aws::Crt::String("FAILED"); - break; - default: - break; - } - } - - Aws::Crt::Optional LocalDeployment::GetStatus() noexcept - { - if (!m_status.has_value()) - return Aws::Crt::Optional(); - if (m_status.value() == Aws::Crt::String("QUEUED")) - { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_QUEUED); - } - if (m_status.value() == Aws::Crt::String("IN_PROGRESS")) - { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_IN_PROGRESS); - } - if (m_status.value() == Aws::Crt::String("SUCCEEDED")) - { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_SUCCEEDED); - } - if (m_status.value() == Aws::Crt::String("FAILED")) - { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_FAILED); - } - - return Aws::Crt::Optional(); - } - - const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; - - Aws::Crt::String LocalDeployment::GetModelName() const noexcept { return LocalDeployment::MODEL_NAME; } - - Aws::Crt::ScopedResource LocalDeployment::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), LocalDeployment::s_customDeleter); - shape->m_allocator = allocator; - LocalDeployment::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void LocalDeployment::s_customDeleter(LocalDeployment *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ComponentDetails::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_version.has_value()) - { - payloadObject.WithString("version", m_version.value()); - } - if (m_state.has_value()) - { - payloadObject.WithString("state", m_state.value()); - } - if (m_configuration.has_value()) - { - payloadObject.WithObject("configuration", m_configuration.value()); - } - } - - void ComponentDetails::s_loadFromJsonView( - ComponentDetails &componentDetails, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - componentDetails.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("version")) - { - componentDetails.m_version = Aws::Crt::Optional(jsonView.GetString("version")); - } - if (jsonView.ValueExists("state")) - { - componentDetails.m_state = Aws::Crt::Optional(jsonView.GetString("state")); - } - if (jsonView.ValueExists("configuration")) - { - componentDetails.m_configuration = - Aws::Crt::Optional(jsonView.GetJsonObject("configuration").Materialize()); - } - } - - void ComponentDetails::SetState(LifecycleState state) noexcept - { - switch (state) - { - case LIFECYCLE_STATE_RUNNING: - m_state = Aws::Crt::String("RUNNING"); - break; - case LIFECYCLE_STATE_ERRORED: - m_state = Aws::Crt::String("ERRORED"); - break; - case LIFECYCLE_STATE_NEW: - m_state = Aws::Crt::String("NEW"); - break; - case LIFECYCLE_STATE_FINISHED: - m_state = Aws::Crt::String("FINISHED"); - break; - case LIFECYCLE_STATE_INSTALLED: - m_state = Aws::Crt::String("INSTALLED"); - break; - case LIFECYCLE_STATE_BROKEN: - m_state = Aws::Crt::String("BROKEN"); - break; - case LIFECYCLE_STATE_STARTING: - m_state = Aws::Crt::String("STARTING"); - break; - case LIFECYCLE_STATE_STOPPING: - m_state = Aws::Crt::String("STOPPING"); - break; - default: - break; - } - } - - Aws::Crt::Optional ComponentDetails::GetState() noexcept - { - if (!m_state.has_value()) - return Aws::Crt::Optional(); - if (m_state.value() == Aws::Crt::String("RUNNING")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_RUNNING); - } - if (m_state.value() == Aws::Crt::String("ERRORED")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_ERRORED); - } - if (m_state.value() == Aws::Crt::String("NEW")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_NEW); - } - if (m_state.value() == Aws::Crt::String("FINISHED")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_FINISHED); - } - if (m_state.value() == Aws::Crt::String("INSTALLED")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_INSTALLED); - } - if (m_state.value() == Aws::Crt::String("BROKEN")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_BROKEN); - } - if (m_state.value() == Aws::Crt::String("STARTING")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_STARTING); - } - if (m_state.value() == Aws::Crt::String("STOPPING")) - { - return Aws::Crt::Optional(LIFECYCLE_STATE_STOPPING); - } - - return Aws::Crt::Optional(); - } - - const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; - - Aws::Crt::String ComponentDetails::GetModelName() const noexcept { return ComponentDetails::MODEL_NAME; } - - Aws::Crt::ScopedResource ComponentDetails::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ComponentDetails::s_customDeleter); - shape->m_allocator = allocator; - ComponentDetails::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ComponentDetails::s_customDeleter(ComponentDetails *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CredentialDocument::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_chosenMember == TAG_MQTT_CREDENTIAL && m_mqttCredential.has_value()) - { - Aws::Crt::JsonObject mQTTCredentialValue; - m_mqttCredential.value().SerializeToJsonObject(mQTTCredentialValue); - payloadObject.WithObject("mqttCredential", std::move(mQTTCredentialValue)); - } - } - - void CredentialDocument::s_loadFromJsonView( - CredentialDocument &credentialDocument, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("mqttCredential")) - { - credentialDocument.m_mqttCredential = MQTTCredential(); - MQTTCredential::s_loadFromJsonView( - credentialDocument.m_mqttCredential.value(), jsonView.GetJsonObject("mqttCredential")); - credentialDocument.m_chosenMember = TAG_MQTT_CREDENTIAL; - } - } - - CredentialDocument &CredentialDocument::operator=(const CredentialDocument &objectToCopy) noexcept - { - if (objectToCopy.m_chosenMember == TAG_MQTT_CREDENTIAL) - { - m_mqttCredential = objectToCopy.m_mqttCredential; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; - } - - const char *CredentialDocument::MODEL_NAME = "aws.greengrass#CredentialDocument"; - - Aws::Crt::String CredentialDocument::GetModelName() const noexcept { return CredentialDocument::MODEL_NAME; } - - Aws::Crt::ScopedResource CredentialDocument::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CredentialDocument::s_customDeleter); - shape->m_allocator = allocator; - CredentialDocument::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CredentialDocument::s_customDeleter(CredentialDocument *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void VerifyClientDeviceIdentityResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_isValidClientDevice.has_value()) - { - payloadObject.WithBool("isValidClientDevice", m_isValidClientDevice.value()); - } - } - - void VerifyClientDeviceIdentityResponse::s_loadFromJsonView( - VerifyClientDeviceIdentityResponse &verifyClientDeviceIdentityResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("isValidClientDevice")) - { - verifyClientDeviceIdentityResponse.m_isValidClientDevice = - Aws::Crt::Optional(jsonView.GetBool("isValidClientDevice")); - } - } - - const char *VerifyClientDeviceIdentityResponse::MODEL_NAME = - "aws.greengrass#VerifyClientDeviceIdentityResponse"; - - Aws::Crt::String VerifyClientDeviceIdentityResponse::GetModelName() const noexcept - { - return VerifyClientDeviceIdentityResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource VerifyClientDeviceIdentityResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - VerifyClientDeviceIdentityResponse::s_customDeleter); - shape->m_allocator = allocator; - VerifyClientDeviceIdentityResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void VerifyClientDeviceIdentityResponse::s_customDeleter(VerifyClientDeviceIdentityResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void VerifyClientDeviceIdentityRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_credential.has_value()) - { - Aws::Crt::JsonObject clientDeviceCredentialValue; - m_credential.value().SerializeToJsonObject(clientDeviceCredentialValue); - payloadObject.WithObject("credential", std::move(clientDeviceCredentialValue)); - } - } - - void VerifyClientDeviceIdentityRequest::s_loadFromJsonView( - VerifyClientDeviceIdentityRequest &verifyClientDeviceIdentityRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("credential")) - { - verifyClientDeviceIdentityRequest.m_credential = ClientDeviceCredential(); - ClientDeviceCredential::s_loadFromJsonView( - verifyClientDeviceIdentityRequest.m_credential.value(), jsonView.GetJsonObject("credential")); - } - } - - const char *VerifyClientDeviceIdentityRequest::MODEL_NAME = "aws.greengrass#VerifyClientDeviceIdentityRequest"; - - Aws::Crt::String VerifyClientDeviceIdentityRequest::GetModelName() const noexcept - { - return VerifyClientDeviceIdentityRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource VerifyClientDeviceIdentityRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - VerifyClientDeviceIdentityRequest::s_customDeleter); - shape->m_allocator = allocator; - VerifyClientDeviceIdentityRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void VerifyClientDeviceIdentityRequest::s_customDeleter(VerifyClientDeviceIdentityRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void InvalidTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidTokenError::s_loadFromJsonView( - InvalidTokenError &invalidTokenError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidTokenError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; - - Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { return InvalidTokenError::MODEL_NAME; } - - Aws::Crt::ScopedResource InvalidTokenError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), InvalidTokenError::s_customDeleter); - shape->m_allocator = allocator; - InvalidTokenError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidTokenError::s_customDeleter(InvalidTokenError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void ValidateAuthorizationTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_isValid.has_value()) - { - payloadObject.WithBool("isValid", m_isValid.value()); - } - } - - void ValidateAuthorizationTokenResponse::s_loadFromJsonView( - ValidateAuthorizationTokenResponse &validateAuthorizationTokenResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("isValid")) - { - validateAuthorizationTokenResponse.m_isValid = Aws::Crt::Optional(jsonView.GetBool("isValid")); - } - } - - const char *ValidateAuthorizationTokenResponse::MODEL_NAME = - "aws.greengrass#ValidateAuthorizationTokenResponse"; - - Aws::Crt::String ValidateAuthorizationTokenResponse::GetModelName() const noexcept - { - return ValidateAuthorizationTokenResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource ValidateAuthorizationTokenResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateAuthorizationTokenResponse::s_customDeleter); - shape->m_allocator = allocator; - ValidateAuthorizationTokenResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ValidateAuthorizationTokenResponse::s_customDeleter(ValidateAuthorizationTokenResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ValidateAuthorizationTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_token.has_value()) - { - payloadObject.WithString("token", m_token.value()); - } - } - - void ValidateAuthorizationTokenRequest::s_loadFromJsonView( - ValidateAuthorizationTokenRequest &validateAuthorizationTokenRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("token")) - { - validateAuthorizationTokenRequest.m_token = - Aws::Crt::Optional(jsonView.GetString("token")); - } - } - - const char *ValidateAuthorizationTokenRequest::MODEL_NAME = "aws.greengrass#ValidateAuthorizationTokenRequest"; - - Aws::Crt::String ValidateAuthorizationTokenRequest::GetModelName() const noexcept - { - return ValidateAuthorizationTokenRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource ValidateAuthorizationTokenRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateAuthorizationTokenRequest::s_customDeleter); - shape->m_allocator = allocator; - ValidateAuthorizationTokenRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ValidateAuthorizationTokenRequest::s_customDeleter(ValidateAuthorizationTokenRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void UpdateThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void UpdateThingShadowResponse::s_loadFromJsonView( - UpdateThingShadowResponse &updateThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - updateThingShadowResponse.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - const char *UpdateThingShadowResponse::MODEL_NAME = "aws.greengrass#UpdateThingShadowResponse"; - - Aws::Crt::String UpdateThingShadowResponse::GetModelName() const noexcept - { - return UpdateThingShadowResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource UpdateThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateThingShadowResponse::s_customDeleter(UpdateThingShadowResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void UpdateThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_thingName.has_value()) - { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) - { - payloadObject.WithString("shadowName", m_shadowName.value()); - } - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void UpdateThingShadowRequest::s_loadFromJsonView( - UpdateThingShadowRequest &updateThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("thingName")) - { - updateThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) - { - updateThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - updateThingShadowRequest.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - const char *UpdateThingShadowRequest::MODEL_NAME = "aws.greengrass#UpdateThingShadowRequest"; - - Aws::Crt::String UpdateThingShadowRequest::GetModelName() const noexcept - { - return UpdateThingShadowRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource UpdateThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateThingShadowRequest::s_customDeleter(UpdateThingShadowRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void UpdateStateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void UpdateStateResponse::s_loadFromJsonView( - UpdateStateResponse &updateStateResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)updateStateResponse; - (void)jsonView; - } - - const char *UpdateStateResponse::MODEL_NAME = "aws.greengrass#UpdateStateResponse"; - - Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { return UpdateStateResponse::MODEL_NAME; } - - Aws::Crt::ScopedResource UpdateStateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateStateResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateStateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateStateResponse::s_customDeleter(UpdateStateResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void UpdateStateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_state.has_value()) - { - payloadObject.WithString("state", m_state.value()); - } - } - - void UpdateStateRequest::s_loadFromJsonView( - UpdateStateRequest &updateStateRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("state")) - { - updateStateRequest.m_state = Aws::Crt::Optional(jsonView.GetString("state")); - } - } - - void UpdateStateRequest::SetState(ReportedLifecycleState state) noexcept - { - switch (state) - { - case REPORTED_LIFECYCLE_STATE_RUNNING: - m_state = Aws::Crt::String("RUNNING"); - break; - case REPORTED_LIFECYCLE_STATE_ERRORED: - m_state = Aws::Crt::String("ERRORED"); - break; - default: - break; - } - } - - Aws::Crt::Optional UpdateStateRequest::GetState() noexcept - { - if (!m_state.has_value()) - return Aws::Crt::Optional(); - if (m_state.value() == Aws::Crt::String("RUNNING")) - { - return Aws::Crt::Optional(REPORTED_LIFECYCLE_STATE_RUNNING); - } - if (m_state.value() == Aws::Crt::String("ERRORED")) - { - return Aws::Crt::Optional(REPORTED_LIFECYCLE_STATE_ERRORED); - } - - return Aws::Crt::Optional(); - } - - const char *UpdateStateRequest::MODEL_NAME = "aws.greengrass#UpdateStateRequest"; - - Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { return UpdateStateRequest::MODEL_NAME; } - - Aws::Crt::ScopedResource UpdateStateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateStateRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateStateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateStateRequest::s_customDeleter(UpdateStateRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void FailedUpdateConditionCheckError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void FailedUpdateConditionCheckError::s_loadFromJsonView( - FailedUpdateConditionCheckError &failedUpdateConditionCheckError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - failedUpdateConditionCheckError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *FailedUpdateConditionCheckError::MODEL_NAME = "aws.greengrass#FailedUpdateConditionCheckError"; - - Aws::Crt::String FailedUpdateConditionCheckError::GetModelName() const noexcept - { - return FailedUpdateConditionCheckError::MODEL_NAME; - } - - Aws::Crt::ScopedResource FailedUpdateConditionCheckError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - FailedUpdateConditionCheckError::s_customDeleter); - shape->m_allocator = allocator; - FailedUpdateConditionCheckError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void FailedUpdateConditionCheckError::s_customDeleter(FailedUpdateConditionCheckError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void ConflictError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void ConflictError::s_loadFromJsonView( - ConflictError &conflictError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - conflictError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; - - Aws::Crt::String ConflictError::GetModelName() const noexcept { return ConflictError::MODEL_NAME; } - - Aws::Crt::ScopedResource ConflictError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ConflictError::s_customDeleter); - shape->m_allocator = allocator; - ConflictError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void ConflictError::s_customDeleter(ConflictError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void UpdateConfigurationResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void UpdateConfigurationResponse::s_loadFromJsonView( - UpdateConfigurationResponse &updateConfigurationResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)updateConfigurationResponse; - (void)jsonView; - } - - const char *UpdateConfigurationResponse::MODEL_NAME = "aws.greengrass#UpdateConfigurationResponse"; - - Aws::Crt::String UpdateConfigurationResponse::GetModelName() const noexcept - { - return UpdateConfigurationResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource UpdateConfigurationResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateConfigurationResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateConfigurationResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateConfigurationResponse::s_customDeleter(UpdateConfigurationResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void UpdateConfigurationRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_keyPath.has_value()) - { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) - { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } - if (m_timestamp.has_value()) - { - payloadObject.WithDouble("timestamp", m_timestamp.value().SecondsWithMSPrecision()); - } - if (m_valueToMerge.has_value()) - { - payloadObject.WithObject("valueToMerge", m_valueToMerge.value()); - } - } - - void UpdateConfigurationRequest::s_loadFromJsonView( - UpdateConfigurationRequest &updateConfigurationRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("keyPath")) - { - updateConfigurationRequest.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) - { - Aws::Crt::Optional keyPathItem; - keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); - updateConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); - } - } - if (jsonView.ValueExists("timestamp")) - { - updateConfigurationRequest.m_timestamp = - Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); - } - if (jsonView.ValueExists("valueToMerge")) - { - updateConfigurationRequest.m_valueToMerge = - Aws::Crt::Optional(jsonView.GetJsonObject("valueToMerge").Materialize()); - } - } - - const char *UpdateConfigurationRequest::MODEL_NAME = "aws.greengrass#UpdateConfigurationRequest"; - - Aws::Crt::String UpdateConfigurationRequest::GetModelName() const noexcept - { - return UpdateConfigurationRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource UpdateConfigurationRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UpdateConfigurationRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateConfigurationRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void UpdateConfigurationRequest::s_customDeleter(UpdateConfigurationRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToValidateConfigurationUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesResponse &subscribeToValidateConfigurationUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToValidateConfigurationUpdatesResponse; - (void)jsonView; - } - - const char *SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"; - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesResponse::GetModelName() const noexcept - { - return SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesResponse:: - s_allocateFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter( - SubscribeToValidateConfigurationUpdatesResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToValidateConfigurationUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesRequest &subscribeToValidateConfigurationUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToValidateConfigurationUpdatesRequest; - (void)jsonView; - } - - const char *SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"; - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesRequest::GetModelName() const noexcept - { - return SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesRequest:: - s_allocateFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter( - SubscribeToValidateConfigurationUpdatesRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToTopicResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topicName.has_value()) - { - payloadObject.WithString("topicName", m_topicName.value()); - } - } - - void SubscribeToTopicResponse::s_loadFromJsonView( - SubscribeToTopicResponse &subscribeToTopicResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topicName")) - { - subscribeToTopicResponse.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - } - - const char *SubscribeToTopicResponse::MODEL_NAME = "aws.greengrass#SubscribeToTopicResponse"; - - Aws::Crt::String SubscribeToTopicResponse::GetModelName() const noexcept - { - return SubscribeToTopicResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToTopicResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SubscribeToTopicResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToTopicResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToTopicResponse::s_customDeleter(SubscribeToTopicResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToTopicRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topic.has_value()) - { - payloadObject.WithString("topic", m_topic.value()); - } - if (m_receiveMode.has_value()) - { - payloadObject.WithString("receiveMode", m_receiveMode.value()); - } - } - - void SubscribeToTopicRequest::s_loadFromJsonView( - SubscribeToTopicRequest &subscribeToTopicRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topic")) - { - subscribeToTopicRequest.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); - } - if (jsonView.ValueExists("receiveMode")) - { - subscribeToTopicRequest.m_receiveMode = - Aws::Crt::Optional(jsonView.GetString("receiveMode")); - } - } - - void SubscribeToTopicRequest::SetReceiveMode(ReceiveMode receiveMode) noexcept - { - switch (receiveMode) - { - case RECEIVE_MODE_RECEIVE_ALL_MESSAGES: - m_receiveMode = Aws::Crt::String("RECEIVE_ALL_MESSAGES"); - break; - case RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS: - m_receiveMode = Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS"); - break; - default: - break; - } - } - - Aws::Crt::Optional SubscribeToTopicRequest::GetReceiveMode() noexcept - { - if (!m_receiveMode.has_value()) - return Aws::Crt::Optional(); - if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_ALL_MESSAGES")) - { - return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_ALL_MESSAGES); - } - if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS")) - { - return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS); - } - - return Aws::Crt::Optional(); - } - - const char *SubscribeToTopicRequest::MODEL_NAME = "aws.greengrass#SubscribeToTopicRequest"; - - Aws::Crt::String SubscribeToTopicRequest::GetModelName() const noexcept - { - return SubscribeToTopicRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToTopicRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SubscribeToTopicRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToTopicRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToTopicRequest::s_customDeleter(SubscribeToTopicRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToIoTCoreResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void SubscribeToIoTCoreResponse::s_loadFromJsonView( - SubscribeToIoTCoreResponse &subscribeToIoTCoreResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToIoTCoreResponse; - (void)jsonView; - } - - const char *SubscribeToIoTCoreResponse::MODEL_NAME = "aws.greengrass#SubscribeToIoTCoreResponse"; - - Aws::Crt::String SubscribeToIoTCoreResponse::GetModelName() const noexcept - { - return SubscribeToIoTCoreResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToIoTCoreResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SubscribeToIoTCoreResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToIoTCoreResponse::s_customDeleter(SubscribeToIoTCoreResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToIoTCoreRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topicName.has_value()) - { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_qos.has_value()) - { - payloadObject.WithString("qos", m_qos.value()); - } - } - - void SubscribeToIoTCoreRequest::s_loadFromJsonView( - SubscribeToIoTCoreRequest &subscribeToIoTCoreRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topicName")) - { - subscribeToIoTCoreRequest.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("qos")) - { - subscribeToIoTCoreRequest.m_qos = Aws::Crt::Optional(jsonView.GetString("qos")); - } - } - - void SubscribeToIoTCoreRequest::SetQos(QOS qos) noexcept - { - switch (qos) - { - case QOS_AT_MOST_ONCE: - m_qos = Aws::Crt::String("0"); - break; - case QOS_AT_LEAST_ONCE: - m_qos = Aws::Crt::String("1"); - break; - default: - break; - } - } - - Aws::Crt::Optional SubscribeToIoTCoreRequest::GetQos() noexcept - { - if (!m_qos.has_value()) - return Aws::Crt::Optional(); - if (m_qos.value() == Aws::Crt::String("0")) - { - return Aws::Crt::Optional(QOS_AT_MOST_ONCE); - } - if (m_qos.value() == Aws::Crt::String("1")) - { - return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); - } - - return Aws::Crt::Optional(); - } - - const char *SubscribeToIoTCoreRequest::MODEL_NAME = "aws.greengrass#SubscribeToIoTCoreRequest"; - - Aws::Crt::String SubscribeToIoTCoreRequest::GetModelName() const noexcept - { - return SubscribeToIoTCoreRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToIoTCoreRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SubscribeToIoTCoreRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToIoTCoreRequest::s_customDeleter(SubscribeToIoTCoreRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - (void)payloadObject; - } - - void SubscribeToConfigurationUpdateResponse::s_loadFromJsonView( - SubscribeToConfigurationUpdateResponse &subscribeToConfigurationUpdateResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToConfigurationUpdateResponse; - (void)jsonView; - } - - const char *SubscribeToConfigurationUpdateResponse::MODEL_NAME = - "aws.greengrass#SubscribeToConfigurationUpdateResponse"; - - Aws::Crt::String SubscribeToConfigurationUpdateResponse::GetModelName() const noexcept - { - return SubscribeToConfigurationUpdateResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToConfigurationUpdateResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToConfigurationUpdateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToConfigurationUpdateResponse::s_customDeleter( - SubscribeToConfigurationUpdateResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) - { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) - { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } - } - - void SubscribeToConfigurationUpdateRequest::s_loadFromJsonView( - SubscribeToConfigurationUpdateRequest &subscribeToConfigurationUpdateRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - subscribeToConfigurationUpdateRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) - { - subscribeToConfigurationUpdateRequest.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) - { - Aws::Crt::Optional keyPathItem; - keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); - subscribeToConfigurationUpdateRequest.m_keyPath.value().push_back(keyPathItem.value()); - } - } - } - - const char *SubscribeToConfigurationUpdateRequest::MODEL_NAME = - "aws.greengrass#SubscribeToConfigurationUpdateRequest"; - - Aws::Crt::String SubscribeToConfigurationUpdateRequest::GetModelName() const noexcept - { - return SubscribeToConfigurationUpdateRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToConfigurationUpdateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToConfigurationUpdateRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToConfigurationUpdateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToConfigurationUpdateRequest::s_customDeleter( - SubscribeToConfigurationUpdateRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToComponentUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - (void)payloadObject; - } - - void SubscribeToComponentUpdatesResponse::s_loadFromJsonView( - SubscribeToComponentUpdatesResponse &subscribeToComponentUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToComponentUpdatesResponse; - (void)jsonView; - } - - const char *SubscribeToComponentUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToComponentUpdatesResponse"; - - Aws::Crt::String SubscribeToComponentUpdatesResponse::GetModelName() const noexcept - { - return SubscribeToComponentUpdatesResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToComponentUpdatesResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToComponentUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToComponentUpdatesResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToComponentUpdatesResponse::s_customDeleter(SubscribeToComponentUpdatesResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToComponentUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - (void)payloadObject; - } - - void SubscribeToComponentUpdatesRequest::s_loadFromJsonView( - SubscribeToComponentUpdatesRequest &subscribeToComponentUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToComponentUpdatesRequest; - (void)jsonView; - } - - const char *SubscribeToComponentUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToComponentUpdatesRequest"; - - Aws::Crt::String SubscribeToComponentUpdatesRequest::GetModelName() const noexcept - { - return SubscribeToComponentUpdatesRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToComponentUpdatesRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToComponentUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToComponentUpdatesRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToComponentUpdatesRequest::s_customDeleter(SubscribeToComponentUpdatesRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - (void)payloadObject; - } - - void SubscribeToCertificateUpdatesResponse::s_loadFromJsonView( - SubscribeToCertificateUpdatesResponse &subscribeToCertificateUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)subscribeToCertificateUpdatesResponse; - (void)jsonView; - } - - const char *SubscribeToCertificateUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToCertificateUpdatesResponse"; - - Aws::Crt::String SubscribeToCertificateUpdatesResponse::GetModelName() const noexcept - { - return SubscribeToCertificateUpdatesResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToCertificateUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToCertificateUpdatesResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToCertificateUpdatesResponse::s_customDeleter( - SubscribeToCertificateUpdatesResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_certificateOptions.has_value()) - { - Aws::Crt::JsonObject certificateOptionsValue; - m_certificateOptions.value().SerializeToJsonObject(certificateOptionsValue); - payloadObject.WithObject("certificateOptions", std::move(certificateOptionsValue)); - } - } - - void SubscribeToCertificateUpdatesRequest::s_loadFromJsonView( - SubscribeToCertificateUpdatesRequest &subscribeToCertificateUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("certificateOptions")) - { - subscribeToCertificateUpdatesRequest.m_certificateOptions = CertificateOptions(); - CertificateOptions::s_loadFromJsonView( - subscribeToCertificateUpdatesRequest.m_certificateOptions.value(), - jsonView.GetJsonObject("certificateOptions")); - } - } - - const char *SubscribeToCertificateUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToCertificateUpdatesRequest"; - - Aws::Crt::String SubscribeToCertificateUpdatesRequest::GetModelName() const noexcept - { - return SubscribeToCertificateUpdatesRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SubscribeToCertificateUpdatesRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToCertificateUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToCertificateUpdatesRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SubscribeToCertificateUpdatesRequest::s_customDeleter(SubscribeToCertificateUpdatesRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void StopComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_stopStatus.has_value()) - { - payloadObject.WithString("stopStatus", m_stopStatus.value()); - } - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void StopComponentResponse::s_loadFromJsonView( - StopComponentResponse &stopComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("stopStatus")) - { - stopComponentResponse.m_stopStatus = - Aws::Crt::Optional(jsonView.GetString("stopStatus")); - } - if (jsonView.ValueExists("message")) - { - stopComponentResponse.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - void StopComponentResponse::SetStopStatus(RequestStatus stopStatus) noexcept - { - switch (stopStatus) - { - case REQUEST_STATUS_SUCCEEDED: - m_stopStatus = Aws::Crt::String("SUCCEEDED"); - break; - case REQUEST_STATUS_FAILED: - m_stopStatus = Aws::Crt::String("FAILED"); - break; - default: - break; - } - } - - Aws::Crt::Optional StopComponentResponse::GetStopStatus() noexcept - { - if (!m_stopStatus.has_value()) - return Aws::Crt::Optional(); - if (m_stopStatus.value() == Aws::Crt::String("SUCCEEDED")) - { - return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); - } - if (m_stopStatus.value() == Aws::Crt::String("FAILED")) - { - return Aws::Crt::Optional(REQUEST_STATUS_FAILED); - } - - return Aws::Crt::Optional(); - } - - const char *StopComponentResponse::MODEL_NAME = "aws.greengrass#StopComponentResponse"; - - Aws::Crt::String StopComponentResponse::GetModelName() const noexcept - { - return StopComponentResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource StopComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), StopComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - StopComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void StopComponentResponse::s_customDeleter(StopComponentResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void StopComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - } - - void StopComponentRequest::s_loadFromJsonView( - StopComponentRequest &stopComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - stopComponentRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - } - - const char *StopComponentRequest::MODEL_NAME = "aws.greengrass#StopComponentRequest"; - - Aws::Crt::String StopComponentRequest::GetModelName() const noexcept - { - return StopComponentRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource StopComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), StopComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - StopComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void StopComponentRequest::s_customDeleter(StopComponentRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SendConfigurationValidityReportResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - (void)payloadObject; - } - - void SendConfigurationValidityReportResponse::s_loadFromJsonView( - SendConfigurationValidityReportResponse &sendConfigurationValidityReportResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)sendConfigurationValidityReportResponse; - (void)jsonView; - } - - const char *SendConfigurationValidityReportResponse::MODEL_NAME = - "aws.greengrass#SendConfigurationValidityReportResponse"; - - Aws::Crt::String SendConfigurationValidityReportResponse::GetModelName() const noexcept - { - return SendConfigurationValidityReportResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource SendConfigurationValidityReportResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SendConfigurationValidityReportResponse::s_customDeleter); - shape->m_allocator = allocator; - SendConfigurationValidityReportResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SendConfigurationValidityReportResponse::s_customDeleter( - SendConfigurationValidityReportResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SendConfigurationValidityReportRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_configurationValidityReport.has_value()) - { - Aws::Crt::JsonObject configurationValidityReportValue; - m_configurationValidityReport.value().SerializeToJsonObject(configurationValidityReportValue); - payloadObject.WithObject("configurationValidityReport", std::move(configurationValidityReportValue)); - } - } - - void SendConfigurationValidityReportRequest::s_loadFromJsonView( - SendConfigurationValidityReportRequest &sendConfigurationValidityReportRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("configurationValidityReport")) - { - sendConfigurationValidityReportRequest.m_configurationValidityReport = ConfigurationValidityReport(); - ConfigurationValidityReport::s_loadFromJsonView( - sendConfigurationValidityReportRequest.m_configurationValidityReport.value(), - jsonView.GetJsonObject("configurationValidityReport")); - } - } - - const char *SendConfigurationValidityReportRequest::MODEL_NAME = - "aws.greengrass#SendConfigurationValidityReportRequest"; - - Aws::Crt::String SendConfigurationValidityReportRequest::GetModelName() const noexcept - { - return SendConfigurationValidityReportRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource SendConfigurationValidityReportRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SendConfigurationValidityReportRequest::s_customDeleter); - shape->m_allocator = allocator; - SendConfigurationValidityReportRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void SendConfigurationValidityReportRequest::s_customDeleter( - SendConfigurationValidityReportRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ResumeComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void ResumeComponentResponse::s_loadFromJsonView( - ResumeComponentResponse &resumeComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)resumeComponentResponse; - (void)jsonView; - } - - const char *ResumeComponentResponse::MODEL_NAME = "aws.greengrass#ResumeComponentResponse"; - - Aws::Crt::String ResumeComponentResponse::GetModelName() const noexcept - { - return ResumeComponentResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource ResumeComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ResumeComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - ResumeComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ResumeComponentResponse::s_customDeleter(ResumeComponentResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ResumeComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - } - - void ResumeComponentRequest::s_loadFromJsonView( - ResumeComponentRequest &resumeComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - resumeComponentRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - } - - const char *ResumeComponentRequest::MODEL_NAME = "aws.greengrass#ResumeComponentRequest"; - - Aws::Crt::String ResumeComponentRequest::GetModelName() const noexcept - { - return ResumeComponentRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource ResumeComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ResumeComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - ResumeComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ResumeComponentRequest::s_customDeleter(ResumeComponentRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ComponentNotFoundError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void ComponentNotFoundError::s_loadFromJsonView( - ComponentNotFoundError &componentNotFoundError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - componentNotFoundError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *ComponentNotFoundError::MODEL_NAME = "aws.greengrass#ComponentNotFoundError"; - - Aws::Crt::String ComponentNotFoundError::GetModelName() const noexcept - { - return ComponentNotFoundError::MODEL_NAME; - } - - Aws::Crt::ScopedResource ComponentNotFoundError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ComponentNotFoundError::s_customDeleter); - shape->m_allocator = allocator; - ComponentNotFoundError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void ComponentNotFoundError::s_customDeleter(ComponentNotFoundError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void RestartComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_restartStatus.has_value()) - { - payloadObject.WithString("restartStatus", m_restartStatus.value()); - } - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void RestartComponentResponse::s_loadFromJsonView( - RestartComponentResponse &restartComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("restartStatus")) - { - restartComponentResponse.m_restartStatus = - Aws::Crt::Optional(jsonView.GetString("restartStatus")); - } - if (jsonView.ValueExists("message")) - { - restartComponentResponse.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - void RestartComponentResponse::SetRestartStatus(RequestStatus restartStatus) noexcept - { - switch (restartStatus) - { - case REQUEST_STATUS_SUCCEEDED: - m_restartStatus = Aws::Crt::String("SUCCEEDED"); - break; - case REQUEST_STATUS_FAILED: - m_restartStatus = Aws::Crt::String("FAILED"); - break; - default: - break; - } - } - - Aws::Crt::Optional RestartComponentResponse::GetRestartStatus() noexcept - { - if (!m_restartStatus.has_value()) - return Aws::Crt::Optional(); - if (m_restartStatus.value() == Aws::Crt::String("SUCCEEDED")) - { - return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); - } - if (m_restartStatus.value() == Aws::Crt::String("FAILED")) - { - return Aws::Crt::Optional(REQUEST_STATUS_FAILED); - } - - return Aws::Crt::Optional(); - } - - const char *RestartComponentResponse::MODEL_NAME = "aws.greengrass#RestartComponentResponse"; - - Aws::Crt::String RestartComponentResponse::GetModelName() const noexcept - { - return RestartComponentResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource RestartComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), RestartComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - RestartComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void RestartComponentResponse::s_customDeleter(RestartComponentResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void RestartComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - } - - void RestartComponentRequest::s_loadFromJsonView( - RestartComponentRequest &restartComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - restartComponentRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - } - - const char *RestartComponentRequest::MODEL_NAME = "aws.greengrass#RestartComponentRequest"; - - Aws::Crt::String RestartComponentRequest::GetModelName() const noexcept - { - return RestartComponentRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource RestartComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), RestartComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - RestartComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void RestartComponentRequest::s_customDeleter(RestartComponentRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PutComponentMetricResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void PutComponentMetricResponse::s_loadFromJsonView( - PutComponentMetricResponse &putComponentMetricResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)putComponentMetricResponse; - (void)jsonView; - } - - const char *PutComponentMetricResponse::MODEL_NAME = "aws.greengrass#PutComponentMetricResponse"; - - Aws::Crt::String PutComponentMetricResponse::GetModelName() const noexcept - { - return PutComponentMetricResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource PutComponentMetricResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PutComponentMetricResponse::s_customDeleter); - shape->m_allocator = allocator; - PutComponentMetricResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PutComponentMetricResponse::s_customDeleter(PutComponentMetricResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PutComponentMetricRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_metrics.has_value()) - { - Aws::Crt::JsonObject metricsList; - Aws::Crt::Vector metricsListJsonArray; - for (const auto &metricsListItem : m_metrics.value()) - { - Aws::Crt::JsonObject metricsListJsonArrayItem; - metricsListItem.SerializeToJsonObject(metricsListJsonArrayItem); - metricsListJsonArray.emplace_back(std::move(metricsListJsonArrayItem)); - } - metricsList.AsArray(std::move(metricsListJsonArray)); - payloadObject.WithObject("metrics", std::move(metricsList)); - } - } - - void PutComponentMetricRequest::s_loadFromJsonView( - PutComponentMetricRequest &putComponentMetricRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("metrics")) - { - putComponentMetricRequest.m_metrics = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &metricsListJsonView : jsonView.GetArray("metrics")) - { - Aws::Crt::Optional metricsListItem; - metricsListItem = Metric(); - Metric::s_loadFromJsonView(metricsListItem.value(), metricsListJsonView); - putComponentMetricRequest.m_metrics.value().push_back(metricsListItem.value()); - } - } - } - - const char *PutComponentMetricRequest::MODEL_NAME = "aws.greengrass#PutComponentMetricRequest"; - - Aws::Crt::String PutComponentMetricRequest::GetModelName() const noexcept - { - return PutComponentMetricRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource PutComponentMetricRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PutComponentMetricRequest::s_customDeleter); - shape->m_allocator = allocator; - PutComponentMetricRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PutComponentMetricRequest::s_customDeleter(PutComponentMetricRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PublishToTopicResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void PublishToTopicResponse::s_loadFromJsonView( - PublishToTopicResponse &publishToTopicResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)publishToTopicResponse; - (void)jsonView; - } - - const char *PublishToTopicResponse::MODEL_NAME = "aws.greengrass#PublishToTopicResponse"; - - Aws::Crt::String PublishToTopicResponse::GetModelName() const noexcept - { - return PublishToTopicResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource PublishToTopicResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PublishToTopicResponse::s_customDeleter); - shape->m_allocator = allocator; - PublishToTopicResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PublishToTopicResponse::s_customDeleter(PublishToTopicResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PublishToTopicRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topic.has_value()) - { - payloadObject.WithString("topic", m_topic.value()); - } - if (m_publishMessage.has_value()) - { - Aws::Crt::JsonObject publishMessageValue; - m_publishMessage.value().SerializeToJsonObject(publishMessageValue); - payloadObject.WithObject("publishMessage", std::move(publishMessageValue)); - } - } - - void PublishToTopicRequest::s_loadFromJsonView( - PublishToTopicRequest &publishToTopicRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topic")) - { - publishToTopicRequest.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); - } - if (jsonView.ValueExists("publishMessage")) - { - publishToTopicRequest.m_publishMessage = PublishMessage(); - PublishMessage::s_loadFromJsonView( - publishToTopicRequest.m_publishMessage.value(), jsonView.GetJsonObject("publishMessage")); - } - } - - const char *PublishToTopicRequest::MODEL_NAME = "aws.greengrass#PublishToTopicRequest"; - - Aws::Crt::String PublishToTopicRequest::GetModelName() const noexcept - { - return PublishToTopicRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource PublishToTopicRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PublishToTopicRequest::s_customDeleter); - shape->m_allocator = allocator; - PublishToTopicRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PublishToTopicRequest::s_customDeleter(PublishToTopicRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PublishToIoTCoreResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void PublishToIoTCoreResponse::s_loadFromJsonView( - PublishToIoTCoreResponse &publishToIoTCoreResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)publishToIoTCoreResponse; - (void)jsonView; - } - - const char *PublishToIoTCoreResponse::MODEL_NAME = "aws.greengrass#PublishToIoTCoreResponse"; - - Aws::Crt::String PublishToIoTCoreResponse::GetModelName() const noexcept - { - return PublishToIoTCoreResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource PublishToIoTCoreResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PublishToIoTCoreResponse::s_customDeleter); - shape->m_allocator = allocator; - PublishToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PublishToIoTCoreResponse::s_customDeleter(PublishToIoTCoreResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PublishToIoTCoreRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_topicName.has_value()) - { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_qos.has_value()) - { - payloadObject.WithString("qos", m_qos.value()); - } - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void PublishToIoTCoreRequest::s_loadFromJsonView( - PublishToIoTCoreRequest &publishToIoTCoreRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("topicName")) - { - publishToIoTCoreRequest.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("qos")) - { - publishToIoTCoreRequest.m_qos = Aws::Crt::Optional(jsonView.GetString("qos")); - } - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - publishToIoTCoreRequest.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - void PublishToIoTCoreRequest::SetQos(QOS qos) noexcept - { - switch (qos) - { - case QOS_AT_MOST_ONCE: - m_qos = Aws::Crt::String("0"); - break; - case QOS_AT_LEAST_ONCE: - m_qos = Aws::Crt::String("1"); - break; - default: - break; - } - } - - Aws::Crt::Optional PublishToIoTCoreRequest::GetQos() noexcept - { - if (!m_qos.has_value()) - return Aws::Crt::Optional(); - if (m_qos.value() == Aws::Crt::String("0")) - { - return Aws::Crt::Optional(QOS_AT_MOST_ONCE); - } - if (m_qos.value() == Aws::Crt::String("1")) - { - return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); - } - - return Aws::Crt::Optional(); - } - - const char *PublishToIoTCoreRequest::MODEL_NAME = "aws.greengrass#PublishToIoTCoreRequest"; - - Aws::Crt::String PublishToIoTCoreRequest::GetModelName() const noexcept - { - return PublishToIoTCoreRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource PublishToIoTCoreRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PublishToIoTCoreRequest::s_customDeleter); - shape->m_allocator = allocator; - PublishToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PublishToIoTCoreRequest::s_customDeleter(PublishToIoTCoreRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PauseComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void PauseComponentResponse::s_loadFromJsonView( - PauseComponentResponse &pauseComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)pauseComponentResponse; - (void)jsonView; - } - - const char *PauseComponentResponse::MODEL_NAME = "aws.greengrass#PauseComponentResponse"; - - Aws::Crt::String PauseComponentResponse::GetModelName() const noexcept - { - return PauseComponentResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource PauseComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PauseComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - PauseComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PauseComponentResponse::s_customDeleter(PauseComponentResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void PauseComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - } - - void PauseComponentRequest::s_loadFromJsonView( - PauseComponentRequest &pauseComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - pauseComponentRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - } - - const char *PauseComponentRequest::MODEL_NAME = "aws.greengrass#PauseComponentRequest"; - - Aws::Crt::String PauseComponentRequest::GetModelName() const noexcept - { - return PauseComponentRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource PauseComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), PauseComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - PauseComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void PauseComponentRequest::s_customDeleter(PauseComponentRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListNamedShadowsForThingResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_results.has_value()) - { - Aws::Crt::JsonObject namedShadowList; - Aws::Crt::Vector namedShadowListJsonArray; - for (const auto &namedShadowListItem : m_results.value()) - { - Aws::Crt::JsonObject namedShadowListJsonArrayItem; - namedShadowListJsonArrayItem.AsString(namedShadowListItem); - namedShadowListJsonArray.emplace_back(std::move(namedShadowListJsonArrayItem)); - } - namedShadowList.AsArray(std::move(namedShadowListJsonArray)); - payloadObject.WithObject("results", std::move(namedShadowList)); - } - if (m_timestamp.has_value()) - { - payloadObject.WithDouble("timestamp", m_timestamp.value().SecondsWithMSPrecision()); - } - if (m_nextToken.has_value()) - { - payloadObject.WithString("nextToken", m_nextToken.value()); - } - } - - void ListNamedShadowsForThingResponse::s_loadFromJsonView( - ListNamedShadowsForThingResponse &listNamedShadowsForThingResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("results")) - { - listNamedShadowsForThingResponse.m_results = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &namedShadowListJsonView : jsonView.GetArray("results")) - { - Aws::Crt::Optional namedShadowListItem; - namedShadowListItem = Aws::Crt::Optional(namedShadowListJsonView.AsString()); - listNamedShadowsForThingResponse.m_results.value().push_back(namedShadowListItem.value()); - } - } - if (jsonView.ValueExists("timestamp")) - { - listNamedShadowsForThingResponse.m_timestamp = - Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); - } - if (jsonView.ValueExists("nextToken")) - { - listNamedShadowsForThingResponse.m_nextToken = - Aws::Crt::Optional(jsonView.GetString("nextToken")); - } - } - - const char *ListNamedShadowsForThingResponse::MODEL_NAME = "aws.greengrass#ListNamedShadowsForThingResponse"; - - Aws::Crt::String ListNamedShadowsForThingResponse::GetModelName() const noexcept - { - return ListNamedShadowsForThingResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListNamedShadowsForThingResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListNamedShadowsForThingResponse::s_customDeleter); - shape->m_allocator = allocator; - ListNamedShadowsForThingResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListNamedShadowsForThingResponse::s_customDeleter(ListNamedShadowsForThingResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListNamedShadowsForThingRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_thingName.has_value()) - { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_nextToken.has_value()) - { - payloadObject.WithString("nextToken", m_nextToken.value()); - } - if (m_pageSize.has_value()) - { - payloadObject.WithInteger("pageSize", m_pageSize.value()); - } - } - - void ListNamedShadowsForThingRequest::s_loadFromJsonView( - ListNamedShadowsForThingRequest &listNamedShadowsForThingRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("thingName")) - { - listNamedShadowsForThingRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("nextToken")) - { - listNamedShadowsForThingRequest.m_nextToken = - Aws::Crt::Optional(jsonView.GetString("nextToken")); - } - if (jsonView.ValueExists("pageSize")) - { - listNamedShadowsForThingRequest.m_pageSize = Aws::Crt::Optional(jsonView.GetInteger("pageSize")); - } - } - - const char *ListNamedShadowsForThingRequest::MODEL_NAME = "aws.greengrass#ListNamedShadowsForThingRequest"; - - Aws::Crt::String ListNamedShadowsForThingRequest::GetModelName() const noexcept - { - return ListNamedShadowsForThingRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListNamedShadowsForThingRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListNamedShadowsForThingRequest::s_customDeleter); - shape->m_allocator = allocator; - ListNamedShadowsForThingRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListNamedShadowsForThingRequest::s_customDeleter(ListNamedShadowsForThingRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListLocalDeploymentsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_localDeployments.has_value()) - { - Aws::Crt::JsonObject listOfLocalDeployments; - Aws::Crt::Vector listOfLocalDeploymentsJsonArray; - for (const auto &listOfLocalDeploymentsItem : m_localDeployments.value()) - { - Aws::Crt::JsonObject listOfLocalDeploymentsJsonArrayItem; - listOfLocalDeploymentsItem.SerializeToJsonObject(listOfLocalDeploymentsJsonArrayItem); - listOfLocalDeploymentsJsonArray.emplace_back(std::move(listOfLocalDeploymentsJsonArrayItem)); - } - listOfLocalDeployments.AsArray(std::move(listOfLocalDeploymentsJsonArray)); - payloadObject.WithObject("localDeployments", std::move(listOfLocalDeployments)); - } - } - - void ListLocalDeploymentsResponse::s_loadFromJsonView( - ListLocalDeploymentsResponse &listLocalDeploymentsResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("localDeployments")) - { - listLocalDeploymentsResponse.m_localDeployments = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &listOfLocalDeploymentsJsonView : jsonView.GetArray("localDeployments")) - { - Aws::Crt::Optional listOfLocalDeploymentsItem; - listOfLocalDeploymentsItem = LocalDeployment(); - LocalDeployment::s_loadFromJsonView( - listOfLocalDeploymentsItem.value(), listOfLocalDeploymentsJsonView); - listLocalDeploymentsResponse.m_localDeployments.value().push_back( - listOfLocalDeploymentsItem.value()); - } - } - } - - const char *ListLocalDeploymentsResponse::MODEL_NAME = "aws.greengrass#ListLocalDeploymentsResponse"; - - Aws::Crt::String ListLocalDeploymentsResponse::GetModelName() const noexcept - { - return ListLocalDeploymentsResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListLocalDeploymentsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ListLocalDeploymentsResponse::s_customDeleter); - shape->m_allocator = allocator; - ListLocalDeploymentsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListLocalDeploymentsResponse::s_customDeleter(ListLocalDeploymentsResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListLocalDeploymentsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void ListLocalDeploymentsRequest::s_loadFromJsonView( - ListLocalDeploymentsRequest &listLocalDeploymentsRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)listLocalDeploymentsRequest; - (void)jsonView; - } - - const char *ListLocalDeploymentsRequest::MODEL_NAME = "aws.greengrass#ListLocalDeploymentsRequest"; - - Aws::Crt::String ListLocalDeploymentsRequest::GetModelName() const noexcept - { - return ListLocalDeploymentsRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListLocalDeploymentsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ListLocalDeploymentsRequest::s_customDeleter); - shape->m_allocator = allocator; - ListLocalDeploymentsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListLocalDeploymentsRequest::s_customDeleter(ListLocalDeploymentsRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListComponentsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_components.has_value()) - { - Aws::Crt::JsonObject listOfComponents; - Aws::Crt::Vector listOfComponentsJsonArray; - for (const auto &listOfComponentsItem : m_components.value()) - { - Aws::Crt::JsonObject listOfComponentsJsonArrayItem; - listOfComponentsItem.SerializeToJsonObject(listOfComponentsJsonArrayItem); - listOfComponentsJsonArray.emplace_back(std::move(listOfComponentsJsonArrayItem)); - } - listOfComponents.AsArray(std::move(listOfComponentsJsonArray)); - payloadObject.WithObject("components", std::move(listOfComponents)); - } - } - - void ListComponentsResponse::s_loadFromJsonView( - ListComponentsResponse &listComponentsResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("components")) - { - listComponentsResponse.m_components = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &listOfComponentsJsonView : jsonView.GetArray("components")) - { - Aws::Crt::Optional listOfComponentsItem; - listOfComponentsItem = ComponentDetails(); - ComponentDetails::s_loadFromJsonView(listOfComponentsItem.value(), listOfComponentsJsonView); - listComponentsResponse.m_components.value().push_back(listOfComponentsItem.value()); - } - } - } - - const char *ListComponentsResponse::MODEL_NAME = "aws.greengrass#ListComponentsResponse"; - - Aws::Crt::String ListComponentsResponse::GetModelName() const noexcept - { - return ListComponentsResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListComponentsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ListComponentsResponse::s_customDeleter); - shape->m_allocator = allocator; - ListComponentsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListComponentsResponse::s_customDeleter(ListComponentsResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ListComponentsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void ListComponentsRequest::s_loadFromJsonView( - ListComponentsRequest &listComponentsRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)listComponentsRequest; - (void)jsonView; - } - - const char *ListComponentsRequest::MODEL_NAME = "aws.greengrass#ListComponentsRequest"; - - Aws::Crt::String ListComponentsRequest::GetModelName() const noexcept - { - return ListComponentsRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource ListComponentsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ListComponentsRequest::s_customDeleter); - shape->m_allocator = allocator; - ListComponentsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void ListComponentsRequest::s_customDeleter(ListComponentsRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void GetThingShadowResponse::s_loadFromJsonView( - GetThingShadowResponse &getThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - getThingShadowResponse.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - const char *GetThingShadowResponse::MODEL_NAME = "aws.greengrass#GetThingShadowResponse"; - - Aws::Crt::String GetThingShadowResponse::GetModelName() const noexcept - { - return GetThingShadowResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - GetThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetThingShadowResponse::s_customDeleter(GetThingShadowResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_thingName.has_value()) - { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) - { - payloadObject.WithString("shadowName", m_shadowName.value()); - } - } - - void GetThingShadowRequest::s_loadFromJsonView( - GetThingShadowRequest &getThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("thingName")) - { - getThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) - { - getThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } - } - - const char *GetThingShadowRequest::MODEL_NAME = "aws.greengrass#GetThingShadowRequest"; - - Aws::Crt::String GetThingShadowRequest::GetModelName() const noexcept - { - return GetThingShadowRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - GetThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetThingShadowRequest::s_customDeleter(GetThingShadowRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetSecretValueResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_secretId.has_value()) - { - payloadObject.WithString("secretId", m_secretId.value()); - } - if (m_versionId.has_value()) - { - payloadObject.WithString("versionId", m_versionId.value()); - } - if (m_versionStage.has_value()) - { - Aws::Crt::JsonObject secretVersionList; - Aws::Crt::Vector secretVersionListJsonArray; - for (const auto &secretVersionListItem : m_versionStage.value()) - { - Aws::Crt::JsonObject secretVersionListJsonArrayItem; - secretVersionListJsonArrayItem.AsString(secretVersionListItem); - secretVersionListJsonArray.emplace_back(std::move(secretVersionListJsonArrayItem)); - } - secretVersionList.AsArray(std::move(secretVersionListJsonArray)); - payloadObject.WithObject("versionStage", std::move(secretVersionList)); - } - if (m_secretValue.has_value()) - { - Aws::Crt::JsonObject secretValueValue; - m_secretValue.value().SerializeToJsonObject(secretValueValue); - payloadObject.WithObject("secretValue", std::move(secretValueValue)); - } - } - - void GetSecretValueResponse::s_loadFromJsonView( - GetSecretValueResponse &getSecretValueResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("secretId")) - { - getSecretValueResponse.m_secretId = - Aws::Crt::Optional(jsonView.GetString("secretId")); - } - if (jsonView.ValueExists("versionId")) - { - getSecretValueResponse.m_versionId = - Aws::Crt::Optional(jsonView.GetString("versionId")); - } - if (jsonView.ValueExists("versionStage")) - { - getSecretValueResponse.m_versionStage = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &secretVersionListJsonView : jsonView.GetArray("versionStage")) - { - Aws::Crt::Optional secretVersionListItem; - secretVersionListItem = Aws::Crt::Optional(secretVersionListJsonView.AsString()); - getSecretValueResponse.m_versionStage.value().push_back(secretVersionListItem.value()); - } - } - if (jsonView.ValueExists("secretValue")) - { - getSecretValueResponse.m_secretValue = SecretValue(); - SecretValue::s_loadFromJsonView( - getSecretValueResponse.m_secretValue.value(), jsonView.GetJsonObject("secretValue")); - } - } - - const char *GetSecretValueResponse::MODEL_NAME = "aws.greengrass#GetSecretValueResponse"; - - Aws::Crt::String GetSecretValueResponse::GetModelName() const noexcept - { - return GetSecretValueResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetSecretValueResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetSecretValueResponse::s_customDeleter); - shape->m_allocator = allocator; - GetSecretValueResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetSecretValueResponse::s_customDeleter(GetSecretValueResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetSecretValueRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_secretId.has_value()) - { - payloadObject.WithString("secretId", m_secretId.value()); - } - if (m_versionId.has_value()) - { - payloadObject.WithString("versionId", m_versionId.value()); - } - if (m_versionStage.has_value()) - { - payloadObject.WithString("versionStage", m_versionStage.value()); - } - } - - void GetSecretValueRequest::s_loadFromJsonView( - GetSecretValueRequest &getSecretValueRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("secretId")) - { - getSecretValueRequest.m_secretId = Aws::Crt::Optional(jsonView.GetString("secretId")); - } - if (jsonView.ValueExists("versionId")) - { - getSecretValueRequest.m_versionId = - Aws::Crt::Optional(jsonView.GetString("versionId")); - } - if (jsonView.ValueExists("versionStage")) - { - getSecretValueRequest.m_versionStage = - Aws::Crt::Optional(jsonView.GetString("versionStage")); - } - } - - const char *GetSecretValueRequest::MODEL_NAME = "aws.greengrass#GetSecretValueRequest"; - - Aws::Crt::String GetSecretValueRequest::GetModelName() const noexcept - { - return GetSecretValueRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetSecretValueRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetSecretValueRequest::s_customDeleter); - shape->m_allocator = allocator; - GetSecretValueRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetSecretValueRequest::s_customDeleter(GetSecretValueRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetLocalDeploymentStatusResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deployment.has_value()) - { - Aws::Crt::JsonObject localDeploymentValue; - m_deployment.value().SerializeToJsonObject(localDeploymentValue); - payloadObject.WithObject("deployment", std::move(localDeploymentValue)); - } - } - - void GetLocalDeploymentStatusResponse::s_loadFromJsonView( - GetLocalDeploymentStatusResponse &getLocalDeploymentStatusResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deployment")) - { - getLocalDeploymentStatusResponse.m_deployment = LocalDeployment(); - LocalDeployment::s_loadFromJsonView( - getLocalDeploymentStatusResponse.m_deployment.value(), jsonView.GetJsonObject("deployment")); - } - } - - const char *GetLocalDeploymentStatusResponse::MODEL_NAME = "aws.greengrass#GetLocalDeploymentStatusResponse"; - - Aws::Crt::String GetLocalDeploymentStatusResponse::GetModelName() const noexcept - { - return GetLocalDeploymentStatusResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetLocalDeploymentStatusResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetLocalDeploymentStatusResponse::s_customDeleter); - shape->m_allocator = allocator; - GetLocalDeploymentStatusResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetLocalDeploymentStatusResponse::s_customDeleter(GetLocalDeploymentStatusResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetLocalDeploymentStatusRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - } - - void GetLocalDeploymentStatusRequest::s_loadFromJsonView( - GetLocalDeploymentStatusRequest &getLocalDeploymentStatusRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - getLocalDeploymentStatusRequest.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - } - - const char *GetLocalDeploymentStatusRequest::MODEL_NAME = "aws.greengrass#GetLocalDeploymentStatusRequest"; - - Aws::Crt::String GetLocalDeploymentStatusRequest::GetModelName() const noexcept - { - return GetLocalDeploymentStatusRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetLocalDeploymentStatusRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetLocalDeploymentStatusRequest::s_customDeleter); - shape->m_allocator = allocator; - GetLocalDeploymentStatusRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetLocalDeploymentStatusRequest::s_customDeleter(GetLocalDeploymentStatusRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetConfigurationResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_value.has_value()) - { - payloadObject.WithObject("value", m_value.value()); - } - } - - void GetConfigurationResponse::s_loadFromJsonView( - GetConfigurationResponse &getConfigurationResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - getConfigurationResponse.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("value")) - { - getConfigurationResponse.m_value = - Aws::Crt::Optional(jsonView.GetJsonObject("value").Materialize()); - } - } - - const char *GetConfigurationResponse::MODEL_NAME = "aws.greengrass#GetConfigurationResponse"; - - Aws::Crt::String GetConfigurationResponse::GetModelName() const noexcept - { - return GetConfigurationResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetConfigurationResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetConfigurationResponse::s_customDeleter); - shape->m_allocator = allocator; - GetConfigurationResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetConfigurationResponse::s_customDeleter(GetConfigurationResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetConfigurationRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) - { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) - { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } - } - - void GetConfigurationRequest::s_loadFromJsonView( - GetConfigurationRequest &getConfigurationRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - getConfigurationRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) - { - getConfigurationRequest.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) - { - Aws::Crt::Optional keyPathItem; - keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); - getConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); - } - } - } - - const char *GetConfigurationRequest::MODEL_NAME = "aws.greengrass#GetConfigurationRequest"; - - Aws::Crt::String GetConfigurationRequest::GetModelName() const noexcept - { - return GetConfigurationRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetConfigurationRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetConfigurationRequest::s_customDeleter); - shape->m_allocator = allocator; - GetConfigurationRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetConfigurationRequest::s_customDeleter(GetConfigurationRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetComponentDetailsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentDetails.has_value()) - { - Aws::Crt::JsonObject componentDetailsValue; - m_componentDetails.value().SerializeToJsonObject(componentDetailsValue); - payloadObject.WithObject("componentDetails", std::move(componentDetailsValue)); - } - } - - void GetComponentDetailsResponse::s_loadFromJsonView( - GetComponentDetailsResponse &getComponentDetailsResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentDetails")) - { - getComponentDetailsResponse.m_componentDetails = ComponentDetails(); - ComponentDetails::s_loadFromJsonView( - getComponentDetailsResponse.m_componentDetails.value(), jsonView.GetJsonObject("componentDetails")); - } - } - - const char *GetComponentDetailsResponse::MODEL_NAME = "aws.greengrass#GetComponentDetailsResponse"; - - Aws::Crt::String GetComponentDetailsResponse::GetModelName() const noexcept - { - return GetComponentDetailsResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetComponentDetailsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetComponentDetailsResponse::s_customDeleter); - shape->m_allocator = allocator; - GetComponentDetailsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetComponentDetailsResponse::s_customDeleter(GetComponentDetailsResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetComponentDetailsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_componentName.has_value()) - { - payloadObject.WithString("componentName", m_componentName.value()); - } - } - - void GetComponentDetailsRequest::s_loadFromJsonView( - GetComponentDetailsRequest &getComponentDetailsRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("componentName")) - { - getComponentDetailsRequest.m_componentName = - Aws::Crt::Optional(jsonView.GetString("componentName")); - } - } - - const char *GetComponentDetailsRequest::MODEL_NAME = "aws.greengrass#GetComponentDetailsRequest"; - - Aws::Crt::String GetComponentDetailsRequest::GetModelName() const noexcept - { - return GetComponentDetailsRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetComponentDetailsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), GetComponentDetailsRequest::s_customDeleter); - shape->m_allocator = allocator; - GetComponentDetailsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetComponentDetailsRequest::s_customDeleter(GetComponentDetailsRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void InvalidCredentialError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidCredentialError::s_loadFromJsonView( - InvalidCredentialError &invalidCredentialError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidCredentialError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidCredentialError::MODEL_NAME = "aws.greengrass#InvalidCredentialError"; - - Aws::Crt::String InvalidCredentialError::GetModelName() const noexcept - { - return InvalidCredentialError::MODEL_NAME; - } - - Aws::Crt::ScopedResource InvalidCredentialError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), InvalidCredentialError::s_customDeleter); - shape->m_allocator = allocator; - InvalidCredentialError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidCredentialError::s_customDeleter(InvalidCredentialError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void GetClientDeviceAuthTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_clientDeviceAuthToken.has_value()) - { - payloadObject.WithString("clientDeviceAuthToken", m_clientDeviceAuthToken.value()); - } - } - - void GetClientDeviceAuthTokenResponse::s_loadFromJsonView( - GetClientDeviceAuthTokenResponse &getClientDeviceAuthTokenResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("clientDeviceAuthToken")) - { - getClientDeviceAuthTokenResponse.m_clientDeviceAuthToken = - Aws::Crt::Optional(jsonView.GetString("clientDeviceAuthToken")); - } - } - - const char *GetClientDeviceAuthTokenResponse::MODEL_NAME = "aws.greengrass#GetClientDeviceAuthTokenResponse"; - - Aws::Crt::String GetClientDeviceAuthTokenResponse::GetModelName() const noexcept - { - return GetClientDeviceAuthTokenResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetClientDeviceAuthTokenResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetClientDeviceAuthTokenResponse::s_customDeleter); - shape->m_allocator = allocator; - GetClientDeviceAuthTokenResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetClientDeviceAuthTokenResponse::s_customDeleter(GetClientDeviceAuthTokenResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void GetClientDeviceAuthTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_credential.has_value()) - { - Aws::Crt::JsonObject credentialDocumentValue; - m_credential.value().SerializeToJsonObject(credentialDocumentValue); - payloadObject.WithObject("credential", std::move(credentialDocumentValue)); - } - } - - void GetClientDeviceAuthTokenRequest::s_loadFromJsonView( - GetClientDeviceAuthTokenRequest &getClientDeviceAuthTokenRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("credential")) - { - getClientDeviceAuthTokenRequest.m_credential = CredentialDocument(); - CredentialDocument::s_loadFromJsonView( - getClientDeviceAuthTokenRequest.m_credential.value(), jsonView.GetJsonObject("credential")); - } - } - - const char *GetClientDeviceAuthTokenRequest::MODEL_NAME = "aws.greengrass#GetClientDeviceAuthTokenRequest"; - - Aws::Crt::String GetClientDeviceAuthTokenRequest::GetModelName() const noexcept - { - return GetClientDeviceAuthTokenRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource GetClientDeviceAuthTokenRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetClientDeviceAuthTokenRequest::s_customDeleter); - shape->m_allocator = allocator; - GetClientDeviceAuthTokenRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void GetClientDeviceAuthTokenRequest::s_customDeleter(GetClientDeviceAuthTokenRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void DeleteThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_payload.has_value()) - { - if (m_payload.value().size() > 0) - { - payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); - } - } - } - - void DeleteThingShadowResponse::s_loadFromJsonView( - DeleteThingShadowResponse &deleteThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("payload")) - { - if (jsonView.GetString("payload").size() > 0) - { - deleteThingShadowResponse.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } - } - - const char *DeleteThingShadowResponse::MODEL_NAME = "aws.greengrass#DeleteThingShadowResponse"; - - Aws::Crt::String DeleteThingShadowResponse::GetModelName() const noexcept - { - return DeleteThingShadowResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource DeleteThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), DeleteThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - DeleteThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void DeleteThingShadowResponse::s_customDeleter(DeleteThingShadowResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void DeleteThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_thingName.has_value()) - { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) - { - payloadObject.WithString("shadowName", m_shadowName.value()); - } - } - - void DeleteThingShadowRequest::s_loadFromJsonView( - DeleteThingShadowRequest &deleteThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("thingName")) - { - deleteThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) - { - deleteThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } - } - - const char *DeleteThingShadowRequest::MODEL_NAME = "aws.greengrass#DeleteThingShadowRequest"; - - Aws::Crt::String DeleteThingShadowRequest::GetModelName() const noexcept - { - return DeleteThingShadowRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource DeleteThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), DeleteThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - DeleteThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void DeleteThingShadowRequest::s_customDeleter(DeleteThingShadowRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void ResourceNotFoundError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - if (m_resourceType.has_value()) - { - payloadObject.WithString("resourceType", m_resourceType.value()); - } - if (m_resourceName.has_value()) - { - payloadObject.WithString("resourceName", m_resourceName.value()); - } - } - - void ResourceNotFoundError::s_loadFromJsonView( - ResourceNotFoundError &resourceNotFoundError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - resourceNotFoundError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("resourceType")) - { - resourceNotFoundError.m_resourceType = - Aws::Crt::Optional(jsonView.GetString("resourceType")); - } - if (jsonView.ValueExists("resourceName")) - { - resourceNotFoundError.m_resourceName = - Aws::Crt::Optional(jsonView.GetString("resourceName")); - } - } - - const char *ResourceNotFoundError::MODEL_NAME = "aws.greengrass#ResourceNotFoundError"; - - Aws::Crt::String ResourceNotFoundError::GetModelName() const noexcept - { - return ResourceNotFoundError::MODEL_NAME; - } - - Aws::Crt::ScopedResource ResourceNotFoundError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ResourceNotFoundError::s_customDeleter); - shape->m_allocator = allocator; - ResourceNotFoundError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void ResourceNotFoundError::s_customDeleter(ResourceNotFoundError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void DeferComponentUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void DeferComponentUpdateResponse::s_loadFromJsonView( - DeferComponentUpdateResponse &deferComponentUpdateResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)deferComponentUpdateResponse; - (void)jsonView; - } - - const char *DeferComponentUpdateResponse::MODEL_NAME = "aws.greengrass#DeferComponentUpdateResponse"; - - Aws::Crt::String DeferComponentUpdateResponse::GetModelName() const noexcept - { - return DeferComponentUpdateResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource DeferComponentUpdateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), DeferComponentUpdateResponse::s_customDeleter); - shape->m_allocator = allocator; - DeferComponentUpdateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void DeferComponentUpdateResponse::s_customDeleter(DeferComponentUpdateResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void DeferComponentUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - if (m_recheckAfterMs.has_value()) - { - payloadObject.WithInt64("recheckAfterMs", m_recheckAfterMs.value()); - } - } - - void DeferComponentUpdateRequest::s_loadFromJsonView( - DeferComponentUpdateRequest &deferComponentUpdateRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - deferComponentUpdateRequest.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("message")) - { - deferComponentUpdateRequest.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("recheckAfterMs")) - { - deferComponentUpdateRequest.m_recheckAfterMs = - Aws::Crt::Optional(jsonView.GetInt64("recheckAfterMs")); - } - } - - const char *DeferComponentUpdateRequest::MODEL_NAME = "aws.greengrass#DeferComponentUpdateRequest"; - - Aws::Crt::String DeferComponentUpdateRequest::GetModelName() const noexcept - { - return DeferComponentUpdateRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource DeferComponentUpdateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), DeferComponentUpdateRequest::s_customDeleter); - shape->m_allocator = allocator; - DeferComponentUpdateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void DeferComponentUpdateRequest::s_customDeleter(DeferComponentUpdateRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void InvalidArtifactsDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidArtifactsDirectoryPathError::s_loadFromJsonView( - InvalidArtifactsDirectoryPathError &invalidArtifactsDirectoryPathError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidArtifactsDirectoryPathError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidArtifactsDirectoryPathError::MODEL_NAME = - "aws.greengrass#InvalidArtifactsDirectoryPathError"; - - Aws::Crt::String InvalidArtifactsDirectoryPathError::GetModelName() const noexcept - { - return InvalidArtifactsDirectoryPathError::MODEL_NAME; - } - - Aws::Crt::ScopedResource InvalidArtifactsDirectoryPathError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidArtifactsDirectoryPathError::s_customDeleter); - shape->m_allocator = allocator; - InvalidArtifactsDirectoryPathError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidArtifactsDirectoryPathError::s_customDeleter(InvalidArtifactsDirectoryPathError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void InvalidRecipeDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidRecipeDirectoryPathError::s_loadFromJsonView( - InvalidRecipeDirectoryPathError &invalidRecipeDirectoryPathError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidRecipeDirectoryPathError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidRecipeDirectoryPathError::MODEL_NAME = "aws.greengrass#InvalidRecipeDirectoryPathError"; - - Aws::Crt::String InvalidRecipeDirectoryPathError::GetModelName() const noexcept - { - return InvalidRecipeDirectoryPathError::MODEL_NAME; - } - - Aws::Crt::ScopedResource InvalidRecipeDirectoryPathError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidRecipeDirectoryPathError::s_customDeleter); - shape->m_allocator = allocator; - InvalidRecipeDirectoryPathError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidRecipeDirectoryPathError::s_customDeleter(InvalidRecipeDirectoryPathError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void CreateLocalDeploymentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_deploymentId.has_value()) - { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - } - - void CreateLocalDeploymentResponse::s_loadFromJsonView( - CreateLocalDeploymentResponse &createLocalDeploymentResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("deploymentId")) - { - createLocalDeploymentResponse.m_deploymentId = - Aws::Crt::Optional(jsonView.GetString("deploymentId")); - } - } - - const char *CreateLocalDeploymentResponse::MODEL_NAME = "aws.greengrass#CreateLocalDeploymentResponse"; - - Aws::Crt::String CreateLocalDeploymentResponse::GetModelName() const noexcept - { - return CreateLocalDeploymentResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource CreateLocalDeploymentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CreateLocalDeploymentResponse::s_customDeleter); - shape->m_allocator = allocator; - CreateLocalDeploymentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CreateLocalDeploymentResponse::s_customDeleter(CreateLocalDeploymentResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CreateLocalDeploymentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_groupName.has_value()) - { - payloadObject.WithString("groupName", m_groupName.value()); - } - if (m_rootComponentVersionsToAdd.has_value()) - { - Aws::Crt::JsonObject componentToVersionMapValue; - for (const auto &componentToVersionMapItem : m_rootComponentVersionsToAdd.value()) - { - Aws::Crt::JsonObject componentToVersionMapJsonObject; - componentToVersionMapJsonObject.AsString(componentToVersionMapItem.second); - componentToVersionMapValue.WithObject( - componentToVersionMapItem.first, std::move(componentToVersionMapJsonObject)); - } - payloadObject.WithObject("rootComponentVersionsToAdd", std::move(componentToVersionMapValue)); - } - if (m_rootComponentsToRemove.has_value()) - { - Aws::Crt::JsonObject componentList; - Aws::Crt::Vector componentListJsonArray; - for (const auto &componentListItem : m_rootComponentsToRemove.value()) - { - Aws::Crt::JsonObject componentListJsonArrayItem; - componentListJsonArrayItem.AsString(componentListItem); - componentListJsonArray.emplace_back(std::move(componentListJsonArrayItem)); - } - componentList.AsArray(std::move(componentListJsonArray)); - payloadObject.WithObject("rootComponentsToRemove", std::move(componentList)); - } - if (m_componentToConfiguration.has_value()) - { - Aws::Crt::JsonObject componentToConfigurationValue; - for (const auto &componentToConfigurationItem : m_componentToConfiguration.value()) - { - Aws::Crt::JsonObject componentToConfigurationJsonObject; - componentToConfigurationJsonObject.AsObject(componentToConfigurationItem.second); - componentToConfigurationValue.WithObject( - componentToConfigurationItem.first, std::move(componentToConfigurationJsonObject)); - } - payloadObject.WithObject("componentToConfiguration", std::move(componentToConfigurationValue)); - } - if (m_componentToRunWithInfo.has_value()) - { - Aws::Crt::JsonObject componentToRunWithInfoValue; - for (const auto &componentToRunWithInfoItem : m_componentToRunWithInfo.value()) - { - Aws::Crt::JsonObject componentToRunWithInfoJsonObject; - componentToRunWithInfoItem.second.SerializeToJsonObject(componentToRunWithInfoJsonObject); - componentToRunWithInfoValue.WithObject( - componentToRunWithInfoItem.first, std::move(componentToRunWithInfoJsonObject)); - } - payloadObject.WithObject("componentToRunWithInfo", std::move(componentToRunWithInfoValue)); - } - if (m_recipeDirectoryPath.has_value()) - { - payloadObject.WithString("recipeDirectoryPath", m_recipeDirectoryPath.value()); - } - if (m_artifactsDirectoryPath.has_value()) - { - payloadObject.WithString("artifactsDirectoryPath", m_artifactsDirectoryPath.value()); - } - } - - void CreateLocalDeploymentRequest::s_loadFromJsonView( - CreateLocalDeploymentRequest &createLocalDeploymentRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("groupName")) - { - createLocalDeploymentRequest.m_groupName = - Aws::Crt::Optional(jsonView.GetString("groupName")); - } - if (jsonView.ValueExists("rootComponentVersionsToAdd")) - { - createLocalDeploymentRequest.m_rootComponentVersionsToAdd = - Aws::Crt::Map(); - for (const auto &componentToVersionMapPair : - jsonView.GetJsonObject("rootComponentVersionsToAdd").GetAllObjects()) - { - Aws::Crt::Optional componentToVersionMapValue; - componentToVersionMapValue = - Aws::Crt::Optional(componentToVersionMapPair.second.AsString()); - createLocalDeploymentRequest.m_rootComponentVersionsToAdd.value()[componentToVersionMapPair.first] = - componentToVersionMapValue.value(); - } - } - if (jsonView.ValueExists("rootComponentsToRemove")) - { - createLocalDeploymentRequest.m_rootComponentsToRemove = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &componentListJsonView : jsonView.GetArray("rootComponentsToRemove")) - { - Aws::Crt::Optional componentListItem; - componentListItem = Aws::Crt::Optional(componentListJsonView.AsString()); - createLocalDeploymentRequest.m_rootComponentsToRemove.value().push_back(componentListItem.value()); - } - } - if (jsonView.ValueExists("componentToConfiguration")) - { - createLocalDeploymentRequest.m_componentToConfiguration = - Aws::Crt::Map(); - for (const auto &componentToConfigurationPair : - jsonView.GetJsonObject("componentToConfiguration").GetAllObjects()) - { - Aws::Crt::Optional componentToConfigurationValue; - componentToConfigurationValue = Aws::Crt::Optional( - componentToConfigurationPair.second.AsObject().Materialize()); - createLocalDeploymentRequest.m_componentToConfiguration - .value()[componentToConfigurationPair.first] = componentToConfigurationValue.value(); - } - } - if (jsonView.ValueExists("componentToRunWithInfo")) - { - createLocalDeploymentRequest.m_componentToRunWithInfo = Aws::Crt::Map(); - for (const auto &componentToRunWithInfoPair : - jsonView.GetJsonObject("componentToRunWithInfo").GetAllObjects()) - { - Aws::Crt::Optional componentToRunWithInfoValue; - componentToRunWithInfoValue = RunWithInfo(); - RunWithInfo::s_loadFromJsonView( - componentToRunWithInfoValue.value(), componentToRunWithInfoPair.second); - createLocalDeploymentRequest.m_componentToRunWithInfo.value()[componentToRunWithInfoPair.first] = - componentToRunWithInfoValue.value(); - } - } - if (jsonView.ValueExists("recipeDirectoryPath")) - { - createLocalDeploymentRequest.m_recipeDirectoryPath = - Aws::Crt::Optional(jsonView.GetString("recipeDirectoryPath")); - } - if (jsonView.ValueExists("artifactsDirectoryPath")) - { - createLocalDeploymentRequest.m_artifactsDirectoryPath = - Aws::Crt::Optional(jsonView.GetString("artifactsDirectoryPath")); - } - } - - const char *CreateLocalDeploymentRequest::MODEL_NAME = "aws.greengrass#CreateLocalDeploymentRequest"; - - Aws::Crt::String CreateLocalDeploymentRequest::GetModelName() const noexcept - { - return CreateLocalDeploymentRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource CreateLocalDeploymentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CreateLocalDeploymentRequest::s_customDeleter); - shape->m_allocator = allocator; - CreateLocalDeploymentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CreateLocalDeploymentRequest::s_customDeleter(CreateLocalDeploymentRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CreateDebugPasswordResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_password.has_value()) - { - payloadObject.WithString("password", m_password.value()); - } - if (m_username.has_value()) - { - payloadObject.WithString("username", m_username.value()); - } - if (m_passwordExpiration.has_value()) - { - payloadObject.WithDouble("passwordExpiration", m_passwordExpiration.value().SecondsWithMSPrecision()); - } - if (m_certificateSHA256Hash.has_value()) - { - payloadObject.WithString("certificateSHA256Hash", m_certificateSHA256Hash.value()); - } - if (m_certificateSHA1Hash.has_value()) - { - payloadObject.WithString("certificateSHA1Hash", m_certificateSHA1Hash.value()); - } - } - - void CreateDebugPasswordResponse::s_loadFromJsonView( - CreateDebugPasswordResponse &createDebugPasswordResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("password")) - { - createDebugPasswordResponse.m_password = - Aws::Crt::Optional(jsonView.GetString("password")); - } - if (jsonView.ValueExists("username")) - { - createDebugPasswordResponse.m_username = - Aws::Crt::Optional(jsonView.GetString("username")); - } - if (jsonView.ValueExists("passwordExpiration")) - { - createDebugPasswordResponse.m_passwordExpiration = Aws::Crt::Optional( - Aws::Crt::DateTime(jsonView.GetDouble("passwordExpiration"))); - } - if (jsonView.ValueExists("certificateSHA256Hash")) - { - createDebugPasswordResponse.m_certificateSHA256Hash = - Aws::Crt::Optional(jsonView.GetString("certificateSHA256Hash")); - } - if (jsonView.ValueExists("certificateSHA1Hash")) - { - createDebugPasswordResponse.m_certificateSHA1Hash = - Aws::Crt::Optional(jsonView.GetString("certificateSHA1Hash")); - } - } - - const char *CreateDebugPasswordResponse::MODEL_NAME = "aws.greengrass#CreateDebugPasswordResponse"; - - Aws::Crt::String CreateDebugPasswordResponse::GetModelName() const noexcept - { - return CreateDebugPasswordResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource CreateDebugPasswordResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CreateDebugPasswordResponse::s_customDeleter); - shape->m_allocator = allocator; - CreateDebugPasswordResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CreateDebugPasswordResponse::s_customDeleter(CreateDebugPasswordResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void CreateDebugPasswordRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - (void)payloadObject; - } - - void CreateDebugPasswordRequest::s_loadFromJsonView( - CreateDebugPasswordRequest &createDebugPasswordRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - (void)createDebugPasswordRequest; - (void)jsonView; - } - - const char *CreateDebugPasswordRequest::MODEL_NAME = "aws.greengrass#CreateDebugPasswordRequest"; - - Aws::Crt::String CreateDebugPasswordRequest::GetModelName() const noexcept - { - return CreateDebugPasswordRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource CreateDebugPasswordRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), CreateDebugPasswordRequest::s_customDeleter); - shape->m_allocator = allocator; - CreateDebugPasswordRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void CreateDebugPasswordRequest::s_customDeleter(CreateDebugPasswordRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void InvalidClientDeviceAuthTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidClientDeviceAuthTokenError::s_loadFromJsonView( - InvalidClientDeviceAuthTokenError &invalidClientDeviceAuthTokenError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidClientDeviceAuthTokenError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidClientDeviceAuthTokenError::MODEL_NAME = "aws.greengrass#InvalidClientDeviceAuthTokenError"; - - Aws::Crt::String InvalidClientDeviceAuthTokenError::GetModelName() const noexcept - { - return InvalidClientDeviceAuthTokenError::MODEL_NAME; - } - - Aws::Crt::ScopedResource InvalidClientDeviceAuthTokenError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidClientDeviceAuthTokenError::s_customDeleter); - shape->m_allocator = allocator; - InvalidClientDeviceAuthTokenError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidClientDeviceAuthTokenError::s_customDeleter(InvalidClientDeviceAuthTokenError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void InvalidArgumentsError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void InvalidArgumentsError::s_loadFromJsonView( - InvalidArgumentsError &invalidArgumentsError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - invalidArgumentsError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *InvalidArgumentsError::MODEL_NAME = "aws.greengrass#InvalidArgumentsError"; - - Aws::Crt::String InvalidArgumentsError::GetModelName() const noexcept - { - return InvalidArgumentsError::MODEL_NAME; - } - - Aws::Crt::ScopedResource InvalidArgumentsError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), InvalidArgumentsError::s_customDeleter); - shape->m_allocator = allocator; - InvalidArgumentsError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void InvalidArgumentsError::s_customDeleter(InvalidArgumentsError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void ServiceError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void ServiceError::s_loadFromJsonView(ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - serviceError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; - - Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } - - Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ServiceError::s_customDeleter); - shape->m_allocator = allocator; - ServiceError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void ServiceError::s_customDeleter(ServiceError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void UnauthorizedError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_message.has_value()) - { - payloadObject.WithString("message", m_message.value()); - } - } - - void UnauthorizedError::s_loadFromJsonView( - UnauthorizedError &unauthorizedError, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("message")) - { - unauthorizedError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); - } - } - - const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; - - Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { return UnauthorizedError::MODEL_NAME; } - - Aws::Crt::ScopedResource UnauthorizedError::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), UnauthorizedError::s_customDeleter); - shape->m_allocator = allocator; - UnauthorizedError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); - } - - void UnauthorizedError::s_customDeleter(UnauthorizedError *shape) noexcept - { - OperationError::s_customDeleter(static_cast(shape)); - } - - void AuthorizeClientDeviceActionResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_isAuthorized.has_value()) - { - payloadObject.WithBool("isAuthorized", m_isAuthorized.value()); - } - } - - void AuthorizeClientDeviceActionResponse::s_loadFromJsonView( - AuthorizeClientDeviceActionResponse &authorizeClientDeviceActionResponse, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("isAuthorized")) - { - authorizeClientDeviceActionResponse.m_isAuthorized = - Aws::Crt::Optional(jsonView.GetBool("isAuthorized")); - } - } - - const char *AuthorizeClientDeviceActionResponse::MODEL_NAME = - "aws.greengrass#AuthorizeClientDeviceActionResponse"; - - Aws::Crt::String AuthorizeClientDeviceActionResponse::GetModelName() const noexcept - { - return AuthorizeClientDeviceActionResponse::MODEL_NAME; - } - - Aws::Crt::ScopedResource AuthorizeClientDeviceActionResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - AuthorizeClientDeviceActionResponse::s_customDeleter); - shape->m_allocator = allocator; - AuthorizeClientDeviceActionResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void AuthorizeClientDeviceActionResponse::s_customDeleter(AuthorizeClientDeviceActionResponse *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void AuthorizeClientDeviceActionRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const - noexcept - { - if (m_clientDeviceAuthToken.has_value()) - { - payloadObject.WithString("clientDeviceAuthToken", m_clientDeviceAuthToken.value()); - } - if (m_operation.has_value()) - { - payloadObject.WithString("operation", m_operation.value()); - } - if (m_resource.has_value()) - { - payloadObject.WithString("resource", m_resource.value()); - } - } - - void AuthorizeClientDeviceActionRequest::s_loadFromJsonView( - AuthorizeClientDeviceActionRequest &authorizeClientDeviceActionRequest, - const Aws::Crt::JsonView &jsonView) noexcept - { - if (jsonView.ValueExists("clientDeviceAuthToken")) - { - authorizeClientDeviceActionRequest.m_clientDeviceAuthToken = - Aws::Crt::Optional(jsonView.GetString("clientDeviceAuthToken")); - } - if (jsonView.ValueExists("operation")) - { - authorizeClientDeviceActionRequest.m_operation = - Aws::Crt::Optional(jsonView.GetString("operation")); - } - if (jsonView.ValueExists("resource")) - { - authorizeClientDeviceActionRequest.m_resource = - Aws::Crt::Optional(jsonView.GetString("resource")); - } - } - - const char *AuthorizeClientDeviceActionRequest::MODEL_NAME = - "aws.greengrass#AuthorizeClientDeviceActionRequest"; - - Aws::Crt::String AuthorizeClientDeviceActionRequest::GetModelName() const noexcept - { - return AuthorizeClientDeviceActionRequest::MODEL_NAME; - } - - Aws::Crt::ScopedResource AuthorizeClientDeviceActionRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept - { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - AuthorizeClientDeviceActionRequest::s_customDeleter); - shape->m_allocator = allocator; - AuthorizeClientDeviceActionRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); - } - - void AuthorizeClientDeviceActionRequest::s_customDeleter(AuthorizeClientDeviceActionRequest *shape) noexcept - { - AbstractShapeBase::s_customDeleter(static_cast(shape)); - } - - void SubscribeToIoTCoreStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToIoTCoreStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToIoTCoreOperationContext::SubscribeToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToIoTCoreOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreRequest"); - } - - Aws::Crt::String SubscribeToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); - } - - Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); - } - - Aws::Crt::String SubscribeToIoTCoreOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCore"); - } - - std::future SubscribeToIoTCoreOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); - } - } - - SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToIoTCoreOperation::Activate( - const SubscribeToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToIoTCoreOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - ResumeComponentOperationContext::ResumeComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource ResumeComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return ResumeComponentResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource ResumeComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String ResumeComponentOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ResumeComponentRequest"); - } - - Aws::Crt::String ResumeComponentOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); - } - - Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String ResumeComponentOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ResumeComponent"); - } - - std::future ResumeComponentOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); - } - } - - ResumeComponentOperation::ResumeComponentOperation( - ClientConnection &connection, - const ResumeComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future ResumeComponentOperation::Activate( - const ResumeComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String ResumeComponentOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - PublishToIoTCoreOperationContext::PublishToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String PublishToIoTCoreOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToIoTCoreRequest"); - } - - Aws::Crt::String PublishToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); - } - - Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String PublishToIoTCoreOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToIoTCore"); - } - - std::future PublishToIoTCoreOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); - } - } - - PublishToIoTCoreOperation::PublishToIoTCoreOperation( - ClientConnection &connection, - const PublishToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future PublishToIoTCoreOperation::Activate( - const PublishToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String PublishToIoTCoreOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void SubscribeToConfigurationUpdateStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToConfigurationUpdateStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToConfigurationUpdateOperationContext::SubscribeToConfigurationUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdateRequest"); - } - - Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdateResponse"); - } - - Aws::Crt::Optional SubscribeToConfigurationUpdateOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ConfigurationUpdateEvents"); - } - - Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdate"); - } - - std::future SubscribeToConfigurationUpdateOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); - } - } - - SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToConfigurationUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToConfigurationUpdateOperation::Activate( - const SubscribeToConfigurationUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToConfigurationUpdateOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - DeleteThingShadowOperationContext::DeleteThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return DeleteThingShadowResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String DeleteThingShadowOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeleteThingShadowRequest"); - } - - Aws::Crt::String DeleteThingShadowOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); - } - - Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String DeleteThingShadowOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeleteThingShadow"); - } - - std::future DeleteThingShadowOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); - } - } - - DeleteThingShadowOperation::DeleteThingShadowOperation( - ClientConnection &connection, - const DeleteThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future DeleteThingShadowOperation::Activate( - const DeleteThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String DeleteThingShadowOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - PutComponentMetricOperationContext::PutComponentMetricOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return PutComponentMetricResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource PutComponentMetricOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String PutComponentMetricOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PutComponentMetricRequest"); - } - - Aws::Crt::String PutComponentMetricOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); - } - - Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String PutComponentMetricOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PutComponentMetric"); - } - - std::future PutComponentMetricOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); - } - } - - PutComponentMetricOperation::PutComponentMetricOperation( - ClientConnection &connection, - const PutComponentMetricOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future PutComponentMetricOperation::Activate( - const PutComponentMetricRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String PutComponentMetricOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - DeferComponentUpdateOperationContext::DeferComponentUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String DeferComponentUpdateOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdateRequest"); - } - - Aws::Crt::String DeferComponentUpdateOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); - } - - Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String DeferComponentUpdateOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdate"); - } - - std::future DeferComponentUpdateOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); - } - } - - DeferComponentUpdateOperation::DeferComponentUpdateOperation( - ClientConnection &connection, - const DeferComponentUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future DeferComponentUpdateOperation::Activate( - const DeferComponentUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String DeferComponentUpdateOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToValidateConfigurationUpdatesOperationContext:: - SubscribeToValidateConfigurationUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); - } - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() const - noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); - } - - Aws::Crt::Optional SubscribeToValidateConfigurationUpdatesOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ValidateConfigurationUpdateEvents"); - } - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdates"); - } - - std::future SubscribeToValidateConfigurationUpdatesOperation:: - GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); - }); - } - } - - SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToValidateConfigurationUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToValidateConfigurationUpdatesOperation::Activate( - const SubscribeToValidateConfigurationUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetConfigurationOperationContext::GetConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetConfigurationOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetConfigurationRequest"); - } - - Aws::Crt::String GetConfigurationOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); - } - - Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetConfigurationOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetConfiguration"); - } - - std::future GetConfigurationOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); - } - } - - GetConfigurationOperation::GetConfigurationOperation( - ClientConnection &connection, - const GetConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetConfigurationOperation::Activate( - const GetConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetConfigurationOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void SubscribeToTopicStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToTopicStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToTopicOperationContext::SubscribeToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscriptionResponseMessage::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToTopicOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToTopicRequest"); - } - - Aws::Crt::String SubscribeToTopicOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); - } - - Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); - } - - Aws::Crt::String SubscribeToTopicOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToTopic"); - } - - std::future SubscribeToTopicOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); - } - } - - SubscribeToTopicOperation::SubscribeToTopicOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToTopicOperation::Activate( - const SubscribeToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToTopicOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetComponentDetailsOperationContext::GetComponentDetailsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return GetComponentDetailsResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetComponentDetailsOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetComponentDetailsRequest"); - } - - Aws::Crt::String GetComponentDetailsOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); - } - - Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetComponentDetailsOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetComponentDetails"); - } - - std::future GetComponentDetailsOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); - } - } - - GetComponentDetailsOperation::GetComponentDetailsOperation( - ClientConnection &connection, - const GetComponentDetailsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetComponentDetailsOperation::Activate( - const GetComponentDetailsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetComponentDetailsOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetClientDeviceAuthTokenOperationContext::GetClientDeviceAuthTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenRequest"); - } - - Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenResponse"); - } - - Aws::Crt::Optional GetClientDeviceAuthTokenOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthToken"); - } - - std::future GetClientDeviceAuthTokenOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return GetClientDeviceAuthTokenResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return GetClientDeviceAuthTokenResult(GetOperationResult().get()); - }); - } - } - - GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( - ClientConnection &connection, - const GetClientDeviceAuthTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetClientDeviceAuthTokenOperation::Activate( - const GetClientDeviceAuthTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetClientDeviceAuthTokenOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - PublishToTopicOperationContext::PublishToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource PublishToTopicOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return PublishToTopicResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource PublishToTopicOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String PublishToTopicOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToTopicRequest"); - } - - Aws::Crt::String PublishToTopicOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); - } - - Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String PublishToTopicOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PublishToTopic"); - } - - std::future PublishToTopicOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); - } - } - - PublishToTopicOperation::PublishToTopicOperation( - ClientConnection &connection, - const PublishToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future PublishToTopicOperation::Activate( - const PublishToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String PublishToTopicOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void SubscribeToCertificateUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToCertificateUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToCertificateUpdatesOperationContext::SubscribeToCertificateUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdatesRequest"); - } - - Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdatesResponse"); - } - - Aws::Crt::Optional SubscribeToCertificateUpdatesOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CertificateUpdateEvent"); - } - - Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdates"); - } - - std::future SubscribeToCertificateUpdatesOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); - }); - } - } - - SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToCertificateUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToCertificateUpdatesOperation::Activate( - const SubscribeToCertificateUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToCertificateUpdatesOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - VerifyClientDeviceIdentityOperationContext::VerifyClientDeviceIdentityOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityRequest"); - } - - Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityResponse"); - } - - Aws::Crt::Optional VerifyClientDeviceIdentityOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentity"); - } - - std::future VerifyClientDeviceIdentityOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return VerifyClientDeviceIdentityResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return VerifyClientDeviceIdentityResult(GetOperationResult().get()); - }); - } - } - - VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( - ClientConnection &connection, - const VerifyClientDeviceIdentityOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future VerifyClientDeviceIdentityOperation::Activate( - const VerifyClientDeviceIdentityRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String VerifyClientDeviceIdentityOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - AuthorizeClientDeviceActionOperationContext::AuthorizeClientDeviceActionOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionRequest"); - } - - Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionResponse"); - } - - Aws::Crt::Optional AuthorizeClientDeviceActionOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceAction"); - } - - std::future AuthorizeClientDeviceActionOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return AuthorizeClientDeviceActionResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return AuthorizeClientDeviceActionResult(GetOperationResult().get()); - }); - } - } - - AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( - ClientConnection &connection, - const AuthorizeClientDeviceActionOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future AuthorizeClientDeviceActionOperation::Activate( - const AuthorizeClientDeviceActionRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String AuthorizeClientDeviceActionOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - ListComponentsOperationContext::ListComponentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource ListComponentsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return ListComponentsResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource ListComponentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String ListComponentsOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListComponentsRequest"); - } - - Aws::Crt::String ListComponentsOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); - } - - Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String ListComponentsOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListComponents"); - } - - std::future ListComponentsOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return ListComponentsResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return ListComponentsResult(GetOperationResult().get()); }); - } - } - - ListComponentsOperation::ListComponentsOperation( - ClientConnection &connection, - const ListComponentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future ListComponentsOperation::Activate( - const ListComponentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String ListComponentsOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - CreateDebugPasswordOperationContext::CreateDebugPasswordOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String CreateDebugPasswordOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateDebugPasswordRequest"); - } - - Aws::Crt::String CreateDebugPasswordOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); - } - - Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String CreateDebugPasswordOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateDebugPassword"); - } - - std::future CreateDebugPasswordOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); - } - } - - CreateDebugPasswordOperation::CreateDebugPasswordOperation( - ClientConnection &connection, - const CreateDebugPasswordOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future CreateDebugPasswordOperation::Activate( - const CreateDebugPasswordRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String CreateDebugPasswordOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetThingShadowOperationContext::GetThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetThingShadowOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return GetThingShadowResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetThingShadowOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetThingShadowRequest"); - } - - Aws::Crt::String GetThingShadowOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); - } - - Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetThingShadowOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetThingShadow"); - } - - std::future GetThingShadowOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); - } - } - - GetThingShadowOperation::GetThingShadowOperation( - ClientConnection &connection, - const GetThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetThingShadowOperation::Activate( - const GetThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetThingShadowOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - SendConfigurationValidityReportOperationContext::SendConfigurationValidityReportOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SendConfigurationValidityReportResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String SendConfigurationValidityReportOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReportRequest"); - } - - Aws::Crt::String SendConfigurationValidityReportOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReportResponse"); - } - - Aws::Crt::Optional SendConfigurationValidityReportOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String SendConfigurationValidityReportOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReport"); - } - - std::future SendConfigurationValidityReportOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return SendConfigurationValidityReportResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return SendConfigurationValidityReportResult(GetOperationResult().get()); - }); - } - } - - SendConfigurationValidityReportOperation::SendConfigurationValidityReportOperation( - ClientConnection &connection, - const SendConfigurationValidityReportOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future SendConfigurationValidityReportOperation::Activate( - const SendConfigurationValidityReportRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SendConfigurationValidityReportOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - UpdateThingShadowOperationContext::UpdateThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return UpdateThingShadowResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String UpdateThingShadowOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateThingShadowRequest"); - } - - Aws::Crt::String UpdateThingShadowOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); - } - - Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String UpdateThingShadowOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateThingShadow"); - } - - std::future UpdateThingShadowOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); - } - } - - UpdateThingShadowOperation::UpdateThingShadowOperation( - ClientConnection &connection, - const UpdateThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future UpdateThingShadowOperation::Activate( - const UpdateThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String UpdateThingShadowOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - UpdateConfigurationOperationContext::UpdateConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return UpdateConfigurationResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String UpdateConfigurationOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateConfigurationRequest"); - } - - Aws::Crt::String UpdateConfigurationOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); - } - - Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String UpdateConfigurationOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateConfiguration"); - } - - std::future UpdateConfigurationOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); - } - } - - UpdateConfigurationOperation::UpdateConfigurationOperation( - ClientConnection &connection, - const UpdateConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future UpdateConfigurationOperation::Activate( - const UpdateConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String UpdateConfigurationOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - ValidateAuthorizationTokenOperationContext::ValidateAuthorizationTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenRequest"); - } - - Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenResponse"); - } - - Aws::Crt::Optional ValidateAuthorizationTokenOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationToken"); - } - - std::future ValidateAuthorizationTokenOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return ValidateAuthorizationTokenResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return ValidateAuthorizationTokenResult(GetOperationResult().get()); - }); - } - } - - ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( - ClientConnection &connection, - const ValidateAuthorizationTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future ValidateAuthorizationTokenOperation::Activate( - const ValidateAuthorizationTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String ValidateAuthorizationTokenOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - RestartComponentOperationContext::RestartComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource RestartComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String RestartComponentOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#RestartComponentRequest"); - } - - Aws::Crt::String RestartComponentOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); - } - - Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String RestartComponentOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#RestartComponent"); - } - - std::future RestartComponentOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return RestartComponentResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return RestartComponentResult(GetOperationResult().get()); }); - } - } - - RestartComponentOperation::RestartComponentOperation( - ClientConnection &connection, - const RestartComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future RestartComponentOperation::Activate( - const RestartComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String RestartComponentOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetLocalDeploymentStatusOperationContext::GetLocalDeploymentStatusOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusRequest"); - } - - Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusResponse"); - } - - Aws::Crt::Optional GetLocalDeploymentStatusOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatus"); - } - - std::future GetLocalDeploymentStatusOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return GetLocalDeploymentStatusResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return GetLocalDeploymentStatusResult(GetOperationResult().get()); - }); - } - } - - GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( - ClientConnection &connection, - const GetLocalDeploymentStatusOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetLocalDeploymentStatusOperation::Activate( - const GetLocalDeploymentStatusRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetLocalDeploymentStatusOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GetSecretValueOperationContext::GetSecretValueOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource GetSecretValueOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return GetSecretValueResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource GetSecretValueOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String GetSecretValueOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetSecretValueRequest"); - } - - Aws::Crt::String GetSecretValueOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); - } - - Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String GetSecretValueOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#GetSecretValue"); - } - - std::future GetSecretValueOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); - } - } - - GetSecretValueOperation::GetSecretValueOperation( - ClientConnection &connection, - const GetSecretValueOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future GetSecretValueOperation::Activate( - const GetSecretValueRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String GetSecretValueOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - UpdateStateOperationContext::UpdateStateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource UpdateStateOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return UpdateStateResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource UpdateStateOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String UpdateStateOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateStateRequest"); - } - - Aws::Crt::String UpdateStateOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateStateResponse"); - } - - Aws::Crt::Optional UpdateStateOperationContext::GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String UpdateStateOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#UpdateState"); - } - - std::future UpdateStateOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return UpdateStateResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return UpdateStateResult(GetOperationResult().get()); }); - } - } - - UpdateStateOperation::UpdateStateOperation( - ClientConnection &connection, - const UpdateStateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future UpdateStateOperation::Activate( - const UpdateStateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String UpdateStateOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - ListNamedShadowsForThingOperationContext::ListNamedShadowsForThingOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String ListNamedShadowsForThingOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingRequest"); - } - - Aws::Crt::String ListNamedShadowsForThingOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingResponse"); - } - - Aws::Crt::Optional ListNamedShadowsForThingOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String ListNamedShadowsForThingOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThing"); - } - - std::future ListNamedShadowsForThingOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return ListNamedShadowsForThingResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return ListNamedShadowsForThingResult(GetOperationResult().get()); - }); - } - } - - ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( - ClientConnection &connection, - const ListNamedShadowsForThingOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future ListNamedShadowsForThingOperation::Activate( - const ListNamedShadowsForThingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String ListNamedShadowsForThingOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - void SubscribeToComponentUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) - { - OnStreamEvent(static_cast(response.get())); - } - - bool SubscribeToComponentUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) - { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) - { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && - !streamShouldTerminate) - { - streamShouldTerminate = OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; - } - - SubscribeToComponentUpdatesOperationContext::SubscribeToComponentUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesRequest"); - } - - Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesResponse"); - } - - Aws::Crt::Optional SubscribeToComponentUpdatesOperationContext:: - GetStreamingResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ComponentUpdatePolicyEvents"); - } - - Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdates"); - } - - std::future SubscribeToComponentUpdatesOperation::GetResult( - bool async_mode) noexcept - { - if (async_mode) - { - return std::async(std::launch::async, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); - } - } - - SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToComponentUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) - { - } - - std::future SubscribeToComponentUpdatesOperation::Activate( - const SubscribeToComponentUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String SubscribeToComponentUpdatesOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - ListLocalDeploymentsOperationContext::ListLocalDeploymentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String ListLocalDeploymentsOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsRequest"); - } - - Aws::Crt::String ListLocalDeploymentsOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); - } - - Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String ListLocalDeploymentsOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#ListLocalDeployments"); - } - - std::future ListLocalDeploymentsOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); - } - } - - ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( - ClientConnection &connection, - const ListLocalDeploymentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future ListLocalDeploymentsOperation::Activate( - const ListLocalDeploymentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String ListLocalDeploymentsOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - StopComponentOperationContext::StopComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource StopComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return StopComponentResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource StopComponentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String StopComponentOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#StopComponentRequest"); - } - - Aws::Crt::String StopComponentOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#StopComponentResponse"); - } - - Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String StopComponentOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#StopComponent"); - } - - std::future StopComponentOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return StopComponentResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return StopComponentResult(GetOperationResult().get()); }); - } - } - - StopComponentOperation::StopComponentOperation( - ClientConnection &connection, - const StopComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future StopComponentOperation::Activate( - const StopComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String StopComponentOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - PauseComponentOperationContext::PauseComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource PauseComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - return PauseComponentResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource PauseComponentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String PauseComponentOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PauseComponentRequest"); - } - - Aws::Crt::String PauseComponentOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); - } - - Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() const - noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String PauseComponentOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#PauseComponent"); - } - - std::future PauseComponentOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return PauseComponentResult(GetOperationResult().get()); }); - } - else - { - return std::async( - std::launch::deferred, [this]() { return PauseComponentResult(GetOperationResult().get()); }); - } - } - - PauseComponentOperation::PauseComponentOperation( - ClientConnection &connection, - const PauseComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future PauseComponentOperation::Activate( - const PauseComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String PauseComponentOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - CreateLocalDeploymentOperationContext::CreateLocalDeploymentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) - { - } - - Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, allocator); - } - - Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: - AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const - noexcept - { - (void)stringView; - (void)allocator; - return nullptr; - } - - Aws::Crt::String CreateLocalDeploymentOperationContext::GetRequestModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentRequest"); - } - - Aws::Crt::String CreateLocalDeploymentOperationContext::GetInitialResponseModelName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentResponse"); - } - - Aws::Crt::Optional CreateLocalDeploymentOperationContext::GetStreamingResponseModelName() - const noexcept - { - return Aws::Crt::Optional(); - } - - Aws::Crt::String CreateLocalDeploymentOperationContext::GetOperationName() const noexcept - { - return Aws::Crt::String("aws.greengrass#CreateLocalDeployment"); - } - - std::future CreateLocalDeploymentOperation::GetResult(bool async_mode) noexcept - { - if (async_mode) - { - return std::async( - std::launch::async, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); - } - else - { - return std::async(std::launch::deferred, [this]() { - return CreateLocalDeploymentResult(GetOperationResult().get()); - }); - } - } - - CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( - ClientConnection &connection, - const CreateLocalDeploymentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) - { - } - - std::future CreateLocalDeploymentOperation::Activate( - const CreateLocalDeploymentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept - { - return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); - } - - Aws::Crt::String CreateLocalDeploymentOperation::GetModelName() const noexcept - { - return m_operationModelContext.GetOperationName(); - } - - GreengrassCoreIpcServiceModel::GreengrassCoreIpcServiceModel() noexcept - : m_subscribeToIoTCoreOperationContext(*this), m_resumeComponentOperationContext(*this), - m_publishToIoTCoreOperationContext(*this), m_subscribeToConfigurationUpdateOperationContext(*this), - m_deleteThingShadowOperationContext(*this), m_putComponentMetricOperationContext(*this), - m_deferComponentUpdateOperationContext(*this), - m_subscribeToValidateConfigurationUpdatesOperationContext(*this), - m_getConfigurationOperationContext(*this), m_subscribeToTopicOperationContext(*this), - m_getComponentDetailsOperationContext(*this), m_getClientDeviceAuthTokenOperationContext(*this), - m_publishToTopicOperationContext(*this), m_subscribeToCertificateUpdatesOperationContext(*this), - m_verifyClientDeviceIdentityOperationContext(*this), m_authorizeClientDeviceActionOperationContext(*this), - m_listComponentsOperationContext(*this), m_createDebugPasswordOperationContext(*this), - m_getThingShadowOperationContext(*this), m_sendConfigurationValidityReportOperationContext(*this), - m_updateThingShadowOperationContext(*this), m_updateConfigurationOperationContext(*this), - m_validateAuthorizationTokenOperationContext(*this), m_restartComponentOperationContext(*this), - m_getLocalDeploymentStatusOperationContext(*this), m_getSecretValueOperationContext(*this), - m_updateStateOperationContext(*this), m_listNamedShadowsForThingOperationContext(*this), - m_subscribeToComponentUpdatesOperationContext(*this), m_listLocalDeploymentsOperationContext(*this), - m_stopComponentOperationContext(*this), m_pauseComponentOperationContext(*this), - m_createLocalDeploymentOperationContext(*this) - { - } - - Aws::Crt::ScopedResource GreengrassCoreIpcServiceModel::AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept - { - auto it = m_modelNameToErrorResponse.find(errorModelName); - if (it == m_modelNameToErrorResponse.end()) - { - return nullptr; - } - else - { - return it->second(stringView, allocator); - } - } - - void GreengrassCoreIpcServiceModel::AssignModelNameToErrorResponse( - Aws::Crt::String modelName, - ErrorResponseFactory factory) noexcept - { - m_modelNameToErrorResponse[modelName] = factory; - } - } // namespace Greengrass +namespace Aws { +namespace Greengrass { +void MessageContext::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topic.has_value()) { + payloadObject.WithString("topic", m_topic.value()); + } +} + +void MessageContext::s_loadFromJsonView( + MessageContext &messageContext, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topic")) { + messageContext.m_topic = + Aws::Crt::Optional(jsonView.GetString("topic")); + } +} + +const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; + +Aws::Crt::String MessageContext::GetModelName() const noexcept { + return MessageContext::MODEL_NAME; +} + +Aws::Crt::ScopedResource +MessageContext::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + MessageContext::s_customDeleter); + shape->m_allocator = allocator; + MessageContext::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void MessageContext::s_customDeleter(MessageContext *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SystemResourceLimits::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_memory.has_value()) { + payloadObject.WithInt64("memory", m_memory.value()); + } + if (m_cpus.has_value()) { + payloadObject.WithDouble("cpus", m_cpus.value()); + } +} + +void SystemResourceLimits::s_loadFromJsonView( + SystemResourceLimits &systemResourceLimits, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("memory")) { + systemResourceLimits.m_memory = + Aws::Crt::Optional(jsonView.GetInt64("memory")); + } + if (jsonView.ValueExists("cpus")) { + systemResourceLimits.m_cpus = + Aws::Crt::Optional(jsonView.GetDouble("cpus")); + } +} + +const char *SystemResourceLimits::MODEL_NAME = + "aws.greengrass#SystemResourceLimits"; + +Aws::Crt::String SystemResourceLimits::GetModelName() const noexcept { + return SystemResourceLimits::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SystemResourceLimits::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SystemResourceLimits::s_customDeleter); + shape->m_allocator = allocator; + SystemResourceLimits::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SystemResourceLimits::s_customDeleter( + SystemResourceLimits *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ValidateConfigurationUpdateEvent::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_configuration.has_value()) { + payloadObject.WithObject("configuration", m_configuration.value()); + } + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } +} + +void ValidateConfigurationUpdateEvent::s_loadFromJsonView( + ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("configuration")) { + validateConfigurationUpdateEvent.m_configuration = + Aws::Crt::Optional( + jsonView.GetJsonObject("configuration").Materialize()); + } + if (jsonView.ValueExists("deploymentId")) { + validateConfigurationUpdateEvent.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } +} + +const char *ValidateConfigurationUpdateEvent::MODEL_NAME = + "aws.greengrass#ValidateConfigurationUpdateEvent"; + +Aws::Crt::String +ValidateConfigurationUpdateEvent::GetModelName() const noexcept { + return ValidateConfigurationUpdateEvent::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ValidateConfigurationUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateConfigurationUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + ValidateConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ValidateConfigurationUpdateEvent::s_customDeleter( + ValidateConfigurationUpdateEvent *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void MQTTMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topicName.has_value()) { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void MQTTMessage::s_loadFromJsonView( + MQTTMessage &mQTTMessage, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topicName")) { + mQTTMessage.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + mQTTMessage.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; + +Aws::Crt::String MQTTMessage::GetModelName() const noexcept { + return MQTTMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +MQTTMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MQTTMessage::s_customDeleter); + shape->m_allocator = allocator; + MQTTMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void MQTTMessage::s_customDeleter(MQTTMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ConfigurationUpdateEvent::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } +} + +void ConfigurationUpdateEvent::s_loadFromJsonView( + ConfigurationUpdateEvent &configurationUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + configurationUpdateEvent.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) { + configurationUpdateEvent.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : + jsonView.GetArray("keyPath")) { + Aws::Crt::Optional keyPathItem; + keyPathItem = + Aws::Crt::Optional(keyPathJsonView.AsString()); + configurationUpdateEvent.m_keyPath.value().push_back(keyPathItem.value()); + } + } +} + +const char *ConfigurationUpdateEvent::MODEL_NAME = + "aws.greengrass#ConfigurationUpdateEvent"; + +Aws::Crt::String ConfigurationUpdateEvent::GetModelName() const noexcept { + return ConfigurationUpdateEvent::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ConfigurationUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ConfigurationUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ConfigurationUpdateEvent::s_customDeleter( + ConfigurationUpdateEvent *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PostComponentUpdateEvent::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } +} + +void PostComponentUpdateEvent::s_loadFromJsonView( + PostComponentUpdateEvent &postComponentUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + postComponentUpdateEvent.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } +} + +const char *PostComponentUpdateEvent::MODEL_NAME = + "aws.greengrass#PostComponentUpdateEvent"; + +Aws::Crt::String PostComponentUpdateEvent::GetModelName() const noexcept { + return PostComponentUpdateEvent::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PostComponentUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PostComponentUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + PostComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PostComponentUpdateEvent::s_customDeleter( + PostComponentUpdateEvent *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PreComponentUpdateEvent::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_isGgcRestarting.has_value()) { + payloadObject.WithBool("isGgcRestarting", m_isGgcRestarting.value()); + } +} + +void PreComponentUpdateEvent::s_loadFromJsonView( + PreComponentUpdateEvent &preComponentUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + preComponentUpdateEvent.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("isGgcRestarting")) { + preComponentUpdateEvent.m_isGgcRestarting = + Aws::Crt::Optional(jsonView.GetBool("isGgcRestarting")); + } +} + +const char *PreComponentUpdateEvent::MODEL_NAME = + "aws.greengrass#PreComponentUpdateEvent"; + +Aws::Crt::String PreComponentUpdateEvent::GetModelName() const noexcept { + return PreComponentUpdateEvent::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PreComponentUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PreComponentUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + PreComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PreComponentUpdateEvent::s_customDeleter( + PreComponentUpdateEvent *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CertificateUpdate::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_privateKey.has_value()) { + payloadObject.WithString("privateKey", m_privateKey.value()); + } + if (m_publicKey.has_value()) { + payloadObject.WithString("publicKey", m_publicKey.value()); + } + if (m_certificate.has_value()) { + payloadObject.WithString("certificate", m_certificate.value()); + } + if (m_caCertificates.has_value()) { + Aws::Crt::JsonObject cACertificates; + Aws::Crt::Vector cACertificatesJsonArray; + for (const auto &cACertificatesItem : m_caCertificates.value()) { + Aws::Crt::JsonObject cACertificatesJsonArrayItem; + cACertificatesJsonArrayItem.AsString(cACertificatesItem); + cACertificatesJsonArray.emplace_back( + std::move(cACertificatesJsonArrayItem)); + } + cACertificates.AsArray(std::move(cACertificatesJsonArray)); + payloadObject.WithObject("caCertificates", std::move(cACertificates)); + } +} + +void CertificateUpdate::s_loadFromJsonView( + CertificateUpdate &certificateUpdate, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("privateKey")) { + certificateUpdate.m_privateKey = + Aws::Crt::Optional(jsonView.GetString("privateKey")); + } + if (jsonView.ValueExists("publicKey")) { + certificateUpdate.m_publicKey = + Aws::Crt::Optional(jsonView.GetString("publicKey")); + } + if (jsonView.ValueExists("certificate")) { + certificateUpdate.m_certificate = + Aws::Crt::Optional(jsonView.GetString("certificate")); + } + if (jsonView.ValueExists("caCertificates")) { + certificateUpdate.m_caCertificates = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &cACertificatesJsonView : + jsonView.GetArray("caCertificates")) { + Aws::Crt::Optional cACertificatesItem; + cACertificatesItem = Aws::Crt::Optional( + cACertificatesJsonView.AsString()); + certificateUpdate.m_caCertificates.value().push_back( + cACertificatesItem.value()); + } + } +} + +const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; + +Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { + return CertificateUpdate::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CertificateUpdate::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CertificateUpdate::s_customDeleter); + shape->m_allocator = allocator; + CertificateUpdate::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CertificateUpdate::s_customDeleter(CertificateUpdate *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void Metric::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_name.has_value()) { + payloadObject.WithString("name", m_name.value()); + } + if (m_unit.has_value()) { + payloadObject.WithString("unit", m_unit.value()); + } + if (m_value.has_value()) { + payloadObject.WithDouble("value", m_value.value()); + } +} + +void Metric::s_loadFromJsonView(Metric &metric, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("name")) { + metric.m_name = + Aws::Crt::Optional(jsonView.GetString("name")); + } + if (jsonView.ValueExists("unit")) { + metric.m_unit = + Aws::Crt::Optional(jsonView.GetString("unit")); + } + if (jsonView.ValueExists("value")) { + metric.m_value = Aws::Crt::Optional(jsonView.GetDouble("value")); + } +} + +void Metric::SetUnit(MetricUnitType unit) noexcept { + switch (unit) { + case METRIC_UNIT_TYPE_BYTES: + m_unit = Aws::Crt::String("BYTES"); + break; + case METRIC_UNIT_TYPE_BYTES_PER_SECOND: + m_unit = Aws::Crt::String("BYTES_PER_SECOND"); + break; + case METRIC_UNIT_TYPE_COUNT: + m_unit = Aws::Crt::String("COUNT"); + break; + case METRIC_UNIT_TYPE_COUNT_PER_SECOND: + m_unit = Aws::Crt::String("COUNT_PER_SECOND"); + break; + case METRIC_UNIT_TYPE_MEGABYTES: + m_unit = Aws::Crt::String("MEGABYTES"); + break; + case METRIC_UNIT_TYPE_SECONDS: + m_unit = Aws::Crt::String("SECONDS"); + break; + default: + break; + } +} + +Aws::Crt::Optional Metric::GetUnit() noexcept { + if (!m_unit.has_value()) + return Aws::Crt::Optional(); + if (m_unit.value() == Aws::Crt::String("BYTES")) { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES); + } + if (m_unit.value() == Aws::Crt::String("BYTES_PER_SECOND")) { + return Aws::Crt::Optional( + METRIC_UNIT_TYPE_BYTES_PER_SECOND); + } + if (m_unit.value() == Aws::Crt::String("COUNT")) { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT); + } + if (m_unit.value() == Aws::Crt::String("COUNT_PER_SECOND")) { + return Aws::Crt::Optional( + METRIC_UNIT_TYPE_COUNT_PER_SECOND); + } + if (m_unit.value() == Aws::Crt::String("MEGABYTES")) { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_MEGABYTES); + } + if (m_unit.value() == Aws::Crt::String("SECONDS")) { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_SECONDS); + } + + return Aws::Crt::Optional(); +} + +const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; + +Aws::Crt::String Metric::GetModelName() const noexcept { + return Metric::MODEL_NAME; +} + +Aws::Crt::ScopedResource +Metric::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), + Metric::s_customDeleter); + shape->m_allocator = allocator; + Metric::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void Metric::s_customDeleter(Metric *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void BinaryMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + if (m_message.value().size() > 0) { + payloadObject.WithString("message", + Aws::Crt::Base64Encode(m_message.value())); + } + } + if (m_context.has_value()) { + Aws::Crt::JsonObject messageContextValue; + m_context.value().SerializeToJsonObject(messageContextValue); + payloadObject.WithObject("context", std::move(messageContextValue)); + } +} + +void BinaryMessage::s_loadFromJsonView( + BinaryMessage &binaryMessage, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + if (jsonView.GetString("message").size() > 0) { + binaryMessage.m_message = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("message"))); + } + } + if (jsonView.ValueExists("context")) { + binaryMessage.m_context = MessageContext(); + MessageContext::s_loadFromJsonView(binaryMessage.m_context.value(), + jsonView.GetJsonObject("context")); + } +} + +const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; + +Aws::Crt::String BinaryMessage::GetModelName() const noexcept { + return BinaryMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +BinaryMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), BinaryMessage::s_customDeleter); + shape->m_allocator = allocator; + BinaryMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void BinaryMessage::s_customDeleter(BinaryMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void JsonMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithObject("message", m_message.value()); + } + if (m_context.has_value()) { + Aws::Crt::JsonObject messageContextValue; + m_context.value().SerializeToJsonObject(messageContextValue); + payloadObject.WithObject("context", std::move(messageContextValue)); + } +} + +void JsonMessage::s_loadFromJsonView( + JsonMessage &jsonMessage, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + jsonMessage.m_message = Aws::Crt::Optional( + jsonView.GetJsonObject("message").Materialize()); + } + if (jsonView.ValueExists("context")) { + jsonMessage.m_context = MessageContext(); + MessageContext::s_loadFromJsonView(jsonMessage.m_context.value(), + jsonView.GetJsonObject("context")); + } +} + +const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; + +Aws::Crt::String JsonMessage::GetModelName() const noexcept { + return JsonMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +JsonMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), JsonMessage::s_customDeleter); + shape->m_allocator = allocator; + JsonMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void JsonMessage::s_customDeleter(JsonMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void MQTTCredential::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_clientId.has_value()) { + payloadObject.WithString("clientId", m_clientId.value()); + } + if (m_certificatePem.has_value()) { + payloadObject.WithString("certificatePem", m_certificatePem.value()); + } + if (m_username.has_value()) { + payloadObject.WithString("username", m_username.value()); + } + if (m_password.has_value()) { + payloadObject.WithString("password", m_password.value()); + } +} + +void MQTTCredential::s_loadFromJsonView( + MQTTCredential &mQTTCredential, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("clientId")) { + mQTTCredential.m_clientId = + Aws::Crt::Optional(jsonView.GetString("clientId")); + } + if (jsonView.ValueExists("certificatePem")) { + mQTTCredential.m_certificatePem = Aws::Crt::Optional( + jsonView.GetString("certificatePem")); + } + if (jsonView.ValueExists("username")) { + mQTTCredential.m_username = + Aws::Crt::Optional(jsonView.GetString("username")); + } + if (jsonView.ValueExists("password")) { + mQTTCredential.m_password = + Aws::Crt::Optional(jsonView.GetString("password")); + } +} + +const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; + +Aws::Crt::String MQTTCredential::GetModelName() const noexcept { + return MQTTCredential::MODEL_NAME; +} + +Aws::Crt::ScopedResource +MQTTCredential::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + MQTTCredential::s_customDeleter); + shape->m_allocator = allocator; + MQTTCredential::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void MQTTCredential::s_customDeleter(MQTTCredential *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void RunWithInfo::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_posixUser.has_value()) { + payloadObject.WithString("posixUser", m_posixUser.value()); + } + if (m_windowsUser.has_value()) { + payloadObject.WithString("windowsUser", m_windowsUser.value()); + } + if (m_systemResourceLimits.has_value()) { + Aws::Crt::JsonObject systemResourceLimitsValue; + m_systemResourceLimits.value().SerializeToJsonObject( + systemResourceLimitsValue); + payloadObject.WithObject("systemResourceLimits", + std::move(systemResourceLimitsValue)); + } +} + +void RunWithInfo::s_loadFromJsonView( + RunWithInfo &runWithInfo, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("posixUser")) { + runWithInfo.m_posixUser = + Aws::Crt::Optional(jsonView.GetString("posixUser")); + } + if (jsonView.ValueExists("windowsUser")) { + runWithInfo.m_windowsUser = + Aws::Crt::Optional(jsonView.GetString("windowsUser")); + } + if (jsonView.ValueExists("systemResourceLimits")) { + runWithInfo.m_systemResourceLimits = SystemResourceLimits(); + SystemResourceLimits::s_loadFromJsonView( + runWithInfo.m_systemResourceLimits.value(), + jsonView.GetJsonObject("systemResourceLimits")); + } +} + +const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; + +Aws::Crt::String RunWithInfo::GetModelName() const noexcept { + return RunWithInfo::MODEL_NAME; +} + +Aws::Crt::ScopedResource +RunWithInfo::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), RunWithInfo::s_customDeleter); + shape->m_allocator = allocator; + RunWithInfo::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void RunWithInfo::s_customDeleter(RunWithInfo *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ClientDeviceCredential::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE && + m_clientDeviceCertificate.has_value()) { + payloadObject.WithString("clientDeviceCertificate", + m_clientDeviceCertificate.value()); + } +} + +void ClientDeviceCredential::s_loadFromJsonView( + ClientDeviceCredential &clientDeviceCredential, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("clientDeviceCertificate")) { + clientDeviceCredential.m_clientDeviceCertificate = + Aws::Crt::Optional( + jsonView.GetString("clientDeviceCertificate")); + clientDeviceCredential.m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; + } +} + +ClientDeviceCredential &ClientDeviceCredential::operator=( + const ClientDeviceCredential &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) { + m_clientDeviceCertificate = objectToCopy.m_clientDeviceCertificate; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *ClientDeviceCredential::MODEL_NAME = + "aws.greengrass#ClientDeviceCredential"; + +Aws::Crt::String ClientDeviceCredential::GetModelName() const noexcept { + return ClientDeviceCredential::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ClientDeviceCredential::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ClientDeviceCredential::s_customDeleter); + shape->m_allocator = allocator; + ClientDeviceCredential::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ClientDeviceCredential::s_customDeleter( + ClientDeviceCredential *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ValidateConfigurationUpdateEvents::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && + m_validateConfigurationUpdateEvent.has_value()) { + Aws::Crt::JsonObject validateConfigurationUpdateEventValue; + m_validateConfigurationUpdateEvent.value().SerializeToJsonObject( + validateConfigurationUpdateEventValue); + payloadObject.WithObject("validateConfigurationUpdateEvent", + std::move(validateConfigurationUpdateEventValue)); + } +} + +void ValidateConfigurationUpdateEvents::s_loadFromJsonView( + ValidateConfigurationUpdateEvents &validateConfigurationUpdateEvents, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("validateConfigurationUpdateEvent")) { + validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent = + ValidateConfigurationUpdateEvent(); + ValidateConfigurationUpdateEvent::s_loadFromJsonView( + validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent + .value(), + jsonView.GetJsonObject("validateConfigurationUpdateEvent")); + validateConfigurationUpdateEvents.m_chosenMember = + TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; + } +} + +ValidateConfigurationUpdateEvents &ValidateConfigurationUpdateEvents::operator=( + const ValidateConfigurationUpdateEvents &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) { + m_validateConfigurationUpdateEvent = + objectToCopy.m_validateConfigurationUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *ValidateConfigurationUpdateEvents::MODEL_NAME = + "aws.greengrass#ValidateConfigurationUpdateEvents"; + +Aws::Crt::String +ValidateConfigurationUpdateEvents::GetModelName() const noexcept { + return ValidateConfigurationUpdateEvents::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ValidateConfigurationUpdateEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateConfigurationUpdateEvents::s_customDeleter); + shape->m_allocator = allocator; + ValidateConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ValidateConfigurationUpdateEvents::s_customDeleter( + ValidateConfigurationUpdateEvents *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscriptionResponseMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) { + Aws::Crt::JsonObject jsonMessageValue; + m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); + payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); + } else if (m_chosenMember == TAG_BINARY_MESSAGE && + m_binaryMessage.has_value()) { + Aws::Crt::JsonObject binaryMessageValue; + m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); + payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); + } +} + +void SubscriptionResponseMessage::s_loadFromJsonView( + SubscriptionResponseMessage &subscriptionResponseMessage, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("jsonMessage")) { + subscriptionResponseMessage.m_jsonMessage = JsonMessage(); + JsonMessage::s_loadFromJsonView( + subscriptionResponseMessage.m_jsonMessage.value(), + jsonView.GetJsonObject("jsonMessage")); + subscriptionResponseMessage.m_chosenMember = TAG_JSON_MESSAGE; + } else if (jsonView.ValueExists("binaryMessage")) { + subscriptionResponseMessage.m_binaryMessage = BinaryMessage(); + BinaryMessage::s_loadFromJsonView( + subscriptionResponseMessage.m_binaryMessage.value(), + jsonView.GetJsonObject("binaryMessage")); + subscriptionResponseMessage.m_chosenMember = TAG_BINARY_MESSAGE; + } +} + +SubscriptionResponseMessage &SubscriptionResponseMessage::operator=( + const SubscriptionResponseMessage &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) { + m_jsonMessage = objectToCopy.m_jsonMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) { + m_binaryMessage = objectToCopy.m_binaryMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *SubscriptionResponseMessage::MODEL_NAME = + "aws.greengrass#SubscriptionResponseMessage"; + +Aws::Crt::String SubscriptionResponseMessage::GetModelName() const noexcept { + return SubscriptionResponseMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscriptionResponseMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscriptionResponseMessage::s_customDeleter); + shape->m_allocator = allocator; + SubscriptionResponseMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscriptionResponseMessage::s_customDeleter( + SubscriptionResponseMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void IoTCoreMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_MESSAGE && m_message.has_value()) { + Aws::Crt::JsonObject mQTTMessageValue; + m_message.value().SerializeToJsonObject(mQTTMessageValue); + payloadObject.WithObject("message", std::move(mQTTMessageValue)); + } +} + +void IoTCoreMessage::s_loadFromJsonView( + IoTCoreMessage &ioTCoreMessage, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + ioTCoreMessage.m_message = MQTTMessage(); + MQTTMessage::s_loadFromJsonView(ioTCoreMessage.m_message.value(), + jsonView.GetJsonObject("message")); + ioTCoreMessage.m_chosenMember = TAG_MESSAGE; + } +} + +IoTCoreMessage & +IoTCoreMessage::operator=(const IoTCoreMessage &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_MESSAGE) { + m_message = objectToCopy.m_message; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; + +Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { + return IoTCoreMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +IoTCoreMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + IoTCoreMessage::s_customDeleter); + shape->m_allocator = allocator; + IoTCoreMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void IoTCoreMessage::s_customDeleter(IoTCoreMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ConfigurationUpdateEvents::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT && + m_configurationUpdateEvent.has_value()) { + Aws::Crt::JsonObject configurationUpdateEventValue; + m_configurationUpdateEvent.value().SerializeToJsonObject( + configurationUpdateEventValue); + payloadObject.WithObject("configurationUpdateEvent", + std::move(configurationUpdateEventValue)); + } +} + +void ConfigurationUpdateEvents::s_loadFromJsonView( + ConfigurationUpdateEvents &configurationUpdateEvents, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("configurationUpdateEvent")) { + configurationUpdateEvents.m_configurationUpdateEvent = + ConfigurationUpdateEvent(); + ConfigurationUpdateEvent::s_loadFromJsonView( + configurationUpdateEvents.m_configurationUpdateEvent.value(), + jsonView.GetJsonObject("configurationUpdateEvent")); + configurationUpdateEvents.m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; + } +} + +ConfigurationUpdateEvents &ConfigurationUpdateEvents::operator=( + const ConfigurationUpdateEvents &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) { + m_configurationUpdateEvent = objectToCopy.m_configurationUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *ConfigurationUpdateEvents::MODEL_NAME = + "aws.greengrass#ConfigurationUpdateEvents"; + +Aws::Crt::String ConfigurationUpdateEvents::GetModelName() const noexcept { + return ConfigurationUpdateEvents::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ConfigurationUpdateEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ConfigurationUpdateEvents::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ConfigurationUpdateEvents::s_customDeleter( + ConfigurationUpdateEvents *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ComponentUpdatePolicyEvents::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_PRE_UPDATE_EVENT && m_preUpdateEvent.has_value()) { + Aws::Crt::JsonObject preComponentUpdateEventValue; + m_preUpdateEvent.value().SerializeToJsonObject( + preComponentUpdateEventValue); + payloadObject.WithObject("preUpdateEvent", + std::move(preComponentUpdateEventValue)); + } else if (m_chosenMember == TAG_POST_UPDATE_EVENT && + m_postUpdateEvent.has_value()) { + Aws::Crt::JsonObject postComponentUpdateEventValue; + m_postUpdateEvent.value().SerializeToJsonObject( + postComponentUpdateEventValue); + payloadObject.WithObject("postUpdateEvent", + std::move(postComponentUpdateEventValue)); + } +} + +void ComponentUpdatePolicyEvents::s_loadFromJsonView( + ComponentUpdatePolicyEvents &componentUpdatePolicyEvents, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("preUpdateEvent")) { + componentUpdatePolicyEvents.m_preUpdateEvent = PreComponentUpdateEvent(); + PreComponentUpdateEvent::s_loadFromJsonView( + componentUpdatePolicyEvents.m_preUpdateEvent.value(), + jsonView.GetJsonObject("preUpdateEvent")); + componentUpdatePolicyEvents.m_chosenMember = TAG_PRE_UPDATE_EVENT; + } else if (jsonView.ValueExists("postUpdateEvent")) { + componentUpdatePolicyEvents.m_postUpdateEvent = PostComponentUpdateEvent(); + PostComponentUpdateEvent::s_loadFromJsonView( + componentUpdatePolicyEvents.m_postUpdateEvent.value(), + jsonView.GetJsonObject("postUpdateEvent")); + componentUpdatePolicyEvents.m_chosenMember = TAG_POST_UPDATE_EVENT; + } +} + +ComponentUpdatePolicyEvents &ComponentUpdatePolicyEvents::operator=( + const ComponentUpdatePolicyEvents &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_PRE_UPDATE_EVENT) { + m_preUpdateEvent = objectToCopy.m_preUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } else if (objectToCopy.m_chosenMember == TAG_POST_UPDATE_EVENT) { + m_postUpdateEvent = objectToCopy.m_postUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *ComponentUpdatePolicyEvents::MODEL_NAME = + "aws.greengrass#ComponentUpdatePolicyEvents"; + +Aws::Crt::String ComponentUpdatePolicyEvents::GetModelName() const noexcept { + return ComponentUpdatePolicyEvents::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ComponentUpdatePolicyEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ComponentUpdatePolicyEvents::s_customDeleter); + shape->m_allocator = allocator; + ComponentUpdatePolicyEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ComponentUpdatePolicyEvents::s_customDeleter( + ComponentUpdatePolicyEvents *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CertificateUpdateEvent::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_CERTIFICATE_UPDATE && + m_certificateUpdate.has_value()) { + Aws::Crt::JsonObject certificateUpdateValue; + m_certificateUpdate.value().SerializeToJsonObject(certificateUpdateValue); + payloadObject.WithObject("certificateUpdate", + std::move(certificateUpdateValue)); + } +} + +void CertificateUpdateEvent::s_loadFromJsonView( + CertificateUpdateEvent &certificateUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("certificateUpdate")) { + certificateUpdateEvent.m_certificateUpdate = CertificateUpdate(); + CertificateUpdate::s_loadFromJsonView( + certificateUpdateEvent.m_certificateUpdate.value(), + jsonView.GetJsonObject("certificateUpdate")); + certificateUpdateEvent.m_chosenMember = TAG_CERTIFICATE_UPDATE; + } +} + +CertificateUpdateEvent &CertificateUpdateEvent::operator=( + const CertificateUpdateEvent &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_CERTIFICATE_UPDATE) { + m_certificateUpdate = objectToCopy.m_certificateUpdate; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *CertificateUpdateEvent::MODEL_NAME = + "aws.greengrass#CertificateUpdateEvent"; + +Aws::Crt::String CertificateUpdateEvent::GetModelName() const noexcept { + return CertificateUpdateEvent::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CertificateUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CertificateUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + CertificateUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CertificateUpdateEvent::s_customDeleter( + CertificateUpdateEvent *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CertificateOptions::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_certificateType.has_value()) { + payloadObject.WithString("certificateType", m_certificateType.value()); + } +} + +void CertificateOptions::s_loadFromJsonView( + CertificateOptions &certificateOptions, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("certificateType")) { + certificateOptions.m_certificateType = Aws::Crt::Optional( + jsonView.GetString("certificateType")); + } +} + +void CertificateOptions::SetCertificateType( + CertificateType certificateType) noexcept { + switch (certificateType) { + case CERTIFICATE_TYPE_SERVER: + m_certificateType = Aws::Crt::String("SERVER"); + break; + default: + break; + } +} + +Aws::Crt::Optional +CertificateOptions::GetCertificateType() noexcept { + if (!m_certificateType.has_value()) + return Aws::Crt::Optional(); + if (m_certificateType.value() == Aws::Crt::String("SERVER")) { + return Aws::Crt::Optional(CERTIFICATE_TYPE_SERVER); + } + + return Aws::Crt::Optional(); +} + +const char *CertificateOptions::MODEL_NAME = + "aws.greengrass#CertificateOptions"; + +Aws::Crt::String CertificateOptions::GetModelName() const noexcept { + return CertificateOptions::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CertificateOptions::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CertificateOptions::s_customDeleter); + shape->m_allocator = allocator; + CertificateOptions::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CertificateOptions::s_customDeleter(CertificateOptions *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ConfigurationValidityReport::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_status.has_value()) { + payloadObject.WithString("status", m_status.value()); + } + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void ConfigurationValidityReport::s_loadFromJsonView( + ConfigurationValidityReport &configurationValidityReport, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("status")) { + configurationValidityReport.m_status = + Aws::Crt::Optional(jsonView.GetString("status")); + } + if (jsonView.ValueExists("deploymentId")) { + configurationValidityReport.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("message")) { + configurationValidityReport.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +void ConfigurationValidityReport::SetStatus( + ConfigurationValidityStatus status) noexcept { + switch (status) { + case CONFIGURATION_VALIDITY_STATUS_ACCEPTED: + m_status = Aws::Crt::String("ACCEPTED"); + break; + case CONFIGURATION_VALIDITY_STATUS_REJECTED: + m_status = Aws::Crt::String("REJECTED"); + break; + default: + break; + } +} + +Aws::Crt::Optional +ConfigurationValidityReport::GetStatus() noexcept { + if (!m_status.has_value()) + return Aws::Crt::Optional(); + if (m_status.value() == Aws::Crt::String("ACCEPTED")) { + return Aws::Crt::Optional( + CONFIGURATION_VALIDITY_STATUS_ACCEPTED); + } + if (m_status.value() == Aws::Crt::String("REJECTED")) { + return Aws::Crt::Optional( + CONFIGURATION_VALIDITY_STATUS_REJECTED); + } + + return Aws::Crt::Optional(); +} + +const char *ConfigurationValidityReport::MODEL_NAME = + "aws.greengrass#ConfigurationValidityReport"; + +Aws::Crt::String ConfigurationValidityReport::GetModelName() const noexcept { + return ConfigurationValidityReport::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ConfigurationValidityReport::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ConfigurationValidityReport::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationValidityReport::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ConfigurationValidityReport::s_customDeleter( + ConfigurationValidityReport *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PublishMessage::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) { + Aws::Crt::JsonObject jsonMessageValue; + m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); + payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); + } else if (m_chosenMember == TAG_BINARY_MESSAGE && + m_binaryMessage.has_value()) { + Aws::Crt::JsonObject binaryMessageValue; + m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); + payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); + } +} + +void PublishMessage::s_loadFromJsonView( + PublishMessage &publishMessage, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("jsonMessage")) { + publishMessage.m_jsonMessage = JsonMessage(); + JsonMessage::s_loadFromJsonView(publishMessage.m_jsonMessage.value(), + jsonView.GetJsonObject("jsonMessage")); + publishMessage.m_chosenMember = TAG_JSON_MESSAGE; + } else if (jsonView.ValueExists("binaryMessage")) { + publishMessage.m_binaryMessage = BinaryMessage(); + BinaryMessage::s_loadFromJsonView(publishMessage.m_binaryMessage.value(), + jsonView.GetJsonObject("binaryMessage")); + publishMessage.m_chosenMember = TAG_BINARY_MESSAGE; + } +} + +PublishMessage & +PublishMessage::operator=(const PublishMessage &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) { + m_jsonMessage = objectToCopy.m_jsonMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) { + m_binaryMessage = objectToCopy.m_binaryMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; + +Aws::Crt::String PublishMessage::GetModelName() const noexcept { + return PublishMessage::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PublishMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PublishMessage::s_customDeleter); + shape->m_allocator = allocator; + PublishMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PublishMessage::s_customDeleter(PublishMessage *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SecretValue::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_SECRET_STRING && m_secretString.has_value()) { + payloadObject.WithString("secretString", m_secretString.value()); + } else if (m_chosenMember == TAG_SECRET_BINARY && + m_secretBinary.has_value()) { + if (m_secretBinary.value().size() > 0) { + payloadObject.WithString("secretBinary", + Aws::Crt::Base64Encode(m_secretBinary.value())); + } + } +} + +void SecretValue::s_loadFromJsonView( + SecretValue &secretValue, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("secretString")) { + secretValue.m_secretString = Aws::Crt::Optional( + jsonView.GetString("secretString")); + secretValue.m_chosenMember = TAG_SECRET_STRING; + } else if (jsonView.ValueExists("secretBinary")) { + if (jsonView.GetString("secretBinary").size() > 0) { + secretValue.m_secretBinary = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("secretBinary"))); + } + secretValue.m_chosenMember = TAG_SECRET_BINARY; + } +} + +SecretValue &SecretValue::operator=(const SecretValue &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_SECRET_STRING) { + m_secretString = objectToCopy.m_secretString; + m_chosenMember = objectToCopy.m_chosenMember; + } else if (objectToCopy.m_chosenMember == TAG_SECRET_BINARY) { + m_secretBinary = objectToCopy.m_secretBinary; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; + +Aws::Crt::String SecretValue::GetModelName() const noexcept { + return SecretValue::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SecretValue::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SecretValue::s_customDeleter); + shape->m_allocator = allocator; + SecretValue::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SecretValue::s_customDeleter(SecretValue *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void LocalDeployment::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_status.has_value()) { + payloadObject.WithString("status", m_status.value()); + } +} + +void LocalDeployment::s_loadFromJsonView( + LocalDeployment &localDeployment, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + localDeployment.m_deploymentId = Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("status")) { + localDeployment.m_status = + Aws::Crt::Optional(jsonView.GetString("status")); + } +} + +void LocalDeployment::SetStatus(DeploymentStatus status) noexcept { + switch (status) { + case DEPLOYMENT_STATUS_QUEUED: + m_status = Aws::Crt::String("QUEUED"); + break; + case DEPLOYMENT_STATUS_IN_PROGRESS: + m_status = Aws::Crt::String("IN_PROGRESS"); + break; + case DEPLOYMENT_STATUS_SUCCEEDED: + m_status = Aws::Crt::String("SUCCEEDED"); + break; + case DEPLOYMENT_STATUS_FAILED: + m_status = Aws::Crt::String("FAILED"); + break; + default: + break; + } +} + +Aws::Crt::Optional LocalDeployment::GetStatus() noexcept { + if (!m_status.has_value()) + return Aws::Crt::Optional(); + if (m_status.value() == Aws::Crt::String("QUEUED")) { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_QUEUED); + } + if (m_status.value() == Aws::Crt::String("IN_PROGRESS")) { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_IN_PROGRESS); + } + if (m_status.value() == Aws::Crt::String("SUCCEEDED")) { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_SUCCEEDED); + } + if (m_status.value() == Aws::Crt::String("FAILED")) { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_FAILED); + } + + return Aws::Crt::Optional(); +} + +const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; + +Aws::Crt::String LocalDeployment::GetModelName() const noexcept { + return LocalDeployment::MODEL_NAME; +} + +Aws::Crt::ScopedResource +LocalDeployment::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + LocalDeployment::s_customDeleter); + shape->m_allocator = allocator; + LocalDeployment::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void LocalDeployment::s_customDeleter(LocalDeployment *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ComponentDetails::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_version.has_value()) { + payloadObject.WithString("version", m_version.value()); + } + if (m_state.has_value()) { + payloadObject.WithString("state", m_state.value()); + } + if (m_configuration.has_value()) { + payloadObject.WithObject("configuration", m_configuration.value()); + } +} + +void ComponentDetails::s_loadFromJsonView( + ComponentDetails &componentDetails, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + componentDetails.m_componentName = Aws::Crt::Optional( + jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("version")) { + componentDetails.m_version = + Aws::Crt::Optional(jsonView.GetString("version")); + } + if (jsonView.ValueExists("state")) { + componentDetails.m_state = + Aws::Crt::Optional(jsonView.GetString("state")); + } + if (jsonView.ValueExists("configuration")) { + componentDetails.m_configuration = Aws::Crt::Optional( + jsonView.GetJsonObject("configuration").Materialize()); + } +} + +void ComponentDetails::SetState(LifecycleState state) noexcept { + switch (state) { + case LIFECYCLE_STATE_RUNNING: + m_state = Aws::Crt::String("RUNNING"); + break; + case LIFECYCLE_STATE_ERRORED: + m_state = Aws::Crt::String("ERRORED"); + break; + case LIFECYCLE_STATE_NEW: + m_state = Aws::Crt::String("NEW"); + break; + case LIFECYCLE_STATE_FINISHED: + m_state = Aws::Crt::String("FINISHED"); + break; + case LIFECYCLE_STATE_INSTALLED: + m_state = Aws::Crt::String("INSTALLED"); + break; + case LIFECYCLE_STATE_BROKEN: + m_state = Aws::Crt::String("BROKEN"); + break; + case LIFECYCLE_STATE_STARTING: + m_state = Aws::Crt::String("STARTING"); + break; + case LIFECYCLE_STATE_STOPPING: + m_state = Aws::Crt::String("STOPPING"); + break; + default: + break; + } +} + +Aws::Crt::Optional ComponentDetails::GetState() noexcept { + if (!m_state.has_value()) + return Aws::Crt::Optional(); + if (m_state.value() == Aws::Crt::String("RUNNING")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_RUNNING); + } + if (m_state.value() == Aws::Crt::String("ERRORED")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_ERRORED); + } + if (m_state.value() == Aws::Crt::String("NEW")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_NEW); + } + if (m_state.value() == Aws::Crt::String("FINISHED")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_FINISHED); + } + if (m_state.value() == Aws::Crt::String("INSTALLED")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_INSTALLED); + } + if (m_state.value() == Aws::Crt::String("BROKEN")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_BROKEN); + } + if (m_state.value() == Aws::Crt::String("STARTING")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_STARTING); + } + if (m_state.value() == Aws::Crt::String("STOPPING")) { + return Aws::Crt::Optional(LIFECYCLE_STATE_STOPPING); + } + + return Aws::Crt::Optional(); +} + +const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; + +Aws::Crt::String ComponentDetails::GetModelName() const noexcept { + return ComponentDetails::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ComponentDetails::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ComponentDetails::s_customDeleter); + shape->m_allocator = allocator; + ComponentDetails::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ComponentDetails::s_customDeleter(ComponentDetails *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CredentialDocument::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_chosenMember == TAG_MQTT_CREDENTIAL && m_mqttCredential.has_value()) { + Aws::Crt::JsonObject mQTTCredentialValue; + m_mqttCredential.value().SerializeToJsonObject(mQTTCredentialValue); + payloadObject.WithObject("mqttCredential", std::move(mQTTCredentialValue)); + } +} + +void CredentialDocument::s_loadFromJsonView( + CredentialDocument &credentialDocument, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("mqttCredential")) { + credentialDocument.m_mqttCredential = MQTTCredential(); + MQTTCredential::s_loadFromJsonView( + credentialDocument.m_mqttCredential.value(), + jsonView.GetJsonObject("mqttCredential")); + credentialDocument.m_chosenMember = TAG_MQTT_CREDENTIAL; + } +} + +CredentialDocument & +CredentialDocument::operator=(const CredentialDocument &objectToCopy) noexcept { + if (objectToCopy.m_chosenMember == TAG_MQTT_CREDENTIAL) { + m_mqttCredential = objectToCopy.m_mqttCredential; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; +} + +const char *CredentialDocument::MODEL_NAME = + "aws.greengrass#CredentialDocument"; + +Aws::Crt::String CredentialDocument::GetModelName() const noexcept { + return CredentialDocument::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CredentialDocument::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CredentialDocument::s_customDeleter); + shape->m_allocator = allocator; + CredentialDocument::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CredentialDocument::s_customDeleter(CredentialDocument *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void VerifyClientDeviceIdentityResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_isValidClientDevice.has_value()) { + payloadObject.WithBool("isValidClientDevice", + m_isValidClientDevice.value()); + } +} + +void VerifyClientDeviceIdentityResponse::s_loadFromJsonView( + VerifyClientDeviceIdentityResponse &verifyClientDeviceIdentityResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("isValidClientDevice")) { + verifyClientDeviceIdentityResponse.m_isValidClientDevice = + Aws::Crt::Optional(jsonView.GetBool("isValidClientDevice")); + } +} + +const char *VerifyClientDeviceIdentityResponse::MODEL_NAME = + "aws.greengrass#VerifyClientDeviceIdentityResponse"; + +Aws::Crt::String +VerifyClientDeviceIdentityResponse::GetModelName() const noexcept { + return VerifyClientDeviceIdentityResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +VerifyClientDeviceIdentityResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + VerifyClientDeviceIdentityResponse::s_customDeleter); + shape->m_allocator = allocator; + VerifyClientDeviceIdentityResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void VerifyClientDeviceIdentityResponse::s_customDeleter( + VerifyClientDeviceIdentityResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void VerifyClientDeviceIdentityRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_credential.has_value()) { + Aws::Crt::JsonObject clientDeviceCredentialValue; + m_credential.value().SerializeToJsonObject(clientDeviceCredentialValue); + payloadObject.WithObject("credential", + std::move(clientDeviceCredentialValue)); + } +} + +void VerifyClientDeviceIdentityRequest::s_loadFromJsonView( + VerifyClientDeviceIdentityRequest &verifyClientDeviceIdentityRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("credential")) { + verifyClientDeviceIdentityRequest.m_credential = ClientDeviceCredential(); + ClientDeviceCredential::s_loadFromJsonView( + verifyClientDeviceIdentityRequest.m_credential.value(), + jsonView.GetJsonObject("credential")); + } +} + +const char *VerifyClientDeviceIdentityRequest::MODEL_NAME = + "aws.greengrass#VerifyClientDeviceIdentityRequest"; + +Aws::Crt::String +VerifyClientDeviceIdentityRequest::GetModelName() const noexcept { + return VerifyClientDeviceIdentityRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +VerifyClientDeviceIdentityRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + VerifyClientDeviceIdentityRequest::s_customDeleter); + shape->m_allocator = allocator; + VerifyClientDeviceIdentityRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void VerifyClientDeviceIdentityRequest::s_customDeleter( + VerifyClientDeviceIdentityRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void InvalidTokenError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidTokenError::s_loadFromJsonView( + InvalidTokenError &invalidTokenError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidTokenError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; + +Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { + return InvalidTokenError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidTokenError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidTokenError::s_customDeleter); + shape->m_allocator = allocator; + InvalidTokenError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidTokenError::s_customDeleter(InvalidTokenError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void ValidateAuthorizationTokenResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_isValid.has_value()) { + payloadObject.WithBool("isValid", m_isValid.value()); + } +} + +void ValidateAuthorizationTokenResponse::s_loadFromJsonView( + ValidateAuthorizationTokenResponse &validateAuthorizationTokenResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("isValid")) { + validateAuthorizationTokenResponse.m_isValid = + Aws::Crt::Optional(jsonView.GetBool("isValid")); + } +} + +const char *ValidateAuthorizationTokenResponse::MODEL_NAME = + "aws.greengrass#ValidateAuthorizationTokenResponse"; + +Aws::Crt::String +ValidateAuthorizationTokenResponse::GetModelName() const noexcept { + return ValidateAuthorizationTokenResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ValidateAuthorizationTokenResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateAuthorizationTokenResponse::s_customDeleter); + shape->m_allocator = allocator; + ValidateAuthorizationTokenResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ValidateAuthorizationTokenResponse::s_customDeleter( + ValidateAuthorizationTokenResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ValidateAuthorizationTokenRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_token.has_value()) { + payloadObject.WithString("token", m_token.value()); + } +} + +void ValidateAuthorizationTokenRequest::s_loadFromJsonView( + ValidateAuthorizationTokenRequest &validateAuthorizationTokenRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("token")) { + validateAuthorizationTokenRequest.m_token = + Aws::Crt::Optional(jsonView.GetString("token")); + } +} + +const char *ValidateAuthorizationTokenRequest::MODEL_NAME = + "aws.greengrass#ValidateAuthorizationTokenRequest"; + +Aws::Crt::String +ValidateAuthorizationTokenRequest::GetModelName() const noexcept { + return ValidateAuthorizationTokenRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ValidateAuthorizationTokenRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateAuthorizationTokenRequest::s_customDeleter); + shape->m_allocator = allocator; + ValidateAuthorizationTokenRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ValidateAuthorizationTokenRequest::s_customDeleter( + ValidateAuthorizationTokenRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void UpdateThingShadowResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void UpdateThingShadowResponse::s_loadFromJsonView( + UpdateThingShadowResponse &updateThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + updateThingShadowResponse.m_payload = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +const char *UpdateThingShadowResponse::MODEL_NAME = + "aws.greengrass#UpdateThingShadowResponse"; + +Aws::Crt::String UpdateThingShadowResponse::GetModelName() const noexcept { + return UpdateThingShadowResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateThingShadowResponse::s_customDeleter( + UpdateThingShadowResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void UpdateThingShadowRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_thingName.has_value()) { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) { + payloadObject.WithString("shadowName", m_shadowName.value()); + } + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void UpdateThingShadowRequest::s_loadFromJsonView( + UpdateThingShadowRequest &updateThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("thingName")) { + updateThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) { + updateThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + updateThingShadowRequest.m_payload = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +const char *UpdateThingShadowRequest::MODEL_NAME = + "aws.greengrass#UpdateThingShadowRequest"; + +Aws::Crt::String UpdateThingShadowRequest::GetModelName() const noexcept { + return UpdateThingShadowRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateThingShadowRequest::s_customDeleter( + UpdateThingShadowRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void UpdateStateResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void UpdateStateResponse::s_loadFromJsonView( + UpdateStateResponse &updateStateResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)updateStateResponse; + (void)jsonView; +} + +const char *UpdateStateResponse::MODEL_NAME = + "aws.greengrass#UpdateStateResponse"; + +Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { + return UpdateStateResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateStateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateStateResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateStateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateStateResponse::s_customDeleter(UpdateStateResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void UpdateStateRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_state.has_value()) { + payloadObject.WithString("state", m_state.value()); + } +} + +void UpdateStateRequest::s_loadFromJsonView( + UpdateStateRequest &updateStateRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("state")) { + updateStateRequest.m_state = + Aws::Crt::Optional(jsonView.GetString("state")); + } +} + +void UpdateStateRequest::SetState(ReportedLifecycleState state) noexcept { + switch (state) { + case REPORTED_LIFECYCLE_STATE_RUNNING: + m_state = Aws::Crt::String("RUNNING"); + break; + case REPORTED_LIFECYCLE_STATE_ERRORED: + m_state = Aws::Crt::String("ERRORED"); + break; + default: + break; + } +} + +Aws::Crt::Optional +UpdateStateRequest::GetState() noexcept { + if (!m_state.has_value()) + return Aws::Crt::Optional(); + if (m_state.value() == Aws::Crt::String("RUNNING")) { + return Aws::Crt::Optional( + REPORTED_LIFECYCLE_STATE_RUNNING); + } + if (m_state.value() == Aws::Crt::String("ERRORED")) { + return Aws::Crt::Optional( + REPORTED_LIFECYCLE_STATE_ERRORED); + } + + return Aws::Crt::Optional(); +} + +const char *UpdateStateRequest::MODEL_NAME = + "aws.greengrass#UpdateStateRequest"; + +Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { + return UpdateStateRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateStateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateStateRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateStateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateStateRequest::s_customDeleter(UpdateStateRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void FailedUpdateConditionCheckError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void FailedUpdateConditionCheckError::s_loadFromJsonView( + FailedUpdateConditionCheckError &failedUpdateConditionCheckError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + failedUpdateConditionCheckError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *FailedUpdateConditionCheckError::MODEL_NAME = + "aws.greengrass#FailedUpdateConditionCheckError"; + +Aws::Crt::String +FailedUpdateConditionCheckError::GetModelName() const noexcept { + return FailedUpdateConditionCheckError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +FailedUpdateConditionCheckError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + FailedUpdateConditionCheckError::s_customDeleter); + shape->m_allocator = allocator; + FailedUpdateConditionCheckError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void FailedUpdateConditionCheckError::s_customDeleter( + FailedUpdateConditionCheckError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void ConflictError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void ConflictError::s_loadFromJsonView( + ConflictError &conflictError, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + conflictError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; + +Aws::Crt::String ConflictError::GetModelName() const noexcept { + return ConflictError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ConflictError::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ConflictError::s_customDeleter); + shape->m_allocator = allocator; + ConflictError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void ConflictError::s_customDeleter(ConflictError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void UpdateConfigurationResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void UpdateConfigurationResponse::s_loadFromJsonView( + UpdateConfigurationResponse &updateConfigurationResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)updateConfigurationResponse; + (void)jsonView; +} + +const char *UpdateConfigurationResponse::MODEL_NAME = + "aws.greengrass#UpdateConfigurationResponse"; + +Aws::Crt::String UpdateConfigurationResponse::GetModelName() const noexcept { + return UpdateConfigurationResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateConfigurationResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateConfigurationResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateConfigurationResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateConfigurationResponse::s_customDeleter( + UpdateConfigurationResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void UpdateConfigurationRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_keyPath.has_value()) { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } + if (m_timestamp.has_value()) { + payloadObject.WithDouble("timestamp", + m_timestamp.value().SecondsWithMSPrecision()); + } + if (m_valueToMerge.has_value()) { + payloadObject.WithObject("valueToMerge", m_valueToMerge.value()); + } +} + +void UpdateConfigurationRequest::s_loadFromJsonView( + UpdateConfigurationRequest &updateConfigurationRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("keyPath")) { + updateConfigurationRequest.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : + jsonView.GetArray("keyPath")) { + Aws::Crt::Optional keyPathItem; + keyPathItem = + Aws::Crt::Optional(keyPathJsonView.AsString()); + updateConfigurationRequest.m_keyPath.value().push_back( + keyPathItem.value()); + } + } + if (jsonView.ValueExists("timestamp")) { + updateConfigurationRequest.m_timestamp = + Aws::Crt::Optional( + Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); + } + if (jsonView.ValueExists("valueToMerge")) { + updateConfigurationRequest.m_valueToMerge = + Aws::Crt::Optional( + jsonView.GetJsonObject("valueToMerge").Materialize()); + } +} + +const char *UpdateConfigurationRequest::MODEL_NAME = + "aws.greengrass#UpdateConfigurationRequest"; + +Aws::Crt::String UpdateConfigurationRequest::GetModelName() const noexcept { + return UpdateConfigurationRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UpdateConfigurationRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UpdateConfigurationRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateConfigurationRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void UpdateConfigurationRequest::s_customDeleter( + UpdateConfigurationRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToValidateConfigurationUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesResponse + &subscribeToValidateConfigurationUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToValidateConfigurationUpdatesResponse; + (void)jsonView; +} + +const char *SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"; + +Aws::Crt::String +SubscribeToValidateConfigurationUpdatesResponse::GetModelName() const noexcept { + return SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource + shape(Aws::Crt::New( + allocator), + SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView(*shape, + jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter( + SubscribeToValidateConfigurationUpdatesResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToValidateConfigurationUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesRequest + &subscribeToValidateConfigurationUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToValidateConfigurationUpdatesRequest; + (void)jsonView; +} + +const char *SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"; + +Aws::Crt::String +SubscribeToValidateConfigurationUpdatesRequest::GetModelName() const noexcept { + return SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToValidateConfigurationUpdatesRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource + shape(Aws::Crt::New( + allocator), + SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView(*shape, + jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter( + SubscribeToValidateConfigurationUpdatesRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToTopicResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topicName.has_value()) { + payloadObject.WithString("topicName", m_topicName.value()); + } +} + +void SubscribeToTopicResponse::s_loadFromJsonView( + SubscribeToTopicResponse &subscribeToTopicResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topicName")) { + subscribeToTopicResponse.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } +} + +const char *SubscribeToTopicResponse::MODEL_NAME = + "aws.greengrass#SubscribeToTopicResponse"; + +Aws::Crt::String SubscribeToTopicResponse::GetModelName() const noexcept { + return SubscribeToTopicResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToTopicResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToTopicResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToTopicResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToTopicResponse::s_customDeleter( + SubscribeToTopicResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToTopicRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topic.has_value()) { + payloadObject.WithString("topic", m_topic.value()); + } + if (m_receiveMode.has_value()) { + payloadObject.WithString("receiveMode", m_receiveMode.value()); + } +} + +void SubscribeToTopicRequest::s_loadFromJsonView( + SubscribeToTopicRequest &subscribeToTopicRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topic")) { + subscribeToTopicRequest.m_topic = + Aws::Crt::Optional(jsonView.GetString("topic")); + } + if (jsonView.ValueExists("receiveMode")) { + subscribeToTopicRequest.m_receiveMode = + Aws::Crt::Optional(jsonView.GetString("receiveMode")); + } +} + +void SubscribeToTopicRequest::SetReceiveMode(ReceiveMode receiveMode) noexcept { + switch (receiveMode) { + case RECEIVE_MODE_RECEIVE_ALL_MESSAGES: + m_receiveMode = Aws::Crt::String("RECEIVE_ALL_MESSAGES"); + break; + case RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS: + m_receiveMode = Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS"); + break; + default: + break; + } +} + +Aws::Crt::Optional +SubscribeToTopicRequest::GetReceiveMode() noexcept { + if (!m_receiveMode.has_value()) + return Aws::Crt::Optional(); + if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_ALL_MESSAGES")) { + return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_ALL_MESSAGES); + } + if (m_receiveMode.value() == + Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS")) { + return Aws::Crt::Optional( + RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS); + } + + return Aws::Crt::Optional(); +} + +const char *SubscribeToTopicRequest::MODEL_NAME = + "aws.greengrass#SubscribeToTopicRequest"; + +Aws::Crt::String SubscribeToTopicRequest::GetModelName() const noexcept { + return SubscribeToTopicRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToTopicRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToTopicRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToTopicRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToTopicRequest::s_customDeleter( + SubscribeToTopicRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToIoTCoreResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToIoTCoreResponse::s_loadFromJsonView( + SubscribeToIoTCoreResponse &subscribeToIoTCoreResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToIoTCoreResponse; + (void)jsonView; +} + +const char *SubscribeToIoTCoreResponse::MODEL_NAME = + "aws.greengrass#SubscribeToIoTCoreResponse"; + +Aws::Crt::String SubscribeToIoTCoreResponse::GetModelName() const noexcept { + return SubscribeToIoTCoreResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToIoTCoreResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToIoTCoreResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToIoTCoreResponse::s_customDeleter( + SubscribeToIoTCoreResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToIoTCoreRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topicName.has_value()) { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_qos.has_value()) { + payloadObject.WithString("qos", m_qos.value()); + } +} + +void SubscribeToIoTCoreRequest::s_loadFromJsonView( + SubscribeToIoTCoreRequest &subscribeToIoTCoreRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topicName")) { + subscribeToIoTCoreRequest.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("qos")) { + subscribeToIoTCoreRequest.m_qos = + Aws::Crt::Optional(jsonView.GetString("qos")); + } +} + +void SubscribeToIoTCoreRequest::SetQos(QOS qos) noexcept { + switch (qos) { + case QOS_AT_MOST_ONCE: + m_qos = Aws::Crt::String("0"); + break; + case QOS_AT_LEAST_ONCE: + m_qos = Aws::Crt::String("1"); + break; + default: + break; + } +} + +Aws::Crt::Optional SubscribeToIoTCoreRequest::GetQos() noexcept { + if (!m_qos.has_value()) + return Aws::Crt::Optional(); + if (m_qos.value() == Aws::Crt::String("0")) { + return Aws::Crt::Optional(QOS_AT_MOST_ONCE); + } + if (m_qos.value() == Aws::Crt::String("1")) { + return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); + } + + return Aws::Crt::Optional(); +} + +const char *SubscribeToIoTCoreRequest::MODEL_NAME = + "aws.greengrass#SubscribeToIoTCoreRequest"; + +Aws::Crt::String SubscribeToIoTCoreRequest::GetModelName() const noexcept { + return SubscribeToIoTCoreRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToIoTCoreRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToIoTCoreRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToIoTCoreRequest::s_customDeleter( + SubscribeToIoTCoreRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToConfigurationUpdateResponse::s_loadFromJsonView( + SubscribeToConfigurationUpdateResponse + &subscribeToConfigurationUpdateResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToConfigurationUpdateResponse; + (void)jsonView; +} + +const char *SubscribeToConfigurationUpdateResponse::MODEL_NAME = + "aws.greengrass#SubscribeToConfigurationUpdateResponse"; + +Aws::Crt::String +SubscribeToConfigurationUpdateResponse::GetModelName() const noexcept { + return SubscribeToConfigurationUpdateResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToConfigurationUpdateResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToConfigurationUpdateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToConfigurationUpdateResponse::s_customDeleter( + SubscribeToConfigurationUpdateResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } +} + +void SubscribeToConfigurationUpdateRequest::s_loadFromJsonView( + SubscribeToConfigurationUpdateRequest + &subscribeToConfigurationUpdateRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + subscribeToConfigurationUpdateRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) { + subscribeToConfigurationUpdateRequest.m_keyPath = + Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : + jsonView.GetArray("keyPath")) { + Aws::Crt::Optional keyPathItem; + keyPathItem = + Aws::Crt::Optional(keyPathJsonView.AsString()); + subscribeToConfigurationUpdateRequest.m_keyPath.value().push_back( + keyPathItem.value()); + } + } +} + +const char *SubscribeToConfigurationUpdateRequest::MODEL_NAME = + "aws.greengrass#SubscribeToConfigurationUpdateRequest"; + +Aws::Crt::String +SubscribeToConfigurationUpdateRequest::GetModelName() const noexcept { + return SubscribeToConfigurationUpdateRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToConfigurationUpdateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToConfigurationUpdateRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToConfigurationUpdateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToConfigurationUpdateRequest::s_customDeleter( + SubscribeToConfigurationUpdateRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToComponentUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToComponentUpdatesResponse::s_loadFromJsonView( + SubscribeToComponentUpdatesResponse &subscribeToComponentUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToComponentUpdatesResponse; + (void)jsonView; +} + +const char *SubscribeToComponentUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToComponentUpdatesResponse"; + +Aws::Crt::String +SubscribeToComponentUpdatesResponse::GetModelName() const noexcept { + return SubscribeToComponentUpdatesResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToComponentUpdatesResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToComponentUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToComponentUpdatesResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToComponentUpdatesResponse::s_customDeleter( + SubscribeToComponentUpdatesResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToComponentUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToComponentUpdatesRequest::s_loadFromJsonView( + SubscribeToComponentUpdatesRequest &subscribeToComponentUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToComponentUpdatesRequest; + (void)jsonView; +} + +const char *SubscribeToComponentUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToComponentUpdatesRequest"; + +Aws::Crt::String +SubscribeToComponentUpdatesRequest::GetModelName() const noexcept { + return SubscribeToComponentUpdatesRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToComponentUpdatesRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToComponentUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToComponentUpdatesRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToComponentUpdatesRequest::s_customDeleter( + SubscribeToComponentUpdatesRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SubscribeToCertificateUpdatesResponse::s_loadFromJsonView( + SubscribeToCertificateUpdatesResponse + &subscribeToCertificateUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)subscribeToCertificateUpdatesResponse; + (void)jsonView; +} + +const char *SubscribeToCertificateUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToCertificateUpdatesResponse"; + +Aws::Crt::String +SubscribeToCertificateUpdatesResponse::GetModelName() const noexcept { + return SubscribeToCertificateUpdatesResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToCertificateUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToCertificateUpdatesResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToCertificateUpdatesResponse::s_customDeleter( + SubscribeToCertificateUpdatesResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_certificateOptions.has_value()) { + Aws::Crt::JsonObject certificateOptionsValue; + m_certificateOptions.value().SerializeToJsonObject(certificateOptionsValue); + payloadObject.WithObject("certificateOptions", + std::move(certificateOptionsValue)); + } +} + +void SubscribeToCertificateUpdatesRequest::s_loadFromJsonView( + SubscribeToCertificateUpdatesRequest &subscribeToCertificateUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("certificateOptions")) { + subscribeToCertificateUpdatesRequest.m_certificateOptions = + CertificateOptions(); + CertificateOptions::s_loadFromJsonView( + subscribeToCertificateUpdatesRequest.m_certificateOptions.value(), + jsonView.GetJsonObject("certificateOptions")); + } +} + +const char *SubscribeToCertificateUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToCertificateUpdatesRequest"; + +Aws::Crt::String +SubscribeToCertificateUpdatesRequest::GetModelName() const noexcept { + return SubscribeToCertificateUpdatesRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SubscribeToCertificateUpdatesRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToCertificateUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToCertificateUpdatesRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SubscribeToCertificateUpdatesRequest::s_customDeleter( + SubscribeToCertificateUpdatesRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void StopComponentResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_stopStatus.has_value()) { + payloadObject.WithString("stopStatus", m_stopStatus.value()); + } + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void StopComponentResponse::s_loadFromJsonView( + StopComponentResponse &stopComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("stopStatus")) { + stopComponentResponse.m_stopStatus = + Aws::Crt::Optional(jsonView.GetString("stopStatus")); + } + if (jsonView.ValueExists("message")) { + stopComponentResponse.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +void StopComponentResponse::SetStopStatus(RequestStatus stopStatus) noexcept { + switch (stopStatus) { + case REQUEST_STATUS_SUCCEEDED: + m_stopStatus = Aws::Crt::String("SUCCEEDED"); + break; + case REQUEST_STATUS_FAILED: + m_stopStatus = Aws::Crt::String("FAILED"); + break; + default: + break; + } +} + +Aws::Crt::Optional +StopComponentResponse::GetStopStatus() noexcept { + if (!m_stopStatus.has_value()) + return Aws::Crt::Optional(); + if (m_stopStatus.value() == Aws::Crt::String("SUCCEEDED")) { + return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); + } + if (m_stopStatus.value() == Aws::Crt::String("FAILED")) { + return Aws::Crt::Optional(REQUEST_STATUS_FAILED); + } + + return Aws::Crt::Optional(); +} + +const char *StopComponentResponse::MODEL_NAME = + "aws.greengrass#StopComponentResponse"; + +Aws::Crt::String StopComponentResponse::GetModelName() const noexcept { + return StopComponentResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +StopComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + StopComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + StopComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void StopComponentResponse::s_customDeleter( + StopComponentResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void StopComponentRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } +} + +void StopComponentRequest::s_loadFromJsonView( + StopComponentRequest &stopComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + stopComponentRequest.m_componentName = Aws::Crt::Optional( + jsonView.GetString("componentName")); + } +} + +const char *StopComponentRequest::MODEL_NAME = + "aws.greengrass#StopComponentRequest"; + +Aws::Crt::String StopComponentRequest::GetModelName() const noexcept { + return StopComponentRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +StopComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + StopComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + StopComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void StopComponentRequest::s_customDeleter( + StopComponentRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SendConfigurationValidityReportResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void SendConfigurationValidityReportResponse::s_loadFromJsonView( + SendConfigurationValidityReportResponse + &sendConfigurationValidityReportResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)sendConfigurationValidityReportResponse; + (void)jsonView; +} + +const char *SendConfigurationValidityReportResponse::MODEL_NAME = + "aws.greengrass#SendConfigurationValidityReportResponse"; + +Aws::Crt::String +SendConfigurationValidityReportResponse::GetModelName() const noexcept { + return SendConfigurationValidityReportResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SendConfigurationValidityReportResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SendConfigurationValidityReportResponse::s_customDeleter); + shape->m_allocator = allocator; + SendConfigurationValidityReportResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SendConfigurationValidityReportResponse::s_customDeleter( + SendConfigurationValidityReportResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SendConfigurationValidityReportRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_configurationValidityReport.has_value()) { + Aws::Crt::JsonObject configurationValidityReportValue; + m_configurationValidityReport.value().SerializeToJsonObject( + configurationValidityReportValue); + payloadObject.WithObject("configurationValidityReport", + std::move(configurationValidityReportValue)); + } +} + +void SendConfigurationValidityReportRequest::s_loadFromJsonView( + SendConfigurationValidityReportRequest + &sendConfigurationValidityReportRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("configurationValidityReport")) { + sendConfigurationValidityReportRequest.m_configurationValidityReport = + ConfigurationValidityReport(); + ConfigurationValidityReport::s_loadFromJsonView( + sendConfigurationValidityReportRequest.m_configurationValidityReport + .value(), + jsonView.GetJsonObject("configurationValidityReport")); + } +} + +const char *SendConfigurationValidityReportRequest::MODEL_NAME = + "aws.greengrass#SendConfigurationValidityReportRequest"; + +Aws::Crt::String +SendConfigurationValidityReportRequest::GetModelName() const noexcept { + return SendConfigurationValidityReportRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +SendConfigurationValidityReportRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SendConfigurationValidityReportRequest::s_customDeleter); + shape->m_allocator = allocator; + SendConfigurationValidityReportRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void SendConfigurationValidityReportRequest::s_customDeleter( + SendConfigurationValidityReportRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ResumeComponentResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void ResumeComponentResponse::s_loadFromJsonView( + ResumeComponentResponse &resumeComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)resumeComponentResponse; + (void)jsonView; +} + +const char *ResumeComponentResponse::MODEL_NAME = + "aws.greengrass#ResumeComponentResponse"; + +Aws::Crt::String ResumeComponentResponse::GetModelName() const noexcept { + return ResumeComponentResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ResumeComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ResumeComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + ResumeComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ResumeComponentResponse::s_customDeleter( + ResumeComponentResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ResumeComponentRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } +} + +void ResumeComponentRequest::s_loadFromJsonView( + ResumeComponentRequest &resumeComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + resumeComponentRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } +} + +const char *ResumeComponentRequest::MODEL_NAME = + "aws.greengrass#ResumeComponentRequest"; + +Aws::Crt::String ResumeComponentRequest::GetModelName() const noexcept { + return ResumeComponentRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ResumeComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ResumeComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + ResumeComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ResumeComponentRequest::s_customDeleter( + ResumeComponentRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ComponentNotFoundError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void ComponentNotFoundError::s_loadFromJsonView( + ComponentNotFoundError &componentNotFoundError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + componentNotFoundError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *ComponentNotFoundError::MODEL_NAME = + "aws.greengrass#ComponentNotFoundError"; + +Aws::Crt::String ComponentNotFoundError::GetModelName() const noexcept { + return ComponentNotFoundError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ComponentNotFoundError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ComponentNotFoundError::s_customDeleter); + shape->m_allocator = allocator; + ComponentNotFoundError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void ComponentNotFoundError::s_customDeleter( + ComponentNotFoundError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void RestartComponentResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_restartStatus.has_value()) { + payloadObject.WithString("restartStatus", m_restartStatus.value()); + } + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void RestartComponentResponse::s_loadFromJsonView( + RestartComponentResponse &restartComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("restartStatus")) { + restartComponentResponse.m_restartStatus = + Aws::Crt::Optional( + jsonView.GetString("restartStatus")); + } + if (jsonView.ValueExists("message")) { + restartComponentResponse.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +void RestartComponentResponse::SetRestartStatus( + RequestStatus restartStatus) noexcept { + switch (restartStatus) { + case REQUEST_STATUS_SUCCEEDED: + m_restartStatus = Aws::Crt::String("SUCCEEDED"); + break; + case REQUEST_STATUS_FAILED: + m_restartStatus = Aws::Crt::String("FAILED"); + break; + default: + break; + } +} + +Aws::Crt::Optional +RestartComponentResponse::GetRestartStatus() noexcept { + if (!m_restartStatus.has_value()) + return Aws::Crt::Optional(); + if (m_restartStatus.value() == Aws::Crt::String("SUCCEEDED")) { + return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); + } + if (m_restartStatus.value() == Aws::Crt::String("FAILED")) { + return Aws::Crt::Optional(REQUEST_STATUS_FAILED); + } + + return Aws::Crt::Optional(); +} + +const char *RestartComponentResponse::MODEL_NAME = + "aws.greengrass#RestartComponentResponse"; + +Aws::Crt::String RestartComponentResponse::GetModelName() const noexcept { + return RestartComponentResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +RestartComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + RestartComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + RestartComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void RestartComponentResponse::s_customDeleter( + RestartComponentResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void RestartComponentRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } +} + +void RestartComponentRequest::s_loadFromJsonView( + RestartComponentRequest &restartComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + restartComponentRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } +} + +const char *RestartComponentRequest::MODEL_NAME = + "aws.greengrass#RestartComponentRequest"; + +Aws::Crt::String RestartComponentRequest::GetModelName() const noexcept { + return RestartComponentRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +RestartComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + RestartComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + RestartComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void RestartComponentRequest::s_customDeleter( + RestartComponentRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PutComponentMetricResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void PutComponentMetricResponse::s_loadFromJsonView( + PutComponentMetricResponse &putComponentMetricResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)putComponentMetricResponse; + (void)jsonView; +} + +const char *PutComponentMetricResponse::MODEL_NAME = + "aws.greengrass#PutComponentMetricResponse"; + +Aws::Crt::String PutComponentMetricResponse::GetModelName() const noexcept { + return PutComponentMetricResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PutComponentMetricResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PutComponentMetricResponse::s_customDeleter); + shape->m_allocator = allocator; + PutComponentMetricResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PutComponentMetricResponse::s_customDeleter( + PutComponentMetricResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PutComponentMetricRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_metrics.has_value()) { + Aws::Crt::JsonObject metricsList; + Aws::Crt::Vector metricsListJsonArray; + for (const auto &metricsListItem : m_metrics.value()) { + Aws::Crt::JsonObject metricsListJsonArrayItem; + metricsListItem.SerializeToJsonObject(metricsListJsonArrayItem); + metricsListJsonArray.emplace_back(std::move(metricsListJsonArrayItem)); + } + metricsList.AsArray(std::move(metricsListJsonArray)); + payloadObject.WithObject("metrics", std::move(metricsList)); + } +} + +void PutComponentMetricRequest::s_loadFromJsonView( + PutComponentMetricRequest &putComponentMetricRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("metrics")) { + putComponentMetricRequest.m_metrics = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &metricsListJsonView : + jsonView.GetArray("metrics")) { + Aws::Crt::Optional metricsListItem; + metricsListItem = Metric(); + Metric::s_loadFromJsonView(metricsListItem.value(), metricsListJsonView); + putComponentMetricRequest.m_metrics.value().push_back( + metricsListItem.value()); + } + } +} + +const char *PutComponentMetricRequest::MODEL_NAME = + "aws.greengrass#PutComponentMetricRequest"; + +Aws::Crt::String PutComponentMetricRequest::GetModelName() const noexcept { + return PutComponentMetricRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PutComponentMetricRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PutComponentMetricRequest::s_customDeleter); + shape->m_allocator = allocator; + PutComponentMetricRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PutComponentMetricRequest::s_customDeleter( + PutComponentMetricRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PublishToTopicResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void PublishToTopicResponse::s_loadFromJsonView( + PublishToTopicResponse &publishToTopicResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)publishToTopicResponse; + (void)jsonView; +} + +const char *PublishToTopicResponse::MODEL_NAME = + "aws.greengrass#PublishToTopicResponse"; + +Aws::Crt::String PublishToTopicResponse::GetModelName() const noexcept { + return PublishToTopicResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PublishToTopicResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PublishToTopicResponse::s_customDeleter); + shape->m_allocator = allocator; + PublishToTopicResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PublishToTopicResponse::s_customDeleter( + PublishToTopicResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PublishToTopicRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topic.has_value()) { + payloadObject.WithString("topic", m_topic.value()); + } + if (m_publishMessage.has_value()) { + Aws::Crt::JsonObject publishMessageValue; + m_publishMessage.value().SerializeToJsonObject(publishMessageValue); + payloadObject.WithObject("publishMessage", std::move(publishMessageValue)); + } +} + +void PublishToTopicRequest::s_loadFromJsonView( + PublishToTopicRequest &publishToTopicRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topic")) { + publishToTopicRequest.m_topic = + Aws::Crt::Optional(jsonView.GetString("topic")); + } + if (jsonView.ValueExists("publishMessage")) { + publishToTopicRequest.m_publishMessage = PublishMessage(); + PublishMessage::s_loadFromJsonView( + publishToTopicRequest.m_publishMessage.value(), + jsonView.GetJsonObject("publishMessage")); + } +} + +const char *PublishToTopicRequest::MODEL_NAME = + "aws.greengrass#PublishToTopicRequest"; + +Aws::Crt::String PublishToTopicRequest::GetModelName() const noexcept { + return PublishToTopicRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PublishToTopicRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PublishToTopicRequest::s_customDeleter); + shape->m_allocator = allocator; + PublishToTopicRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PublishToTopicRequest::s_customDeleter( + PublishToTopicRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PublishToIoTCoreResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void PublishToIoTCoreResponse::s_loadFromJsonView( + PublishToIoTCoreResponse &publishToIoTCoreResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)publishToIoTCoreResponse; + (void)jsonView; +} + +const char *PublishToIoTCoreResponse::MODEL_NAME = + "aws.greengrass#PublishToIoTCoreResponse"; + +Aws::Crt::String PublishToIoTCoreResponse::GetModelName() const noexcept { + return PublishToIoTCoreResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PublishToIoTCoreResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PublishToIoTCoreResponse::s_customDeleter); + shape->m_allocator = allocator; + PublishToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PublishToIoTCoreResponse::s_customDeleter( + PublishToIoTCoreResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PublishToIoTCoreRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_topicName.has_value()) { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_qos.has_value()) { + payloadObject.WithString("qos", m_qos.value()); + } + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void PublishToIoTCoreRequest::s_loadFromJsonView( + PublishToIoTCoreRequest &publishToIoTCoreRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("topicName")) { + publishToIoTCoreRequest.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("qos")) { + publishToIoTCoreRequest.m_qos = + Aws::Crt::Optional(jsonView.GetString("qos")); + } + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + publishToIoTCoreRequest.m_payload = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +void PublishToIoTCoreRequest::SetQos(QOS qos) noexcept { + switch (qos) { + case QOS_AT_MOST_ONCE: + m_qos = Aws::Crt::String("0"); + break; + case QOS_AT_LEAST_ONCE: + m_qos = Aws::Crt::String("1"); + break; + default: + break; + } +} + +Aws::Crt::Optional PublishToIoTCoreRequest::GetQos() noexcept { + if (!m_qos.has_value()) + return Aws::Crt::Optional(); + if (m_qos.value() == Aws::Crt::String("0")) { + return Aws::Crt::Optional(QOS_AT_MOST_ONCE); + } + if (m_qos.value() == Aws::Crt::String("1")) { + return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); + } + + return Aws::Crt::Optional(); +} + +const char *PublishToIoTCoreRequest::MODEL_NAME = + "aws.greengrass#PublishToIoTCoreRequest"; + +Aws::Crt::String PublishToIoTCoreRequest::GetModelName() const noexcept { + return PublishToIoTCoreRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PublishToIoTCoreRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PublishToIoTCoreRequest::s_customDeleter); + shape->m_allocator = allocator; + PublishToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PublishToIoTCoreRequest::s_customDeleter( + PublishToIoTCoreRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PauseComponentResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void PauseComponentResponse::s_loadFromJsonView( + PauseComponentResponse &pauseComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)pauseComponentResponse; + (void)jsonView; +} + +const char *PauseComponentResponse::MODEL_NAME = + "aws.greengrass#PauseComponentResponse"; + +Aws::Crt::String PauseComponentResponse::GetModelName() const noexcept { + return PauseComponentResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PauseComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PauseComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + PauseComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PauseComponentResponse::s_customDeleter( + PauseComponentResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void PauseComponentRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } +} + +void PauseComponentRequest::s_loadFromJsonView( + PauseComponentRequest &pauseComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + pauseComponentRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } +} + +const char *PauseComponentRequest::MODEL_NAME = + "aws.greengrass#PauseComponentRequest"; + +Aws::Crt::String PauseComponentRequest::GetModelName() const noexcept { + return PauseComponentRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +PauseComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + PauseComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + PauseComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void PauseComponentRequest::s_customDeleter( + PauseComponentRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListNamedShadowsForThingResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_results.has_value()) { + Aws::Crt::JsonObject namedShadowList; + Aws::Crt::Vector namedShadowListJsonArray; + for (const auto &namedShadowListItem : m_results.value()) { + Aws::Crt::JsonObject namedShadowListJsonArrayItem; + namedShadowListJsonArrayItem.AsString(namedShadowListItem); + namedShadowListJsonArray.emplace_back( + std::move(namedShadowListJsonArrayItem)); + } + namedShadowList.AsArray(std::move(namedShadowListJsonArray)); + payloadObject.WithObject("results", std::move(namedShadowList)); + } + if (m_timestamp.has_value()) { + payloadObject.WithDouble("timestamp", + m_timestamp.value().SecondsWithMSPrecision()); + } + if (m_nextToken.has_value()) { + payloadObject.WithString("nextToken", m_nextToken.value()); + } +} + +void ListNamedShadowsForThingResponse::s_loadFromJsonView( + ListNamedShadowsForThingResponse &listNamedShadowsForThingResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("results")) { + listNamedShadowsForThingResponse.m_results = + Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &namedShadowListJsonView : + jsonView.GetArray("results")) { + Aws::Crt::Optional namedShadowListItem; + namedShadowListItem = Aws::Crt::Optional( + namedShadowListJsonView.AsString()); + listNamedShadowsForThingResponse.m_results.value().push_back( + namedShadowListItem.value()); + } + } + if (jsonView.ValueExists("timestamp")) { + listNamedShadowsForThingResponse.m_timestamp = + Aws::Crt::Optional( + Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); + } + if (jsonView.ValueExists("nextToken")) { + listNamedShadowsForThingResponse.m_nextToken = + Aws::Crt::Optional(jsonView.GetString("nextToken")); + } +} + +const char *ListNamedShadowsForThingResponse::MODEL_NAME = + "aws.greengrass#ListNamedShadowsForThingResponse"; + +Aws::Crt::String +ListNamedShadowsForThingResponse::GetModelName() const noexcept { + return ListNamedShadowsForThingResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListNamedShadowsForThingResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListNamedShadowsForThingResponse::s_customDeleter); + shape->m_allocator = allocator; + ListNamedShadowsForThingResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListNamedShadowsForThingResponse::s_customDeleter( + ListNamedShadowsForThingResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListNamedShadowsForThingRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_thingName.has_value()) { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_nextToken.has_value()) { + payloadObject.WithString("nextToken", m_nextToken.value()); + } + if (m_pageSize.has_value()) { + payloadObject.WithInteger("pageSize", m_pageSize.value()); + } +} + +void ListNamedShadowsForThingRequest::s_loadFromJsonView( + ListNamedShadowsForThingRequest &listNamedShadowsForThingRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("thingName")) { + listNamedShadowsForThingRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("nextToken")) { + listNamedShadowsForThingRequest.m_nextToken = + Aws::Crt::Optional(jsonView.GetString("nextToken")); + } + if (jsonView.ValueExists("pageSize")) { + listNamedShadowsForThingRequest.m_pageSize = + Aws::Crt::Optional(jsonView.GetInteger("pageSize")); + } +} + +const char *ListNamedShadowsForThingRequest::MODEL_NAME = + "aws.greengrass#ListNamedShadowsForThingRequest"; + +Aws::Crt::String +ListNamedShadowsForThingRequest::GetModelName() const noexcept { + return ListNamedShadowsForThingRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListNamedShadowsForThingRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListNamedShadowsForThingRequest::s_customDeleter); + shape->m_allocator = allocator; + ListNamedShadowsForThingRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListNamedShadowsForThingRequest::s_customDeleter( + ListNamedShadowsForThingRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListLocalDeploymentsResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_localDeployments.has_value()) { + Aws::Crt::JsonObject listOfLocalDeployments; + Aws::Crt::Vector listOfLocalDeploymentsJsonArray; + for (const auto &listOfLocalDeploymentsItem : m_localDeployments.value()) { + Aws::Crt::JsonObject listOfLocalDeploymentsJsonArrayItem; + listOfLocalDeploymentsItem.SerializeToJsonObject( + listOfLocalDeploymentsJsonArrayItem); + listOfLocalDeploymentsJsonArray.emplace_back( + std::move(listOfLocalDeploymentsJsonArrayItem)); + } + listOfLocalDeployments.AsArray(std::move(listOfLocalDeploymentsJsonArray)); + payloadObject.WithObject("localDeployments", + std::move(listOfLocalDeployments)); + } +} + +void ListLocalDeploymentsResponse::s_loadFromJsonView( + ListLocalDeploymentsResponse &listLocalDeploymentsResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("localDeployments")) { + listLocalDeploymentsResponse.m_localDeployments = + Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &listOfLocalDeploymentsJsonView : + jsonView.GetArray("localDeployments")) { + Aws::Crt::Optional listOfLocalDeploymentsItem; + listOfLocalDeploymentsItem = LocalDeployment(); + LocalDeployment::s_loadFromJsonView(listOfLocalDeploymentsItem.value(), + listOfLocalDeploymentsJsonView); + listLocalDeploymentsResponse.m_localDeployments.value().push_back( + listOfLocalDeploymentsItem.value()); + } + } +} + +const char *ListLocalDeploymentsResponse::MODEL_NAME = + "aws.greengrass#ListLocalDeploymentsResponse"; + +Aws::Crt::String ListLocalDeploymentsResponse::GetModelName() const noexcept { + return ListLocalDeploymentsResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListLocalDeploymentsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListLocalDeploymentsResponse::s_customDeleter); + shape->m_allocator = allocator; + ListLocalDeploymentsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListLocalDeploymentsResponse::s_customDeleter( + ListLocalDeploymentsResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListLocalDeploymentsRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void ListLocalDeploymentsRequest::s_loadFromJsonView( + ListLocalDeploymentsRequest &listLocalDeploymentsRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)listLocalDeploymentsRequest; + (void)jsonView; +} + +const char *ListLocalDeploymentsRequest::MODEL_NAME = + "aws.greengrass#ListLocalDeploymentsRequest"; + +Aws::Crt::String ListLocalDeploymentsRequest::GetModelName() const noexcept { + return ListLocalDeploymentsRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListLocalDeploymentsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListLocalDeploymentsRequest::s_customDeleter); + shape->m_allocator = allocator; + ListLocalDeploymentsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListLocalDeploymentsRequest::s_customDeleter( + ListLocalDeploymentsRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListComponentsResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_components.has_value()) { + Aws::Crt::JsonObject listOfComponents; + Aws::Crt::Vector listOfComponentsJsonArray; + for (const auto &listOfComponentsItem : m_components.value()) { + Aws::Crt::JsonObject listOfComponentsJsonArrayItem; + listOfComponentsItem.SerializeToJsonObject(listOfComponentsJsonArrayItem); + listOfComponentsJsonArray.emplace_back( + std::move(listOfComponentsJsonArrayItem)); + } + listOfComponents.AsArray(std::move(listOfComponentsJsonArray)); + payloadObject.WithObject("components", std::move(listOfComponents)); + } +} + +void ListComponentsResponse::s_loadFromJsonView( + ListComponentsResponse &listComponentsResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("components")) { + listComponentsResponse.m_components = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &listOfComponentsJsonView : + jsonView.GetArray("components")) { + Aws::Crt::Optional listOfComponentsItem; + listOfComponentsItem = ComponentDetails(); + ComponentDetails::s_loadFromJsonView(listOfComponentsItem.value(), + listOfComponentsJsonView); + listComponentsResponse.m_components.value().push_back( + listOfComponentsItem.value()); + } + } +} + +const char *ListComponentsResponse::MODEL_NAME = + "aws.greengrass#ListComponentsResponse"; + +Aws::Crt::String ListComponentsResponse::GetModelName() const noexcept { + return ListComponentsResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListComponentsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListComponentsResponse::s_customDeleter); + shape->m_allocator = allocator; + ListComponentsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListComponentsResponse::s_customDeleter( + ListComponentsResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ListComponentsRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void ListComponentsRequest::s_loadFromJsonView( + ListComponentsRequest &listComponentsRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)listComponentsRequest; + (void)jsonView; +} + +const char *ListComponentsRequest::MODEL_NAME = + "aws.greengrass#ListComponentsRequest"; + +Aws::Crt::String ListComponentsRequest::GetModelName() const noexcept { + return ListComponentsRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ListComponentsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListComponentsRequest::s_customDeleter); + shape->m_allocator = allocator; + ListComponentsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void ListComponentsRequest::s_customDeleter( + ListComponentsRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetThingShadowResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void GetThingShadowResponse::s_loadFromJsonView( + GetThingShadowResponse &getThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + getThingShadowResponse.m_payload = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +const char *GetThingShadowResponse::MODEL_NAME = + "aws.greengrass#GetThingShadowResponse"; + +Aws::Crt::String GetThingShadowResponse::GetModelName() const noexcept { + return GetThingShadowResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + GetThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetThingShadowResponse::s_customDeleter( + GetThingShadowResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetThingShadowRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_thingName.has_value()) { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) { + payloadObject.WithString("shadowName", m_shadowName.value()); + } +} + +void GetThingShadowRequest::s_loadFromJsonView( + GetThingShadowRequest &getThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("thingName")) { + getThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) { + getThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } +} + +const char *GetThingShadowRequest::MODEL_NAME = + "aws.greengrass#GetThingShadowRequest"; + +Aws::Crt::String GetThingShadowRequest::GetModelName() const noexcept { + return GetThingShadowRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + GetThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetThingShadowRequest::s_customDeleter( + GetThingShadowRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetSecretValueResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_secretId.has_value()) { + payloadObject.WithString("secretId", m_secretId.value()); + } + if (m_versionId.has_value()) { + payloadObject.WithString("versionId", m_versionId.value()); + } + if (m_versionStage.has_value()) { + Aws::Crt::JsonObject secretVersionList; + Aws::Crt::Vector secretVersionListJsonArray; + for (const auto &secretVersionListItem : m_versionStage.value()) { + Aws::Crt::JsonObject secretVersionListJsonArrayItem; + secretVersionListJsonArrayItem.AsString(secretVersionListItem); + secretVersionListJsonArray.emplace_back( + std::move(secretVersionListJsonArrayItem)); + } + secretVersionList.AsArray(std::move(secretVersionListJsonArray)); + payloadObject.WithObject("versionStage", std::move(secretVersionList)); + } + if (m_secretValue.has_value()) { + Aws::Crt::JsonObject secretValueValue; + m_secretValue.value().SerializeToJsonObject(secretValueValue); + payloadObject.WithObject("secretValue", std::move(secretValueValue)); + } +} + +void GetSecretValueResponse::s_loadFromJsonView( + GetSecretValueResponse &getSecretValueResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("secretId")) { + getSecretValueResponse.m_secretId = + Aws::Crt::Optional(jsonView.GetString("secretId")); + } + if (jsonView.ValueExists("versionId")) { + getSecretValueResponse.m_versionId = + Aws::Crt::Optional(jsonView.GetString("versionId")); + } + if (jsonView.ValueExists("versionStage")) { + getSecretValueResponse.m_versionStage = + Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &secretVersionListJsonView : + jsonView.GetArray("versionStage")) { + Aws::Crt::Optional secretVersionListItem; + secretVersionListItem = Aws::Crt::Optional( + secretVersionListJsonView.AsString()); + getSecretValueResponse.m_versionStage.value().push_back( + secretVersionListItem.value()); + } + } + if (jsonView.ValueExists("secretValue")) { + getSecretValueResponse.m_secretValue = SecretValue(); + SecretValue::s_loadFromJsonView( + getSecretValueResponse.m_secretValue.value(), + jsonView.GetJsonObject("secretValue")); + } +} + +const char *GetSecretValueResponse::MODEL_NAME = + "aws.greengrass#GetSecretValueResponse"; + +Aws::Crt::String GetSecretValueResponse::GetModelName() const noexcept { + return GetSecretValueResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetSecretValueResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetSecretValueResponse::s_customDeleter); + shape->m_allocator = allocator; + GetSecretValueResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetSecretValueResponse::s_customDeleter( + GetSecretValueResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetSecretValueRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_secretId.has_value()) { + payloadObject.WithString("secretId", m_secretId.value()); + } + if (m_versionId.has_value()) { + payloadObject.WithString("versionId", m_versionId.value()); + } + if (m_versionStage.has_value()) { + payloadObject.WithString("versionStage", m_versionStage.value()); + } +} + +void GetSecretValueRequest::s_loadFromJsonView( + GetSecretValueRequest &getSecretValueRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("secretId")) { + getSecretValueRequest.m_secretId = + Aws::Crt::Optional(jsonView.GetString("secretId")); + } + if (jsonView.ValueExists("versionId")) { + getSecretValueRequest.m_versionId = + Aws::Crt::Optional(jsonView.GetString("versionId")); + } + if (jsonView.ValueExists("versionStage")) { + getSecretValueRequest.m_versionStage = Aws::Crt::Optional( + jsonView.GetString("versionStage")); + } +} + +const char *GetSecretValueRequest::MODEL_NAME = + "aws.greengrass#GetSecretValueRequest"; + +Aws::Crt::String GetSecretValueRequest::GetModelName() const noexcept { + return GetSecretValueRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetSecretValueRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetSecretValueRequest::s_customDeleter); + shape->m_allocator = allocator; + GetSecretValueRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetSecretValueRequest::s_customDeleter( + GetSecretValueRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetLocalDeploymentStatusResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deployment.has_value()) { + Aws::Crt::JsonObject localDeploymentValue; + m_deployment.value().SerializeToJsonObject(localDeploymentValue); + payloadObject.WithObject("deployment", std::move(localDeploymentValue)); + } +} + +void GetLocalDeploymentStatusResponse::s_loadFromJsonView( + GetLocalDeploymentStatusResponse &getLocalDeploymentStatusResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deployment")) { + getLocalDeploymentStatusResponse.m_deployment = LocalDeployment(); + LocalDeployment::s_loadFromJsonView( + getLocalDeploymentStatusResponse.m_deployment.value(), + jsonView.GetJsonObject("deployment")); + } +} + +const char *GetLocalDeploymentStatusResponse::MODEL_NAME = + "aws.greengrass#GetLocalDeploymentStatusResponse"; + +Aws::Crt::String +GetLocalDeploymentStatusResponse::GetModelName() const noexcept { + return GetLocalDeploymentStatusResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetLocalDeploymentStatusResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetLocalDeploymentStatusResponse::s_customDeleter); + shape->m_allocator = allocator; + GetLocalDeploymentStatusResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetLocalDeploymentStatusResponse::s_customDeleter( + GetLocalDeploymentStatusResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetLocalDeploymentStatusRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } +} + +void GetLocalDeploymentStatusRequest::s_loadFromJsonView( + GetLocalDeploymentStatusRequest &getLocalDeploymentStatusRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + getLocalDeploymentStatusRequest.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } +} + +const char *GetLocalDeploymentStatusRequest::MODEL_NAME = + "aws.greengrass#GetLocalDeploymentStatusRequest"; + +Aws::Crt::String +GetLocalDeploymentStatusRequest::GetModelName() const noexcept { + return GetLocalDeploymentStatusRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetLocalDeploymentStatusRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetLocalDeploymentStatusRequest::s_customDeleter); + shape->m_allocator = allocator; + GetLocalDeploymentStatusRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetLocalDeploymentStatusRequest::s_customDeleter( + GetLocalDeploymentStatusRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetConfigurationResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_value.has_value()) { + payloadObject.WithObject("value", m_value.value()); + } +} + +void GetConfigurationResponse::s_loadFromJsonView( + GetConfigurationResponse &getConfigurationResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + getConfigurationResponse.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("value")) { + getConfigurationResponse.m_value = Aws::Crt::Optional( + jsonView.GetJsonObject("value").Materialize()); + } +} + +const char *GetConfigurationResponse::MODEL_NAME = + "aws.greengrass#GetConfigurationResponse"; + +Aws::Crt::String GetConfigurationResponse::GetModelName() const noexcept { + return GetConfigurationResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetConfigurationResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetConfigurationResponse::s_customDeleter); + shape->m_allocator = allocator; + GetConfigurationResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetConfigurationResponse::s_customDeleter( + GetConfigurationResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetConfigurationRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } +} + +void GetConfigurationRequest::s_loadFromJsonView( + GetConfigurationRequest &getConfigurationRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + getConfigurationRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) { + getConfigurationRequest.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : + jsonView.GetArray("keyPath")) { + Aws::Crt::Optional keyPathItem; + keyPathItem = + Aws::Crt::Optional(keyPathJsonView.AsString()); + getConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); + } + } +} + +const char *GetConfigurationRequest::MODEL_NAME = + "aws.greengrass#GetConfigurationRequest"; + +Aws::Crt::String GetConfigurationRequest::GetModelName() const noexcept { + return GetConfigurationRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetConfigurationRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetConfigurationRequest::s_customDeleter); + shape->m_allocator = allocator; + GetConfigurationRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetConfigurationRequest::s_customDeleter( + GetConfigurationRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetComponentDetailsResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentDetails.has_value()) { + Aws::Crt::JsonObject componentDetailsValue; + m_componentDetails.value().SerializeToJsonObject(componentDetailsValue); + payloadObject.WithObject("componentDetails", + std::move(componentDetailsValue)); + } +} + +void GetComponentDetailsResponse::s_loadFromJsonView( + GetComponentDetailsResponse &getComponentDetailsResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentDetails")) { + getComponentDetailsResponse.m_componentDetails = ComponentDetails(); + ComponentDetails::s_loadFromJsonView( + getComponentDetailsResponse.m_componentDetails.value(), + jsonView.GetJsonObject("componentDetails")); + } +} + +const char *GetComponentDetailsResponse::MODEL_NAME = + "aws.greengrass#GetComponentDetailsResponse"; + +Aws::Crt::String GetComponentDetailsResponse::GetModelName() const noexcept { + return GetComponentDetailsResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetComponentDetailsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetComponentDetailsResponse::s_customDeleter); + shape->m_allocator = allocator; + GetComponentDetailsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetComponentDetailsResponse::s_customDeleter( + GetComponentDetailsResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetComponentDetailsRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_componentName.has_value()) { + payloadObject.WithString("componentName", m_componentName.value()); + } +} + +void GetComponentDetailsRequest::s_loadFromJsonView( + GetComponentDetailsRequest &getComponentDetailsRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("componentName")) { + getComponentDetailsRequest.m_componentName = + Aws::Crt::Optional( + jsonView.GetString("componentName")); + } +} + +const char *GetComponentDetailsRequest::MODEL_NAME = + "aws.greengrass#GetComponentDetailsRequest"; + +Aws::Crt::String GetComponentDetailsRequest::GetModelName() const noexcept { + return GetComponentDetailsRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetComponentDetailsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetComponentDetailsRequest::s_customDeleter); + shape->m_allocator = allocator; + GetComponentDetailsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetComponentDetailsRequest::s_customDeleter( + GetComponentDetailsRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void InvalidCredentialError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidCredentialError::s_loadFromJsonView( + InvalidCredentialError &invalidCredentialError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidCredentialError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidCredentialError::MODEL_NAME = + "aws.greengrass#InvalidCredentialError"; + +Aws::Crt::String InvalidCredentialError::GetModelName() const noexcept { + return InvalidCredentialError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidCredentialError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidCredentialError::s_customDeleter); + shape->m_allocator = allocator; + InvalidCredentialError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidCredentialError::s_customDeleter( + InvalidCredentialError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void GetClientDeviceAuthTokenResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_clientDeviceAuthToken.has_value()) { + payloadObject.WithString("clientDeviceAuthToken", + m_clientDeviceAuthToken.value()); + } +} + +void GetClientDeviceAuthTokenResponse::s_loadFromJsonView( + GetClientDeviceAuthTokenResponse &getClientDeviceAuthTokenResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("clientDeviceAuthToken")) { + getClientDeviceAuthTokenResponse.m_clientDeviceAuthToken = + Aws::Crt::Optional( + jsonView.GetString("clientDeviceAuthToken")); + } +} + +const char *GetClientDeviceAuthTokenResponse::MODEL_NAME = + "aws.greengrass#GetClientDeviceAuthTokenResponse"; + +Aws::Crt::String +GetClientDeviceAuthTokenResponse::GetModelName() const noexcept { + return GetClientDeviceAuthTokenResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetClientDeviceAuthTokenResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetClientDeviceAuthTokenResponse::s_customDeleter); + shape->m_allocator = allocator; + GetClientDeviceAuthTokenResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetClientDeviceAuthTokenResponse::s_customDeleter( + GetClientDeviceAuthTokenResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void GetClientDeviceAuthTokenRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_credential.has_value()) { + Aws::Crt::JsonObject credentialDocumentValue; + m_credential.value().SerializeToJsonObject(credentialDocumentValue); + payloadObject.WithObject("credential", std::move(credentialDocumentValue)); + } +} + +void GetClientDeviceAuthTokenRequest::s_loadFromJsonView( + GetClientDeviceAuthTokenRequest &getClientDeviceAuthTokenRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("credential")) { + getClientDeviceAuthTokenRequest.m_credential = CredentialDocument(); + CredentialDocument::s_loadFromJsonView( + getClientDeviceAuthTokenRequest.m_credential.value(), + jsonView.GetJsonObject("credential")); + } +} + +const char *GetClientDeviceAuthTokenRequest::MODEL_NAME = + "aws.greengrass#GetClientDeviceAuthTokenRequest"; + +Aws::Crt::String +GetClientDeviceAuthTokenRequest::GetModelName() const noexcept { + return GetClientDeviceAuthTokenRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +GetClientDeviceAuthTokenRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetClientDeviceAuthTokenRequest::s_customDeleter); + shape->m_allocator = allocator; + GetClientDeviceAuthTokenRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void GetClientDeviceAuthTokenRequest::s_customDeleter( + GetClientDeviceAuthTokenRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void DeleteThingShadowResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_payload.has_value()) { + if (m_payload.value().size() > 0) { + payloadObject.WithString("payload", + Aws::Crt::Base64Encode(m_payload.value())); + } + } +} + +void DeleteThingShadowResponse::s_loadFromJsonView( + DeleteThingShadowResponse &deleteThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("payload")) { + if (jsonView.GetString("payload").size() > 0) { + deleteThingShadowResponse.m_payload = + Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } +} + +const char *DeleteThingShadowResponse::MODEL_NAME = + "aws.greengrass#DeleteThingShadowResponse"; + +Aws::Crt::String DeleteThingShadowResponse::GetModelName() const noexcept { + return DeleteThingShadowResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +DeleteThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + DeleteThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + DeleteThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void DeleteThingShadowResponse::s_customDeleter( + DeleteThingShadowResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void DeleteThingShadowRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_thingName.has_value()) { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) { + payloadObject.WithString("shadowName", m_shadowName.value()); + } +} + +void DeleteThingShadowRequest::s_loadFromJsonView( + DeleteThingShadowRequest &deleteThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("thingName")) { + deleteThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) { + deleteThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } +} + +const char *DeleteThingShadowRequest::MODEL_NAME = + "aws.greengrass#DeleteThingShadowRequest"; + +Aws::Crt::String DeleteThingShadowRequest::GetModelName() const noexcept { + return DeleteThingShadowRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +DeleteThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + DeleteThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + DeleteThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void DeleteThingShadowRequest::s_customDeleter( + DeleteThingShadowRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void ResourceNotFoundError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } + if (m_resourceType.has_value()) { + payloadObject.WithString("resourceType", m_resourceType.value()); + } + if (m_resourceName.has_value()) { + payloadObject.WithString("resourceName", m_resourceName.value()); + } +} + +void ResourceNotFoundError::s_loadFromJsonView( + ResourceNotFoundError &resourceNotFoundError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + resourceNotFoundError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("resourceType")) { + resourceNotFoundError.m_resourceType = Aws::Crt::Optional( + jsonView.GetString("resourceType")); + } + if (jsonView.ValueExists("resourceName")) { + resourceNotFoundError.m_resourceName = Aws::Crt::Optional( + jsonView.GetString("resourceName")); + } +} + +const char *ResourceNotFoundError::MODEL_NAME = + "aws.greengrass#ResourceNotFoundError"; + +Aws::Crt::String ResourceNotFoundError::GetModelName() const noexcept { + return ResourceNotFoundError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ResourceNotFoundError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ResourceNotFoundError::s_customDeleter); + shape->m_allocator = allocator; + ResourceNotFoundError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void ResourceNotFoundError::s_customDeleter( + ResourceNotFoundError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void DeferComponentUpdateResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void DeferComponentUpdateResponse::s_loadFromJsonView( + DeferComponentUpdateResponse &deferComponentUpdateResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)deferComponentUpdateResponse; + (void)jsonView; +} + +const char *DeferComponentUpdateResponse::MODEL_NAME = + "aws.greengrass#DeferComponentUpdateResponse"; + +Aws::Crt::String DeferComponentUpdateResponse::GetModelName() const noexcept { + return DeferComponentUpdateResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +DeferComponentUpdateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + DeferComponentUpdateResponse::s_customDeleter); + shape->m_allocator = allocator; + DeferComponentUpdateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void DeferComponentUpdateResponse::s_customDeleter( + DeferComponentUpdateResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void DeferComponentUpdateRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } + if (m_recheckAfterMs.has_value()) { + payloadObject.WithInt64("recheckAfterMs", m_recheckAfterMs.value()); + } +} + +void DeferComponentUpdateRequest::s_loadFromJsonView( + DeferComponentUpdateRequest &deferComponentUpdateRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + deferComponentUpdateRequest.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("message")) { + deferComponentUpdateRequest.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("recheckAfterMs")) { + deferComponentUpdateRequest.m_recheckAfterMs = + Aws::Crt::Optional(jsonView.GetInt64("recheckAfterMs")); + } +} + +const char *DeferComponentUpdateRequest::MODEL_NAME = + "aws.greengrass#DeferComponentUpdateRequest"; + +Aws::Crt::String DeferComponentUpdateRequest::GetModelName() const noexcept { + return DeferComponentUpdateRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +DeferComponentUpdateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + DeferComponentUpdateRequest::s_customDeleter); + shape->m_allocator = allocator; + DeferComponentUpdateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void DeferComponentUpdateRequest::s_customDeleter( + DeferComponentUpdateRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void InvalidArtifactsDirectoryPathError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidArtifactsDirectoryPathError::s_loadFromJsonView( + InvalidArtifactsDirectoryPathError &invalidArtifactsDirectoryPathError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidArtifactsDirectoryPathError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidArtifactsDirectoryPathError::MODEL_NAME = + "aws.greengrass#InvalidArtifactsDirectoryPathError"; + +Aws::Crt::String +InvalidArtifactsDirectoryPathError::GetModelName() const noexcept { + return InvalidArtifactsDirectoryPathError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidArtifactsDirectoryPathError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidArtifactsDirectoryPathError::s_customDeleter); + shape->m_allocator = allocator; + InvalidArtifactsDirectoryPathError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidArtifactsDirectoryPathError::s_customDeleter( + InvalidArtifactsDirectoryPathError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void InvalidRecipeDirectoryPathError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidRecipeDirectoryPathError::s_loadFromJsonView( + InvalidRecipeDirectoryPathError &invalidRecipeDirectoryPathError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidRecipeDirectoryPathError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidRecipeDirectoryPathError::MODEL_NAME = + "aws.greengrass#InvalidRecipeDirectoryPathError"; + +Aws::Crt::String +InvalidRecipeDirectoryPathError::GetModelName() const noexcept { + return InvalidRecipeDirectoryPathError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidRecipeDirectoryPathError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidRecipeDirectoryPathError::s_customDeleter); + shape->m_allocator = allocator; + InvalidRecipeDirectoryPathError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidRecipeDirectoryPathError::s_customDeleter( + InvalidRecipeDirectoryPathError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void CreateLocalDeploymentResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_deploymentId.has_value()) { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } +} + +void CreateLocalDeploymentResponse::s_loadFromJsonView( + CreateLocalDeploymentResponse &createLocalDeploymentResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("deploymentId")) { + createLocalDeploymentResponse.m_deploymentId = + Aws::Crt::Optional( + jsonView.GetString("deploymentId")); + } +} + +const char *CreateLocalDeploymentResponse::MODEL_NAME = + "aws.greengrass#CreateLocalDeploymentResponse"; + +Aws::Crt::String CreateLocalDeploymentResponse::GetModelName() const noexcept { + return CreateLocalDeploymentResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CreateLocalDeploymentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CreateLocalDeploymentResponse::s_customDeleter); + shape->m_allocator = allocator; + CreateLocalDeploymentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CreateLocalDeploymentResponse::s_customDeleter( + CreateLocalDeploymentResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CreateLocalDeploymentRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_groupName.has_value()) { + payloadObject.WithString("groupName", m_groupName.value()); + } + if (m_rootComponentVersionsToAdd.has_value()) { + Aws::Crt::JsonObject componentToVersionMapValue; + for (const auto &componentToVersionMapItem : + m_rootComponentVersionsToAdd.value()) { + Aws::Crt::JsonObject componentToVersionMapJsonObject; + componentToVersionMapJsonObject.AsString( + componentToVersionMapItem.second); + componentToVersionMapValue.WithObject( + componentToVersionMapItem.first, + std::move(componentToVersionMapJsonObject)); + } + payloadObject.WithObject("rootComponentVersionsToAdd", + std::move(componentToVersionMapValue)); + } + if (m_rootComponentsToRemove.has_value()) { + Aws::Crt::JsonObject componentList; + Aws::Crt::Vector componentListJsonArray; + for (const auto &componentListItem : m_rootComponentsToRemove.value()) { + Aws::Crt::JsonObject componentListJsonArrayItem; + componentListJsonArrayItem.AsString(componentListItem); + componentListJsonArray.emplace_back( + std::move(componentListJsonArrayItem)); + } + componentList.AsArray(std::move(componentListJsonArray)); + payloadObject.WithObject("rootComponentsToRemove", + std::move(componentList)); + } + if (m_componentToConfiguration.has_value()) { + Aws::Crt::JsonObject componentToConfigurationValue; + for (const auto &componentToConfigurationItem : + m_componentToConfiguration.value()) { + Aws::Crt::JsonObject componentToConfigurationJsonObject; + componentToConfigurationJsonObject.AsObject( + componentToConfigurationItem.second); + componentToConfigurationValue.WithObject( + componentToConfigurationItem.first, + std::move(componentToConfigurationJsonObject)); + } + payloadObject.WithObject("componentToConfiguration", + std::move(componentToConfigurationValue)); + } + if (m_componentToRunWithInfo.has_value()) { + Aws::Crt::JsonObject componentToRunWithInfoValue; + for (const auto &componentToRunWithInfoItem : + m_componentToRunWithInfo.value()) { + Aws::Crt::JsonObject componentToRunWithInfoJsonObject; + componentToRunWithInfoItem.second.SerializeToJsonObject( + componentToRunWithInfoJsonObject); + componentToRunWithInfoValue.WithObject( + componentToRunWithInfoItem.first, + std::move(componentToRunWithInfoJsonObject)); + } + payloadObject.WithObject("componentToRunWithInfo", + std::move(componentToRunWithInfoValue)); + } + if (m_recipeDirectoryPath.has_value()) { + payloadObject.WithString("recipeDirectoryPath", + m_recipeDirectoryPath.value()); + } + if (m_artifactsDirectoryPath.has_value()) { + payloadObject.WithString("artifactsDirectoryPath", + m_artifactsDirectoryPath.value()); + } +} + +void CreateLocalDeploymentRequest::s_loadFromJsonView( + CreateLocalDeploymentRequest &createLocalDeploymentRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("groupName")) { + createLocalDeploymentRequest.m_groupName = + Aws::Crt::Optional(jsonView.GetString("groupName")); + } + if (jsonView.ValueExists("rootComponentVersionsToAdd")) { + createLocalDeploymentRequest.m_rootComponentVersionsToAdd = + Aws::Crt::Map(); + for (const auto &componentToVersionMapPair : + jsonView.GetJsonObject("rootComponentVersionsToAdd").GetAllObjects()) { + Aws::Crt::Optional componentToVersionMapValue; + componentToVersionMapValue = Aws::Crt::Optional( + componentToVersionMapPair.second.AsString()); + createLocalDeploymentRequest.m_rootComponentVersionsToAdd + .value()[componentToVersionMapPair.first] = + componentToVersionMapValue.value(); + } + } + if (jsonView.ValueExists("rootComponentsToRemove")) { + createLocalDeploymentRequest.m_rootComponentsToRemove = + Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &componentListJsonView : + jsonView.GetArray("rootComponentsToRemove")) { + Aws::Crt::Optional componentListItem; + componentListItem = Aws::Crt::Optional( + componentListJsonView.AsString()); + createLocalDeploymentRequest.m_rootComponentsToRemove.value().push_back( + componentListItem.value()); + } + } + if (jsonView.ValueExists("componentToConfiguration")) { + createLocalDeploymentRequest.m_componentToConfiguration = + Aws::Crt::Map(); + for (const auto &componentToConfigurationPair : + jsonView.GetJsonObject("componentToConfiguration").GetAllObjects()) { + Aws::Crt::Optional componentToConfigurationValue; + componentToConfigurationValue = Aws::Crt::Optional( + componentToConfigurationPair.second.AsObject().Materialize()); + createLocalDeploymentRequest.m_componentToConfiguration + .value()[componentToConfigurationPair.first] = + componentToConfigurationValue.value(); + } + } + if (jsonView.ValueExists("componentToRunWithInfo")) { + createLocalDeploymentRequest.m_componentToRunWithInfo = + Aws::Crt::Map(); + for (const auto &componentToRunWithInfoPair : + jsonView.GetJsonObject("componentToRunWithInfo").GetAllObjects()) { + Aws::Crt::Optional componentToRunWithInfoValue; + componentToRunWithInfoValue = RunWithInfo(); + RunWithInfo::s_loadFromJsonView(componentToRunWithInfoValue.value(), + componentToRunWithInfoPair.second); + createLocalDeploymentRequest.m_componentToRunWithInfo + .value()[componentToRunWithInfoPair.first] = + componentToRunWithInfoValue.value(); + } + } + if (jsonView.ValueExists("recipeDirectoryPath")) { + createLocalDeploymentRequest.m_recipeDirectoryPath = + Aws::Crt::Optional( + jsonView.GetString("recipeDirectoryPath")); + } + if (jsonView.ValueExists("artifactsDirectoryPath")) { + createLocalDeploymentRequest.m_artifactsDirectoryPath = + Aws::Crt::Optional( + jsonView.GetString("artifactsDirectoryPath")); + } +} + +const char *CreateLocalDeploymentRequest::MODEL_NAME = + "aws.greengrass#CreateLocalDeploymentRequest"; + +Aws::Crt::String CreateLocalDeploymentRequest::GetModelName() const noexcept { + return CreateLocalDeploymentRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CreateLocalDeploymentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CreateLocalDeploymentRequest::s_customDeleter); + shape->m_allocator = allocator; + CreateLocalDeploymentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CreateLocalDeploymentRequest::s_customDeleter( + CreateLocalDeploymentRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CreateDebugPasswordResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_password.has_value()) { + payloadObject.WithString("password", m_password.value()); + } + if (m_username.has_value()) { + payloadObject.WithString("username", m_username.value()); + } + if (m_passwordExpiration.has_value()) { + payloadObject.WithDouble( + "passwordExpiration", + m_passwordExpiration.value().SecondsWithMSPrecision()); + } + if (m_certificateSHA256Hash.has_value()) { + payloadObject.WithString("certificateSHA256Hash", + m_certificateSHA256Hash.value()); + } + if (m_certificateSHA1Hash.has_value()) { + payloadObject.WithString("certificateSHA1Hash", + m_certificateSHA1Hash.value()); + } +} + +void CreateDebugPasswordResponse::s_loadFromJsonView( + CreateDebugPasswordResponse &createDebugPasswordResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("password")) { + createDebugPasswordResponse.m_password = + Aws::Crt::Optional(jsonView.GetString("password")); + } + if (jsonView.ValueExists("username")) { + createDebugPasswordResponse.m_username = + Aws::Crt::Optional(jsonView.GetString("username")); + } + if (jsonView.ValueExists("passwordExpiration")) { + createDebugPasswordResponse.m_passwordExpiration = + Aws::Crt::Optional( + Aws::Crt::DateTime(jsonView.GetDouble("passwordExpiration"))); + } + if (jsonView.ValueExists("certificateSHA256Hash")) { + createDebugPasswordResponse.m_certificateSHA256Hash = + Aws::Crt::Optional( + jsonView.GetString("certificateSHA256Hash")); + } + if (jsonView.ValueExists("certificateSHA1Hash")) { + createDebugPasswordResponse.m_certificateSHA1Hash = + Aws::Crt::Optional( + jsonView.GetString("certificateSHA1Hash")); + } +} + +const char *CreateDebugPasswordResponse::MODEL_NAME = + "aws.greengrass#CreateDebugPasswordResponse"; + +Aws::Crt::String CreateDebugPasswordResponse::GetModelName() const noexcept { + return CreateDebugPasswordResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CreateDebugPasswordResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CreateDebugPasswordResponse::s_customDeleter); + shape->m_allocator = allocator; + CreateDebugPasswordResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CreateDebugPasswordResponse::s_customDeleter( + CreateDebugPasswordResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void CreateDebugPasswordRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + (void)payloadObject; +} + +void CreateDebugPasswordRequest::s_loadFromJsonView( + CreateDebugPasswordRequest &createDebugPasswordRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + (void)createDebugPasswordRequest; + (void)jsonView; +} + +const char *CreateDebugPasswordRequest::MODEL_NAME = + "aws.greengrass#CreateDebugPasswordRequest"; + +Aws::Crt::String CreateDebugPasswordRequest::GetModelName() const noexcept { + return CreateDebugPasswordRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +CreateDebugPasswordRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CreateDebugPasswordRequest::s_customDeleter); + shape->m_allocator = allocator; + CreateDebugPasswordRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void CreateDebugPasswordRequest::s_customDeleter( + CreateDebugPasswordRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void InvalidClientDeviceAuthTokenError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidClientDeviceAuthTokenError::s_loadFromJsonView( + InvalidClientDeviceAuthTokenError &invalidClientDeviceAuthTokenError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidClientDeviceAuthTokenError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidClientDeviceAuthTokenError::MODEL_NAME = + "aws.greengrass#InvalidClientDeviceAuthTokenError"; + +Aws::Crt::String +InvalidClientDeviceAuthTokenError::GetModelName() const noexcept { + return InvalidClientDeviceAuthTokenError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidClientDeviceAuthTokenError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidClientDeviceAuthTokenError::s_customDeleter); + shape->m_allocator = allocator; + InvalidClientDeviceAuthTokenError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidClientDeviceAuthTokenError::s_customDeleter( + InvalidClientDeviceAuthTokenError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void InvalidArgumentsError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void InvalidArgumentsError::s_loadFromJsonView( + InvalidArgumentsError &invalidArgumentsError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + invalidArgumentsError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *InvalidArgumentsError::MODEL_NAME = + "aws.greengrass#InvalidArgumentsError"; + +Aws::Crt::String InvalidArgumentsError::GetModelName() const noexcept { + return InvalidArgumentsError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +InvalidArgumentsError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidArgumentsError::s_customDeleter); + shape->m_allocator = allocator; + InvalidArgumentsError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void InvalidArgumentsError::s_customDeleter( + InvalidArgumentsError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void ServiceError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void ServiceError::s_loadFromJsonView( + ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + serviceError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; + +Aws::Crt::String ServiceError::GetModelName() const noexcept { + return ServiceError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +ServiceError::s_allocateFromPayload(Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ServiceError::s_customDeleter); + shape->m_allocator = allocator; + ServiceError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void ServiceError::s_customDeleter(ServiceError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void UnauthorizedError::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_message.has_value()) { + payloadObject.WithString("message", m_message.value()); + } +} + +void UnauthorizedError::s_loadFromJsonView( + UnauthorizedError &unauthorizedError, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("message")) { + unauthorizedError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } +} + +const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; + +Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { + return UnauthorizedError::MODEL_NAME; +} + +Aws::Crt::ScopedResource +UnauthorizedError::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + UnauthorizedError::s_customDeleter); + shape->m_allocator = allocator; + UnauthorizedError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, OperationError::s_customDeleter); +} + +void UnauthorizedError::s_customDeleter(UnauthorizedError *shape) noexcept { + OperationError::s_customDeleter(static_cast(shape)); +} + +void AuthorizeClientDeviceActionResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_isAuthorized.has_value()) { + payloadObject.WithBool("isAuthorized", m_isAuthorized.value()); + } +} + +void AuthorizeClientDeviceActionResponse::s_loadFromJsonView( + AuthorizeClientDeviceActionResponse &authorizeClientDeviceActionResponse, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("isAuthorized")) { + authorizeClientDeviceActionResponse.m_isAuthorized = + Aws::Crt::Optional(jsonView.GetBool("isAuthorized")); + } +} + +const char *AuthorizeClientDeviceActionResponse::MODEL_NAME = + "aws.greengrass#AuthorizeClientDeviceActionResponse"; + +Aws::Crt::String +AuthorizeClientDeviceActionResponse::GetModelName() const noexcept { + return AuthorizeClientDeviceActionResponse::MODEL_NAME; +} + +Aws::Crt::ScopedResource +AuthorizeClientDeviceActionResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + AuthorizeClientDeviceActionResponse::s_customDeleter); + shape->m_allocator = allocator; + AuthorizeClientDeviceActionResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void AuthorizeClientDeviceActionResponse::s_customDeleter( + AuthorizeClientDeviceActionResponse *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void AuthorizeClientDeviceActionRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_clientDeviceAuthToken.has_value()) { + payloadObject.WithString("clientDeviceAuthToken", + m_clientDeviceAuthToken.value()); + } + if (m_operation.has_value()) { + payloadObject.WithString("operation", m_operation.value()); + } + if (m_resource.has_value()) { + payloadObject.WithString("resource", m_resource.value()); + } +} + +void AuthorizeClientDeviceActionRequest::s_loadFromJsonView( + AuthorizeClientDeviceActionRequest &authorizeClientDeviceActionRequest, + const Aws::Crt::JsonView &jsonView) noexcept { + if (jsonView.ValueExists("clientDeviceAuthToken")) { + authorizeClientDeviceActionRequest.m_clientDeviceAuthToken = + Aws::Crt::Optional( + jsonView.GetString("clientDeviceAuthToken")); + } + if (jsonView.ValueExists("operation")) { + authorizeClientDeviceActionRequest.m_operation = + Aws::Crt::Optional(jsonView.GetString("operation")); + } + if (jsonView.ValueExists("resource")) { + authorizeClientDeviceActionRequest.m_resource = + Aws::Crt::Optional(jsonView.GetString("resource")); + } +} + +const char *AuthorizeClientDeviceActionRequest::MODEL_NAME = + "aws.greengrass#AuthorizeClientDeviceActionRequest"; + +Aws::Crt::String +AuthorizeClientDeviceActionRequest::GetModelName() const noexcept { + return AuthorizeClientDeviceActionRequest::MODEL_NAME; +} + +Aws::Crt::ScopedResource +AuthorizeClientDeviceActionRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + AuthorizeClientDeviceActionRequest::s_customDeleter); + shape->m_allocator = allocator; + AuthorizeClientDeviceActionRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource( + operationResponse, AbstractShapeBase::s_customDeleter); +} + +void AuthorizeClientDeviceActionRequest::s_customDeleter( + AuthorizeClientDeviceActionRequest *shape) noexcept { + AbstractShapeBase::s_customDeleter(static_cast(shape)); +} + +void SubscribeToIoTCoreStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool SubscribeToIoTCoreStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToIoTCoreOperationContext::SubscribeToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToIoTCoreOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +SubscribeToIoTCoreOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::String +SubscribeToIoTCoreOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreRequest"); +} + +Aws::Crt::String +SubscribeToIoTCoreOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); +} + +Aws::Crt::Optional +SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); +} + +Aws::Crt::String +SubscribeToIoTCoreOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCore"); +} + +std::future +SubscribeToIoTCoreOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToIoTCoreResult(GetOperationResult().get()); + }); +} + +SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future SubscribeToIoTCoreOperation::Activate( + const SubscribeToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String SubscribeToIoTCoreOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +ResumeComponentOperationContext::ResumeComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +ResumeComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ResumeComponentResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +ResumeComponentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +ResumeComponentOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ResumeComponentRequest"); +} + +Aws::Crt::String +ResumeComponentOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); +} + +Aws::Crt::Optional +ResumeComponentOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +ResumeComponentOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#ResumeComponent"); +} + +std::future +ResumeComponentOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return ResumeComponentResult(GetOperationResult().get()); + }); +} + +ResumeComponentOperation::ResumeComponentOperation( + ClientConnection &connection, + const ResumeComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future ResumeComponentOperation::Activate( + const ResumeComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String ResumeComponentOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +PublishToIoTCoreOperationContext::PublishToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +PublishToIoTCoreOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +PublishToIoTCoreOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +PublishToIoTCoreOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToIoTCoreRequest"); +} + +Aws::Crt::String +PublishToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); +} + +Aws::Crt::Optional +PublishToIoTCoreOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +PublishToIoTCoreOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToIoTCore"); +} + +std::future +PublishToIoTCoreOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return PublishToIoTCoreResult(GetOperationResult().get()); + }); +} + +PublishToIoTCoreOperation::PublishToIoTCoreOperation( + ClientConnection &connection, + const PublishToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future PublishToIoTCoreOperation::Activate( + const PublishToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String PublishToIoTCoreOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void SubscribeToConfigurationUpdateStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool SubscribeToConfigurationUpdateStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && + !streamShouldTerminate) { + streamShouldTerminate = OnStreamError( + static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToConfigurationUpdateOperationContext:: + SubscribeToConfigurationUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToConfigurationUpdateOperationContext:: + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( + stringView, allocator); +} + +Aws::Crt::ScopedResource +SubscribeToConfigurationUpdateOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::String +SubscribeToConfigurationUpdateOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToConfigurationUpdateRequest"); +} + +Aws::Crt::String +SubscribeToConfigurationUpdateOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToConfigurationUpdateResponse"); +} + +Aws::Crt::Optional +SubscribeToConfigurationUpdateOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ConfigurationUpdateEvents"); +} + +Aws::Crt::String +SubscribeToConfigurationUpdateOperationContext::GetOperationName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdate"); +} + +std::future +SubscribeToConfigurationUpdateOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); +} + +SubscribeToConfigurationUpdateOperation:: + SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + std::shared_ptr + streamHandler, + const SubscribeToConfigurationUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future SubscribeToConfigurationUpdateOperation::Activate( + const SubscribeToConfigurationUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +SubscribeToConfigurationUpdateOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +DeleteThingShadowOperationContext::DeleteThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +DeleteThingShadowOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return DeleteThingShadowResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +DeleteThingShadowOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +DeleteThingShadowOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#DeleteThingShadowRequest"); +} + +Aws::Crt::String +DeleteThingShadowOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); +} + +Aws::Crt::Optional +DeleteThingShadowOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +DeleteThingShadowOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#DeleteThingShadow"); +} + +std::future +DeleteThingShadowOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return DeleteThingShadowResult(GetOperationResult().get()); + }); +} + +DeleteThingShadowOperation::DeleteThingShadowOperation( + ClientConnection &connection, + const DeleteThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future DeleteThingShadowOperation::Activate( + const DeleteThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String DeleteThingShadowOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +PutComponentMetricOperationContext::PutComponentMetricOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +PutComponentMetricOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return PutComponentMetricResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +PutComponentMetricOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +PutComponentMetricOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PutComponentMetricRequest"); +} + +Aws::Crt::String +PutComponentMetricOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); +} + +Aws::Crt::Optional +PutComponentMetricOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +PutComponentMetricOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#PutComponentMetric"); +} + +std::future +PutComponentMetricOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return PutComponentMetricResult(GetOperationResult().get()); + }); +} + +PutComponentMetricOperation::PutComponentMetricOperation( + ClientConnection &connection, + const PutComponentMetricOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future PutComponentMetricOperation::Activate( + const PutComponentMetricRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String PutComponentMetricOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +DeferComponentUpdateOperationContext::DeferComponentUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +DeferComponentUpdateOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +DeferComponentUpdateOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +DeferComponentUpdateOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdateRequest"); +} + +Aws::Crt::String +DeferComponentUpdateOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); +} + +Aws::Crt::Optional +DeferComponentUpdateOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +DeferComponentUpdateOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdate"); +} + +std::future +DeferComponentUpdateOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return DeferComponentUpdateResult(GetOperationResult().get()); + }); +} + +DeferComponentUpdateOperation::DeferComponentUpdateOperation( + ClientConnection &connection, + const DeferComponentUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future DeferComponentUpdateOperation::Activate( + const DeferComponentUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String DeferComponentUpdateOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent( + static_cast(response.get())); +} + +bool SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToValidateConfigurationUpdatesOperationContext:: + SubscribeToValidateConfigurationUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToValidateConfigurationUpdatesOperationContext:: + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload( + stringView, allocator); +} + +Aws::Crt::ScopedResource +SubscribeToValidateConfigurationUpdatesOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::String +SubscribeToValidateConfigurationUpdatesOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); +} + +Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext:: + GetInitialResponseModelName() const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); +} + +Aws::Crt::Optional +SubscribeToValidateConfigurationUpdatesOperationContext:: + GetStreamingResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ValidateConfigurationUpdateEvents"); +} + +Aws::Crt::String +SubscribeToValidateConfigurationUpdatesOperationContext::GetOperationName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToValidateConfigurationUpdates"); +} + +std::future +SubscribeToValidateConfigurationUpdatesOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToValidateConfigurationUpdatesResult( + GetOperationResult().get()); + }); +} + +SubscribeToValidateConfigurationUpdatesOperation:: + SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + std::shared_ptr + streamHandler, + const SubscribeToValidateConfigurationUpdatesOperationContext + &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future +SubscribeToValidateConfigurationUpdatesOperation::Activate( + const SubscribeToValidateConfigurationUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +SubscribeToValidateConfigurationUpdatesOperation::GetModelName() + const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetConfigurationOperationContext::GetConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetConfigurationOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +GetConfigurationOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetConfigurationOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetConfigurationRequest"); +} + +Aws::Crt::String +GetConfigurationOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); +} + +Aws::Crt::Optional +GetConfigurationOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetConfigurationOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetConfiguration"); +} + +std::future +GetConfigurationOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetConfigurationResult(GetOperationResult().get()); + }); +} + +GetConfigurationOperation::GetConfigurationOperation( + ClientConnection &connection, + const GetConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetConfigurationOperation::Activate( + const GetConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetConfigurationOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void SubscribeToTopicStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool SubscribeToTopicStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && + !streamShouldTerminate) { + streamShouldTerminate = OnStreamError( + static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToTopicOperationContext::SubscribeToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToTopicOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +SubscribeToTopicOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscriptionResponseMessage::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::String +SubscribeToTopicOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToTopicRequest"); +} + +Aws::Crt::String +SubscribeToTopicOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); +} + +Aws::Crt::Optional +SubscribeToTopicOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); +} + +Aws::Crt::String +SubscribeToTopicOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToTopic"); +} + +std::future +SubscribeToTopicOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToTopicResult(GetOperationResult().get()); + }); +} + +SubscribeToTopicOperation::SubscribeToTopicOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future SubscribeToTopicOperation::Activate( + const SubscribeToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String SubscribeToTopicOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetComponentDetailsOperationContext::GetComponentDetailsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetComponentDetailsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetComponentDetailsResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +GetComponentDetailsOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetComponentDetailsOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetComponentDetailsRequest"); +} + +Aws::Crt::String +GetComponentDetailsOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); +} + +Aws::Crt::Optional +GetComponentDetailsOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetComponentDetailsOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetComponentDetails"); +} + +std::future +GetComponentDetailsOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetComponentDetailsResult(GetOperationResult().get()); + }); +} + +GetComponentDetailsOperation::GetComponentDetailsOperation( + ClientConnection &connection, + const GetComponentDetailsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetComponentDetailsOperation::Activate( + const GetComponentDetailsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetComponentDetailsOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetClientDeviceAuthTokenOperationContext:: + GetClientDeviceAuthTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetClientDeviceAuthTokenOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +GetClientDeviceAuthTokenOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetClientDeviceAuthTokenOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenRequest"); +} + +Aws::Crt::String +GetClientDeviceAuthTokenOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenResponse"); +} + +Aws::Crt::Optional +GetClientDeviceAuthTokenOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetClientDeviceAuthTokenOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthToken"); +} + +std::future +GetClientDeviceAuthTokenOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetClientDeviceAuthTokenResult(GetOperationResult().get()); + }); +} + +GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( + ClientConnection &connection, + const GetClientDeviceAuthTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetClientDeviceAuthTokenOperation::Activate( + const GetClientDeviceAuthTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +GetClientDeviceAuthTokenOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +PublishToTopicOperationContext::PublishToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +PublishToTopicOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return PublishToTopicResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +PublishToTopicOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +PublishToTopicOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToTopicRequest"); +} + +Aws::Crt::String +PublishToTopicOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); +} + +Aws::Crt::Optional +PublishToTopicOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +PublishToTopicOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#PublishToTopic"); +} + +std::future +PublishToTopicOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return PublishToTopicResult(GetOperationResult().get()); + }); +} + +PublishToTopicOperation::PublishToTopicOperation( + ClientConnection &connection, + const PublishToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future PublishToTopicOperation::Activate( + const PublishToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String PublishToTopicOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void SubscribeToCertificateUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool SubscribeToCertificateUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && + !streamShouldTerminate) { + streamShouldTerminate = OnStreamError( + static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToCertificateUpdatesOperationContext:: + SubscribeToCertificateUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToCertificateUpdatesOperationContext:: + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( + stringView, allocator); +} + +Aws::Crt::ScopedResource +SubscribeToCertificateUpdatesOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::String +SubscribeToCertificateUpdatesOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToCertificateUpdatesRequest"); +} + +Aws::Crt::String +SubscribeToCertificateUpdatesOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SubscribeToCertificateUpdatesResponse"); +} + +Aws::Crt::Optional +SubscribeToCertificateUpdatesOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#CertificateUpdateEvent"); +} + +Aws::Crt::String +SubscribeToCertificateUpdatesOperationContext::GetOperationName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdates"); +} + +std::future +SubscribeToCertificateUpdatesOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); + }); +} + +SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToCertificateUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future SubscribeToCertificateUpdatesOperation::Activate( + const SubscribeToCertificateUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +SubscribeToCertificateUpdatesOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +VerifyClientDeviceIdentityOperationContext:: + VerifyClientDeviceIdentityOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +VerifyClientDeviceIdentityOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +VerifyClientDeviceIdentityOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +VerifyClientDeviceIdentityOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityRequest"); +} + +Aws::Crt::String +VerifyClientDeviceIdentityOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityResponse"); +} + +Aws::Crt::Optional +VerifyClientDeviceIdentityOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +VerifyClientDeviceIdentityOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentity"); +} + +std::future +VerifyClientDeviceIdentityOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return VerifyClientDeviceIdentityResult(GetOperationResult().get()); + }); +} + +VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( + ClientConnection &connection, + const VerifyClientDeviceIdentityOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future VerifyClientDeviceIdentityOperation::Activate( + const VerifyClientDeviceIdentityRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +VerifyClientDeviceIdentityOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +AuthorizeClientDeviceActionOperationContext:: + AuthorizeClientDeviceActionOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +AuthorizeClientDeviceActionOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +AuthorizeClientDeviceActionOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +AuthorizeClientDeviceActionOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionRequest"); +} + +Aws::Crt::String +AuthorizeClientDeviceActionOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionResponse"); +} + +Aws::Crt::Optional +AuthorizeClientDeviceActionOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +AuthorizeClientDeviceActionOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceAction"); +} + +std::future +AuthorizeClientDeviceActionOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return AuthorizeClientDeviceActionResult(GetOperationResult().get()); + }); +} + +AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( + ClientConnection &connection, + const AuthorizeClientDeviceActionOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future AuthorizeClientDeviceActionOperation::Activate( + const AuthorizeClientDeviceActionRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +AuthorizeClientDeviceActionOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +ListComponentsOperationContext::ListComponentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +ListComponentsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ListComponentsResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +ListComponentsOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +ListComponentsOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListComponentsRequest"); +} + +Aws::Crt::String +ListComponentsOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); +} + +Aws::Crt::Optional +ListComponentsOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +ListComponentsOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListComponents"); +} + +std::future +ListComponentsOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return ListComponentsResult(GetOperationResult().get()); + }); +} + +ListComponentsOperation::ListComponentsOperation( + ClientConnection &connection, + const ListComponentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future ListComponentsOperation::Activate( + const ListComponentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String ListComponentsOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +CreateDebugPasswordOperationContext::CreateDebugPasswordOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +CreateDebugPasswordOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +CreateDebugPasswordOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +CreateDebugPasswordOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#CreateDebugPasswordRequest"); +} + +Aws::Crt::String +CreateDebugPasswordOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); +} + +Aws::Crt::Optional +CreateDebugPasswordOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +CreateDebugPasswordOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#CreateDebugPassword"); +} + +std::future +CreateDebugPasswordOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return CreateDebugPasswordResult(GetOperationResult().get()); + }); +} + +CreateDebugPasswordOperation::CreateDebugPasswordOperation( + ClientConnection &connection, + const CreateDebugPasswordOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future CreateDebugPasswordOperation::Activate( + const CreateDebugPasswordRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String CreateDebugPasswordOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetThingShadowOperationContext::GetThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetThingShadowOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetThingShadowResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +GetThingShadowOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetThingShadowOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetThingShadowRequest"); +} + +Aws::Crt::String +GetThingShadowOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); +} + +Aws::Crt::Optional +GetThingShadowOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetThingShadowOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetThingShadow"); +} + +std::future +GetThingShadowOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetThingShadowResult(GetOperationResult().get()); + }); +} + +GetThingShadowOperation::GetThingShadowOperation( + ClientConnection &connection, + const GetThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetThingShadowOperation::Activate( + const GetThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetThingShadowOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +SendConfigurationValidityReportOperationContext:: + SendConfigurationValidityReportOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SendConfigurationValidityReportOperationContext:: + AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SendConfigurationValidityReportResponse::s_allocateFromPayload( + stringView, allocator); +} + +Aws::Crt::ScopedResource +SendConfigurationValidityReportOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +SendConfigurationValidityReportOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SendConfigurationValidityReportRequest"); +} + +Aws::Crt::String +SendConfigurationValidityReportOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String( + "aws.greengrass#SendConfigurationValidityReportResponse"); +} + +Aws::Crt::Optional +SendConfigurationValidityReportOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +SendConfigurationValidityReportOperationContext::GetOperationName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReport"); +} + +std::future +SendConfigurationValidityReportOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SendConfigurationValidityReportResult(GetOperationResult().get()); + }); +} + +SendConfigurationValidityReportOperation:: + SendConfigurationValidityReportOperation( + ClientConnection &connection, + const SendConfigurationValidityReportOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future SendConfigurationValidityReportOperation::Activate( + const SendConfigurationValidityReportRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +SendConfigurationValidityReportOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +UpdateThingShadowOperationContext::UpdateThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +UpdateThingShadowOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return UpdateThingShadowResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +UpdateThingShadowOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +UpdateThingShadowOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateThingShadowRequest"); +} + +Aws::Crt::String +UpdateThingShadowOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); +} + +Aws::Crt::Optional +UpdateThingShadowOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +UpdateThingShadowOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateThingShadow"); +} + +std::future +UpdateThingShadowOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return UpdateThingShadowResult(GetOperationResult().get()); + }); +} + +UpdateThingShadowOperation::UpdateThingShadowOperation( + ClientConnection &connection, + const UpdateThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future UpdateThingShadowOperation::Activate( + const UpdateThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String UpdateThingShadowOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +UpdateConfigurationOperationContext::UpdateConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +UpdateConfigurationOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return UpdateConfigurationResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +UpdateConfigurationOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +UpdateConfigurationOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateConfigurationRequest"); +} + +Aws::Crt::String +UpdateConfigurationOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); +} + +Aws::Crt::Optional +UpdateConfigurationOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +UpdateConfigurationOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateConfiguration"); +} + +std::future +UpdateConfigurationOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return UpdateConfigurationResult(GetOperationResult().get()); + }); +} + +UpdateConfigurationOperation::UpdateConfigurationOperation( + ClientConnection &connection, + const UpdateConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future UpdateConfigurationOperation::Activate( + const UpdateConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String UpdateConfigurationOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +ValidateAuthorizationTokenOperationContext:: + ValidateAuthorizationTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +ValidateAuthorizationTokenOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +ValidateAuthorizationTokenOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +ValidateAuthorizationTokenOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenRequest"); +} + +Aws::Crt::String +ValidateAuthorizationTokenOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenResponse"); +} + +Aws::Crt::Optional +ValidateAuthorizationTokenOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +ValidateAuthorizationTokenOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationToken"); +} + +std::future +ValidateAuthorizationTokenOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return ValidateAuthorizationTokenResult(GetOperationResult().get()); + }); +} + +ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( + ClientConnection &connection, + const ValidateAuthorizationTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future ValidateAuthorizationTokenOperation::Activate( + const ValidateAuthorizationTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +ValidateAuthorizationTokenOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +RestartComponentOperationContext::RestartComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +RestartComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +RestartComponentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +RestartComponentOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#RestartComponentRequest"); +} + +Aws::Crt::String +RestartComponentOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); +} + +Aws::Crt::Optional +RestartComponentOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +RestartComponentOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#RestartComponent"); +} + +std::future +RestartComponentOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return RestartComponentResult(GetOperationResult().get()); + }); +} + +RestartComponentOperation::RestartComponentOperation( + ClientConnection &connection, + const RestartComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future RestartComponentOperation::Activate( + const RestartComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String RestartComponentOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetLocalDeploymentStatusOperationContext:: + GetLocalDeploymentStatusOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetLocalDeploymentStatusOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +GetLocalDeploymentStatusOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetLocalDeploymentStatusOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusRequest"); +} + +Aws::Crt::String +GetLocalDeploymentStatusOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusResponse"); +} + +Aws::Crt::Optional +GetLocalDeploymentStatusOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetLocalDeploymentStatusOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatus"); +} + +std::future +GetLocalDeploymentStatusOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetLocalDeploymentStatusResult(GetOperationResult().get()); + }); +} + +GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( + ClientConnection &connection, + const GetLocalDeploymentStatusOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetLocalDeploymentStatusOperation::Activate( + const GetLocalDeploymentStatusRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +GetLocalDeploymentStatusOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GetSecretValueOperationContext::GetSecretValueOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +GetSecretValueOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return GetSecretValueResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +GetSecretValueOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +GetSecretValueOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetSecretValueRequest"); +} + +Aws::Crt::String +GetSecretValueOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); +} + +Aws::Crt::Optional +GetSecretValueOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +GetSecretValueOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#GetSecretValue"); +} + +std::future +GetSecretValueOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return GetSecretValueResult(GetOperationResult().get()); + }); +} + +GetSecretValueOperation::GetSecretValueOperation( + ClientConnection &connection, + const GetSecretValueOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future GetSecretValueOperation::Activate( + const GetSecretValueRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String GetSecretValueOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +UpdateStateOperationContext::UpdateStateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +UpdateStateOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return UpdateStateResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +UpdateStateOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +UpdateStateOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateStateRequest"); +} + +Aws::Crt::String +UpdateStateOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateStateResponse"); +} + +Aws::Crt::Optional +UpdateStateOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +UpdateStateOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#UpdateState"); +} + +std::future UpdateStateOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return UpdateStateResult(GetOperationResult().get()); + }); +} + +UpdateStateOperation::UpdateStateOperation( + ClientConnection &connection, + const UpdateStateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future UpdateStateOperation::Activate( + const UpdateStateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String UpdateStateOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +ListNamedShadowsForThingOperationContext:: + ListNamedShadowsForThingOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +ListNamedShadowsForThingOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +ListNamedShadowsForThingOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +ListNamedShadowsForThingOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingRequest"); +} + +Aws::Crt::String +ListNamedShadowsForThingOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingResponse"); +} + +Aws::Crt::Optional +ListNamedShadowsForThingOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +ListNamedShadowsForThingOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThing"); +} + +std::future +ListNamedShadowsForThingOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return ListNamedShadowsForThingResult(GetOperationResult().get()); + }); +} + +ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( + ClientConnection &connection, + const ListNamedShadowsForThingOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future ListNamedShadowsForThingOperation::Activate( + const ListNamedShadowsForThingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +ListNamedShadowsForThingOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +void SubscribeToComponentUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) { + OnStreamEvent(static_cast(response.get())); +} + +bool SubscribeToComponentUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) { + streamShouldTerminate = + OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == + Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && + !streamShouldTerminate) { + streamShouldTerminate = OnStreamError( + static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; +} + +SubscribeToComponentUpdatesOperationContext:: + SubscribeToComponentUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +SubscribeToComponentUpdatesOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +SubscribeToComponentUpdatesOperationContext:: + AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::String +SubscribeToComponentUpdatesOperationContext::GetRequestModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesRequest"); +} + +Aws::Crt::String +SubscribeToComponentUpdatesOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesResponse"); +} + +Aws::Crt::Optional +SubscribeToComponentUpdatesOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ComponentUpdatePolicyEvents"); +} + +Aws::Crt::String +SubscribeToComponentUpdatesOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdates"); +} + +std::future +SubscribeToComponentUpdatesOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToComponentUpdatesResult(GetOperationResult().get()); + }); +} + +SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToComponentUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) {} + +std::future SubscribeToComponentUpdatesOperation::Activate( + const SubscribeToComponentUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String +SubscribeToComponentUpdatesOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +ListLocalDeploymentsOperationContext::ListLocalDeploymentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +ListLocalDeploymentsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +ListLocalDeploymentsOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +ListLocalDeploymentsOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsRequest"); +} + +Aws::Crt::String +ListLocalDeploymentsOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); +} + +Aws::Crt::Optional +ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +ListLocalDeploymentsOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#ListLocalDeployments"); +} + +std::future +ListLocalDeploymentsOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return ListLocalDeploymentsResult(GetOperationResult().get()); + }); +} + +ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( + ClientConnection &connection, + const ListLocalDeploymentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future ListLocalDeploymentsOperation::Activate( + const ListLocalDeploymentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String ListLocalDeploymentsOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +StopComponentOperationContext::StopComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +StopComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return StopComponentResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +StopComponentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +StopComponentOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#StopComponentRequest"); +} + +Aws::Crt::String +StopComponentOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#StopComponentResponse"); +} + +Aws::Crt::Optional +StopComponentOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +StopComponentOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#StopComponent"); +} + +std::future StopComponentOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return StopComponentResult(GetOperationResult().get()); + }); +} + +StopComponentOperation::StopComponentOperation( + ClientConnection &connection, + const StopComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future StopComponentOperation::Activate( + const StopComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String StopComponentOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +PauseComponentOperationContext::PauseComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +PauseComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return PauseComponentResponse::s_allocateFromPayload(stringView, allocator); +} + +Aws::Crt::ScopedResource +PauseComponentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +PauseComponentOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PauseComponentRequest"); +} + +Aws::Crt::String +PauseComponentOperationContext::GetInitialResponseModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); +} + +Aws::Crt::Optional +PauseComponentOperationContext::GetStreamingResponseModelName() const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +PauseComponentOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#PauseComponent"); +} + +std::future +PauseComponentOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return PauseComponentResult(GetOperationResult().get()); + }); +} + +PauseComponentOperation::PauseComponentOperation( + ClientConnection &connection, + const PauseComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future PauseComponentOperation::Activate( + const PauseComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String PauseComponentOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +CreateLocalDeploymentOperationContext::CreateLocalDeploymentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) {} + +Aws::Crt::ScopedResource +CreateLocalDeploymentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, + allocator); +} + +Aws::Crt::ScopedResource +CreateLocalDeploymentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + (void)stringView; + (void)allocator; + return nullptr; +} + +Aws::Crt::String +CreateLocalDeploymentOperationContext::GetRequestModelName() const noexcept { + return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentRequest"); +} + +Aws::Crt::String +CreateLocalDeploymentOperationContext::GetInitialResponseModelName() + const noexcept { + return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentResponse"); +} + +Aws::Crt::Optional +CreateLocalDeploymentOperationContext::GetStreamingResponseModelName() + const noexcept { + return Aws::Crt::Optional(); +} + +Aws::Crt::String +CreateLocalDeploymentOperationContext::GetOperationName() const noexcept { + return Aws::Crt::String("aws.greengrass#CreateLocalDeployment"); +} + +std::future +CreateLocalDeploymentOperation::GetResult() noexcept { + return std::async(m_asyncLaunchMode, [this]() { + return CreateLocalDeploymentResult(GetOperationResult().get()); + }); +} + +CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( + ClientConnection &connection, + const CreateLocalDeploymentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) {} + +std::future CreateLocalDeploymentOperation::Activate( + const CreateLocalDeploymentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept { + return ClientOperation::Activate( + static_cast(&request), onMessageFlushCallback); +} + +Aws::Crt::String CreateLocalDeploymentOperation::GetModelName() const noexcept { + return m_operationModelContext.GetOperationName(); +} + +GreengrassCoreIpcServiceModel::GreengrassCoreIpcServiceModel() noexcept + : m_subscribeToIoTCoreOperationContext(*this), + m_resumeComponentOperationContext(*this), + m_publishToIoTCoreOperationContext(*this), + m_subscribeToConfigurationUpdateOperationContext(*this), + m_deleteThingShadowOperationContext(*this), + m_putComponentMetricOperationContext(*this), + m_deferComponentUpdateOperationContext(*this), + m_subscribeToValidateConfigurationUpdatesOperationContext(*this), + m_getConfigurationOperationContext(*this), + m_subscribeToTopicOperationContext(*this), + m_getComponentDetailsOperationContext(*this), + m_getClientDeviceAuthTokenOperationContext(*this), + m_publishToTopicOperationContext(*this), + m_subscribeToCertificateUpdatesOperationContext(*this), + m_verifyClientDeviceIdentityOperationContext(*this), + m_authorizeClientDeviceActionOperationContext(*this), + m_listComponentsOperationContext(*this), + m_createDebugPasswordOperationContext(*this), + m_getThingShadowOperationContext(*this), + m_sendConfigurationValidityReportOperationContext(*this), + m_updateThingShadowOperationContext(*this), + m_updateConfigurationOperationContext(*this), + m_validateAuthorizationTokenOperationContext(*this), + m_restartComponentOperationContext(*this), + m_getLocalDeploymentStatusOperationContext(*this), + m_getSecretValueOperationContext(*this), + m_updateStateOperationContext(*this), + m_listNamedShadowsForThingOperationContext(*this), + m_subscribeToComponentUpdatesOperationContext(*this), + m_listLocalDeploymentsOperationContext(*this), + m_stopComponentOperationContext(*this), + m_pauseComponentOperationContext(*this), + m_createLocalDeploymentOperationContext(*this) {} + +Aws::Crt::ScopedResource +GreengrassCoreIpcServiceModel::AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept { + auto it = m_modelNameToErrorResponse.find(errorModelName); + if (it == m_modelNameToErrorResponse.end()) { + return nullptr; + } else { + return it->second(stringView, allocator); + } +} + +void GreengrassCoreIpcServiceModel::AssignModelNameToErrorResponse( + Aws::Crt::String modelName, ErrorResponseFactory factory) noexcept { + m_modelNameToErrorResponse[modelName] = factory; +} +} // namespace Greengrass } // namespace Aws From 82dad1a61ec5e3c81de4a83aa6ff8cacdab322e9 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 14 Feb 2023 18:25:23 -0800 Subject: [PATCH 6/8] clang-format --- eventstream_rpc/tests/EchoTestRpcClient.cpp | 139 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 2777 +-- .../tests/include/awstest/EchoTestRpcClient.h | 89 +- .../tests/include/awstest/EchoTestRpcModel.h | 2058 +- .../aws/greengrass/GreengrassCoreIpcClient.h | 176 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 12284 ++++++----- .../source/GreengrassCoreIpcClient.cpp | 827 +- .../source/GreengrassCoreIpcModel.cpp | 17303 ++++++++-------- 8 files changed, 17664 insertions(+), 17989 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index 9e5a311e1..f49f52b36 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -2,86 +2,83 @@ #include #include -namespace Awstest { -EchoTestRpcClient::EchoTestRpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator) noexcept - : m_connection(allocator), m_clientBootstrap(clientBootstrap), - m_allocator(allocator), m_asyncLaunchMode(std::launch::deferred) { - m_echoTestRpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("awstest#ServiceError"), - ServiceError::s_allocateFromPayload); -} +namespace Awstest +{ + EchoTestRpcClient::EchoTestRpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator) noexcept + : m_connection(allocator), m_clientBootstrap(clientBootstrap), m_allocator(allocator), + m_asyncLaunchMode(std::launch::deferred) + { + m_echoTestRpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("awstest#ServiceError"), ServiceError::s_allocateFromPayload); + } -std::future -EchoTestRpcClient::Connect(ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig) noexcept { - return m_connection.Connect(connectionConfig, &lifecycleHandler, - m_clientBootstrap); -} + std::future EchoTestRpcClient::Connect( + ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig) noexcept + { + return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); + } -void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } + void EchoTestRpcClient::Close() noexcept { m_connection.Close(); } -void EchoTestRpcClient::WithLaunchMode(std::launch mode) noexcept { - m_asyncLaunchMode = mode; -} + void EchoTestRpcClient::WithLaunchMode(std::launch mode) noexcept { m_asyncLaunchMode = mode; } -EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } + EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } -std::shared_ptr -EchoTestRpcClient::NewGetAllProducts() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} + std::shared_ptr EchoTestRpcClient::NewGetAllProducts() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } -std::shared_ptr -EchoTestRpcClient::NewCauseServiceError() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} + std::shared_ptr EchoTestRpcClient::NewCauseServiceError() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } -std::shared_ptr -EchoTestRpcClient::NewCauseStreamServiceToError( - std::shared_ptr - streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, - m_allocator); -} + std::shared_ptr EchoTestRpcClient::NewCauseStreamServiceToError( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, + m_allocator); + } -std::shared_ptr -EchoTestRpcClient::NewEchoStreamMessages( - std::shared_ptr streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, - m_allocator); -} + std::shared_ptr EchoTestRpcClient::NewEchoStreamMessages( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, + m_allocator); + } -std::shared_ptr -EchoTestRpcClient::NewEchoMessage() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} + std::shared_ptr EchoTestRpcClient::NewEchoMessage() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } -std::shared_ptr -EchoTestRpcClient::NewGetAllCustomers() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} + std::shared_ptr EchoTestRpcClient::NewGetAllCustomers() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } } // namespace Awstest diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index dab7fcb30..d6b463468 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1,1375 +1,1412 @@ #include #include -namespace Awstest { -void Product::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_name.has_value()) { - payloadObject.WithString("name", m_name.value()); - } - if (m_price.has_value()) { - payloadObject.WithDouble("price", static_cast(m_price.value())); - } -} - -void Product::s_loadFromJsonView(Product &product, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("name")) { - product.m_name = - Aws::Crt::Optional(jsonView.GetString("name")); - } - if (jsonView.ValueExists("price")) { - product.m_price = Aws::Crt::Optional( - static_cast(jsonView.GetDouble("price"))); - } -} - -const char *Product::MODEL_NAME = "awstest#Product"; - -Aws::Crt::String Product::GetModelName() const noexcept { - return Product::MODEL_NAME; -} - -Aws::Crt::ScopedResource -Product::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), - Product::s_customDeleter); - shape->m_allocator = allocator; - Product::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void Product::s_customDeleter(Product *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void Customer::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_id.has_value()) { - payloadObject.WithInt64("id", m_id.value()); - } - if (m_firstName.has_value()) { - payloadObject.WithString("firstName", m_firstName.value()); - } - if (m_lastName.has_value()) { - payloadObject.WithString("lastName", m_lastName.value()); - } -} - -void Customer::s_loadFromJsonView(Customer &customer, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("id")) { - customer.m_id = Aws::Crt::Optional(jsonView.GetInt64("id")); - } - if (jsonView.ValueExists("firstName")) { - customer.m_firstName = - Aws::Crt::Optional(jsonView.GetString("firstName")); - } - if (jsonView.ValueExists("lastName")) { - customer.m_lastName = - Aws::Crt::Optional(jsonView.GetString("lastName")); - } -} - -const char *Customer::MODEL_NAME = "awstest#Customer"; - -Aws::Crt::String Customer::GetModelName() const noexcept { - return Customer::MODEL_NAME; -} - -Aws::Crt::ScopedResource -Customer::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), - Customer::s_customDeleter); - shape->m_allocator = allocator; - Customer::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void Customer::s_customDeleter(Customer *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void Pair::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_key.has_value()) { - payloadObject.WithString("key", m_key.value()); - } - if (m_value.has_value()) { - payloadObject.WithString("value", m_value.value()); - } -} - -void Pair::s_loadFromJsonView(Pair &pair, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("key")) { - pair.m_key = - Aws::Crt::Optional(jsonView.GetString("key")); - } - if (jsonView.ValueExists("value")) { - pair.m_value = - Aws::Crt::Optional(jsonView.GetString("value")); - } -} - -const char *Pair::MODEL_NAME = "awstest#Pair"; - -Aws::Crt::String Pair::GetModelName() const noexcept { - return Pair::MODEL_NAME; -} - -Aws::Crt::ScopedResource -Pair::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), - Pair::s_customDeleter); - shape->m_allocator = allocator; - Pair::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void Pair::s_customDeleter(Pair *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void MessageData::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_stringMessage.has_value()) { - payloadObject.WithString("stringMessage", m_stringMessage.value()); - } - if (m_booleanMessage.has_value()) { - payloadObject.WithBool("booleanMessage", m_booleanMessage.value()); - } - if (m_timeMessage.has_value()) { - payloadObject.WithDouble("timeMessage", - m_timeMessage.value().SecondsWithMSPrecision()); - } - if (m_documentMessage.has_value()) { - payloadObject.WithObject("documentMessage", m_documentMessage.value()); - } - if (m_enumMessage.has_value()) { - payloadObject.WithString("enumMessage", m_enumMessage.value()); - } - if (m_blobMessage.has_value()) { - if (m_blobMessage.value().size() > 0) { - payloadObject.WithString("blobMessage", - Aws::Crt::Base64Encode(m_blobMessage.value())); - } - } - if (m_stringListMessage.has_value()) { - Aws::Crt::JsonObject stringList; - Aws::Crt::Vector stringListJsonArray; - for (const auto &stringListItem : m_stringListMessage.value()) { - Aws::Crt::JsonObject stringListJsonArrayItem; - stringListJsonArrayItem.AsString(stringListItem); - stringListJsonArray.emplace_back(std::move(stringListJsonArrayItem)); - } - stringList.AsArray(std::move(stringListJsonArray)); - payloadObject.WithObject("stringListMessage", std::move(stringList)); - } - if (m_keyValuePairList.has_value()) { - Aws::Crt::JsonObject keyValuePairList; - Aws::Crt::Vector keyValuePairListJsonArray; - for (const auto &keyValuePairListItem : m_keyValuePairList.value()) { - Aws::Crt::JsonObject keyValuePairListJsonArrayItem; - keyValuePairListItem.SerializeToJsonObject(keyValuePairListJsonArrayItem); - keyValuePairListJsonArray.emplace_back( - std::move(keyValuePairListJsonArrayItem)); - } - keyValuePairList.AsArray(std::move(keyValuePairListJsonArray)); - payloadObject.WithObject("keyValuePairList", std::move(keyValuePairList)); - } - if (m_stringToValue.has_value()) { - Aws::Crt::JsonObject stringToValueValue; - for (const auto &stringToValueItem : m_stringToValue.value()) { - Aws::Crt::JsonObject stringToValueJsonObject; - stringToValueItem.second.SerializeToJsonObject(stringToValueJsonObject); - stringToValueValue.WithObject(stringToValueItem.first, - std::move(stringToValueJsonObject)); - } - payloadObject.WithObject("stringToValue", std::move(stringToValueValue)); - } -} - -void MessageData::s_loadFromJsonView( - MessageData &messageData, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("stringMessage")) { - messageData.m_stringMessage = Aws::Crt::Optional( - jsonView.GetString("stringMessage")); - } - if (jsonView.ValueExists("booleanMessage")) { - messageData.m_booleanMessage = - Aws::Crt::Optional(jsonView.GetBool("booleanMessage")); - } - if (jsonView.ValueExists("timeMessage")) { - messageData.m_timeMessage = Aws::Crt::Optional( - Aws::Crt::DateTime(jsonView.GetDouble("timeMessage"))); - } - if (jsonView.ValueExists("documentMessage")) { - messageData.m_documentMessage = Aws::Crt::Optional( - jsonView.GetJsonObject("documentMessage").Materialize()); - } - if (jsonView.ValueExists("enumMessage")) { - messageData.m_enumMessage = - Aws::Crt::Optional(jsonView.GetString("enumMessage")); - } - if (jsonView.ValueExists("blobMessage")) { - if (jsonView.GetString("blobMessage").size() > 0) { - messageData.m_blobMessage = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("blobMessage"))); - } - } - if (jsonView.ValueExists("stringListMessage")) { - messageData.m_stringListMessage = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &stringListJsonView : - jsonView.GetArray("stringListMessage")) { - Aws::Crt::Optional stringListItem; - stringListItem = - Aws::Crt::Optional(stringListJsonView.AsString()); - messageData.m_stringListMessage.value().push_back(stringListItem.value()); - } - } - if (jsonView.ValueExists("keyValuePairList")) { - messageData.m_keyValuePairList = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyValuePairListJsonView : - jsonView.GetArray("keyValuePairList")) { - Aws::Crt::Optional keyValuePairListItem; - keyValuePairListItem = Pair(); - Pair::s_loadFromJsonView(keyValuePairListItem.value(), - keyValuePairListJsonView); - messageData.m_keyValuePairList.value().push_back( - keyValuePairListItem.value()); - } - } - if (jsonView.ValueExists("stringToValue")) { - messageData.m_stringToValue = Aws::Crt::Map(); - for (const auto &stringToValuePair : - jsonView.GetJsonObject("stringToValue").GetAllObjects()) { - Aws::Crt::Optional stringToValueValue; - stringToValueValue = Product(); - Product::s_loadFromJsonView(stringToValueValue.value(), - stringToValuePair.second); - messageData.m_stringToValue.value()[stringToValuePair.first] = - stringToValueValue.value(); - } - } -} - -void MessageData::SetEnumMessage(FruitEnum enumMessage) noexcept { - switch (enumMessage) { - case FRUIT_ENUM_APPLE: - m_enumMessage = Aws::Crt::String("apl"); - break; - case FRUIT_ENUM_ORANGE: - m_enumMessage = Aws::Crt::String("org"); - break; - case FRUIT_ENUM_BANANA: - m_enumMessage = Aws::Crt::String("ban"); - break; - case FRUIT_ENUM_PINEAPPLE: - m_enumMessage = Aws::Crt::String("pin"); - break; - default: - break; - } -} - -Aws::Crt::Optional MessageData::GetEnumMessage() noexcept { - if (!m_enumMessage.has_value()) - return Aws::Crt::Optional(); - if (m_enumMessage.value() == Aws::Crt::String("apl")) { - return Aws::Crt::Optional(FRUIT_ENUM_APPLE); - } - if (m_enumMessage.value() == Aws::Crt::String("org")) { - return Aws::Crt::Optional(FRUIT_ENUM_ORANGE); - } - if (m_enumMessage.value() == Aws::Crt::String("ban")) { - return Aws::Crt::Optional(FRUIT_ENUM_BANANA); - } - if (m_enumMessage.value() == Aws::Crt::String("pin")) { - return Aws::Crt::Optional(FRUIT_ENUM_PINEAPPLE); - } - - return Aws::Crt::Optional(); -} - -const char *MessageData::MODEL_NAME = "awstest#MessageData"; - -Aws::Crt::String MessageData::GetModelName() const noexcept { - return MessageData::MODEL_NAME; -} - -Aws::Crt::ScopedResource -MessageData::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MessageData::s_customDeleter); - shape->m_allocator = allocator; - MessageData::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void MessageData::s_customDeleter(MessageData *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void EchoStreamingMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_STREAM_MESSAGE && m_streamMessage.has_value()) { - Aws::Crt::JsonObject messageDataValue; - m_streamMessage.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("streamMessage", std::move(messageDataValue)); - } else if (m_chosenMember == TAG_KEY_VALUE_PAIR && - m_keyValuePair.has_value()) { - Aws::Crt::JsonObject pairValue; - m_keyValuePair.value().SerializeToJsonObject(pairValue); - payloadObject.WithObject("keyValuePair", std::move(pairValue)); - } -} - -void EchoStreamingMessage::s_loadFromJsonView( - EchoStreamingMessage &echoStreamingMessage, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("streamMessage")) { - echoStreamingMessage.m_streamMessage = MessageData(); - MessageData::s_loadFromJsonView( - echoStreamingMessage.m_streamMessage.value(), - jsonView.GetJsonObject("streamMessage")); - echoStreamingMessage.m_chosenMember = TAG_STREAM_MESSAGE; - } else if (jsonView.ValueExists("keyValuePair")) { - echoStreamingMessage.m_keyValuePair = Pair(); - Pair::s_loadFromJsonView(echoStreamingMessage.m_keyValuePair.value(), - jsonView.GetJsonObject("keyValuePair")); - echoStreamingMessage.m_chosenMember = TAG_KEY_VALUE_PAIR; - } -} - -EchoStreamingMessage &EchoStreamingMessage::operator=( - const EchoStreamingMessage &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_STREAM_MESSAGE) { - m_streamMessage = objectToCopy.m_streamMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } else if (objectToCopy.m_chosenMember == TAG_KEY_VALUE_PAIR) { - m_keyValuePair = objectToCopy.m_keyValuePair; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; - -Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { - return EchoStreamingMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -EchoStreamingMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - EchoStreamingMessage::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void EchoStreamingMessage::s_customDeleter( - EchoStreamingMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetAllProductsResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_products.has_value()) { - Aws::Crt::JsonObject productMapValue; - for (const auto &productMapItem : m_products.value()) { - Aws::Crt::JsonObject productMapJsonObject; - productMapItem.second.SerializeToJsonObject(productMapJsonObject); - productMapValue.WithObject(productMapItem.first, - std::move(productMapJsonObject)); - } - payloadObject.WithObject("products", std::move(productMapValue)); - } -} - -void GetAllProductsResponse::s_loadFromJsonView( - GetAllProductsResponse &getAllProductsResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("products")) { - getAllProductsResponse.m_products = - Aws::Crt::Map(); - for (const auto &productMapPair : - jsonView.GetJsonObject("products").GetAllObjects()) { - Aws::Crt::Optional productMapValue; - productMapValue = Product(); - Product::s_loadFromJsonView(productMapValue.value(), - productMapPair.second); - getAllProductsResponse.m_products.value()[productMapPair.first] = - productMapValue.value(); - } - } -} - -const char *GetAllProductsResponse::MODEL_NAME = - "awstest#GetAllProductsResponse"; - -Aws::Crt::String GetAllProductsResponse::GetModelName() const noexcept { - return GetAllProductsResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetAllProductsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetAllProductsResponse::s_customDeleter); - shape->m_allocator = allocator; - GetAllProductsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetAllProductsResponse::s_customDeleter( - GetAllProductsResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetAllProductsRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void GetAllProductsRequest::s_loadFromJsonView( - GetAllProductsRequest &getAllProductsRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)getAllProductsRequest; - (void)jsonView; -} - -const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; - -Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { - return GetAllProductsRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetAllProductsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetAllProductsRequest::s_customDeleter); - shape->m_allocator = allocator; - GetAllProductsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetAllProductsRequest::s_customDeleter( - GetAllProductsRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetAllCustomersResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_customers.has_value()) { - Aws::Crt::JsonObject customerList; - Aws::Crt::Vector customerListJsonArray; - for (const auto &customerListItem : m_customers.value()) { - Aws::Crt::JsonObject customerListJsonArrayItem; - customerListItem.SerializeToJsonObject(customerListJsonArrayItem); - customerListJsonArray.emplace_back(std::move(customerListJsonArrayItem)); - } - customerList.AsArray(std::move(customerListJsonArray)); - payloadObject.WithObject("customers", std::move(customerList)); - } -} - -void GetAllCustomersResponse::s_loadFromJsonView( - GetAllCustomersResponse &getAllCustomersResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("customers")) { - getAllCustomersResponse.m_customers = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &customerListJsonView : - jsonView.GetArray("customers")) { - Aws::Crt::Optional customerListItem; - customerListItem = Customer(); - Customer::s_loadFromJsonView(customerListItem.value(), - customerListJsonView); - getAllCustomersResponse.m_customers.value().push_back( - customerListItem.value()); - } - } -} - -const char *GetAllCustomersResponse::MODEL_NAME = - "awstest#GetAllCustomersResponse"; - -Aws::Crt::String GetAllCustomersResponse::GetModelName() const noexcept { - return GetAllCustomersResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetAllCustomersResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetAllCustomersResponse::s_customDeleter); - shape->m_allocator = allocator; - GetAllCustomersResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetAllCustomersResponse::s_customDeleter( - GetAllCustomersResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetAllCustomersRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void GetAllCustomersRequest::s_loadFromJsonView( - GetAllCustomersRequest &getAllCustomersRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)getAllCustomersRequest; - (void)jsonView; -} - -const char *GetAllCustomersRequest::MODEL_NAME = - "awstest#GetAllCustomersRequest"; - -Aws::Crt::String GetAllCustomersRequest::GetModelName() const noexcept { - return GetAllCustomersRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetAllCustomersRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetAllCustomersRequest::s_customDeleter); - shape->m_allocator = allocator; - GetAllCustomersRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetAllCustomersRequest::s_customDeleter( - GetAllCustomersRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void EchoMessageResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - Aws::Crt::JsonObject messageDataValue; - m_message.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("message", std::move(messageDataValue)); - } -} - -void EchoMessageResponse::s_loadFromJsonView( - EchoMessageResponse &echoMessageResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - echoMessageResponse.m_message = MessageData(); - MessageData::s_loadFromJsonView(echoMessageResponse.m_message.value(), - jsonView.GetJsonObject("message")); - } -} - -const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; - -Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { - return EchoMessageResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -EchoMessageResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - EchoMessageResponse::s_customDeleter); - shape->m_allocator = allocator; - EchoMessageResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void EchoMessageResponse::s_customDeleter(EchoMessageResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void EchoMessageRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - Aws::Crt::JsonObject messageDataValue; - m_message.value().SerializeToJsonObject(messageDataValue); - payloadObject.WithObject("message", std::move(messageDataValue)); - } -} - -void EchoMessageRequest::s_loadFromJsonView( - EchoMessageRequest &echoMessageRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - echoMessageRequest.m_message = MessageData(); - MessageData::s_loadFromJsonView(echoMessageRequest.m_message.value(), - jsonView.GetJsonObject("message")); - } -} - -const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; - -Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { - return EchoMessageRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -EchoMessageRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - EchoMessageRequest::s_customDeleter); - shape->m_allocator = allocator; - EchoMessageRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void EchoMessageRequest::s_customDeleter(EchoMessageRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void EchoStreamingResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void EchoStreamingResponse::s_loadFromJsonView( - EchoStreamingResponse &echoStreamingResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)echoStreamingResponse; - (void)jsonView; -} - -const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; - -Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { - return EchoStreamingResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -EchoStreamingResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - EchoStreamingResponse::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void EchoStreamingResponse::s_customDeleter( - EchoStreamingResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void EchoStreamingRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void EchoStreamingRequest::s_loadFromJsonView( - EchoStreamingRequest &echoStreamingRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)echoStreamingRequest; - (void)jsonView; -} - -const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; - -Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { - return EchoStreamingRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -EchoStreamingRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - EchoStreamingRequest::s_customDeleter); - shape->m_allocator = allocator; - EchoStreamingRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void EchoStreamingRequest::s_customDeleter( - EchoStreamingRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ServiceError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } - if (m_value.has_value()) { - payloadObject.WithString("value", m_value.value()); - } -} - -void ServiceError::s_loadFromJsonView( - ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - serviceError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("value")) { - serviceError.m_value = - Aws::Crt::Optional(jsonView.GetString("value")); - } -} - -const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; - -Aws::Crt::String ServiceError::GetModelName() const noexcept { - return ServiceError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ServiceError::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ServiceError::s_customDeleter); - shape->m_allocator = allocator; - ServiceError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void ServiceError::s_customDeleter(ServiceError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void CauseServiceErrorResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void CauseServiceErrorResponse::s_loadFromJsonView( - CauseServiceErrorResponse &causeServiceErrorResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)causeServiceErrorResponse; - (void)jsonView; -} - -const char *CauseServiceErrorResponse::MODEL_NAME = - "awstest#CauseServiceErrorResponse"; - -Aws::Crt::String CauseServiceErrorResponse::GetModelName() const noexcept { - return CauseServiceErrorResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CauseServiceErrorResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CauseServiceErrorResponse::s_customDeleter); - shape->m_allocator = allocator; - CauseServiceErrorResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CauseServiceErrorResponse::s_customDeleter( - CauseServiceErrorResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CauseServiceErrorRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void CauseServiceErrorRequest::s_loadFromJsonView( - CauseServiceErrorRequest &causeServiceErrorRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)causeServiceErrorRequest; - (void)jsonView; -} - -const char *CauseServiceErrorRequest::MODEL_NAME = - "awstest#CauseServiceErrorRequest"; - -Aws::Crt::String CauseServiceErrorRequest::GetModelName() const noexcept { - return CauseServiceErrorRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CauseServiceErrorRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CauseServiceErrorRequest::s_customDeleter); - shape->m_allocator = allocator; - CauseServiceErrorRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CauseServiceErrorRequest::s_customDeleter( - CauseServiceErrorRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -GetAllProductsOperationContext::GetAllProductsOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetAllProductsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetAllProductsResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -GetAllProductsOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetAllProductsOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("awstest#GetAllProductsRequest"); -} - -Aws::Crt::String -GetAllProductsOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("awstest#GetAllProductsResponse"); -} - -Aws::Crt::Optional -GetAllProductsOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetAllProductsOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#GetAllProducts"); -} - -std::future -GetAllProductsOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetAllProductsResult(GetOperationResult().get()); - }); -} - -GetAllProductsOperation::GetAllProductsOperation( - ClientConnection &connection, - const GetAllProductsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetAllProductsOperation::Activate( - const GetAllProductsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetAllProductsOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -CauseServiceErrorOperationContext::CauseServiceErrorOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -CauseServiceErrorOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return CauseServiceErrorResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -CauseServiceErrorOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -CauseServiceErrorOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("awstest#CauseServiceErrorRequest"); -} - -Aws::Crt::String -CauseServiceErrorOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("awstest#CauseServiceErrorResponse"); -} - -Aws::Crt::Optional -CauseServiceErrorOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -CauseServiceErrorOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#CauseServiceError"); -} - -std::future -CauseServiceErrorOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return CauseServiceErrorResult(GetOperationResult().get()); - }); -} - -CauseServiceErrorOperation::CauseServiceErrorOperation( - ClientConnection &connection, - const CauseServiceErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future CauseServiceErrorOperation::Activate( - const CauseServiceErrorRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String CauseServiceErrorOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void CauseStreamServiceToErrorStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool CauseStreamServiceToErrorStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("awstest#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -CauseStreamServiceToErrorOperationContext:: - CauseStreamServiceToErrorOperationContext( +namespace Awstest +{ + void Product::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_name.has_value()) + { + payloadObject.WithString("name", m_name.value()); + } + if (m_price.has_value()) + { + payloadObject.WithDouble("price", static_cast(m_price.value())); + } + } + + void Product::s_loadFromJsonView(Product &product, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("name")) + { + product.m_name = Aws::Crt::Optional(jsonView.GetString("name")); + } + if (jsonView.ValueExists("price")) + { + product.m_price = Aws::Crt::Optional(static_cast(jsonView.GetDouble("price"))); + } + } + + const char *Product::MODEL_NAME = "awstest#Product"; + + Aws::Crt::String Product::GetModelName() const noexcept { return Product::MODEL_NAME; } + + Aws::Crt::ScopedResource Product::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Product::s_customDeleter); + shape->m_allocator = allocator; + Product::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void Product::s_customDeleter(Product *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void Customer::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_id.has_value()) + { + payloadObject.WithInt64("id", m_id.value()); + } + if (m_firstName.has_value()) + { + payloadObject.WithString("firstName", m_firstName.value()); + } + if (m_lastName.has_value()) + { + payloadObject.WithString("lastName", m_lastName.value()); + } + } + + void Customer::s_loadFromJsonView(Customer &customer, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("id")) + { + customer.m_id = Aws::Crt::Optional(jsonView.GetInt64("id")); + } + if (jsonView.ValueExists("firstName")) + { + customer.m_firstName = Aws::Crt::Optional(jsonView.GetString("firstName")); + } + if (jsonView.ValueExists("lastName")) + { + customer.m_lastName = Aws::Crt::Optional(jsonView.GetString("lastName")); + } + } + + const char *Customer::MODEL_NAME = "awstest#Customer"; + + Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::MODEL_NAME; } + + Aws::Crt::ScopedResource Customer::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Customer::s_customDeleter); + shape->m_allocator = allocator; + Customer::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void Customer::s_customDeleter(Customer *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void Pair::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_key.has_value()) + { + payloadObject.WithString("key", m_key.value()); + } + if (m_value.has_value()) + { + payloadObject.WithString("value", m_value.value()); + } + } + + void Pair::s_loadFromJsonView(Pair &pair, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("key")) + { + pair.m_key = Aws::Crt::Optional(jsonView.GetString("key")); + } + if (jsonView.ValueExists("value")) + { + pair.m_value = Aws::Crt::Optional(jsonView.GetString("value")); + } + } + + const char *Pair::MODEL_NAME = "awstest#Pair"; + + Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::MODEL_NAME; } + + Aws::Crt::ScopedResource Pair::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Pair::s_customDeleter); + shape->m_allocator = allocator; + Pair::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void Pair::s_customDeleter(Pair *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void MessageData::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_stringMessage.has_value()) + { + payloadObject.WithString("stringMessage", m_stringMessage.value()); + } + if (m_booleanMessage.has_value()) + { + payloadObject.WithBool("booleanMessage", m_booleanMessage.value()); + } + if (m_timeMessage.has_value()) + { + payloadObject.WithDouble("timeMessage", m_timeMessage.value().SecondsWithMSPrecision()); + } + if (m_documentMessage.has_value()) + { + payloadObject.WithObject("documentMessage", m_documentMessage.value()); + } + if (m_enumMessage.has_value()) + { + payloadObject.WithString("enumMessage", m_enumMessage.value()); + } + if (m_blobMessage.has_value()) + { + if (m_blobMessage.value().size() > 0) + { + payloadObject.WithString("blobMessage", Aws::Crt::Base64Encode(m_blobMessage.value())); + } + } + if (m_stringListMessage.has_value()) + { + Aws::Crt::JsonObject stringList; + Aws::Crt::Vector stringListJsonArray; + for (const auto &stringListItem : m_stringListMessage.value()) + { + Aws::Crt::JsonObject stringListJsonArrayItem; + stringListJsonArrayItem.AsString(stringListItem); + stringListJsonArray.emplace_back(std::move(stringListJsonArrayItem)); + } + stringList.AsArray(std::move(stringListJsonArray)); + payloadObject.WithObject("stringListMessage", std::move(stringList)); + } + if (m_keyValuePairList.has_value()) + { + Aws::Crt::JsonObject keyValuePairList; + Aws::Crt::Vector keyValuePairListJsonArray; + for (const auto &keyValuePairListItem : m_keyValuePairList.value()) + { + Aws::Crt::JsonObject keyValuePairListJsonArrayItem; + keyValuePairListItem.SerializeToJsonObject(keyValuePairListJsonArrayItem); + keyValuePairListJsonArray.emplace_back(std::move(keyValuePairListJsonArrayItem)); + } + keyValuePairList.AsArray(std::move(keyValuePairListJsonArray)); + payloadObject.WithObject("keyValuePairList", std::move(keyValuePairList)); + } + if (m_stringToValue.has_value()) + { + Aws::Crt::JsonObject stringToValueValue; + for (const auto &stringToValueItem : m_stringToValue.value()) + { + Aws::Crt::JsonObject stringToValueJsonObject; + stringToValueItem.second.SerializeToJsonObject(stringToValueJsonObject); + stringToValueValue.WithObject(stringToValueItem.first, std::move(stringToValueJsonObject)); + } + payloadObject.WithObject("stringToValue", std::move(stringToValueValue)); + } + } + + void MessageData::s_loadFromJsonView(MessageData &messageData, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("stringMessage")) + { + messageData.m_stringMessage = Aws::Crt::Optional(jsonView.GetString("stringMessage")); + } + if (jsonView.ValueExists("booleanMessage")) + { + messageData.m_booleanMessage = Aws::Crt::Optional(jsonView.GetBool("booleanMessage")); + } + if (jsonView.ValueExists("timeMessage")) + { + messageData.m_timeMessage = + Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timeMessage"))); + } + if (jsonView.ValueExists("documentMessage")) + { + messageData.m_documentMessage = + Aws::Crt::Optional(jsonView.GetJsonObject("documentMessage").Materialize()); + } + if (jsonView.ValueExists("enumMessage")) + { + messageData.m_enumMessage = Aws::Crt::Optional(jsonView.GetString("enumMessage")); + } + if (jsonView.ValueExists("blobMessage")) + { + if (jsonView.GetString("blobMessage").size() > 0) + { + messageData.m_blobMessage = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("blobMessage"))); + } + } + if (jsonView.ValueExists("stringListMessage")) + { + messageData.m_stringListMessage = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &stringListJsonView : jsonView.GetArray("stringListMessage")) + { + Aws::Crt::Optional stringListItem; + stringListItem = Aws::Crt::Optional(stringListJsonView.AsString()); + messageData.m_stringListMessage.value().push_back(stringListItem.value()); + } + } + if (jsonView.ValueExists("keyValuePairList")) + { + messageData.m_keyValuePairList = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyValuePairListJsonView : jsonView.GetArray("keyValuePairList")) + { + Aws::Crt::Optional keyValuePairListItem; + keyValuePairListItem = Pair(); + Pair::s_loadFromJsonView(keyValuePairListItem.value(), keyValuePairListJsonView); + messageData.m_keyValuePairList.value().push_back(keyValuePairListItem.value()); + } + } + if (jsonView.ValueExists("stringToValue")) + { + messageData.m_stringToValue = Aws::Crt::Map(); + for (const auto &stringToValuePair : jsonView.GetJsonObject("stringToValue").GetAllObjects()) + { + Aws::Crt::Optional stringToValueValue; + stringToValueValue = Product(); + Product::s_loadFromJsonView(stringToValueValue.value(), stringToValuePair.second); + messageData.m_stringToValue.value()[stringToValuePair.first] = stringToValueValue.value(); + } + } + } + + void MessageData::SetEnumMessage(FruitEnum enumMessage) noexcept + { + switch (enumMessage) + { + case FRUIT_ENUM_APPLE: + m_enumMessage = Aws::Crt::String("apl"); + break; + case FRUIT_ENUM_ORANGE: + m_enumMessage = Aws::Crt::String("org"); + break; + case FRUIT_ENUM_BANANA: + m_enumMessage = Aws::Crt::String("ban"); + break; + case FRUIT_ENUM_PINEAPPLE: + m_enumMessage = Aws::Crt::String("pin"); + break; + default: + break; + } + } + + Aws::Crt::Optional MessageData::GetEnumMessage() noexcept + { + if (!m_enumMessage.has_value()) + return Aws::Crt::Optional(); + if (m_enumMessage.value() == Aws::Crt::String("apl")) + { + return Aws::Crt::Optional(FRUIT_ENUM_APPLE); + } + if (m_enumMessage.value() == Aws::Crt::String("org")) + { + return Aws::Crt::Optional(FRUIT_ENUM_ORANGE); + } + if (m_enumMessage.value() == Aws::Crt::String("ban")) + { + return Aws::Crt::Optional(FRUIT_ENUM_BANANA); + } + if (m_enumMessage.value() == Aws::Crt::String("pin")) + { + return Aws::Crt::Optional(FRUIT_ENUM_PINEAPPLE); + } + + return Aws::Crt::Optional(); + } + + const char *MessageData::MODEL_NAME = "awstest#MessageData"; + + Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::MODEL_NAME; } + + Aws::Crt::ScopedResource MessageData::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MessageData::s_customDeleter); + shape->m_allocator = allocator; + MessageData::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void MessageData::s_customDeleter(MessageData *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void EchoStreamingMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_STREAM_MESSAGE && m_streamMessage.has_value()) + { + Aws::Crt::JsonObject messageDataValue; + m_streamMessage.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("streamMessage", std::move(messageDataValue)); + } + else if (m_chosenMember == TAG_KEY_VALUE_PAIR && m_keyValuePair.has_value()) + { + Aws::Crt::JsonObject pairValue; + m_keyValuePair.value().SerializeToJsonObject(pairValue); + payloadObject.WithObject("keyValuePair", std::move(pairValue)); + } + } + + void EchoStreamingMessage::s_loadFromJsonView( + EchoStreamingMessage &echoStreamingMessage, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("streamMessage")) + { + echoStreamingMessage.m_streamMessage = MessageData(); + MessageData::s_loadFromJsonView( + echoStreamingMessage.m_streamMessage.value(), jsonView.GetJsonObject("streamMessage")); + echoStreamingMessage.m_chosenMember = TAG_STREAM_MESSAGE; + } + else if (jsonView.ValueExists("keyValuePair")) + { + echoStreamingMessage.m_keyValuePair = Pair(); + Pair::s_loadFromJsonView( + echoStreamingMessage.m_keyValuePair.value(), jsonView.GetJsonObject("keyValuePair")); + echoStreamingMessage.m_chosenMember = TAG_KEY_VALUE_PAIR; + } + } + + EchoStreamingMessage &EchoStreamingMessage::operator=(const EchoStreamingMessage &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_STREAM_MESSAGE) + { + m_streamMessage = objectToCopy.m_streamMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + else if (objectToCopy.m_chosenMember == TAG_KEY_VALUE_PAIR) + { + m_keyValuePair = objectToCopy.m_keyValuePair; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage"; + + Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { return EchoStreamingMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource EchoStreamingMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), EchoStreamingMessage::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void EchoStreamingMessage::s_customDeleter(EchoStreamingMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetAllProductsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_products.has_value()) + { + Aws::Crt::JsonObject productMapValue; + for (const auto &productMapItem : m_products.value()) + { + Aws::Crt::JsonObject productMapJsonObject; + productMapItem.second.SerializeToJsonObject(productMapJsonObject); + productMapValue.WithObject(productMapItem.first, std::move(productMapJsonObject)); + } + payloadObject.WithObject("products", std::move(productMapValue)); + } + } + + void GetAllProductsResponse::s_loadFromJsonView( + GetAllProductsResponse &getAllProductsResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("products")) + { + getAllProductsResponse.m_products = Aws::Crt::Map(); + for (const auto &productMapPair : jsonView.GetJsonObject("products").GetAllObjects()) + { + Aws::Crt::Optional productMapValue; + productMapValue = Product(); + Product::s_loadFromJsonView(productMapValue.value(), productMapPair.second); + getAllProductsResponse.m_products.value()[productMapPair.first] = productMapValue.value(); + } + } + } + + const char *GetAllProductsResponse::MODEL_NAME = "awstest#GetAllProductsResponse"; + + Aws::Crt::String GetAllProductsResponse::GetModelName() const noexcept + { + return GetAllProductsResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetAllProductsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetAllProductsResponse::s_customDeleter); + shape->m_allocator = allocator; + GetAllProductsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetAllProductsResponse::s_customDeleter(GetAllProductsResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetAllProductsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void GetAllProductsRequest::s_loadFromJsonView( + GetAllProductsRequest &getAllProductsRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)getAllProductsRequest; + (void)jsonView; + } + + const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest"; + + Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { return GetAllProductsRequest::MODEL_NAME; } + + Aws::Crt::ScopedResource GetAllProductsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetAllProductsRequest::s_customDeleter); + shape->m_allocator = allocator; + GetAllProductsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetAllProductsRequest::s_customDeleter(GetAllProductsRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetAllCustomersResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_customers.has_value()) + { + Aws::Crt::JsonObject customerList; + Aws::Crt::Vector customerListJsonArray; + for (const auto &customerListItem : m_customers.value()) + { + Aws::Crt::JsonObject customerListJsonArrayItem; + customerListItem.SerializeToJsonObject(customerListJsonArrayItem); + customerListJsonArray.emplace_back(std::move(customerListJsonArrayItem)); + } + customerList.AsArray(std::move(customerListJsonArray)); + payloadObject.WithObject("customers", std::move(customerList)); + } + } + + void GetAllCustomersResponse::s_loadFromJsonView( + GetAllCustomersResponse &getAllCustomersResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("customers")) + { + getAllCustomersResponse.m_customers = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &customerListJsonView : jsonView.GetArray("customers")) + { + Aws::Crt::Optional customerListItem; + customerListItem = Customer(); + Customer::s_loadFromJsonView(customerListItem.value(), customerListJsonView); + getAllCustomersResponse.m_customers.value().push_back(customerListItem.value()); + } + } + } + + const char *GetAllCustomersResponse::MODEL_NAME = "awstest#GetAllCustomersResponse"; + + Aws::Crt::String GetAllCustomersResponse::GetModelName() const noexcept + { + return GetAllCustomersResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetAllCustomersResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetAllCustomersResponse::s_customDeleter); + shape->m_allocator = allocator; + GetAllCustomersResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetAllCustomersResponse::s_customDeleter(GetAllCustomersResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetAllCustomersRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void GetAllCustomersRequest::s_loadFromJsonView( + GetAllCustomersRequest &getAllCustomersRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)getAllCustomersRequest; + (void)jsonView; + } + + const char *GetAllCustomersRequest::MODEL_NAME = "awstest#GetAllCustomersRequest"; + + Aws::Crt::String GetAllCustomersRequest::GetModelName() const noexcept + { + return GetAllCustomersRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetAllCustomersRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetAllCustomersRequest::s_customDeleter); + shape->m_allocator = allocator; + GetAllCustomersRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetAllCustomersRequest::s_customDeleter(GetAllCustomersRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void EchoMessageResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + Aws::Crt::JsonObject messageDataValue; + m_message.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("message", std::move(messageDataValue)); + } + } + + void EchoMessageResponse::s_loadFromJsonView( + EchoMessageResponse &echoMessageResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + echoMessageResponse.m_message = MessageData(); + MessageData::s_loadFromJsonView(echoMessageResponse.m_message.value(), jsonView.GetJsonObject("message")); + } + } + + const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse"; + + Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { return EchoMessageResponse::MODEL_NAME; } + + Aws::Crt::ScopedResource EchoMessageResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), EchoMessageResponse::s_customDeleter); + shape->m_allocator = allocator; + EchoMessageResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void EchoMessageResponse::s_customDeleter(EchoMessageResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void EchoMessageRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + Aws::Crt::JsonObject messageDataValue; + m_message.value().SerializeToJsonObject(messageDataValue); + payloadObject.WithObject("message", std::move(messageDataValue)); + } + } + + void EchoMessageRequest::s_loadFromJsonView( + EchoMessageRequest &echoMessageRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + echoMessageRequest.m_message = MessageData(); + MessageData::s_loadFromJsonView(echoMessageRequest.m_message.value(), jsonView.GetJsonObject("message")); + } + } + + const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest"; + + Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::MODEL_NAME; } + + Aws::Crt::ScopedResource EchoMessageRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), EchoMessageRequest::s_customDeleter); + shape->m_allocator = allocator; + EchoMessageRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void EchoMessageRequest::s_customDeleter(EchoMessageRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void EchoStreamingResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void EchoStreamingResponse::s_loadFromJsonView( + EchoStreamingResponse &echoStreamingResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)echoStreamingResponse; + (void)jsonView; + } + + const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse"; + + Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { return EchoStreamingResponse::MODEL_NAME; } + + Aws::Crt::ScopedResource EchoStreamingResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), EchoStreamingResponse::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void EchoStreamingResponse::s_customDeleter(EchoStreamingResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void EchoStreamingRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void EchoStreamingRequest::s_loadFromJsonView( + EchoStreamingRequest &echoStreamingRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)echoStreamingRequest; + (void)jsonView; + } + + const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest"; + + Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { return EchoStreamingRequest::MODEL_NAME; } + + Aws::Crt::ScopedResource EchoStreamingRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), EchoStreamingRequest::s_customDeleter); + shape->m_allocator = allocator; + EchoStreamingRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void EchoStreamingRequest::s_customDeleter(EchoStreamingRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ServiceError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + if (m_value.has_value()) + { + payloadObject.WithString("value", m_value.value()); + } + } + + void ServiceError::s_loadFromJsonView(ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + serviceError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("value")) + { + serviceError.m_value = Aws::Crt::Optional(jsonView.GetString("value")); + } + } + + const char *ServiceError::MODEL_NAME = "awstest#ServiceError"; + + Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } + + Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ServiceError::s_customDeleter); + shape->m_allocator = allocator; + ServiceError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void ServiceError::s_customDeleter(ServiceError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void CauseServiceErrorResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void CauseServiceErrorResponse::s_loadFromJsonView( + CauseServiceErrorResponse &causeServiceErrorResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)causeServiceErrorResponse; + (void)jsonView; + } + + const char *CauseServiceErrorResponse::MODEL_NAME = "awstest#CauseServiceErrorResponse"; + + Aws::Crt::String CauseServiceErrorResponse::GetModelName() const noexcept + { + return CauseServiceErrorResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource CauseServiceErrorResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CauseServiceErrorResponse::s_customDeleter); + shape->m_allocator = allocator; + CauseServiceErrorResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CauseServiceErrorResponse::s_customDeleter(CauseServiceErrorResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CauseServiceErrorRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void CauseServiceErrorRequest::s_loadFromJsonView( + CauseServiceErrorRequest &causeServiceErrorRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)causeServiceErrorRequest; + (void)jsonView; + } + + const char *CauseServiceErrorRequest::MODEL_NAME = "awstest#CauseServiceErrorRequest"; + + Aws::Crt::String CauseServiceErrorRequest::GetModelName() const noexcept + { + return CauseServiceErrorRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource CauseServiceErrorRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CauseServiceErrorRequest::s_customDeleter); + shape->m_allocator = allocator; + CauseServiceErrorRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CauseServiceErrorRequest::s_customDeleter(CauseServiceErrorRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + GetAllProductsOperationContext::GetAllProductsOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetAllProductsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return GetAllProductsResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetAllProductsOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetAllProductsOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#GetAllProductsRequest"); + } + + Aws::Crt::String GetAllProductsOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#GetAllProductsResponse"); + } + + Aws::Crt::Optional GetAllProductsOperationContext::GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetAllProductsOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#GetAllProducts"); + } + + std::future GetAllProductsOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return GetAllProductsResult(GetOperationResult().get()); }); + } + + GetAllProductsOperation::GetAllProductsOperation( + ClientConnection &connection, + const GetAllProductsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetAllProductsOperation::Activate( + const GetAllProductsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetAllProductsOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + CauseServiceErrorOperationContext::CauseServiceErrorOperationContext( const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -CauseStreamServiceToErrorOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -CauseStreamServiceToErrorOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::String -CauseStreamServiceToErrorOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String("awstest#EchoStreamingRequest"); -} - -Aws::Crt::String -CauseStreamServiceToErrorOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("awstest#EchoStreamingResponse"); -} - -Aws::Crt::Optional -CauseStreamServiceToErrorOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("awstest#EchoStreamingMessage"); -} - -Aws::Crt::String -CauseStreamServiceToErrorOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#CauseStreamServiceToError"); -} - -std::future -CauseStreamServiceToErrorOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return CauseStreamServiceToErrorResult(GetOperationResult().get()); - }); -} - -CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const CauseStreamServiceToErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future CauseStreamServiceToErrorOperation::Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -CauseStreamServiceToErrorOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void EchoStreamMessagesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool EchoStreamMessagesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -EchoStreamMessagesOperationContext::EchoStreamMessagesOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -EchoStreamMessagesOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -EchoStreamMessagesOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::String -EchoStreamMessagesOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("awstest#EchoStreamingRequest"); -} - -Aws::Crt::String -EchoStreamMessagesOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("awstest#EchoStreamingResponse"); -} - -Aws::Crt::Optional -EchoStreamMessagesOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("awstest#EchoStreamingMessage"); -} - -Aws::Crt::String -EchoStreamMessagesOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#EchoStreamMessages"); -} - -std::future -EchoStreamMessagesOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return EchoStreamMessagesResult(GetOperationResult().get()); - }); -} - -EchoStreamMessagesOperation::EchoStreamMessagesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const EchoStreamMessagesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future EchoStreamMessagesOperation::Activate( - const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String EchoStreamMessagesOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -EchoMessageOperationContext::EchoMessageOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -EchoMessageOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return EchoMessageResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -EchoMessageOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -EchoMessageOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("awstest#EchoMessageRequest"); -} - -Aws::Crt::String -EchoMessageOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("awstest#EchoMessageResponse"); -} - -Aws::Crt::Optional -EchoMessageOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -EchoMessageOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#EchoMessage"); -} - -std::future EchoMessageOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return EchoMessageResult(GetOperationResult().get()); - }); -} - -EchoMessageOperation::EchoMessageOperation( - ClientConnection &connection, - const EchoMessageOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future EchoMessageOperation::Activate( - const EchoMessageRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String EchoMessageOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetAllCustomersOperationContext::GetAllCustomersOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetAllCustomersOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetAllCustomersResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -GetAllCustomersOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetAllCustomersOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("awstest#GetAllCustomersRequest"); -} - -Aws::Crt::String -GetAllCustomersOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("awstest#GetAllCustomersResponse"); -} - -Aws::Crt::Optional -GetAllCustomersOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetAllCustomersOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("awstest#GetAllCustomers"); -} - -std::future -GetAllCustomersOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetAllCustomersResult(GetOperationResult().get()); - }); -} - -GetAllCustomersOperation::GetAllCustomersOperation( - ClientConnection &connection, - const GetAllCustomersOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetAllCustomersOperation::Activate( - const GetAllCustomersRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetAllCustomersOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -EchoTestRpcServiceModel::EchoTestRpcServiceModel() noexcept - : m_getAllProductsOperationContext(*this), - m_causeServiceErrorOperationContext(*this), - m_causeStreamServiceToErrorOperationContext(*this), - m_echoStreamMessagesOperationContext(*this), - m_echoMessageOperationContext(*this), - m_getAllCustomersOperationContext(*this) {} - -Aws::Crt::ScopedResource -EchoTestRpcServiceModel::AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - auto it = m_modelNameToErrorResponse.find(errorModelName); - if (it == m_modelNameToErrorResponse.end()) { - return nullptr; - } else { - return it->second(stringView, allocator); - } -} - -void EchoTestRpcServiceModel::AssignModelNameToErrorResponse( - Aws::Crt::String modelName, ErrorResponseFactory factory) noexcept { - m_modelNameToErrorResponse[modelName] = factory; -} + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource CauseServiceErrorOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return CauseServiceErrorResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource CauseServiceErrorOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String CauseServiceErrorOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#CauseServiceErrorRequest"); + } + + Aws::Crt::String CauseServiceErrorOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#CauseServiceErrorResponse"); + } + + Aws::Crt::Optional CauseServiceErrorOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String CauseServiceErrorOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#CauseServiceError"); + } + + std::future CauseServiceErrorOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return CauseServiceErrorResult(GetOperationResult().get()); }); + } + + CauseServiceErrorOperation::CauseServiceErrorOperation( + ClientConnection &connection, + const CauseServiceErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future CauseServiceErrorOperation::Activate( + const CauseServiceErrorRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String CauseServiceErrorOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void CauseStreamServiceToErrorStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool CauseStreamServiceToErrorStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && operationError->GetModelName() == Aws::Crt::String("awstest#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + CauseStreamServiceToErrorOperationContext::CauseStreamServiceToErrorOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource CauseStreamServiceToErrorOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoStreamingRequest"); + } + + Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoStreamingResponse"); + } + + Aws::Crt::Optional CauseStreamServiceToErrorOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::String("awstest#EchoStreamingMessage"); + } + + Aws::Crt::String CauseStreamServiceToErrorOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#CauseStreamServiceToError"); + } + + std::future CauseStreamServiceToErrorOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + } + + CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const CauseStreamServiceToErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future CauseStreamServiceToErrorOperation::Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String CauseStreamServiceToErrorOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void EchoStreamMessagesStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool EchoStreamMessagesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + EchoStreamMessagesOperationContext::EchoStreamMessagesOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource EchoStreamMessagesOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource EchoStreamMessagesOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String EchoStreamMessagesOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoStreamingRequest"); + } + + Aws::Crt::String EchoStreamMessagesOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoStreamingResponse"); + } + + Aws::Crt::Optional EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::String("awstest#EchoStreamingMessage"); + } + + Aws::Crt::String EchoStreamMessagesOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#EchoStreamMessages"); + } + + std::future EchoStreamMessagesOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + } + + EchoStreamMessagesOperation::EchoStreamMessagesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const EchoStreamMessagesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future EchoStreamMessagesOperation::Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String EchoStreamMessagesOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + EchoMessageOperationContext::EchoMessageOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource EchoMessageOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return EchoMessageResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource EchoMessageOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String EchoMessageOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoMessageRequest"); + } + + Aws::Crt::String EchoMessageOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#EchoMessageResponse"); + } + + Aws::Crt::Optional EchoMessageOperationContext::GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String EchoMessageOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#EchoMessage"); + } + + std::future EchoMessageOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return EchoMessageResult(GetOperationResult().get()); }); + } + + EchoMessageOperation::EchoMessageOperation( + ClientConnection &connection, + const EchoMessageOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future EchoMessageOperation::Activate( + const EchoMessageRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String EchoMessageOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetAllCustomersOperationContext::GetAllCustomersOperationContext( + const EchoTestRpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetAllCustomersOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return GetAllCustomersResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetAllCustomersOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetAllCustomersOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("awstest#GetAllCustomersRequest"); + } + + Aws::Crt::String GetAllCustomersOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("awstest#GetAllCustomersResponse"); + } + + Aws::Crt::Optional GetAllCustomersOperationContext::GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetAllCustomersOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("awstest#GetAllCustomers"); + } + + std::future GetAllCustomersOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return GetAllCustomersResult(GetOperationResult().get()); }); + } + + GetAllCustomersOperation::GetAllCustomersOperation( + ClientConnection &connection, + const GetAllCustomersOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetAllCustomersOperation::Activate( + const GetAllCustomersRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetAllCustomersOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + EchoTestRpcServiceModel::EchoTestRpcServiceModel() noexcept + : m_getAllProductsOperationContext(*this), m_causeServiceErrorOperationContext(*this), + m_causeStreamServiceToErrorOperationContext(*this), m_echoStreamMessagesOperationContext(*this), + m_echoMessageOperationContext(*this), m_getAllCustomersOperationContext(*this) + { + } + + Aws::Crt::ScopedResource EchoTestRpcServiceModel::AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + auto it = m_modelNameToErrorResponse.find(errorModelName); + if (it == m_modelNameToErrorResponse.end()) + { + return nullptr; + } + else + { + return it->second(stringView, allocator); + } + } + + void EchoTestRpcServiceModel::AssignModelNameToErrorResponse( + Aws::Crt::String modelName, + ErrorResponseFactory factory) noexcept + { + m_modelNameToErrorResponse[modelName] = factory; + } } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index 80a73707b..a4a40e199 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -12,57 +12,58 @@ using namespace Aws::Eventstreamrpc; -namespace Awstest { -class DefaultConnectionConfig : public ConnectionConfig { -public: - DefaultConnectionConfig() noexcept; -}; +namespace Awstest +{ + class DefaultConnectionConfig : public ConnectionConfig + { + public: + DefaultConnectionConfig() noexcept; + }; -class EchoTestRpcClient { -public: - EchoTestRpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle - * events relating to the connection occur. - * @param connectionConfig The configuration parameters used for establishing - * the connection. - * @return An `RpcError` that can be used to check whether the connection was - * established. - */ - std::future Connect(ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig = - DefaultConnectionConfig()) noexcept; - bool IsConnected() const noexcept { return m_connection.IsOpen(); } - void Close() noexcept; - void WithLaunchMode(std::launch mode) noexcept; + class EchoTestRpcClient + { + public: + EchoTestRpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Connect the client to the server + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. + */ + std::future Connect( + ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig = DefaultConnectionConfig()) noexcept; + bool IsConnected() const noexcept { return m_connection.IsOpen(); } + void Close() noexcept; + void WithLaunchMode(std::launch mode) noexcept; - std::shared_ptr NewGetAllProducts() noexcept; + std::shared_ptr NewGetAllProducts() noexcept; - std::shared_ptr NewCauseServiceError() noexcept; + std::shared_ptr NewCauseServiceError() noexcept; - std::shared_ptr - NewCauseStreamServiceToError( - std::shared_ptr - streamHandler) noexcept; + std::shared_ptr NewCauseStreamServiceToError( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewEchoStreamMessages( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewEchoStreamMessages( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewEchoMessage() noexcept; + std::shared_ptr NewEchoMessage() noexcept; - std::shared_ptr NewGetAllCustomers() noexcept; + std::shared_ptr NewGetAllCustomers() noexcept; - ~EchoTestRpcClient() noexcept; + ~EchoTestRpcClient() noexcept; -private: - EchoTestRpcServiceModel m_echoTestRpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - std::launch m_asyncLaunchMode; -}; + private: + EchoTestRpcServiceModel m_echoTestRpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + std::launch m_asyncLaunchMode; + }; } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index c99cb380f..45e15eb27 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -15,1069 +15,997 @@ using namespace Aws::Eventstreamrpc; -namespace Awstest { -class EchoTestRpcClient; -class EchoTestRpcServiceModel; -class Product : public AbstractShapeBase { -public: - Product() noexcept {} - Product(const Product &) = default; - void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } - Aws::Crt::Optional GetName() noexcept { return m_name; } - void SetPrice(const float &price) noexcept { m_price = price; } - Aws::Crt::Optional GetPrice() noexcept { return m_price; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Product &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Product *) noexcept; - /* This needs to be defined so that `Product` can be used as a key in maps. */ - bool operator<(const Product &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_name; - Aws::Crt::Optional m_price; -}; - -class Customer : public AbstractShapeBase { -public: - Customer() noexcept {} - Customer(const Customer &) = default; - void SetId(const int64_t &id) noexcept { m_id = id; } - Aws::Crt::Optional GetId() noexcept { return m_id; } - void SetFirstName(const Aws::Crt::String &firstName) noexcept { - m_firstName = firstName; - } - Aws::Crt::Optional GetFirstName() noexcept { - return m_firstName; - } - void SetLastName(const Aws::Crt::String &lastName) noexcept { - m_lastName = lastName; - } - Aws::Crt::Optional GetLastName() noexcept { - return m_lastName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Customer &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Customer *) noexcept; - /* This needs to be defined so that `Customer` can be used as a key in maps. - */ - bool operator<(const Customer &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_id; - Aws::Crt::Optional m_firstName; - Aws::Crt::Optional m_lastName; -}; - -enum FruitEnum { - FRUIT_ENUM_APPLE, - FRUIT_ENUM_ORANGE, - FRUIT_ENUM_BANANA, - FRUIT_ENUM_PINEAPPLE -}; - -class Pair : public AbstractShapeBase { -public: - Pair() noexcept {} - Pair(const Pair &) = default; - void SetKey(const Aws::Crt::String &key) noexcept { m_key = key; } - Aws::Crt::Optional GetKey() noexcept { return m_key; } - void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Pair &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Pair *) noexcept; - /* This needs to be defined so that `Pair` can be used as a key in maps. */ - bool operator<(const Pair &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_key; - Aws::Crt::Optional m_value; -}; - -class MessageData : public AbstractShapeBase { -public: - MessageData() noexcept {} - MessageData(const MessageData &) = default; - void SetStringMessage(const Aws::Crt::String &stringMessage) noexcept { - m_stringMessage = stringMessage; - } - Aws::Crt::Optional GetStringMessage() noexcept { - return m_stringMessage; - } - void SetBooleanMessage(const bool &booleanMessage) noexcept { - m_booleanMessage = booleanMessage; - } - Aws::Crt::Optional GetBooleanMessage() noexcept { - return m_booleanMessage; - } - void SetTimeMessage(const Aws::Crt::DateTime &timeMessage) noexcept { - m_timeMessage = timeMessage; - } - Aws::Crt::Optional GetTimeMessage() noexcept { - return m_timeMessage; - } - void - SetDocumentMessage(const Aws::Crt::JsonObject &documentMessage) noexcept { - m_documentMessage = documentMessage; - } - Aws::Crt::Optional GetDocumentMessage() noexcept { - return m_documentMessage; - } - void SetEnumMessage(FruitEnum enumMessage) noexcept; - Aws::Crt::Optional GetEnumMessage() noexcept; - void SetBlobMessage(const Aws::Crt::Vector &blobMessage) noexcept { - m_blobMessage = blobMessage; - } - Aws::Crt::Optional> GetBlobMessage() noexcept { - return m_blobMessage; - } - void SetStringListMessage( - const Aws::Crt::Vector &stringListMessage) noexcept { - m_stringListMessage = stringListMessage; - } - Aws::Crt::Optional> - GetStringListMessage() noexcept { - return m_stringListMessage; - } - void - SetKeyValuePairList(const Aws::Crt::Vector &keyValuePairList) noexcept { - m_keyValuePairList = keyValuePairList; - } - Aws::Crt::Optional> GetKeyValuePairList() noexcept { - return m_keyValuePairList; - } - void SetStringToValue( - const Aws::Crt::Map &stringToValue) noexcept { - m_stringToValue = stringToValue; - } - Aws::Crt::Optional> - GetStringToValue() noexcept { - return m_stringToValue; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MessageData &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MessageData *) noexcept; - /* This needs to be defined so that `MessageData` can be used as a key in - * maps. */ - bool operator<(const MessageData &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_stringMessage; - Aws::Crt::Optional m_booleanMessage; - Aws::Crt::Optional m_timeMessage; - Aws::Crt::Optional m_documentMessage; - Aws::Crt::Optional m_enumMessage; - Aws::Crt::Optional> m_blobMessage; - Aws::Crt::Optional> m_stringListMessage; - Aws::Crt::Optional> m_keyValuePairList; - Aws::Crt::Optional> m_stringToValue; -}; - -class EchoStreamingMessage : public AbstractShapeBase { -public: - EchoStreamingMessage() noexcept {} - EchoStreamingMessage &operator=(const EchoStreamingMessage &) noexcept; - EchoStreamingMessage(const EchoStreamingMessage &objectToCopy) { - *this = objectToCopy; - } - void SetStreamMessage(const MessageData &streamMessage) noexcept { - m_streamMessage = streamMessage; - m_chosenMember = TAG_STREAM_MESSAGE; - } - Aws::Crt::Optional GetStreamMessage() noexcept { - if (m_chosenMember == TAG_STREAM_MESSAGE) { - return m_streamMessage; - } else { - return Aws::Crt::Optional(); - } - } - void SetKeyValuePair(const Pair &keyValuePair) noexcept { - m_keyValuePair = keyValuePair; - m_chosenMember = TAG_KEY_VALUE_PAIR; - } - Aws::Crt::Optional GetKeyValuePair() noexcept { - if (m_chosenMember == TAG_KEY_VALUE_PAIR) { - return m_keyValuePair; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingMessage *) noexcept; - /* This needs to be defined so that `EchoStreamingMessage` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_STREAM_MESSAGE, TAG_KEY_VALUE_PAIR } m_chosenMember; - Aws::Crt::Optional m_streamMessage; - Aws::Crt::Optional m_keyValuePair; -}; - -class GetAllProductsResponse : public AbstractShapeBase { -public: - GetAllProductsResponse() noexcept {} - GetAllProductsResponse(const GetAllProductsResponse &) = default; - void SetProducts( - const Aws::Crt::Map &products) noexcept { - m_products = products; - } - Aws::Crt::Optional> - GetProducts() noexcept { - return m_products; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllProductsResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllProductsResponse *) noexcept; - /* This needs to be defined so that `GetAllProductsResponse` can be used as a - * key in maps. */ - bool operator<(const GetAllProductsResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_products; -}; - -class GetAllProductsRequest : public AbstractShapeBase { -public: - GetAllProductsRequest() noexcept {} - GetAllProductsRequest(const GetAllProductsRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllProductsRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllProductsRequest *) noexcept; - /* This needs to be defined so that `GetAllProductsRequest` can be used as a - * key in maps. */ - bool operator<(const GetAllProductsRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class GetAllCustomersResponse : public AbstractShapeBase { -public: - GetAllCustomersResponse() noexcept {} - GetAllCustomersResponse(const GetAllCustomersResponse &) = default; - void SetCustomers(const Aws::Crt::Vector &customers) noexcept { - m_customers = customers; - } - Aws::Crt::Optional> GetCustomers() noexcept { - return m_customers; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllCustomersResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllCustomersResponse *) noexcept; - /* This needs to be defined so that `GetAllCustomersResponse` can be used as a - * key in maps. */ - bool operator<(const GetAllCustomersResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_customers; -}; - -class GetAllCustomersRequest : public AbstractShapeBase { -public: - GetAllCustomersRequest() noexcept {} - GetAllCustomersRequest(const GetAllCustomersRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetAllCustomersRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetAllCustomersRequest *) noexcept; - /* This needs to be defined so that `GetAllCustomersRequest` can be used as a - * key in maps. */ - bool operator<(const GetAllCustomersRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class EchoMessageResponse : public AbstractShapeBase { -public: - EchoMessageResponse() noexcept {} - EchoMessageResponse(const EchoMessageResponse &) = default; - void SetMessage(const MessageData &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoMessageResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoMessageResponse *) noexcept; - /* This needs to be defined so that `EchoMessageResponse` can be used as a key - * in maps. */ - bool operator<(const EchoMessageResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class EchoMessageRequest : public AbstractShapeBase { -public: - EchoMessageRequest() noexcept {} - EchoMessageRequest(const EchoMessageRequest &) = default; - void SetMessage(const MessageData &message) noexcept { m_message = message; } - Aws::Crt::Optional GetMessage() noexcept { return m_message; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoMessageRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoMessageRequest *) noexcept; - /* This needs to be defined so that `EchoMessageRequest` can be used as a key - * in maps. */ - bool operator<(const EchoMessageRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class EchoStreamingResponse : public AbstractShapeBase { -public: - EchoStreamingResponse() noexcept {} - EchoStreamingResponse(const EchoStreamingResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingResponse *) noexcept; - /* This needs to be defined so that `EchoStreamingResponse` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class EchoStreamingRequest : public AbstractShapeBase { -public: - EchoStreamingRequest() noexcept {} - EchoStreamingRequest(const EchoStreamingRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(EchoStreamingRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(EchoStreamingRequest *) noexcept; - /* This needs to be defined so that `EchoStreamingRequest` can be used as a - * key in maps. */ - bool operator<(const EchoStreamingRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class ServiceError : public OperationError { -public: - ServiceError() noexcept {} - ServiceError(const ServiceError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ServiceError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in - * maps. */ - bool operator<(const ServiceError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_value; -}; - -class CauseServiceErrorResponse : public AbstractShapeBase { -public: - CauseServiceErrorResponse() noexcept {} - CauseServiceErrorResponse(const CauseServiceErrorResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CauseServiceErrorResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CauseServiceErrorResponse *) noexcept; - /* This needs to be defined so that `CauseServiceErrorResponse` can be used as - * a key in maps. */ - bool operator<(const CauseServiceErrorResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class CauseServiceErrorRequest : public AbstractShapeBase { -public: - CauseServiceErrorRequest() noexcept {} - CauseServiceErrorRequest(const CauseServiceErrorRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CauseServiceErrorRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CauseServiceErrorRequest *) noexcept; - /* This needs to be defined so that `CauseServiceErrorRequest` can be used as - * a key in maps. */ - bool operator<(const CauseServiceErrorRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class GetAllProductsOperationContext : public OperationModelContext { -public: - GetAllProductsOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetAllProductsResult { -public: - GetAllProductsResult() noexcept {} - GetAllProductsResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetAllProductsResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetAllProductsOperation : public ClientOperation { -public: - GetAllProductsOperation( - ClientConnection &connection, - const GetAllProductsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetAllProductsOperation` - * @param request The request used for the `GetAllProductsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetAllProductsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class CauseServiceErrorOperationContext : public OperationModelContext { -public: - CauseServiceErrorOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class CauseServiceErrorResult { -public: - CauseServiceErrorResult() noexcept {} - CauseServiceErrorResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - CauseServiceErrorResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class CauseServiceErrorOperation : public ClientOperation { -public: - CauseServiceErrorOperation( - ClientConnection &connection, - const CauseServiceErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CauseServiceErrorOperation` - * @param request The request used for the `CauseServiceErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const CauseServiceErrorRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class CauseStreamServiceToErrorStreamHandler : public StreamResponseHandler { -public: - virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class CauseStreamServiceToErrorOperationContext : public OperationModelContext { -public: - CauseStreamServiceToErrorOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class CauseStreamServiceToErrorResult { -public: - CauseStreamServiceToErrorResult() noexcept {} - CauseStreamServiceToErrorResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - EchoStreamingResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class CauseStreamServiceToErrorOperation : public ClientOperation { -public: - CauseStreamServiceToErrorOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const CauseStreamServiceToErrorOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CauseStreamServiceToErrorOperation` - * @param request The request used for the - * `CauseStreamServiceToErrorOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class EchoStreamMessagesStreamHandler : public StreamResponseHandler { -public: - virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class EchoStreamMessagesOperationContext : public OperationModelContext { -public: - EchoStreamMessagesOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class EchoStreamMessagesResult { -public: - EchoStreamMessagesResult() noexcept {} - EchoStreamMessagesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - EchoStreamingResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class EchoStreamMessagesOperation : public ClientOperation { -public: - EchoStreamMessagesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const EchoStreamMessagesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `EchoStreamMessagesOperation` - * @param request The request used for the `EchoStreamMessagesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const EchoStreamingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class EchoMessageOperationContext : public OperationModelContext { -public: - EchoMessageOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class EchoMessageResult { -public: - EchoMessageResult() noexcept {} - EchoMessageResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - EchoMessageResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class EchoMessageOperation : public ClientOperation { -public: - EchoMessageOperation( - ClientConnection &connection, - const EchoMessageOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `EchoMessageOperation` - * @param request The request used for the `EchoMessageOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const EchoMessageRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetAllCustomersOperationContext : public OperationModelContext { -public: - GetAllCustomersOperationContext( - const EchoTestRpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetAllCustomersResult { -public: - GetAllCustomersResult() noexcept {} - GetAllCustomersResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetAllCustomersResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetAllCustomersOperation : public ClientOperation { -public: - GetAllCustomersOperation( - ClientConnection &connection, - const GetAllCustomersOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetAllCustomersOperation` - * @param request The request used for the `GetAllCustomersOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetAllCustomersRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class EchoTestRpcServiceModel : public ServiceModel { -public: - EchoTestRpcServiceModel() noexcept; - Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - void AssignModelNameToErrorResponse(Aws::Crt::String, - ErrorResponseFactory) noexcept; - -private: - friend class EchoTestRpcClient; - GetAllProductsOperationContext m_getAllProductsOperationContext; - CauseServiceErrorOperationContext m_causeServiceErrorOperationContext; - CauseStreamServiceToErrorOperationContext - m_causeStreamServiceToErrorOperationContext; - EchoStreamMessagesOperationContext m_echoStreamMessagesOperationContext; - EchoMessageOperationContext m_echoMessageOperationContext; - GetAllCustomersOperationContext m_getAllCustomersOperationContext; - Aws::Crt::Map - m_modelNameToErrorResponse; -}; +namespace Awstest +{ + class EchoTestRpcClient; + class EchoTestRpcServiceModel; + class Product : public AbstractShapeBase + { + public: + Product() noexcept {} + Product(const Product &) = default; + void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } + Aws::Crt::Optional GetName() noexcept { return m_name; } + void SetPrice(const float &price) noexcept { m_price = price; } + Aws::Crt::Optional GetPrice() noexcept { return m_price; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Product &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Product *) noexcept; + /* This needs to be defined so that `Product` can be used as a key in maps. */ + bool operator<(const Product &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_name; + Aws::Crt::Optional m_price; + }; + + class Customer : public AbstractShapeBase + { + public: + Customer() noexcept {} + Customer(const Customer &) = default; + void SetId(const int64_t &id) noexcept { m_id = id; } + Aws::Crt::Optional GetId() noexcept { return m_id; } + void SetFirstName(const Aws::Crt::String &firstName) noexcept { m_firstName = firstName; } + Aws::Crt::Optional GetFirstName() noexcept { return m_firstName; } + void SetLastName(const Aws::Crt::String &lastName) noexcept { m_lastName = lastName; } + Aws::Crt::Optional GetLastName() noexcept { return m_lastName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Customer &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Customer *) noexcept; + /* This needs to be defined so that `Customer` can be used as a key in maps. + */ + bool operator<(const Customer &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_id; + Aws::Crt::Optional m_firstName; + Aws::Crt::Optional m_lastName; + }; + + enum FruitEnum + { + FRUIT_ENUM_APPLE, + FRUIT_ENUM_ORANGE, + FRUIT_ENUM_BANANA, + FRUIT_ENUM_PINEAPPLE + }; + + class Pair : public AbstractShapeBase + { + public: + Pair() noexcept {} + Pair(const Pair &) = default; + void SetKey(const Aws::Crt::String &key) noexcept { m_key = key; } + Aws::Crt::Optional GetKey() noexcept { return m_key; } + void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Pair &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Pair *) noexcept; + /* This needs to be defined so that `Pair` can be used as a key in maps. */ + bool operator<(const Pair &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_key; + Aws::Crt::Optional m_value; + }; + + class MessageData : public AbstractShapeBase + { + public: + MessageData() noexcept {} + MessageData(const MessageData &) = default; + void SetStringMessage(const Aws::Crt::String &stringMessage) noexcept { m_stringMessage = stringMessage; } + Aws::Crt::Optional GetStringMessage() noexcept { return m_stringMessage; } + void SetBooleanMessage(const bool &booleanMessage) noexcept { m_booleanMessage = booleanMessage; } + Aws::Crt::Optional GetBooleanMessage() noexcept { return m_booleanMessage; } + void SetTimeMessage(const Aws::Crt::DateTime &timeMessage) noexcept { m_timeMessage = timeMessage; } + Aws::Crt::Optional GetTimeMessage() noexcept { return m_timeMessage; } + void SetDocumentMessage(const Aws::Crt::JsonObject &documentMessage) noexcept + { + m_documentMessage = documentMessage; + } + Aws::Crt::Optional GetDocumentMessage() noexcept { return m_documentMessage; } + void SetEnumMessage(FruitEnum enumMessage) noexcept; + Aws::Crt::Optional GetEnumMessage() noexcept; + void SetBlobMessage(const Aws::Crt::Vector &blobMessage) noexcept { m_blobMessage = blobMessage; } + Aws::Crt::Optional> GetBlobMessage() noexcept { return m_blobMessage; } + void SetStringListMessage(const Aws::Crt::Vector &stringListMessage) noexcept + { + m_stringListMessage = stringListMessage; + } + Aws::Crt::Optional> GetStringListMessage() noexcept + { + return m_stringListMessage; + } + void SetKeyValuePairList(const Aws::Crt::Vector &keyValuePairList) noexcept + { + m_keyValuePairList = keyValuePairList; + } + Aws::Crt::Optional> GetKeyValuePairList() noexcept { return m_keyValuePairList; } + void SetStringToValue(const Aws::Crt::Map &stringToValue) noexcept + { + m_stringToValue = stringToValue; + } + Aws::Crt::Optional> GetStringToValue() noexcept + { + return m_stringToValue; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MessageData &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MessageData *) noexcept; + /* This needs to be defined so that `MessageData` can be used as a key in + * maps. */ + bool operator<(const MessageData &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_stringMessage; + Aws::Crt::Optional m_booleanMessage; + Aws::Crt::Optional m_timeMessage; + Aws::Crt::Optional m_documentMessage; + Aws::Crt::Optional m_enumMessage; + Aws::Crt::Optional> m_blobMessage; + Aws::Crt::Optional> m_stringListMessage; + Aws::Crt::Optional> m_keyValuePairList; + Aws::Crt::Optional> m_stringToValue; + }; + + class EchoStreamingMessage : public AbstractShapeBase + { + public: + EchoStreamingMessage() noexcept {} + EchoStreamingMessage &operator=(const EchoStreamingMessage &) noexcept; + EchoStreamingMessage(const EchoStreamingMessage &objectToCopy) { *this = objectToCopy; } + void SetStreamMessage(const MessageData &streamMessage) noexcept + { + m_streamMessage = streamMessage; + m_chosenMember = TAG_STREAM_MESSAGE; + } + Aws::Crt::Optional GetStreamMessage() noexcept + { + if (m_chosenMember == TAG_STREAM_MESSAGE) + { + return m_streamMessage; + } + else + { + return Aws::Crt::Optional(); + } + } + void SetKeyValuePair(const Pair &keyValuePair) noexcept + { + m_keyValuePair = keyValuePair; + m_chosenMember = TAG_KEY_VALUE_PAIR; + } + Aws::Crt::Optional GetKeyValuePair() noexcept + { + if (m_chosenMember == TAG_KEY_VALUE_PAIR) + { + return m_keyValuePair; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingMessage *) noexcept; + /* This needs to be defined so that `EchoStreamingMessage` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_STREAM_MESSAGE, + TAG_KEY_VALUE_PAIR + } m_chosenMember; + Aws::Crt::Optional m_streamMessage; + Aws::Crt::Optional m_keyValuePair; + }; + + class GetAllProductsResponse : public AbstractShapeBase + { + public: + GetAllProductsResponse() noexcept {} + GetAllProductsResponse(const GetAllProductsResponse &) = default; + void SetProducts(const Aws::Crt::Map &products) noexcept { m_products = products; } + Aws::Crt::Optional> GetProducts() noexcept { return m_products; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllProductsResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllProductsResponse *) noexcept; + /* This needs to be defined so that `GetAllProductsResponse` can be used as a + * key in maps. */ + bool operator<(const GetAllProductsResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_products; + }; + + class GetAllProductsRequest : public AbstractShapeBase + { + public: + GetAllProductsRequest() noexcept {} + GetAllProductsRequest(const GetAllProductsRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllProductsRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllProductsRequest *) noexcept; + /* This needs to be defined so that `GetAllProductsRequest` can be used as a + * key in maps. */ + bool operator<(const GetAllProductsRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class GetAllCustomersResponse : public AbstractShapeBase + { + public: + GetAllCustomersResponse() noexcept {} + GetAllCustomersResponse(const GetAllCustomersResponse &) = default; + void SetCustomers(const Aws::Crt::Vector &customers) noexcept { m_customers = customers; } + Aws::Crt::Optional> GetCustomers() noexcept { return m_customers; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllCustomersResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllCustomersResponse *) noexcept; + /* This needs to be defined so that `GetAllCustomersResponse` can be used as a + * key in maps. */ + bool operator<(const GetAllCustomersResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_customers; + }; + + class GetAllCustomersRequest : public AbstractShapeBase + { + public: + GetAllCustomersRequest() noexcept {} + GetAllCustomersRequest(const GetAllCustomersRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetAllCustomersRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetAllCustomersRequest *) noexcept; + /* This needs to be defined so that `GetAllCustomersRequest` can be used as a + * key in maps. */ + bool operator<(const GetAllCustomersRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class EchoMessageResponse : public AbstractShapeBase + { + public: + EchoMessageResponse() noexcept {} + EchoMessageResponse(const EchoMessageResponse &) = default; + void SetMessage(const MessageData &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoMessageResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoMessageResponse *) noexcept; + /* This needs to be defined so that `EchoMessageResponse` can be used as a key + * in maps. */ + bool operator<(const EchoMessageResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class EchoMessageRequest : public AbstractShapeBase + { + public: + EchoMessageRequest() noexcept {} + EchoMessageRequest(const EchoMessageRequest &) = default; + void SetMessage(const MessageData &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoMessageRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoMessageRequest *) noexcept; + /* This needs to be defined so that `EchoMessageRequest` can be used as a key + * in maps. */ + bool operator<(const EchoMessageRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class EchoStreamingResponse : public AbstractShapeBase + { + public: + EchoStreamingResponse() noexcept {} + EchoStreamingResponse(const EchoStreamingResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingResponse *) noexcept; + /* This needs to be defined so that `EchoStreamingResponse` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class EchoStreamingRequest : public AbstractShapeBase + { + public: + EchoStreamingRequest() noexcept {} + EchoStreamingRequest(const EchoStreamingRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(EchoStreamingRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(EchoStreamingRequest *) noexcept; + /* This needs to be defined so that `EchoStreamingRequest` can be used as a + * key in maps. */ + bool operator<(const EchoStreamingRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class ServiceError : public OperationError + { + public: + ServiceError() noexcept {} + ServiceError(const ServiceError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SetValue(const Aws::Crt::String &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ServiceError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ServiceError *) noexcept; + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ + bool operator<(const ServiceError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_value; + }; + + class CauseServiceErrorResponse : public AbstractShapeBase + { + public: + CauseServiceErrorResponse() noexcept {} + CauseServiceErrorResponse(const CauseServiceErrorResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CauseServiceErrorResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CauseServiceErrorResponse *) noexcept; + /* This needs to be defined so that `CauseServiceErrorResponse` can be used as + * a key in maps. */ + bool operator<(const CauseServiceErrorResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class CauseServiceErrorRequest : public AbstractShapeBase + { + public: + CauseServiceErrorRequest() noexcept {} + CauseServiceErrorRequest(const CauseServiceErrorRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CauseServiceErrorRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CauseServiceErrorRequest *) noexcept; + /* This needs to be defined so that `CauseServiceErrorRequest` can be used as + * a key in maps. */ + bool operator<(const CauseServiceErrorRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class GetAllProductsOperationContext : public OperationModelContext + { + public: + GetAllProductsOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetAllProductsResult + { + public: + GetAllProductsResult() noexcept {} + GetAllProductsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetAllProductsResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetAllProductsOperation : public ClientOperation + { + public: + GetAllProductsOperation( + ClientConnection &connection, + const GetAllProductsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetAllProductsOperation` + * @param request The request used for the `GetAllProductsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetAllProductsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class CauseServiceErrorOperationContext : public OperationModelContext + { + public: + CauseServiceErrorOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class CauseServiceErrorResult + { + public: + CauseServiceErrorResult() noexcept {} + CauseServiceErrorResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + CauseServiceErrorResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class CauseServiceErrorOperation : public ClientOperation + { + public: + CauseServiceErrorOperation( + ClientConnection &connection, + const CauseServiceErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CauseServiceErrorOperation` + * @param request The request used for the `CauseServiceErrorOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const CauseServiceErrorRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class CauseStreamServiceToErrorStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class CauseStreamServiceToErrorOperationContext : public OperationModelContext + { + public: + CauseStreamServiceToErrorOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class CauseStreamServiceToErrorResult + { + public: + CauseStreamServiceToErrorResult() noexcept {} + CauseStreamServiceToErrorResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) + { + } + EchoStreamingResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class CauseStreamServiceToErrorOperation : public ClientOperation + { + public: + CauseStreamServiceToErrorOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const CauseStreamServiceToErrorOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CauseStreamServiceToErrorOperation` + * @param request The request used for the + * `CauseStreamServiceToErrorOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class EchoStreamMessagesStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class EchoStreamMessagesOperationContext : public OperationModelContext + { + public: + EchoStreamMessagesOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class EchoStreamMessagesResult + { + public: + EchoStreamMessagesResult() noexcept {} + EchoStreamMessagesResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + EchoStreamingResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class EchoStreamMessagesOperation : public ClientOperation + { + public: + EchoStreamMessagesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const EchoStreamMessagesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `EchoStreamMessagesOperation` + * @param request The request used for the `EchoStreamMessagesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const EchoStreamingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class EchoMessageOperationContext : public OperationModelContext + { + public: + EchoMessageOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class EchoMessageResult + { + public: + EchoMessageResult() noexcept {} + EchoMessageResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + EchoMessageResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class EchoMessageOperation : public ClientOperation + { + public: + EchoMessageOperation( + ClientConnection &connection, + const EchoMessageOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `EchoMessageOperation` + * @param request The request used for the `EchoMessageOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const EchoMessageRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetAllCustomersOperationContext : public OperationModelContext + { + public: + GetAllCustomersOperationContext(const EchoTestRpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetAllCustomersResult + { + public: + GetAllCustomersResult() noexcept {} + GetAllCustomersResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetAllCustomersResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetAllCustomersOperation : public ClientOperation + { + public: + GetAllCustomersOperation( + ClientConnection &connection, + const GetAllCustomersOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetAllCustomersOperation` + * @param request The request used for the `GetAllCustomersOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetAllCustomersRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class EchoTestRpcServiceModel : public ServiceModel + { + public: + EchoTestRpcServiceModel() noexcept; + Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + void AssignModelNameToErrorResponse(Aws::Crt::String, ErrorResponseFactory) noexcept; + + private: + friend class EchoTestRpcClient; + GetAllProductsOperationContext m_getAllProductsOperationContext; + CauseServiceErrorOperationContext m_causeServiceErrorOperationContext; + CauseStreamServiceToErrorOperationContext m_causeStreamServiceToErrorOperationContext; + EchoStreamMessagesOperationContext m_echoStreamMessagesOperationContext; + EchoMessageOperationContext m_echoMessageOperationContext; + GetAllCustomersOperationContext m_getAllCustomersOperationContext; + Aws::Crt::Map m_modelNameToErrorResponse; + }; } // namespace Awstest diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h index 7fea02759..d0c12faaf 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -12,136 +12,120 @@ using namespace Aws::Eventstreamrpc; -namespace Aws { -namespace Greengrass { -class DefaultConnectionConfig : public ConnectionConfig { -public: - DefaultConnectionConfig() noexcept; -}; +namespace Aws +{ + namespace Greengrass + { + class DefaultConnectionConfig : public ConnectionConfig + { + public: + DefaultConnectionConfig() noexcept; + }; -class GreengrassCoreIpcClient { -public: - GreengrassCoreIpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Connect the client to the server - * @param lifecycleHandler An interface that is called upon when lifecycle - * events relating to the connection occur. - * @param connectionConfig The configuration parameters used for establishing - * the connection. - * @return An `RpcError` that can be used to check whether the connection was - * established. - */ - std::future Connect(ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig = - DefaultConnectionConfig()) noexcept; - bool IsConnected() const noexcept { return m_connection.IsOpen(); } - void Close() noexcept; - void WithLaunchMode(std::launch mode) noexcept; + class GreengrassCoreIpcClient + { + public: + GreengrassCoreIpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Connect the client to the server + * @param lifecycleHandler An interface that is called upon when lifecycle + * events relating to the connection occur. + * @param connectionConfig The configuration parameters used for establishing + * the connection. + * @return An `RpcError` that can be used to check whether the connection was + * established. + */ + std::future Connect( + ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig = DefaultConnectionConfig()) noexcept; + bool IsConnected() const noexcept { return m_connection.IsOpen(); } + void Close() noexcept; + void WithLaunchMode(std::launch mode) noexcept; - std::shared_ptr NewSubscribeToIoTCore( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewSubscribeToIoTCore( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewResumeComponent() noexcept; + std::shared_ptr NewResumeComponent() noexcept; - std::shared_ptr NewPublishToIoTCore() noexcept; + std::shared_ptr NewPublishToIoTCore() noexcept; - std::shared_ptr - NewSubscribeToConfigurationUpdate( - std::shared_ptr - streamHandler) noexcept; + std::shared_ptr NewSubscribeToConfigurationUpdate( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewDeleteThingShadow() noexcept; + std::shared_ptr NewDeleteThingShadow() noexcept; - std::shared_ptr NewPutComponentMetric() noexcept; + std::shared_ptr NewPutComponentMetric() noexcept; - std::shared_ptr - NewDeferComponentUpdate() noexcept; + std::shared_ptr NewDeferComponentUpdate() noexcept; - std::shared_ptr - NewSubscribeToValidateConfigurationUpdates( - std::shared_ptr - streamHandler) noexcept; + std::shared_ptr + NewSubscribeToValidateConfigurationUpdates( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr NewGetConfiguration() noexcept; + std::shared_ptr NewGetConfiguration() noexcept; - std::shared_ptr NewSubscribeToTopic( - std::shared_ptr streamHandler) noexcept; + std::shared_ptr NewSubscribeToTopic( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr - NewGetComponentDetails() noexcept; + std::shared_ptr NewGetComponentDetails() noexcept; - std::shared_ptr - NewGetClientDeviceAuthToken() noexcept; + std::shared_ptr NewGetClientDeviceAuthToken() noexcept; - std::shared_ptr NewPublishToTopic() noexcept; + std::shared_ptr NewPublishToTopic() noexcept; - std::shared_ptr - NewSubscribeToCertificateUpdates( - std::shared_ptr - streamHandler) noexcept; + std::shared_ptr NewSubscribeToCertificateUpdates( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr - NewVerifyClientDeviceIdentity() noexcept; + std::shared_ptr NewVerifyClientDeviceIdentity() noexcept; - std::shared_ptr - NewAuthorizeClientDeviceAction() noexcept; + std::shared_ptr NewAuthorizeClientDeviceAction() noexcept; - std::shared_ptr NewListComponents() noexcept; + std::shared_ptr NewListComponents() noexcept; - std::shared_ptr - NewCreateDebugPassword() noexcept; + std::shared_ptr NewCreateDebugPassword() noexcept; - std::shared_ptr NewGetThingShadow() noexcept; + std::shared_ptr NewGetThingShadow() noexcept; - std::shared_ptr - NewSendConfigurationValidityReport() noexcept; + std::shared_ptr NewSendConfigurationValidityReport() noexcept; - std::shared_ptr NewUpdateThingShadow() noexcept; + std::shared_ptr NewUpdateThingShadow() noexcept; - std::shared_ptr - NewUpdateConfiguration() noexcept; + std::shared_ptr NewUpdateConfiguration() noexcept; - std::shared_ptr - NewValidateAuthorizationToken() noexcept; + std::shared_ptr NewValidateAuthorizationToken() noexcept; - std::shared_ptr NewRestartComponent() noexcept; + std::shared_ptr NewRestartComponent() noexcept; - std::shared_ptr - NewGetLocalDeploymentStatus() noexcept; + std::shared_ptr NewGetLocalDeploymentStatus() noexcept; - std::shared_ptr NewGetSecretValue() noexcept; + std::shared_ptr NewGetSecretValue() noexcept; - std::shared_ptr NewUpdateState() noexcept; + std::shared_ptr NewUpdateState() noexcept; - std::shared_ptr - NewListNamedShadowsForThing() noexcept; + std::shared_ptr NewListNamedShadowsForThing() noexcept; - std::shared_ptr - NewSubscribeToComponentUpdates( - std::shared_ptr - streamHandler) noexcept; + std::shared_ptr NewSubscribeToComponentUpdates( + std::shared_ptr streamHandler) noexcept; - std::shared_ptr - NewListLocalDeployments() noexcept; + std::shared_ptr NewListLocalDeployments() noexcept; - std::shared_ptr NewStopComponent() noexcept; + std::shared_ptr NewStopComponent() noexcept; - std::shared_ptr NewPauseComponent() noexcept; + std::shared_ptr NewPauseComponent() noexcept; - std::shared_ptr - NewCreateLocalDeployment() noexcept; + std::shared_ptr NewCreateLocalDeployment() noexcept; - ~GreengrassCoreIpcClient() noexcept; + ~GreengrassCoreIpcClient() noexcept; -private: - GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - std::launch m_asyncLaunchMode; -}; -} // namespace Greengrass + private: + GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + std::launch m_asyncLaunchMode; + }; + } // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index bf53d67de..ea4fb36f2 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -15,6433 +15,5859 @@ using namespace Aws::Eventstreamrpc; -namespace Aws { -namespace Greengrass { -class GreengrassCoreIpcClient; -class GreengrassCoreIpcServiceModel; -enum MetricUnitType { - METRIC_UNIT_TYPE_BYTES, - METRIC_UNIT_TYPE_BYTES_PER_SECOND, - METRIC_UNIT_TYPE_COUNT, - METRIC_UNIT_TYPE_COUNT_PER_SECOND, - METRIC_UNIT_TYPE_MEGABYTES, - METRIC_UNIT_TYPE_SECONDS -}; - -class MessageContext : public AbstractShapeBase { -public: - MessageContext() noexcept {} - MessageContext(const MessageContext &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MessageContext &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MessageContext *) noexcept; - /* This needs to be defined so that `MessageContext` can be used as a key in - * maps. */ - bool operator<(const MessageContext &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topic; -}; - -class SystemResourceLimits : public AbstractShapeBase { -public: - SystemResourceLimits() noexcept {} - SystemResourceLimits(const SystemResourceLimits &) = default; - void SetMemory(const int64_t &memory) noexcept { m_memory = memory; } - Aws::Crt::Optional GetMemory() noexcept { return m_memory; } - void SetCpus(const double &cpus) noexcept { m_cpus = cpus; } - Aws::Crt::Optional GetCpus() noexcept { return m_cpus; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SystemResourceLimits &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SystemResourceLimits *) noexcept; - /* This needs to be defined so that `SystemResourceLimits` can be used as a - * key in maps. */ - bool operator<(const SystemResourceLimits &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_memory; - Aws::Crt::Optional m_cpus; -}; - -class ValidateConfigurationUpdateEvent : public AbstractShapeBase { -public: - ValidateConfigurationUpdateEvent() noexcept {} - ValidateConfigurationUpdateEvent(const ValidateConfigurationUpdateEvent &) = - default; - void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept { - m_configuration = configuration; - } - Aws::Crt::Optional GetConfiguration() noexcept { - return m_configuration; - } - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateConfigurationUpdateEvent &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be - * used as a key in maps. */ - bool operator<(const ValidateConfigurationUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_configuration; - Aws::Crt::Optional m_deploymentId; -}; - -class MQTTMessage : public AbstractShapeBase { -public: - MQTTMessage() noexcept {} - MQTTMessage(const MQTTMessage &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { - m_topicName = topicName; - } - Aws::Crt::Optional GetTopicName() noexcept { - return m_topicName; - } - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MQTTMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MQTTMessage *) noexcept; - /* This needs to be defined so that `MQTTMessage` can be used as a key in - * maps. */ - bool operator<(const MQTTMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional> m_payload; -}; - -class ConfigurationUpdateEvent : public AbstractShapeBase { -public: - ConfigurationUpdateEvent() noexcept {} - ConfigurationUpdateEvent(const ConfigurationUpdateEvent &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { - m_keyPath = keyPath; - } - Aws::Crt::Optional> GetKeyPath() noexcept { - return m_keyPath; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationUpdateEvent &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationUpdateEvent *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as - * a key in maps. */ - bool operator<(const ConfigurationUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; -}; - -class PostComponentUpdateEvent : public AbstractShapeBase { -public: - PostComponentUpdateEvent() noexcept {} - PostComponentUpdateEvent(const PostComponentUpdateEvent &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PostComponentUpdateEvent &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PostComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PostComponentUpdateEvent` can be used as - * a key in maps. */ - bool operator<(const PostComponentUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; -}; - -class PreComponentUpdateEvent : public AbstractShapeBase { -public: - PreComponentUpdateEvent() noexcept {} - PreComponentUpdateEvent(const PreComponentUpdateEvent &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SetIsGgcRestarting(const bool &isGgcRestarting) noexcept { - m_isGgcRestarting = isGgcRestarting; - } - Aws::Crt::Optional GetIsGgcRestarting() noexcept { - return m_isGgcRestarting; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PreComponentUpdateEvent &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PreComponentUpdateEvent *) noexcept; - /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a - * key in maps. */ - bool operator<(const PreComponentUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_isGgcRestarting; -}; - -class CertificateUpdate : public AbstractShapeBase { -public: - CertificateUpdate() noexcept {} - CertificateUpdate(const CertificateUpdate &) = default; - void SetPrivateKey(const Aws::Crt::String &privateKey) noexcept { - m_privateKey = privateKey; - } - Aws::Crt::Optional GetPrivateKey() noexcept { - return m_privateKey; - } - void SetPublicKey(const Aws::Crt::String &publicKey) noexcept { - m_publicKey = publicKey; - } - Aws::Crt::Optional GetPublicKey() noexcept { - return m_publicKey; - } - void SetCertificate(const Aws::Crt::String &certificate) noexcept { - m_certificate = certificate; - } - Aws::Crt::Optional GetCertificate() noexcept { - return m_certificate; - } - void SetCaCertificates( - const Aws::Crt::Vector &caCertificates) noexcept { - m_caCertificates = caCertificates; - } - Aws::Crt::Optional> - GetCaCertificates() noexcept { - return m_caCertificates; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateUpdate &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateUpdate *) noexcept; - /* This needs to be defined so that `CertificateUpdate` can be used as a key - * in maps. */ - bool operator<(const CertificateUpdate &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_privateKey; - Aws::Crt::Optional m_publicKey; - Aws::Crt::Optional m_certificate; - Aws::Crt::Optional> m_caCertificates; -}; - -enum CertificateType { CERTIFICATE_TYPE_SERVER }; - -enum ConfigurationValidityStatus { - CONFIGURATION_VALIDITY_STATUS_ACCEPTED, - CONFIGURATION_VALIDITY_STATUS_REJECTED -}; - -class Metric : public AbstractShapeBase { -public: - Metric() noexcept {} - Metric(const Metric &) = default; - void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } - Aws::Crt::Optional GetName() noexcept { return m_name; } - void SetUnit(MetricUnitType unit) noexcept; - Aws::Crt::Optional GetUnit() noexcept; - void SetValue(const double &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { return m_value; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(Metric &, const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(Metric *) noexcept; - /* This needs to be defined so that `Metric` can be used as a key in maps. */ - bool operator<(const Metric &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_name; - Aws::Crt::Optional m_unit; - Aws::Crt::Optional m_value; -}; - -class BinaryMessage : public AbstractShapeBase { -public: - BinaryMessage() noexcept {} - BinaryMessage(const BinaryMessage &) = default; - void SetMessage(const Aws::Crt::Vector &message) noexcept { - m_message = message; - } - Aws::Crt::Optional> GetMessage() noexcept { - return m_message; - } - /* The context is ignored if used in PublishMessage. */ - void SetContext(const MessageContext &context) noexcept { - m_context = context; - } - /* The context is ignored if used in PublishMessage. */ - Aws::Crt::Optional GetContext() noexcept { return m_context; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(BinaryMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(BinaryMessage *) noexcept; - /* This needs to be defined so that `BinaryMessage` can be used as a key in - * maps. */ - bool operator<(const BinaryMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_message; - Aws::Crt::Optional m_context; -}; - -class JsonMessage : public AbstractShapeBase { -public: - JsonMessage() noexcept {} - JsonMessage(const JsonMessage &) = default; - void SetMessage(const Aws::Crt::JsonObject &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept { - return m_message; - } - /* The context is ignored if used in PublishMessage. */ - void SetContext(const MessageContext &context) noexcept { - m_context = context; - } - /* The context is ignored if used in PublishMessage. */ - Aws::Crt::Optional GetContext() noexcept { return m_context; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(JsonMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(JsonMessage *) noexcept; - /* This needs to be defined so that `JsonMessage` can be used as a key in - * maps. */ - bool operator<(const JsonMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_context; -}; - -enum DeploymentStatus { - DEPLOYMENT_STATUS_QUEUED, - DEPLOYMENT_STATUS_IN_PROGRESS, - DEPLOYMENT_STATUS_SUCCEEDED, - DEPLOYMENT_STATUS_FAILED -}; - -enum LifecycleState { - LIFECYCLE_STATE_RUNNING, - LIFECYCLE_STATE_ERRORED, - LIFECYCLE_STATE_NEW, - LIFECYCLE_STATE_FINISHED, - LIFECYCLE_STATE_INSTALLED, - LIFECYCLE_STATE_BROKEN, - LIFECYCLE_STATE_STARTING, - LIFECYCLE_STATE_STOPPING -}; - -class MQTTCredential : public AbstractShapeBase { -public: - MQTTCredential() noexcept {} - MQTTCredential(const MQTTCredential &) = default; - void SetClientId(const Aws::Crt::String &clientId) noexcept { - m_clientId = clientId; - } - Aws::Crt::Optional GetClientId() noexcept { - return m_clientId; - } - void SetCertificatePem(const Aws::Crt::String &certificatePem) noexcept { - m_certificatePem = certificatePem; - } - Aws::Crt::Optional GetCertificatePem() noexcept { - return m_certificatePem; - } - void SetUsername(const Aws::Crt::String &username) noexcept { - m_username = username; - } - Aws::Crt::Optional GetUsername() noexcept { - return m_username; - } - void SetPassword(const Aws::Crt::String &password) noexcept { - m_password = password; - } - Aws::Crt::Optional GetPassword() noexcept { - return m_password; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(MQTTCredential &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(MQTTCredential *) noexcept; - /* This needs to be defined so that `MQTTCredential` can be used as a key in - * maps. */ - bool operator<(const MQTTCredential &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_clientId; - Aws::Crt::Optional m_certificatePem; - Aws::Crt::Optional m_username; - Aws::Crt::Optional m_password; -}; - -class RunWithInfo : public AbstractShapeBase { -public: - RunWithInfo() noexcept {} - RunWithInfo(const RunWithInfo &) = default; - void SetPosixUser(const Aws::Crt::String &posixUser) noexcept { - m_posixUser = posixUser; - } - Aws::Crt::Optional GetPosixUser() noexcept { - return m_posixUser; - } - void SetWindowsUser(const Aws::Crt::String &windowsUser) noexcept { - m_windowsUser = windowsUser; - } - Aws::Crt::Optional GetWindowsUser() noexcept { - return m_windowsUser; - } - void SetSystemResourceLimits( - const SystemResourceLimits &systemResourceLimits) noexcept { - m_systemResourceLimits = systemResourceLimits; - } - Aws::Crt::Optional GetSystemResourceLimits() noexcept { - return m_systemResourceLimits; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RunWithInfo &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RunWithInfo *) noexcept; - /* This needs to be defined so that `RunWithInfo` can be used as a key in - * maps. */ - bool operator<(const RunWithInfo &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_posixUser; - Aws::Crt::Optional m_windowsUser; - Aws::Crt::Optional m_systemResourceLimits; -}; - -class ClientDeviceCredential : public AbstractShapeBase { -public: - ClientDeviceCredential() noexcept {} - ClientDeviceCredential &operator=(const ClientDeviceCredential &) noexcept; - ClientDeviceCredential(const ClientDeviceCredential &objectToCopy) { - *this = objectToCopy; - } - void SetClientDeviceCertificate( - const Aws::Crt::String &clientDeviceCertificate) noexcept { - m_clientDeviceCertificate = clientDeviceCertificate; - m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; - } - Aws::Crt::Optional GetClientDeviceCertificate() noexcept { - if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) { - return m_clientDeviceCertificate; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ClientDeviceCredential &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ClientDeviceCredential *) noexcept; - /* This needs to be defined so that `ClientDeviceCredential` can be used as a - * key in maps. */ - bool operator<(const ClientDeviceCredential &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_CLIENT_DEVICE_CERTIFICATE } m_chosenMember; - Aws::Crt::Optional m_clientDeviceCertificate; -}; - -enum ReportedLifecycleState { - REPORTED_LIFECYCLE_STATE_RUNNING, - REPORTED_LIFECYCLE_STATE_ERRORED -}; - -class ValidateConfigurationUpdateEvents : public AbstractShapeBase { -public: - ValidateConfigurationUpdateEvents() noexcept {} - ValidateConfigurationUpdateEvents & - operator=(const ValidateConfigurationUpdateEvents &) noexcept; - ValidateConfigurationUpdateEvents( - const ValidateConfigurationUpdateEvents &objectToCopy) { - *this = objectToCopy; - } - void SetValidateConfigurationUpdateEvent( - const ValidateConfigurationUpdateEvent - &validateConfigurationUpdateEvent) noexcept { - m_validateConfigurationUpdateEvent = validateConfigurationUpdateEvent; - m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; - } - Aws::Crt::Optional - GetValidateConfigurationUpdateEvent() noexcept { - if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) { - return m_validateConfigurationUpdateEvent; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateConfigurationUpdateEvents &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be - * used as a key in maps. */ - bool operator<(const ValidateConfigurationUpdateEvents &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT } m_chosenMember; - Aws::Crt::Optional - m_validateConfigurationUpdateEvent; -}; - -class SubscriptionResponseMessage : public AbstractShapeBase { -public: - SubscriptionResponseMessage() noexcept {} - SubscriptionResponseMessage & - operator=(const SubscriptionResponseMessage &) noexcept; - SubscriptionResponseMessage(const SubscriptionResponseMessage &objectToCopy) { - *this = objectToCopy; - } - void SetJsonMessage(const JsonMessage &jsonMessage) noexcept { - m_jsonMessage = jsonMessage; - m_chosenMember = TAG_JSON_MESSAGE; - } - Aws::Crt::Optional GetJsonMessage() noexcept { - if (m_chosenMember == TAG_JSON_MESSAGE) { - return m_jsonMessage; - } else { - return Aws::Crt::Optional(); - } - } - void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept { - m_binaryMessage = binaryMessage; - m_chosenMember = TAG_BINARY_MESSAGE; - } - Aws::Crt::Optional GetBinaryMessage() noexcept { - if (m_chosenMember == TAG_BINARY_MESSAGE) { - return m_binaryMessage; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscriptionResponseMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscriptionResponseMessage *) noexcept; - /* This needs to be defined so that `SubscriptionResponseMessage` can be used - * as a key in maps. */ - bool operator<(const SubscriptionResponseMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_JSON_MESSAGE, TAG_BINARY_MESSAGE } m_chosenMember; - Aws::Crt::Optional m_jsonMessage; - Aws::Crt::Optional m_binaryMessage; -}; - -enum ReceiveMode { - RECEIVE_MODE_RECEIVE_ALL_MESSAGES, - RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS -}; - -class IoTCoreMessage : public AbstractShapeBase { -public: - IoTCoreMessage() noexcept {} - IoTCoreMessage &operator=(const IoTCoreMessage &) noexcept; - IoTCoreMessage(const IoTCoreMessage &objectToCopy) { *this = objectToCopy; } - void SetMessage(const MQTTMessage &message) noexcept { - m_message = message; - m_chosenMember = TAG_MESSAGE; - } - Aws::Crt::Optional GetMessage() noexcept { - if (m_chosenMember == TAG_MESSAGE) { - return m_message; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(IoTCoreMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(IoTCoreMessage *) noexcept; - /* This needs to be defined so that `IoTCoreMessage` can be used as a key in - * maps. */ - bool operator<(const IoTCoreMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_MESSAGE } m_chosenMember; - Aws::Crt::Optional m_message; -}; - -class ConfigurationUpdateEvents : public AbstractShapeBase { -public: - ConfigurationUpdateEvents() noexcept {} - ConfigurationUpdateEvents & - operator=(const ConfigurationUpdateEvents &) noexcept; - ConfigurationUpdateEvents(const ConfigurationUpdateEvents &objectToCopy) { - *this = objectToCopy; - } - void SetConfigurationUpdateEvent( - const ConfigurationUpdateEvent &configurationUpdateEvent) noexcept { - m_configurationUpdateEvent = configurationUpdateEvent; - m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; - } - Aws::Crt::Optional - GetConfigurationUpdateEvent() noexcept { - if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) { - return m_configurationUpdateEvent; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationUpdateEvents &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationUpdateEvents *) noexcept; - /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as - * a key in maps. */ - bool operator<(const ConfigurationUpdateEvents &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_CONFIGURATION_UPDATE_EVENT } m_chosenMember; - Aws::Crt::Optional m_configurationUpdateEvent; -}; - -class ComponentUpdatePolicyEvents : public AbstractShapeBase { -public: - ComponentUpdatePolicyEvents() noexcept {} - ComponentUpdatePolicyEvents & - operator=(const ComponentUpdatePolicyEvents &) noexcept; - ComponentUpdatePolicyEvents(const ComponentUpdatePolicyEvents &objectToCopy) { - *this = objectToCopy; - } - void - SetPreUpdateEvent(const PreComponentUpdateEvent &preUpdateEvent) noexcept { - m_preUpdateEvent = preUpdateEvent; - m_chosenMember = TAG_PRE_UPDATE_EVENT; - } - Aws::Crt::Optional GetPreUpdateEvent() noexcept { - if (m_chosenMember == TAG_PRE_UPDATE_EVENT) { - return m_preUpdateEvent; - } else { - return Aws::Crt::Optional(); - } - } - void - SetPostUpdateEvent(const PostComponentUpdateEvent &postUpdateEvent) noexcept { - m_postUpdateEvent = postUpdateEvent; - m_chosenMember = TAG_POST_UPDATE_EVENT; - } - Aws::Crt::Optional GetPostUpdateEvent() noexcept { - if (m_chosenMember == TAG_POST_UPDATE_EVENT) { - return m_postUpdateEvent; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentUpdatePolicyEvents &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; - /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used - * as a key in maps. */ - bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { - TAG_PRE_UPDATE_EVENT, - TAG_POST_UPDATE_EVENT - } m_chosenMember; - Aws::Crt::Optional m_preUpdateEvent; - Aws::Crt::Optional m_postUpdateEvent; -}; - -class CertificateUpdateEvent : public AbstractShapeBase { -public: - CertificateUpdateEvent() noexcept {} - CertificateUpdateEvent &operator=(const CertificateUpdateEvent &) noexcept; - CertificateUpdateEvent(const CertificateUpdateEvent &objectToCopy) { - *this = objectToCopy; - } - void - SetCertificateUpdate(const CertificateUpdate &certificateUpdate) noexcept { - m_certificateUpdate = certificateUpdate; - m_chosenMember = TAG_CERTIFICATE_UPDATE; - } - Aws::Crt::Optional GetCertificateUpdate() noexcept { - if (m_chosenMember == TAG_CERTIFICATE_UPDATE) { - return m_certificateUpdate; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateUpdateEvent &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateUpdateEvent *) noexcept; - /* This needs to be defined so that `CertificateUpdateEvent` can be used as a - * key in maps. */ - bool operator<(const CertificateUpdateEvent &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_CERTIFICATE_UPDATE } m_chosenMember; - Aws::Crt::Optional m_certificateUpdate; -}; - -class CertificateOptions : public AbstractShapeBase { -public: - CertificateOptions() noexcept {} - CertificateOptions(const CertificateOptions &) = default; - void SetCertificateType(CertificateType certificateType) noexcept; - Aws::Crt::Optional GetCertificateType() noexcept; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CertificateOptions &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CertificateOptions *) noexcept; - /* This needs to be defined so that `CertificateOptions` can be used as a key - * in maps. */ - bool operator<(const CertificateOptions &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_certificateType; -}; - -class ConfigurationValidityReport : public AbstractShapeBase { -public: - ConfigurationValidityReport() noexcept {} - ConfigurationValidityReport(const ConfigurationValidityReport &) = default; - void SetStatus(ConfigurationValidityStatus status) noexcept; - Aws::Crt::Optional GetStatus() noexcept; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConfigurationValidityReport &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConfigurationValidityReport *) noexcept; - /* This needs to be defined so that `ConfigurationValidityReport` can be used - * as a key in maps. */ - bool operator<(const ConfigurationValidityReport &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_status; - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_message; -}; - -enum RequestStatus { REQUEST_STATUS_SUCCEEDED, REQUEST_STATUS_FAILED }; - -class PublishMessage : public AbstractShapeBase { -public: - PublishMessage() noexcept {} - PublishMessage &operator=(const PublishMessage &) noexcept; - PublishMessage(const PublishMessage &objectToCopy) { *this = objectToCopy; } - void SetJsonMessage(const JsonMessage &jsonMessage) noexcept { - m_jsonMessage = jsonMessage; - m_chosenMember = TAG_JSON_MESSAGE; - } - Aws::Crt::Optional GetJsonMessage() noexcept { - if (m_chosenMember == TAG_JSON_MESSAGE) { - return m_jsonMessage; - } else { - return Aws::Crt::Optional(); - } - } - void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept { - m_binaryMessage = binaryMessage; - m_chosenMember = TAG_BINARY_MESSAGE; - } - Aws::Crt::Optional GetBinaryMessage() noexcept { - if (m_chosenMember == TAG_BINARY_MESSAGE) { - return m_binaryMessage; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishMessage &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishMessage *) noexcept; - /* This needs to be defined so that `PublishMessage` can be used as a key in - * maps. */ - bool operator<(const PublishMessage &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_JSON_MESSAGE, TAG_BINARY_MESSAGE } m_chosenMember; - Aws::Crt::Optional m_jsonMessage; - Aws::Crt::Optional m_binaryMessage; -}; - -enum QOS { QOS_AT_MOST_ONCE, QOS_AT_LEAST_ONCE }; - -class SecretValue : public AbstractShapeBase { -public: - SecretValue() noexcept {} - SecretValue &operator=(const SecretValue &) noexcept; - SecretValue(const SecretValue &objectToCopy) { *this = objectToCopy; } - void SetSecretString(const Aws::Crt::String &secretString) noexcept { - m_secretString = secretString; - m_chosenMember = TAG_SECRET_STRING; - } - Aws::Crt::Optional GetSecretString() noexcept { - if (m_chosenMember == TAG_SECRET_STRING) { - return m_secretString; - } else { - return Aws::Crt::Optional(); - } - } - void SetSecretBinary(const Aws::Crt::Vector &secretBinary) noexcept { - m_secretBinary = secretBinary; - m_chosenMember = TAG_SECRET_BINARY; - } - Aws::Crt::Optional> GetSecretBinary() noexcept { - if (m_chosenMember == TAG_SECRET_BINARY) { - return m_secretBinary; - } else { - return Aws::Crt::Optional>(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SecretValue &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SecretValue *) noexcept; - /* This needs to be defined so that `SecretValue` can be used as a key in - * maps. */ - bool operator<(const SecretValue &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_SECRET_STRING, TAG_SECRET_BINARY } m_chosenMember; - Aws::Crt::Optional m_secretString; - Aws::Crt::Optional> m_secretBinary; -}; - -class LocalDeployment : public AbstractShapeBase { -public: - LocalDeployment() noexcept {} - LocalDeployment(const LocalDeployment &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SetStatus(DeploymentStatus status) noexcept; - Aws::Crt::Optional GetStatus() noexcept; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(LocalDeployment &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(LocalDeployment *) noexcept; - /* This needs to be defined so that `LocalDeployment` can be used as a key in - * maps. */ - bool operator<(const LocalDeployment &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_status; -}; - -class ComponentDetails : public AbstractShapeBase { -public: - ComponentDetails() noexcept {} - ComponentDetails(const ComponentDetails &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SetVersion(const Aws::Crt::String &version) noexcept { - m_version = version; - } - Aws::Crt::Optional GetVersion() noexcept { - return m_version; - } - void SetState(LifecycleState state) noexcept; - Aws::Crt::Optional GetState() noexcept; - void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept { - m_configuration = configuration; - } - Aws::Crt::Optional GetConfiguration() noexcept { - return m_configuration; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentDetails &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentDetails *) noexcept; - /* This needs to be defined so that `ComponentDetails` can be used as a key in - * maps. */ - bool operator<(const ComponentDetails &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional m_version; - Aws::Crt::Optional m_state; - Aws::Crt::Optional m_configuration; -}; - -class CredentialDocument : public AbstractShapeBase { -public: - CredentialDocument() noexcept {} - CredentialDocument &operator=(const CredentialDocument &) noexcept; - CredentialDocument(const CredentialDocument &objectToCopy) { - *this = objectToCopy; - } - void SetMqttCredential(const MQTTCredential &mqttCredential) noexcept { - m_mqttCredential = mqttCredential; - m_chosenMember = TAG_MQTT_CREDENTIAL; - } - Aws::Crt::Optional GetMqttCredential() noexcept { - if (m_chosenMember == TAG_MQTT_CREDENTIAL) { - return m_mqttCredential; - } else { - return Aws::Crt::Optional(); - } - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CredentialDocument &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CredentialDocument *) noexcept; - /* This needs to be defined so that `CredentialDocument` can be used as a key - * in maps. */ - bool operator<(const CredentialDocument &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - enum ChosenMember { TAG_MQTT_CREDENTIAL } m_chosenMember; - Aws::Crt::Optional m_mqttCredential; -}; - -class VerifyClientDeviceIdentityResponse : public AbstractShapeBase { -public: - VerifyClientDeviceIdentityResponse() noexcept {} - VerifyClientDeviceIdentityResponse( - const VerifyClientDeviceIdentityResponse &) = default; - void SetIsValidClientDevice(const bool &isValidClientDevice) noexcept { - m_isValidClientDevice = isValidClientDevice; - } - Aws::Crt::Optional GetIsValidClientDevice() noexcept { - return m_isValidClientDevice; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(VerifyClientDeviceIdentityResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(VerifyClientDeviceIdentityResponse *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can - * be used as a key in maps. */ - bool operator<(const VerifyClientDeviceIdentityResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_isValidClientDevice; -}; - -class VerifyClientDeviceIdentityRequest : public AbstractShapeBase { -public: - VerifyClientDeviceIdentityRequest() noexcept {} - VerifyClientDeviceIdentityRequest(const VerifyClientDeviceIdentityRequest &) = - default; - void SetCredential(const ClientDeviceCredential &credential) noexcept { - m_credential = credential; - } - Aws::Crt::Optional GetCredential() noexcept { - return m_credential; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(VerifyClientDeviceIdentityRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(VerifyClientDeviceIdentityRequest *) noexcept; - /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be - * used as a key in maps. */ - bool operator<(const VerifyClientDeviceIdentityRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_credential; -}; - -class InvalidTokenError : public OperationError { -public: - InvalidTokenError() noexcept {} - InvalidTokenError(const InvalidTokenError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidTokenError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidTokenError *) noexcept; - /* This needs to be defined so that `InvalidTokenError` can be used as a key - * in maps. */ - bool operator<(const InvalidTokenError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class ValidateAuthorizationTokenResponse : public AbstractShapeBase { -public: - ValidateAuthorizationTokenResponse() noexcept {} - ValidateAuthorizationTokenResponse( - const ValidateAuthorizationTokenResponse &) = default; - void SetIsValid(const bool &isValid) noexcept { m_isValid = isValid; } - Aws::Crt::Optional GetIsValid() noexcept { return m_isValid; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateAuthorizationTokenResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateAuthorizationTokenResponse *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can - * be used as a key in maps. */ - bool operator<(const ValidateAuthorizationTokenResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_isValid; -}; - -class ValidateAuthorizationTokenRequest : public AbstractShapeBase { -public: - ValidateAuthorizationTokenRequest() noexcept {} - ValidateAuthorizationTokenRequest(const ValidateAuthorizationTokenRequest &) = - default; - void SetToken(const Aws::Crt::String &token) noexcept { m_token = token; } - Aws::Crt::Optional GetToken() noexcept { return m_token; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ValidateAuthorizationTokenRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ValidateAuthorizationTokenRequest *) noexcept; - /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be - * used as a key in maps. */ - bool operator<(const ValidateAuthorizationTokenRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_token; -}; - -class UpdateThingShadowResponse : public AbstractShapeBase { -public: - UpdateThingShadowResponse() noexcept {} - UpdateThingShadowResponse(const UpdateThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateThingShadowResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateThingShadowResponse *) noexcept; - /* This needs to be defined so that `UpdateThingShadowResponse` can be used as - * a key in maps. */ - bool operator<(const UpdateThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_payload; -}; - -class UpdateThingShadowRequest : public AbstractShapeBase { -public: - UpdateThingShadowRequest() noexcept {} - UpdateThingShadowRequest(const UpdateThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { - m_thingName = thingName; - } - Aws::Crt::Optional GetThingName() noexcept { - return m_thingName; - } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { - m_shadowName = shadowName; - } - Aws::Crt::Optional GetShadowName() noexcept { - return m_shadowName; - } - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateThingShadowRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateThingShadowRequest *) noexcept; - /* This needs to be defined so that `UpdateThingShadowRequest` can be used as - * a key in maps. */ - bool operator<(const UpdateThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; - Aws::Crt::Optional> m_payload; -}; - -class UpdateStateResponse : public AbstractShapeBase { -public: - UpdateStateResponse() noexcept {} - UpdateStateResponse(const UpdateStateResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateStateResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateStateResponse *) noexcept; - /* This needs to be defined so that `UpdateStateResponse` can be used as a key - * in maps. */ - bool operator<(const UpdateStateResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class UpdateStateRequest : public AbstractShapeBase { -public: - UpdateStateRequest() noexcept {} - UpdateStateRequest(const UpdateStateRequest &) = default; - void SetState(ReportedLifecycleState state) noexcept; - Aws::Crt::Optional GetState() noexcept; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateStateRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateStateRequest *) noexcept; - /* This needs to be defined so that `UpdateStateRequest` can be used as a key - * in maps. */ - bool operator<(const UpdateStateRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_state; -}; - -class FailedUpdateConditionCheckError : public OperationError { -public: - FailedUpdateConditionCheckError() noexcept {} - FailedUpdateConditionCheckError(const FailedUpdateConditionCheckError &) = - default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(FailedUpdateConditionCheckError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(FailedUpdateConditionCheckError *) noexcept; - /* This needs to be defined so that `FailedUpdateConditionCheckError` can be - * used as a key in maps. */ - bool operator<(const FailedUpdateConditionCheckError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class ConflictError : public OperationError { -public: - ConflictError() noexcept {} - ConflictError(const ConflictError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ConflictError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ConflictError *) noexcept; - /* This needs to be defined so that `ConflictError` can be used as a key in - * maps. */ - bool operator<(const ConflictError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class UpdateConfigurationResponse : public AbstractShapeBase { -public: - UpdateConfigurationResponse() noexcept {} - UpdateConfigurationResponse(const UpdateConfigurationResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateConfigurationResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateConfigurationResponse *) noexcept; - /* This needs to be defined so that `UpdateConfigurationResponse` can be used - * as a key in maps. */ - bool operator<(const UpdateConfigurationResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class UpdateConfigurationRequest : public AbstractShapeBase { -public: - UpdateConfigurationRequest() noexcept {} - UpdateConfigurationRequest(const UpdateConfigurationRequest &) = default; - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { - m_keyPath = keyPath; - } - Aws::Crt::Optional> GetKeyPath() noexcept { - return m_keyPath; - } - void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { - m_timestamp = timestamp; - } - Aws::Crt::Optional GetTimestamp() noexcept { - return m_timestamp; - } - void SetValueToMerge(const Aws::Crt::JsonObject &valueToMerge) noexcept { - m_valueToMerge = valueToMerge; - } - Aws::Crt::Optional GetValueToMerge() noexcept { - return m_valueToMerge; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UpdateConfigurationRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UpdateConfigurationRequest *) noexcept; - /* This needs to be defined so that `UpdateConfigurationRequest` can be used - * as a key in maps. */ - bool operator<(const UpdateConfigurationRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_keyPath; - Aws::Crt::Optional m_timestamp; - Aws::Crt::Optional m_valueToMerge; -}; - -class SubscribeToValidateConfigurationUpdatesResponse - : public AbstractShapeBase { -public: - SubscribeToValidateConfigurationUpdatesResponse() noexcept {} - SubscribeToValidateConfigurationUpdatesResponse( - const SubscribeToValidateConfigurationUpdatesResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void - s_loadFromJsonView(SubscribeToValidateConfigurationUpdatesResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void - s_customDeleter(SubscribeToValidateConfigurationUpdatesResponse *) noexcept; - /* This needs to be defined so that - * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in - * maps. */ - bool operator<( - const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToValidateConfigurationUpdatesRequest - : public AbstractShapeBase { -public: - SubscribeToValidateConfigurationUpdatesRequest() noexcept {} - SubscribeToValidateConfigurationUpdatesRequest( - const SubscribeToValidateConfigurationUpdatesRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void - s_loadFromJsonView(SubscribeToValidateConfigurationUpdatesRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void - s_customDeleter(SubscribeToValidateConfigurationUpdatesRequest *) noexcept; - /* This needs to be defined so that - * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in - * maps. */ - bool operator<( - const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToTopicResponse : public AbstractShapeBase { -public: - SubscribeToTopicResponse() noexcept {} - SubscribeToTopicResponse(const SubscribeToTopicResponse &) = default; - /* Deprecated No longer used */ - void SetTopicName(const Aws::Crt::String &topicName) noexcept { - m_topicName = topicName; - } - /* Deprecated No longer used */ - Aws::Crt::Optional GetTopicName() noexcept { - return m_topicName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToTopicResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToTopicResponse *) noexcept; - /* This needs to be defined so that `SubscribeToTopicResponse` can be used as - * a key in maps. */ - bool operator<(const SubscribeToTopicResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topicName; -}; - -class SubscribeToTopicRequest : public AbstractShapeBase { -public: - SubscribeToTopicRequest() noexcept {} - SubscribeToTopicRequest(const SubscribeToTopicRequest &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SetReceiveMode(ReceiveMode receiveMode) noexcept; - Aws::Crt::Optional GetReceiveMode() noexcept; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToTopicRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToTopicRequest *) noexcept; - /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a - * key in maps. */ - bool operator<(const SubscribeToTopicRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topic; - Aws::Crt::Optional m_receiveMode; -}; - -class SubscribeToIoTCoreResponse : public AbstractShapeBase { -public: - SubscribeToIoTCoreResponse() noexcept {} - SubscribeToIoTCoreResponse(const SubscribeToIoTCoreResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToIoTCoreResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used - * as a key in maps. */ - bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToIoTCoreRequest : public AbstractShapeBase { -public: - SubscribeToIoTCoreRequest() noexcept {} - SubscribeToIoTCoreRequest(const SubscribeToIoTCoreRequest &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { - m_topicName = topicName; - } - Aws::Crt::Optional GetTopicName() noexcept { - return m_topicName; - } - void SetQos(QOS qos) noexcept; - Aws::Crt::Optional GetQos() noexcept; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToIoTCoreRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as - * a key in maps. */ - bool operator<(const SubscribeToIoTCoreRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional m_qos; -}; - -class SubscribeToConfigurationUpdateResponse : public AbstractShapeBase { -public: - SubscribeToConfigurationUpdateResponse() noexcept {} - SubscribeToConfigurationUpdateResponse( - const SubscribeToConfigurationUpdateResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToConfigurationUpdateResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void - s_customDeleter(SubscribeToConfigurationUpdateResponse *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` - * can be used as a key in maps. */ - bool operator<(const SubscribeToConfigurationUpdateResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToConfigurationUpdateRequest : public AbstractShapeBase { -public: - SubscribeToConfigurationUpdateRequest() noexcept {} - SubscribeToConfigurationUpdateRequest( - const SubscribeToConfigurationUpdateRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { - m_keyPath = keyPath; - } - Aws::Crt::Optional> GetKeyPath() noexcept { - return m_keyPath; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToConfigurationUpdateRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToConfigurationUpdateRequest *) noexcept; - /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` - * can be used as a key in maps. */ - bool operator<(const SubscribeToConfigurationUpdateRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; -}; - -class SubscribeToComponentUpdatesResponse : public AbstractShapeBase { -public: - SubscribeToComponentUpdatesResponse() noexcept {} - SubscribeToComponentUpdatesResponse( - const SubscribeToComponentUpdatesResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToComponentUpdatesResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToComponentUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can - * be used as a key in maps. */ - bool operator<(const SubscribeToComponentUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToComponentUpdatesRequest : public AbstractShapeBase { -public: - SubscribeToComponentUpdatesRequest() noexcept {} - SubscribeToComponentUpdatesRequest( - const SubscribeToComponentUpdatesRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToComponentUpdatesRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToComponentUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can - * be used as a key in maps. */ - bool operator<(const SubscribeToComponentUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToCertificateUpdatesResponse : public AbstractShapeBase { -public: - SubscribeToCertificateUpdatesResponse() noexcept {} - SubscribeToCertificateUpdatesResponse( - const SubscribeToCertificateUpdatesResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToCertificateUpdatesResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToCertificateUpdatesResponse *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` - * can be used as a key in maps. */ - bool operator<(const SubscribeToCertificateUpdatesResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SubscribeToCertificateUpdatesRequest : public AbstractShapeBase { -public: - SubscribeToCertificateUpdatesRequest() noexcept {} - SubscribeToCertificateUpdatesRequest( - const SubscribeToCertificateUpdatesRequest &) = default; - void - SetCertificateOptions(const CertificateOptions &certificateOptions) noexcept { - m_certificateOptions = certificateOptions; - } - Aws::Crt::Optional GetCertificateOptions() noexcept { - return m_certificateOptions; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SubscribeToCertificateUpdatesRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(SubscribeToCertificateUpdatesRequest *) noexcept; - /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can - * be used as a key in maps. */ - bool operator<(const SubscribeToCertificateUpdatesRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_certificateOptions; -}; - -class StopComponentResponse : public AbstractShapeBase { -public: - StopComponentResponse() noexcept {} - StopComponentResponse(const StopComponentResponse &) = default; - void SetStopStatus(RequestStatus stopStatus) noexcept; - Aws::Crt::Optional GetStopStatus() noexcept; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(StopComponentResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(StopComponentResponse *) noexcept; - /* This needs to be defined so that `StopComponentResponse` can be used as a - * key in maps. */ - bool operator<(const StopComponentResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_stopStatus; - Aws::Crt::Optional m_message; -}; - -class StopComponentRequest : public AbstractShapeBase { -public: - StopComponentRequest() noexcept {} - StopComponentRequest(const StopComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(StopComponentRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(StopComponentRequest *) noexcept; - /* This needs to be defined so that `StopComponentRequest` can be used as a - * key in maps. */ - bool operator<(const StopComponentRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; -}; - -class SendConfigurationValidityReportResponse : public AbstractShapeBase { -public: - SendConfigurationValidityReportResponse() noexcept {} - SendConfigurationValidityReportResponse( - const SendConfigurationValidityReportResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SendConfigurationValidityReportResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void - s_customDeleter(SendConfigurationValidityReportResponse *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportResponse` - * can be used as a key in maps. */ - bool - operator<(const SendConfigurationValidityReportResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class SendConfigurationValidityReportRequest : public AbstractShapeBase { -public: - SendConfigurationValidityReportRequest() noexcept {} - SendConfigurationValidityReportRequest( - const SendConfigurationValidityReportRequest &) = default; - void SetConfigurationValidityReport( - const ConfigurationValidityReport &configurationValidityReport) noexcept { - m_configurationValidityReport = configurationValidityReport; - } - Aws::Crt::Optional - GetConfigurationValidityReport() noexcept { - return m_configurationValidityReport; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(SendConfigurationValidityReportRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void - s_customDeleter(SendConfigurationValidityReportRequest *) noexcept; - /* This needs to be defined so that `SendConfigurationValidityReportRequest` - * can be used as a key in maps. */ - bool operator<(const SendConfigurationValidityReportRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_configurationValidityReport; -}; - -class ResumeComponentResponse : public AbstractShapeBase { -public: - ResumeComponentResponse() noexcept {} - ResumeComponentResponse(const ResumeComponentResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResumeComponentResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResumeComponentResponse *) noexcept; - /* This needs to be defined so that `ResumeComponentResponse` can be used as a - * key in maps. */ - bool operator<(const ResumeComponentResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class ResumeComponentRequest : public AbstractShapeBase { -public: - ResumeComponentRequest() noexcept {} - ResumeComponentRequest(const ResumeComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResumeComponentRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResumeComponentRequest *) noexcept; - /* This needs to be defined so that `ResumeComponentRequest` can be used as a - * key in maps. */ - bool operator<(const ResumeComponentRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; -}; - -class ComponentNotFoundError : public OperationError { -public: - ComponentNotFoundError() noexcept {} - ComponentNotFoundError(const ComponentNotFoundError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ComponentNotFoundError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ComponentNotFoundError *) noexcept; - /* This needs to be defined so that `ComponentNotFoundError` can be used as a - * key in maps. */ - bool operator<(const ComponentNotFoundError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class RestartComponentResponse : public AbstractShapeBase { -public: - RestartComponentResponse() noexcept {} - RestartComponentResponse(const RestartComponentResponse &) = default; - void SetRestartStatus(RequestStatus restartStatus) noexcept; - Aws::Crt::Optional GetRestartStatus() noexcept; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RestartComponentResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RestartComponentResponse *) noexcept; - /* This needs to be defined so that `RestartComponentResponse` can be used as - * a key in maps. */ - bool operator<(const RestartComponentResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_restartStatus; - Aws::Crt::Optional m_message; -}; - -class RestartComponentRequest : public AbstractShapeBase { -public: - RestartComponentRequest() noexcept {} - RestartComponentRequest(const RestartComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(RestartComponentRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(RestartComponentRequest *) noexcept; - /* This needs to be defined so that `RestartComponentRequest` can be used as a - * key in maps. */ - bool operator<(const RestartComponentRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; -}; - -class PutComponentMetricResponse : public AbstractShapeBase { -public: - PutComponentMetricResponse() noexcept {} - PutComponentMetricResponse(const PutComponentMetricResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PutComponentMetricResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PutComponentMetricResponse *) noexcept; - /* This needs to be defined so that `PutComponentMetricResponse` can be used - * as a key in maps. */ - bool operator<(const PutComponentMetricResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class PutComponentMetricRequest : public AbstractShapeBase { -public: - PutComponentMetricRequest() noexcept {} - PutComponentMetricRequest(const PutComponentMetricRequest &) = default; - void SetMetrics(const Aws::Crt::Vector &metrics) noexcept { - m_metrics = metrics; - } - Aws::Crt::Optional> GetMetrics() noexcept { - return m_metrics; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PutComponentMetricRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PutComponentMetricRequest *) noexcept; - /* This needs to be defined so that `PutComponentMetricRequest` can be used as - * a key in maps. */ - bool operator<(const PutComponentMetricRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_metrics; -}; - -class PublishToTopicResponse : public AbstractShapeBase { -public: - PublishToTopicResponse() noexcept {} - PublishToTopicResponse(const PublishToTopicResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToTopicResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToTopicResponse *) noexcept; - /* This needs to be defined so that `PublishToTopicResponse` can be used as a - * key in maps. */ - bool operator<(const PublishToTopicResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class PublishToTopicRequest : public AbstractShapeBase { -public: - PublishToTopicRequest() noexcept {} - PublishToTopicRequest(const PublishToTopicRequest &) = default; - void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } - Aws::Crt::Optional GetTopic() noexcept { return m_topic; } - void SetPublishMessage(const PublishMessage &publishMessage) noexcept { - m_publishMessage = publishMessage; - } - Aws::Crt::Optional GetPublishMessage() noexcept { - return m_publishMessage; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToTopicRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToTopicRequest *) noexcept; - /* This needs to be defined so that `PublishToTopicRequest` can be used as a - * key in maps. */ - bool operator<(const PublishToTopicRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topic; - Aws::Crt::Optional m_publishMessage; -}; - -class PublishToIoTCoreResponse : public AbstractShapeBase { -public: - PublishToIoTCoreResponse() noexcept {} - PublishToIoTCoreResponse(const PublishToIoTCoreResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToIoTCoreResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as - * a key in maps. */ - bool operator<(const PublishToIoTCoreResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class PublishToIoTCoreRequest : public AbstractShapeBase { -public: - PublishToIoTCoreRequest() noexcept {} - PublishToIoTCoreRequest(const PublishToIoTCoreRequest &) = default; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { - m_topicName = topicName; - } - Aws::Crt::Optional GetTopicName() noexcept { - return m_topicName; - } - void SetQos(QOS qos) noexcept; - Aws::Crt::Optional GetQos() noexcept; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PublishToIoTCoreRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PublishToIoTCoreRequest *) noexcept; - /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a - * key in maps. */ - bool operator<(const PublishToIoTCoreRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_topicName; - Aws::Crt::Optional m_qos; - Aws::Crt::Optional> m_payload; -}; - -class PauseComponentResponse : public AbstractShapeBase { -public: - PauseComponentResponse() noexcept {} - PauseComponentResponse(const PauseComponentResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PauseComponentResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PauseComponentResponse *) noexcept; - /* This needs to be defined so that `PauseComponentResponse` can be used as a - * key in maps. */ - bool operator<(const PauseComponentResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class PauseComponentRequest : public AbstractShapeBase { -public: - PauseComponentRequest() noexcept {} - PauseComponentRequest(const PauseComponentRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(PauseComponentRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(PauseComponentRequest *) noexcept; - /* This needs to be defined so that `PauseComponentRequest` can be used as a - * key in maps. */ - bool operator<(const PauseComponentRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; -}; - -class ListNamedShadowsForThingResponse : public AbstractShapeBase { -public: - ListNamedShadowsForThingResponse() noexcept {} - ListNamedShadowsForThingResponse(const ListNamedShadowsForThingResponse &) = - default; - void SetResults(const Aws::Crt::Vector &results) noexcept { - m_results = results; - } - Aws::Crt::Optional> GetResults() noexcept { - return m_results; - } - void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { - m_timestamp = timestamp; - } - Aws::Crt::Optional GetTimestamp() noexcept { - return m_timestamp; - } - void SetNextToken(const Aws::Crt::String &nextToken) noexcept { - m_nextToken = nextToken; - } - Aws::Crt::Optional GetNextToken() noexcept { - return m_nextToken; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListNamedShadowsForThingResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListNamedShadowsForThingResponse *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be - * used as a key in maps. */ - bool operator<(const ListNamedShadowsForThingResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_results; - Aws::Crt::Optional m_timestamp; - Aws::Crt::Optional m_nextToken; -}; - -class ListNamedShadowsForThingRequest : public AbstractShapeBase { -public: - ListNamedShadowsForThingRequest() noexcept {} - ListNamedShadowsForThingRequest(const ListNamedShadowsForThingRequest &) = - default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { - m_thingName = thingName; - } - Aws::Crt::Optional GetThingName() noexcept { - return m_thingName; - } - void SetNextToken(const Aws::Crt::String &nextToken) noexcept { - m_nextToken = nextToken; - } - Aws::Crt::Optional GetNextToken() noexcept { - return m_nextToken; - } - void SetPageSize(const int &pageSize) noexcept { m_pageSize = pageSize; } - Aws::Crt::Optional GetPageSize() noexcept { return m_pageSize; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListNamedShadowsForThingRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListNamedShadowsForThingRequest *) noexcept; - /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be - * used as a key in maps. */ - bool operator<(const ListNamedShadowsForThingRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_nextToken; - Aws::Crt::Optional m_pageSize; -}; - -class ListLocalDeploymentsResponse : public AbstractShapeBase { -public: - ListLocalDeploymentsResponse() noexcept {} - ListLocalDeploymentsResponse(const ListLocalDeploymentsResponse &) = default; - void SetLocalDeployments( - const Aws::Crt::Vector &localDeployments) noexcept { - m_localDeployments = localDeployments; - } - Aws::Crt::Optional> - GetLocalDeployments() noexcept { - return m_localDeployments; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListLocalDeploymentsResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used - * as a key in maps. */ - bool operator<(const ListLocalDeploymentsResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_localDeployments; -}; - -class ListLocalDeploymentsRequest : public AbstractShapeBase { -public: - ListLocalDeploymentsRequest() noexcept {} - ListLocalDeploymentsRequest(const ListLocalDeploymentsRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListLocalDeploymentsRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used - * as a key in maps. */ - bool operator<(const ListLocalDeploymentsRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class ListComponentsResponse : public AbstractShapeBase { -public: - ListComponentsResponse() noexcept {} - ListComponentsResponse(const ListComponentsResponse &) = default; - void - SetComponents(const Aws::Crt::Vector &components) noexcept { - m_components = components; - } - Aws::Crt::Optional> - GetComponents() noexcept { - return m_components; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListComponentsResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListComponentsResponse *) noexcept; - /* This needs to be defined so that `ListComponentsResponse` can be used as a - * key in maps. */ - bool operator<(const ListComponentsResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_components; -}; - -class ListComponentsRequest : public AbstractShapeBase { -public: - ListComponentsRequest() noexcept {} - ListComponentsRequest(const ListComponentsRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ListComponentsRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ListComponentsRequest *) noexcept; - /* This needs to be defined so that `ListComponentsRequest` can be used as a - * key in maps. */ - bool operator<(const ListComponentsRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class GetThingShadowResponse : public AbstractShapeBase { -public: - GetThingShadowResponse() noexcept {} - GetThingShadowResponse(const GetThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetThingShadowResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetThingShadowResponse *) noexcept; - /* This needs to be defined so that `GetThingShadowResponse` can be used as a - * key in maps. */ - bool operator<(const GetThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_payload; -}; - -class GetThingShadowRequest : public AbstractShapeBase { -public: - GetThingShadowRequest() noexcept {} - GetThingShadowRequest(const GetThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { - m_thingName = thingName; - } - Aws::Crt::Optional GetThingName() noexcept { - return m_thingName; - } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { - m_shadowName = shadowName; - } - Aws::Crt::Optional GetShadowName() noexcept { - return m_shadowName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetThingShadowRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetThingShadowRequest *) noexcept; - /* This needs to be defined so that `GetThingShadowRequest` can be used as a - * key in maps. */ - bool operator<(const GetThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; -}; - -class GetSecretValueResponse : public AbstractShapeBase { -public: - GetSecretValueResponse() noexcept {} - GetSecretValueResponse(const GetSecretValueResponse &) = default; - void SetSecretId(const Aws::Crt::String &secretId) noexcept { - m_secretId = secretId; - } - Aws::Crt::Optional GetSecretId() noexcept { - return m_secretId; - } - void SetVersionId(const Aws::Crt::String &versionId) noexcept { - m_versionId = versionId; - } - Aws::Crt::Optional GetVersionId() noexcept { - return m_versionId; - } - void SetVersionStage( - const Aws::Crt::Vector &versionStage) noexcept { - m_versionStage = versionStage; - } - Aws::Crt::Optional> - GetVersionStage() noexcept { - return m_versionStage; - } - void SetSecretValue(const SecretValue &secretValue) noexcept { - m_secretValue = secretValue; - } - Aws::Crt::Optional GetSecretValue() noexcept { - return m_secretValue; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetSecretValueResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetSecretValueResponse *) noexcept; - /* This needs to be defined so that `GetSecretValueResponse` can be used as a - * key in maps. */ - bool operator<(const GetSecretValueResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_secretId; - Aws::Crt::Optional m_versionId; - Aws::Crt::Optional> m_versionStage; - Aws::Crt::Optional m_secretValue; -}; - -class GetSecretValueRequest : public AbstractShapeBase { -public: - GetSecretValueRequest() noexcept {} - GetSecretValueRequest(const GetSecretValueRequest &) = default; - void SetSecretId(const Aws::Crt::String &secretId) noexcept { - m_secretId = secretId; - } - Aws::Crt::Optional GetSecretId() noexcept { - return m_secretId; - } - void SetVersionId(const Aws::Crt::String &versionId) noexcept { - m_versionId = versionId; - } - Aws::Crt::Optional GetVersionId() noexcept { - return m_versionId; - } - void SetVersionStage(const Aws::Crt::String &versionStage) noexcept { - m_versionStage = versionStage; - } - Aws::Crt::Optional GetVersionStage() noexcept { - return m_versionStage; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetSecretValueRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetSecretValueRequest *) noexcept; - /* This needs to be defined so that `GetSecretValueRequest` can be used as a - * key in maps. */ - bool operator<(const GetSecretValueRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_secretId; - Aws::Crt::Optional m_versionId; - Aws::Crt::Optional m_versionStage; -}; - -class GetLocalDeploymentStatusResponse : public AbstractShapeBase { -public: - GetLocalDeploymentStatusResponse() noexcept {} - GetLocalDeploymentStatusResponse(const GetLocalDeploymentStatusResponse &) = - default; - void SetDeployment(const LocalDeployment &deployment) noexcept { - m_deployment = deployment; - } - Aws::Crt::Optional GetDeployment() noexcept { - return m_deployment; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetLocalDeploymentStatusResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetLocalDeploymentStatusResponse *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be - * used as a key in maps. */ - bool operator<(const GetLocalDeploymentStatusResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deployment; -}; - -class GetLocalDeploymentStatusRequest : public AbstractShapeBase { -public: - GetLocalDeploymentStatusRequest() noexcept {} - GetLocalDeploymentStatusRequest(const GetLocalDeploymentStatusRequest &) = - default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetLocalDeploymentStatusRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetLocalDeploymentStatusRequest *) noexcept; - /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be - * used as a key in maps. */ - bool operator<(const GetLocalDeploymentStatusRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; -}; - -class GetConfigurationResponse : public AbstractShapeBase { -public: - GetConfigurationResponse() noexcept {} - GetConfigurationResponse(const GetConfigurationResponse &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SetValue(const Aws::Crt::JsonObject &value) noexcept { m_value = value; } - Aws::Crt::Optional GetValue() noexcept { - return m_value; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetConfigurationResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetConfigurationResponse *) noexcept; - /* This needs to be defined so that `GetConfigurationResponse` can be used as - * a key in maps. */ - bool operator<(const GetConfigurationResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional m_value; -}; - -class GetConfigurationRequest : public AbstractShapeBase { -public: - GetConfigurationRequest() noexcept {} - GetConfigurationRequest(const GetConfigurationRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { - m_keyPath = keyPath; - } - Aws::Crt::Optional> GetKeyPath() noexcept { - return m_keyPath; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetConfigurationRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetConfigurationRequest *) noexcept; - /* This needs to be defined so that `GetConfigurationRequest` can be used as a - * key in maps. */ - bool operator<(const GetConfigurationRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; - Aws::Crt::Optional> m_keyPath; -}; - -class GetComponentDetailsResponse : public AbstractShapeBase { -public: - GetComponentDetailsResponse() noexcept {} - GetComponentDetailsResponse(const GetComponentDetailsResponse &) = default; - void SetComponentDetails(const ComponentDetails &componentDetails) noexcept { - m_componentDetails = componentDetails; - } - Aws::Crt::Optional GetComponentDetails() noexcept { - return m_componentDetails; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetComponentDetailsResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetComponentDetailsResponse *) noexcept; - /* This needs to be defined so that `GetComponentDetailsResponse` can be used - * as a key in maps. */ - bool operator<(const GetComponentDetailsResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentDetails; -}; - -class GetComponentDetailsRequest : public AbstractShapeBase { -public: - GetComponentDetailsRequest() noexcept {} - GetComponentDetailsRequest(const GetComponentDetailsRequest &) = default; - void SetComponentName(const Aws::Crt::String &componentName) noexcept { - m_componentName = componentName; - } - Aws::Crt::Optional GetComponentName() noexcept { - return m_componentName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetComponentDetailsRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetComponentDetailsRequest *) noexcept; - /* This needs to be defined so that `GetComponentDetailsRequest` can be used - * as a key in maps. */ - bool operator<(const GetComponentDetailsRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_componentName; -}; - -class InvalidCredentialError : public OperationError { -public: - InvalidCredentialError() noexcept {} - InvalidCredentialError(const InvalidCredentialError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidCredentialError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidCredentialError *) noexcept; - /* This needs to be defined so that `InvalidCredentialError` can be used as a - * key in maps. */ - bool operator<(const InvalidCredentialError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class GetClientDeviceAuthTokenResponse : public AbstractShapeBase { -public: - GetClientDeviceAuthTokenResponse() noexcept {} - GetClientDeviceAuthTokenResponse(const GetClientDeviceAuthTokenResponse &) = - default; - void SetClientDeviceAuthToken( - const Aws::Crt::String &clientDeviceAuthToken) noexcept { - m_clientDeviceAuthToken = clientDeviceAuthToken; - } - Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { - return m_clientDeviceAuthToken; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetClientDeviceAuthTokenResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetClientDeviceAuthTokenResponse *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be - * used as a key in maps. */ - bool operator<(const GetClientDeviceAuthTokenResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_clientDeviceAuthToken; -}; - -class GetClientDeviceAuthTokenRequest : public AbstractShapeBase { -public: - GetClientDeviceAuthTokenRequest() noexcept {} - GetClientDeviceAuthTokenRequest(const GetClientDeviceAuthTokenRequest &) = - default; - void SetCredential(const CredentialDocument &credential) noexcept { - m_credential = credential; - } - Aws::Crt::Optional GetCredential() noexcept { - return m_credential; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(GetClientDeviceAuthTokenRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(GetClientDeviceAuthTokenRequest *) noexcept; - /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be - * used as a key in maps. */ - bool operator<(const GetClientDeviceAuthTokenRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_credential; -}; - -class DeleteThingShadowResponse : public AbstractShapeBase { -public: - DeleteThingShadowResponse() noexcept {} - DeleteThingShadowResponse(const DeleteThingShadowResponse &) = default; - void SetPayload(const Aws::Crt::Vector &payload) noexcept { - m_payload = payload; - } - Aws::Crt::Optional> GetPayload() noexcept { - return m_payload; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeleteThingShadowResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeleteThingShadowResponse *) noexcept; - /* This needs to be defined so that `DeleteThingShadowResponse` can be used as - * a key in maps. */ - bool operator<(const DeleteThingShadowResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional> m_payload; -}; - -class DeleteThingShadowRequest : public AbstractShapeBase { -public: - DeleteThingShadowRequest() noexcept {} - DeleteThingShadowRequest(const DeleteThingShadowRequest &) = default; - void SetThingName(const Aws::Crt::String &thingName) noexcept { - m_thingName = thingName; - } - Aws::Crt::Optional GetThingName() noexcept { - return m_thingName; - } - void SetShadowName(const Aws::Crt::String &shadowName) noexcept { - m_shadowName = shadowName; - } - Aws::Crt::Optional GetShadowName() noexcept { - return m_shadowName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeleteThingShadowRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeleteThingShadowRequest *) noexcept; - /* This needs to be defined so that `DeleteThingShadowRequest` can be used as - * a key in maps. */ - bool operator<(const DeleteThingShadowRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_thingName; - Aws::Crt::Optional m_shadowName; -}; - -class ResourceNotFoundError : public OperationError { -public: - ResourceNotFoundError() noexcept {} - ResourceNotFoundError(const ResourceNotFoundError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SetResourceType(const Aws::Crt::String &resourceType) noexcept { - m_resourceType = resourceType; - } - Aws::Crt::Optional GetResourceType() noexcept { - return m_resourceType; - } - void SetResourceName(const Aws::Crt::String &resourceName) noexcept { - m_resourceName = resourceName; - } - Aws::Crt::Optional GetResourceName() noexcept { - return m_resourceName; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ResourceNotFoundError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ResourceNotFoundError *) noexcept; - /* This needs to be defined so that `ResourceNotFoundError` can be used as a - * key in maps. */ - bool operator<(const ResourceNotFoundError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_resourceType; - Aws::Crt::Optional m_resourceName; -}; - -class DeferComponentUpdateResponse : public AbstractShapeBase { -public: - DeferComponentUpdateResponse() noexcept {} - DeferComponentUpdateResponse(const DeferComponentUpdateResponse &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeferComponentUpdateResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateResponse` can be used - * as a key in maps. */ - bool operator<(const DeferComponentUpdateResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class DeferComponentUpdateRequest : public AbstractShapeBase { -public: - DeferComponentUpdateRequest() noexcept {} - DeferComponentUpdateRequest(const DeferComponentUpdateRequest &) = default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept { - return m_message; - } - void SetRecheckAfterMs(const int64_t &recheckAfterMs) noexcept { - m_recheckAfterMs = recheckAfterMs; - } - Aws::Crt::Optional GetRecheckAfterMs() noexcept { - return m_recheckAfterMs; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(DeferComponentUpdateRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateRequest` can be used - * as a key in maps. */ - bool operator<(const DeferComponentUpdateRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; - Aws::Crt::Optional m_message; - Aws::Crt::Optional m_recheckAfterMs; -}; - -class InvalidArtifactsDirectoryPathError : public OperationError { -public: - InvalidArtifactsDirectoryPathError() noexcept {} - InvalidArtifactsDirectoryPathError( - const InvalidArtifactsDirectoryPathError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidArtifactsDirectoryPathError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidArtifactsDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can - * be used as a key in maps. */ - bool operator<(const InvalidArtifactsDirectoryPathError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class InvalidRecipeDirectoryPathError : public OperationError { -public: - InvalidRecipeDirectoryPathError() noexcept {} - InvalidRecipeDirectoryPathError(const InvalidRecipeDirectoryPathError &) = - default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidRecipeDirectoryPathError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidRecipeDirectoryPathError *) noexcept; - /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be - * used as a key in maps. */ - bool operator<(const InvalidRecipeDirectoryPathError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class CreateLocalDeploymentResponse : public AbstractShapeBase { -public: - CreateLocalDeploymentResponse() noexcept {} - CreateLocalDeploymentResponse(const CreateLocalDeploymentResponse &) = - default; - void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { - m_deploymentId = deploymentId; - } - Aws::Crt::Optional GetDeploymentId() noexcept { - return m_deploymentId; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateLocalDeploymentResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateLocalDeploymentResponse *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentResponse` can be - * used as a key in maps. */ - bool operator<(const CreateLocalDeploymentResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_deploymentId; -}; - -class CreateLocalDeploymentRequest : public AbstractShapeBase { -public: - CreateLocalDeploymentRequest() noexcept {} - CreateLocalDeploymentRequest(const CreateLocalDeploymentRequest &) = default; - void SetGroupName(const Aws::Crt::String &groupName) noexcept { - m_groupName = groupName; - } - Aws::Crt::Optional GetGroupName() noexcept { - return m_groupName; - } - void SetRootComponentVersionsToAdd( - const Aws::Crt::Map - &rootComponentVersionsToAdd) noexcept { - m_rootComponentVersionsToAdd = rootComponentVersionsToAdd; - } - Aws::Crt::Optional> - GetRootComponentVersionsToAdd() noexcept { - return m_rootComponentVersionsToAdd; - } - void SetRootComponentsToRemove(const Aws::Crt::Vector - &rootComponentsToRemove) noexcept { - m_rootComponentsToRemove = rootComponentsToRemove; - } - Aws::Crt::Optional> - GetRootComponentsToRemove() noexcept { - return m_rootComponentsToRemove; - } - void SetComponentToConfiguration( - const Aws::Crt::Map - &componentToConfiguration) noexcept { - m_componentToConfiguration = componentToConfiguration; - } - Aws::Crt::Optional> - GetComponentToConfiguration() noexcept { - return m_componentToConfiguration; - } - void - SetComponentToRunWithInfo(const Aws::Crt::Map - &componentToRunWithInfo) noexcept { - m_componentToRunWithInfo = componentToRunWithInfo; - } - Aws::Crt::Optional> - GetComponentToRunWithInfo() noexcept { - return m_componentToRunWithInfo; - } - void - SetRecipeDirectoryPath(const Aws::Crt::String &recipeDirectoryPath) noexcept { - m_recipeDirectoryPath = recipeDirectoryPath; - } - Aws::Crt::Optional GetRecipeDirectoryPath() noexcept { - return m_recipeDirectoryPath; - } - void SetArtifactsDirectoryPath( - const Aws::Crt::String &artifactsDirectoryPath) noexcept { - m_artifactsDirectoryPath = artifactsDirectoryPath; - } - Aws::Crt::Optional GetArtifactsDirectoryPath() noexcept { - return m_artifactsDirectoryPath; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateLocalDeploymentRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used - * as a key in maps. */ - bool operator<(const CreateLocalDeploymentRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_groupName; - Aws::Crt::Optional> - m_rootComponentVersionsToAdd; - Aws::Crt::Optional> - m_rootComponentsToRemove; - Aws::Crt::Optional> - m_componentToConfiguration; - Aws::Crt::Optional> - m_componentToRunWithInfo; - Aws::Crt::Optional m_recipeDirectoryPath; - Aws::Crt::Optional m_artifactsDirectoryPath; -}; - -class CreateDebugPasswordResponse : public AbstractShapeBase { -public: - CreateDebugPasswordResponse() noexcept {} - CreateDebugPasswordResponse(const CreateDebugPasswordResponse &) = default; - void SetPassword(const Aws::Crt::String &password) noexcept { - m_password = password; - } - Aws::Crt::Optional GetPassword() noexcept { - return m_password; - } - void SetUsername(const Aws::Crt::String &username) noexcept { - m_username = username; - } - Aws::Crt::Optional GetUsername() noexcept { - return m_username; - } - void - SetPasswordExpiration(const Aws::Crt::DateTime &passwordExpiration) noexcept { - m_passwordExpiration = passwordExpiration; - } - Aws::Crt::Optional GetPasswordExpiration() noexcept { - return m_passwordExpiration; - } - void SetCertificateSHA256Hash( - const Aws::Crt::String &certificateSHA256Hash) noexcept { - m_certificateSHA256Hash = certificateSHA256Hash; - } - Aws::Crt::Optional GetCertificateSHA256Hash() noexcept { - return m_certificateSHA256Hash; - } - void - SetCertificateSHA1Hash(const Aws::Crt::String &certificateSHA1Hash) noexcept { - m_certificateSHA1Hash = certificateSHA1Hash; - } - Aws::Crt::Optional GetCertificateSHA1Hash() noexcept { - return m_certificateSHA1Hash; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateDebugPasswordResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordResponse` can be used - * as a key in maps. */ - bool operator<(const CreateDebugPasswordResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_password; - Aws::Crt::Optional m_username; - Aws::Crt::Optional m_passwordExpiration; - Aws::Crt::Optional m_certificateSHA256Hash; - Aws::Crt::Optional m_certificateSHA1Hash; -}; - -class CreateDebugPasswordRequest : public AbstractShapeBase { -public: - CreateDebugPasswordRequest() noexcept {} - CreateDebugPasswordRequest(const CreateDebugPasswordRequest &) = default; - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(CreateDebugPasswordRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordRequest` can be used - * as a key in maps. */ - bool operator<(const CreateDebugPasswordRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: -}; - -class InvalidClientDeviceAuthTokenError : public OperationError { -public: - InvalidClientDeviceAuthTokenError() noexcept {} - InvalidClientDeviceAuthTokenError(const InvalidClientDeviceAuthTokenError &) = - default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidClientDeviceAuthTokenError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidClientDeviceAuthTokenError *) noexcept; - /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be - * used as a key in maps. */ - bool operator<(const InvalidClientDeviceAuthTokenError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class InvalidArgumentsError : public OperationError { -public: - InvalidArgumentsError() noexcept {} - InvalidArgumentsError(const InvalidArgumentsError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(InvalidArgumentsError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(InvalidArgumentsError *) noexcept; - /* This needs to be defined so that `InvalidArgumentsError` can be used as a - * key in maps. */ - bool operator<(const InvalidArgumentsError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class ServiceError : public OperationError { -public: - ServiceError() noexcept {} - ServiceError(const ServiceError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(ServiceError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(ServiceError *) noexcept; - /* This needs to be defined so that `ServiceError` can be used as a key in - * maps. */ - bool operator<(const ServiceError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class UnauthorizedError : public OperationError { -public: - UnauthorizedError() noexcept {} - UnauthorizedError(const UnauthorizedError &) = default; - void SetMessage(const Aws::Crt::String &message) noexcept { - m_message = message; - } - Aws::Crt::Optional GetMessage() noexcept override { - return m_message; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(UnauthorizedError &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(UnauthorizedError *) noexcept; - /* This needs to be defined so that `UnauthorizedError` can be used as a key - * in maps. */ - bool operator<(const UnauthorizedError &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_message; -}; - -class AuthorizeClientDeviceActionResponse : public AbstractShapeBase { -public: - AuthorizeClientDeviceActionResponse() noexcept {} - AuthorizeClientDeviceActionResponse( - const AuthorizeClientDeviceActionResponse &) = default; - void SetIsAuthorized(const bool &isAuthorized) noexcept { - m_isAuthorized = isAuthorized; - } - Aws::Crt::Optional GetIsAuthorized() noexcept { return m_isAuthorized; } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(AuthorizeClientDeviceActionResponse &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(AuthorizeClientDeviceActionResponse *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can - * be used as a key in maps. */ - bool operator<(const AuthorizeClientDeviceActionResponse &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_isAuthorized; -}; - -class AuthorizeClientDeviceActionRequest : public AbstractShapeBase { -public: - AuthorizeClientDeviceActionRequest() noexcept {} - AuthorizeClientDeviceActionRequest( - const AuthorizeClientDeviceActionRequest &) = default; - void SetClientDeviceAuthToken( - const Aws::Crt::String &clientDeviceAuthToken) noexcept { - m_clientDeviceAuthToken = clientDeviceAuthToken; - } - Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { - return m_clientDeviceAuthToken; - } - void SetOperation(const Aws::Crt::String &operation) noexcept { - m_operation = operation; - } - Aws::Crt::Optional GetOperation() noexcept { - return m_operation; - } - void SetResource(const Aws::Crt::String &resource) noexcept { - m_resource = resource; - } - Aws::Crt::Optional GetResource() noexcept { - return m_resource; - } - void SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept override; - static void s_loadFromJsonView(AuthorizeClientDeviceActionRequest &, - const Aws::Crt::JsonView &) noexcept; - static Aws::Crt::ScopedResource - s_allocateFromPayload(Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; - static void s_customDeleter(AuthorizeClientDeviceActionRequest *) noexcept; - /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can - * be used as a key in maps. */ - bool operator<(const AuthorizeClientDeviceActionRequest &) const noexcept; - static const char *MODEL_NAME; - -protected: - Aws::Crt::String GetModelName() const noexcept override; - -private: - Aws::Crt::Optional m_clientDeviceAuthToken; - Aws::Crt::Optional m_operation; - Aws::Crt::Optional m_resource; -}; - -class SubscribeToIoTCoreStreamHandler : public StreamResponseHandler { -public: - virtual void OnStreamEvent(IoTCoreMessage *response) { (void)response; } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToIoTCoreOperationContext : public OperationModelContext { -public: - SubscribeToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToIoTCoreResult { -public: - SubscribeToIoTCoreResult() noexcept {} - SubscribeToIoTCoreResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToIoTCoreResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToIoTCoreOperation : public ClientOperation { -public: - SubscribeToIoTCoreOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToIoTCoreOperation` - * @param request The request used for the `SubscribeToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class ResumeComponentOperationContext : public OperationModelContext { -public: - ResumeComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class ResumeComponentResult { -public: - ResumeComponentResult() noexcept {} - ResumeComponentResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - ResumeComponentResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class ResumeComponentOperation : public ClientOperation { -public: - ResumeComponentOperation( - ClientConnection &connection, - const ResumeComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ResumeComponentOperation` - * @param request The request used for the `ResumeComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const ResumeComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class PublishToIoTCoreOperationContext : public OperationModelContext { -public: - PublishToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class PublishToIoTCoreResult { -public: - PublishToIoTCoreResult() noexcept {} - PublishToIoTCoreResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - PublishToIoTCoreResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class PublishToIoTCoreOperation : public ClientOperation { -public: - PublishToIoTCoreOperation( - ClientConnection &connection, - const PublishToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PublishToIoTCoreOperation` - * @param request The request used for the `PublishToIoTCoreOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const PublishToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SubscribeToConfigurationUpdateStreamHandler - : public StreamResponseHandler { -public: - virtual void OnStreamEvent(ConfigurationUpdateEvents *response) { - (void)response; - } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `ResourceNotFoundError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ResourceNotFoundError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToConfigurationUpdateOperationContext - : public OperationModelContext { -public: - SubscribeToConfigurationUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToConfigurationUpdateResult { -public: - SubscribeToConfigurationUpdateResult() noexcept {} - SubscribeToConfigurationUpdateResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToConfigurationUpdateResponse * - GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToConfigurationUpdateOperation : public ClientOperation { -public: - SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - std::shared_ptr - streamHandler, - const SubscribeToConfigurationUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToConfigurationUpdateOperation` - * @param request The request used for the - * `SubscribeToConfigurationUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToConfigurationUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class DeleteThingShadowOperationContext : public OperationModelContext { -public: - DeleteThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class DeleteThingShadowResult { -public: - DeleteThingShadowResult() noexcept {} - DeleteThingShadowResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - DeleteThingShadowResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class DeleteThingShadowOperation : public ClientOperation { -public: - DeleteThingShadowOperation( - ClientConnection &connection, - const DeleteThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `DeleteThingShadowOperation` - * @param request The request used for the `DeleteThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const DeleteThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class PutComponentMetricOperationContext : public OperationModelContext { -public: - PutComponentMetricOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class PutComponentMetricResult { -public: - PutComponentMetricResult() noexcept {} - PutComponentMetricResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - PutComponentMetricResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class PutComponentMetricOperation : public ClientOperation { -public: - PutComponentMetricOperation( - ClientConnection &connection, - const PutComponentMetricOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PutComponentMetricOperation` - * @param request The request used for the `PutComponentMetricOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const PutComponentMetricRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class DeferComponentUpdateOperationContext : public OperationModelContext { -public: - DeferComponentUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class DeferComponentUpdateResult { -public: - DeferComponentUpdateResult() noexcept {} - DeferComponentUpdateResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - DeferComponentUpdateResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class DeferComponentUpdateOperation : public ClientOperation { -public: - DeferComponentUpdateOperation( - ClientConnection &connection, - const DeferComponentUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `DeferComponentUpdateOperation` - * @param request The request used for the `DeferComponentUpdateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const DeferComponentUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SubscribeToValidateConfigurationUpdatesStreamHandler - : public StreamResponseHandler { -public: - virtual void OnStreamEvent(ValidateConfigurationUpdateEvents *response) { - (void)response; - } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToValidateConfigurationUpdatesOperationContext - : public OperationModelContext { -public: - SubscribeToValidateConfigurationUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToValidateConfigurationUpdatesResult { -public: - SubscribeToValidateConfigurationUpdatesResult() noexcept {} - SubscribeToValidateConfigurationUpdatesResult( - TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToValidateConfigurationUpdatesResponse * - GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToValidateConfigurationUpdatesOperation - : public ClientOperation { -public: - SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - std::shared_ptr - streamHandler, - const SubscribeToValidateConfigurationUpdatesOperationContext - &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the - * `SubscribeToValidateConfigurationUpdatesOperation` - * @param request The request used for the - * `SubscribeToValidateConfigurationUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToValidateConfigurationUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future - GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetConfigurationOperationContext : public OperationModelContext { -public: - GetConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetConfigurationResult { -public: - GetConfigurationResult() noexcept {} - GetConfigurationResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetConfigurationResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetConfigurationOperation : public ClientOperation { -public: - GetConfigurationOperation( - ClientConnection &connection, - const GetConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetConfigurationOperation` - * @param request The request used for the `GetConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SubscribeToTopicStreamHandler : public StreamResponseHandler { -public: - virtual void OnStreamEvent(SubscriptionResponseMessage *response) { - (void)response; - } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `InvalidArgumentsError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(InvalidArgumentsError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToTopicOperationContext : public OperationModelContext { -public: - SubscribeToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToTopicResult { -public: - SubscribeToTopicResult() noexcept {} - SubscribeToTopicResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToTopicResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToTopicOperation : public ClientOperation { -public: - SubscribeToTopicOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToTopicOperation` - * @param request The request used for the `SubscribeToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetComponentDetailsOperationContext : public OperationModelContext { -public: - GetComponentDetailsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetComponentDetailsResult { -public: - GetComponentDetailsResult() noexcept {} - GetComponentDetailsResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetComponentDetailsResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetComponentDetailsOperation : public ClientOperation { -public: - GetComponentDetailsOperation( - ClientConnection &connection, - const GetComponentDetailsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetComponentDetailsOperation` - * @param request The request used for the `GetComponentDetailsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetComponentDetailsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetClientDeviceAuthTokenOperationContext : public OperationModelContext { -public: - GetClientDeviceAuthTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetClientDeviceAuthTokenResult { -public: - GetClientDeviceAuthTokenResult() noexcept {} - GetClientDeviceAuthTokenResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetClientDeviceAuthTokenResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetClientDeviceAuthTokenOperation : public ClientOperation { -public: - GetClientDeviceAuthTokenOperation( - ClientConnection &connection, - const GetClientDeviceAuthTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetClientDeviceAuthTokenOperation` - * @param request The request used for the `GetClientDeviceAuthTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetClientDeviceAuthTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class PublishToTopicOperationContext : public OperationModelContext { -public: - PublishToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class PublishToTopicResult { -public: - PublishToTopicResult() noexcept {} - PublishToTopicResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - PublishToTopicResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class PublishToTopicOperation : public ClientOperation { -public: - PublishToTopicOperation( - ClientConnection &connection, - const PublishToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PublishToTopicOperation` - * @param request The request used for the `PublishToTopicOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const PublishToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SubscribeToCertificateUpdatesStreamHandler - : public StreamResponseHandler { -public: - virtual void OnStreamEvent(CertificateUpdateEvent *response) { - (void)response; - } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `UnauthorizedError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(UnauthorizedError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `InvalidArgumentsError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(InvalidArgumentsError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToCertificateUpdatesOperationContext - : public OperationModelContext { -public: - SubscribeToCertificateUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToCertificateUpdatesResult { -public: - SubscribeToCertificateUpdatesResult() noexcept {} - SubscribeToCertificateUpdatesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToCertificateUpdatesResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToCertificateUpdatesOperation : public ClientOperation { -public: - SubscribeToCertificateUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToCertificateUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToCertificateUpdatesOperation` - * @param request The request used for the - * `SubscribeToCertificateUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToCertificateUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class VerifyClientDeviceIdentityOperationContext - : public OperationModelContext { -public: - VerifyClientDeviceIdentityOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class VerifyClientDeviceIdentityResult { -public: - VerifyClientDeviceIdentityResult() noexcept {} - VerifyClientDeviceIdentityResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - VerifyClientDeviceIdentityResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class VerifyClientDeviceIdentityOperation : public ClientOperation { -public: - VerifyClientDeviceIdentityOperation( - ClientConnection &connection, - const VerifyClientDeviceIdentityOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `VerifyClientDeviceIdentityOperation` - * @param request The request used for the - * `VerifyClientDeviceIdentityOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const VerifyClientDeviceIdentityRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class AuthorizeClientDeviceActionOperationContext - : public OperationModelContext { -public: - AuthorizeClientDeviceActionOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class AuthorizeClientDeviceActionResult { -public: - AuthorizeClientDeviceActionResult() noexcept {} - AuthorizeClientDeviceActionResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - AuthorizeClientDeviceActionResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class AuthorizeClientDeviceActionOperation : public ClientOperation { -public: - AuthorizeClientDeviceActionOperation( - ClientConnection &connection, - const AuthorizeClientDeviceActionOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `AuthorizeClientDeviceActionOperation` - * @param request The request used for the - * `AuthorizeClientDeviceActionOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const AuthorizeClientDeviceActionRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class ListComponentsOperationContext : public OperationModelContext { -public: - ListComponentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class ListComponentsResult { -public: - ListComponentsResult() noexcept {} - ListComponentsResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - ListComponentsResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class ListComponentsOperation : public ClientOperation { -public: - ListComponentsOperation( - ClientConnection &connection, - const ListComponentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListComponentsOperation` - * @param request The request used for the `ListComponentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const ListComponentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class CreateDebugPasswordOperationContext : public OperationModelContext { -public: - CreateDebugPasswordOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class CreateDebugPasswordResult { -public: - CreateDebugPasswordResult() noexcept {} - CreateDebugPasswordResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - CreateDebugPasswordResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class CreateDebugPasswordOperation : public ClientOperation { -public: - CreateDebugPasswordOperation( - ClientConnection &connection, - const CreateDebugPasswordOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CreateDebugPasswordOperation` - * @param request The request used for the `CreateDebugPasswordOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const CreateDebugPasswordRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetThingShadowOperationContext : public OperationModelContext { -public: - GetThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetThingShadowResult { -public: - GetThingShadowResult() noexcept {} - GetThingShadowResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetThingShadowResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetThingShadowOperation : public ClientOperation { -public: - GetThingShadowOperation( - ClientConnection &connection, - const GetThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetThingShadowOperation` - * @param request The request used for the `GetThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SendConfigurationValidityReportOperationContext - : public OperationModelContext { -public: - SendConfigurationValidityReportOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SendConfigurationValidityReportResult { -public: - SendConfigurationValidityReportResult() noexcept {} - SendConfigurationValidityReportResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SendConfigurationValidityReportResponse * - GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SendConfigurationValidityReportOperation : public ClientOperation { -public: - SendConfigurationValidityReportOperation( - ClientConnection &connection, - const SendConfigurationValidityReportOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the - * `SendConfigurationValidityReportOperation` - * @param request The request used for the - * `SendConfigurationValidityReportOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SendConfigurationValidityReportRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class UpdateThingShadowOperationContext : public OperationModelContext { -public: - UpdateThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class UpdateThingShadowResult { -public: - UpdateThingShadowResult() noexcept {} - UpdateThingShadowResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - UpdateThingShadowResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class UpdateThingShadowOperation : public ClientOperation { -public: - UpdateThingShadowOperation( - ClientConnection &connection, - const UpdateThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateThingShadowOperation` - * @param request The request used for the `UpdateThingShadowOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const UpdateThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class UpdateConfigurationOperationContext : public OperationModelContext { -public: - UpdateConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class UpdateConfigurationResult { -public: - UpdateConfigurationResult() noexcept {} - UpdateConfigurationResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - UpdateConfigurationResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class UpdateConfigurationOperation : public ClientOperation { -public: - UpdateConfigurationOperation( - ClientConnection &connection, - const UpdateConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateConfigurationOperation` - * @param request The request used for the `UpdateConfigurationOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const UpdateConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class ValidateAuthorizationTokenOperationContext - : public OperationModelContext { -public: - ValidateAuthorizationTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class ValidateAuthorizationTokenResult { -public: - ValidateAuthorizationTokenResult() noexcept {} - ValidateAuthorizationTokenResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - ValidateAuthorizationTokenResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class ValidateAuthorizationTokenOperation : public ClientOperation { -public: - ValidateAuthorizationTokenOperation( - ClientConnection &connection, - const ValidateAuthorizationTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ValidateAuthorizationTokenOperation` - * @param request The request used for the - * `ValidateAuthorizationTokenOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const ValidateAuthorizationTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class RestartComponentOperationContext : public OperationModelContext { -public: - RestartComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class RestartComponentResult { -public: - RestartComponentResult() noexcept {} - RestartComponentResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - RestartComponentResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class RestartComponentOperation : public ClientOperation { -public: - RestartComponentOperation( - ClientConnection &connection, - const RestartComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `RestartComponentOperation` - * @param request The request used for the `RestartComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const RestartComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetLocalDeploymentStatusOperationContext : public OperationModelContext { -public: - GetLocalDeploymentStatusOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetLocalDeploymentStatusResult { -public: - GetLocalDeploymentStatusResult() noexcept {} - GetLocalDeploymentStatusResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetLocalDeploymentStatusResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetLocalDeploymentStatusOperation : public ClientOperation { -public: - GetLocalDeploymentStatusOperation( - ClientConnection &connection, - const GetLocalDeploymentStatusOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetLocalDeploymentStatusOperation` - * @param request The request used for the `GetLocalDeploymentStatusOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetLocalDeploymentStatusRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GetSecretValueOperationContext : public OperationModelContext { -public: - GetSecretValueOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class GetSecretValueResult { -public: - GetSecretValueResult() noexcept {} - GetSecretValueResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - GetSecretValueResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class GetSecretValueOperation : public ClientOperation { -public: - GetSecretValueOperation( - ClientConnection &connection, - const GetSecretValueOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `GetSecretValueOperation` - * @param request The request used for the `GetSecretValueOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const GetSecretValueRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class UpdateStateOperationContext : public OperationModelContext { -public: - UpdateStateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class UpdateStateResult { -public: - UpdateStateResult() noexcept {} - UpdateStateResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - UpdateStateResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class UpdateStateOperation : public ClientOperation { -public: - UpdateStateOperation( - ClientConnection &connection, - const UpdateStateOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `UpdateStateOperation` - * @param request The request used for the `UpdateStateOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const UpdateStateRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class ListNamedShadowsForThingOperationContext : public OperationModelContext { -public: - ListNamedShadowsForThingOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class ListNamedShadowsForThingResult { -public: - ListNamedShadowsForThingResult() noexcept {} - ListNamedShadowsForThingResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - ListNamedShadowsForThingResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class ListNamedShadowsForThingOperation : public ClientOperation { -public: - ListNamedShadowsForThingOperation( - ClientConnection &connection, - const ListNamedShadowsForThingOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListNamedShadowsForThingOperation` - * @param request The request used for the `ListNamedShadowsForThingOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const ListNamedShadowsForThingRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class SubscribeToComponentUpdatesStreamHandler : public StreamResponseHandler { -public: - virtual void OnStreamEvent(ComponentUpdatePolicyEvents *response) { - (void)response; - } - - /** - * A callback that is invoked when an error occurs while parsing a message - * from the stream. - * @param rpcError The RPC error containing the status and possibly a CRT - * error. - */ - virtual bool OnStreamError(RpcError rpcError) { - (void)rpcError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type `ServiceError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ServiceError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving an error of type - * `ResourceNotFoundError`. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(ResourceNotFoundError *operationError) { - (void)operationError; - return true; - } - - /** - * A callback that is invoked upon receiving ANY error response from the - * server. - * @param operationError The error message being received. - */ - virtual bool OnStreamError(OperationError *operationError) { - (void)operationError; - return true; - } - -private: - /** - * Invoked when a message is received on this continuation. - */ - void - OnStreamEvent(Aws::Crt::ScopedResource response) override; - /** - * Invoked when a message is received on this continuation but results in an - * error. - * - * This callback can return true so that the stream is closed afterwards. - */ - bool OnStreamError(Aws::Crt::ScopedResource error, - RpcError rpcError) override; -}; -class SubscribeToComponentUpdatesOperationContext - : public OperationModelContext { -public: - SubscribeToComponentUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class SubscribeToComponentUpdatesResult { -public: - SubscribeToComponentUpdatesResult() noexcept {} - SubscribeToComponentUpdatesResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - SubscribeToComponentUpdatesResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class SubscribeToComponentUpdatesOperation : public ClientOperation { -public: - SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToComponentUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `SubscribeToComponentUpdatesOperation` - * @param request The request used for the - * `SubscribeToComponentUpdatesOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const SubscribeToComponentUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class ListLocalDeploymentsOperationContext : public OperationModelContext { -public: - ListLocalDeploymentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class ListLocalDeploymentsResult { -public: - ListLocalDeploymentsResult() noexcept {} - ListLocalDeploymentsResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - ListLocalDeploymentsResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class ListLocalDeploymentsOperation : public ClientOperation { -public: - ListLocalDeploymentsOperation( - ClientConnection &connection, - const ListLocalDeploymentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `ListLocalDeploymentsOperation` - * @param request The request used for the `ListLocalDeploymentsOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const ListLocalDeploymentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class StopComponentOperationContext : public OperationModelContext { -public: - StopComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class StopComponentResult { -public: - StopComponentResult() noexcept {} - StopComponentResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - StopComponentResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class StopComponentOperation : public ClientOperation { -public: - StopComponentOperation( - ClientConnection &connection, - const StopComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `StopComponentOperation` - * @param request The request used for the `StopComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const StopComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class PauseComponentOperationContext : public OperationModelContext { -public: - PauseComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class PauseComponentResult { -public: - PauseComponentResult() noexcept {} - PauseComponentResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - PauseComponentResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class PauseComponentOperation : public ClientOperation { -public: - PauseComponentOperation( - ClientConnection &connection, - const PauseComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `PauseComponentOperation` - * @param request The request used for the `PauseComponentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const PauseComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class CreateLocalDeploymentOperationContext : public OperationModelContext { -public: - CreateLocalDeploymentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept; - Aws::Crt::ScopedResource - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::ScopedResource - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - Aws::Crt::String GetRequestModelName() const noexcept override; - Aws::Crt::String GetInitialResponseModelName() const noexcept override; - Aws::Crt::Optional - GetStreamingResponseModelName() const noexcept override; - Aws::Crt::String GetOperationName() const noexcept override; -}; - -class CreateLocalDeploymentResult { -public: - CreateLocalDeploymentResult() noexcept {} - CreateLocalDeploymentResult(TaggedResult &&taggedResult) noexcept - : m_taggedResult(std::move(taggedResult)) {} - CreateLocalDeploymentResponse *GetOperationResponse() const noexcept { - return static_cast( - m_taggedResult.GetOperationResponse()); - } - /** - * @return true if the response is associated with an expected response; - * false if the response is associated with an error. - */ - operator bool() const noexcept { return m_taggedResult == true; } - OperationError *GetOperationError() const noexcept { - return m_taggedResult.GetOperationError(); - } - RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } - ResultType GetResultType() const noexcept { - return m_taggedResult.GetResultType(); - } - -private: - TaggedResult m_taggedResult; -}; - -class CreateLocalDeploymentOperation : public ClientOperation { -public: - CreateLocalDeploymentOperation( - ClientConnection &connection, - const CreateLocalDeploymentOperationContext &operationContext, - Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; - /** - * Used to activate a stream for the `CreateLocalDeploymentOperation` - * @param request The request used for the `CreateLocalDeploymentOperation` - * @param onMessageFlushCallback An optional callback that is invoked when the - * request is flushed. - * @return An `RpcError` that can be used to check whether the stream was - * activated. - */ - std::future - Activate(const CreateLocalDeploymentRequest &request, - OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; - /** - * Retrieve the result from activating the stream. - */ - std::future GetResult() noexcept; - -protected: - Aws::Crt::String GetModelName() const noexcept override; -}; - -class GreengrassCoreIpcServiceModel : public ServiceModel { -public: - GreengrassCoreIpcServiceModel() noexcept; - Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator = - Aws::Crt::g_allocator) const noexcept override; - void AssignModelNameToErrorResponse(Aws::Crt::String, - ErrorResponseFactory) noexcept; - -private: - friend class GreengrassCoreIpcClient; - SubscribeToIoTCoreOperationContext m_subscribeToIoTCoreOperationContext; - ResumeComponentOperationContext m_resumeComponentOperationContext; - PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext; - SubscribeToConfigurationUpdateOperationContext - m_subscribeToConfigurationUpdateOperationContext; - DeleteThingShadowOperationContext m_deleteThingShadowOperationContext; - PutComponentMetricOperationContext m_putComponentMetricOperationContext; - DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; - SubscribeToValidateConfigurationUpdatesOperationContext - m_subscribeToValidateConfigurationUpdatesOperationContext; - GetConfigurationOperationContext m_getConfigurationOperationContext; - SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; - GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; - GetClientDeviceAuthTokenOperationContext - m_getClientDeviceAuthTokenOperationContext; - PublishToTopicOperationContext m_publishToTopicOperationContext; - SubscribeToCertificateUpdatesOperationContext - m_subscribeToCertificateUpdatesOperationContext; - VerifyClientDeviceIdentityOperationContext - m_verifyClientDeviceIdentityOperationContext; - AuthorizeClientDeviceActionOperationContext - m_authorizeClientDeviceActionOperationContext; - ListComponentsOperationContext m_listComponentsOperationContext; - CreateDebugPasswordOperationContext m_createDebugPasswordOperationContext; - GetThingShadowOperationContext m_getThingShadowOperationContext; - SendConfigurationValidityReportOperationContext - m_sendConfigurationValidityReportOperationContext; - UpdateThingShadowOperationContext m_updateThingShadowOperationContext; - UpdateConfigurationOperationContext m_updateConfigurationOperationContext; - ValidateAuthorizationTokenOperationContext - m_validateAuthorizationTokenOperationContext; - RestartComponentOperationContext m_restartComponentOperationContext; - GetLocalDeploymentStatusOperationContext - m_getLocalDeploymentStatusOperationContext; - GetSecretValueOperationContext m_getSecretValueOperationContext; - UpdateStateOperationContext m_updateStateOperationContext; - ListNamedShadowsForThingOperationContext - m_listNamedShadowsForThingOperationContext; - SubscribeToComponentUpdatesOperationContext - m_subscribeToComponentUpdatesOperationContext; - ListLocalDeploymentsOperationContext m_listLocalDeploymentsOperationContext; - StopComponentOperationContext m_stopComponentOperationContext; - PauseComponentOperationContext m_pauseComponentOperationContext; - CreateLocalDeploymentOperationContext m_createLocalDeploymentOperationContext; - Aws::Crt::Map - m_modelNameToErrorResponse; -}; -} // namespace Greengrass +namespace Aws +{ + namespace Greengrass + { + class GreengrassCoreIpcClient; + class GreengrassCoreIpcServiceModel; + enum MetricUnitType + { + METRIC_UNIT_TYPE_BYTES, + METRIC_UNIT_TYPE_BYTES_PER_SECOND, + METRIC_UNIT_TYPE_COUNT, + METRIC_UNIT_TYPE_COUNT_PER_SECOND, + METRIC_UNIT_TYPE_MEGABYTES, + METRIC_UNIT_TYPE_SECONDS + }; + + class MessageContext : public AbstractShapeBase + { + public: + MessageContext() noexcept {} + MessageContext(const MessageContext &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MessageContext &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MessageContext *) noexcept; + /* This needs to be defined so that `MessageContext` can be used as a key in + * maps. */ + bool operator<(const MessageContext &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topic; + }; + + class SystemResourceLimits : public AbstractShapeBase + { + public: + SystemResourceLimits() noexcept {} + SystemResourceLimits(const SystemResourceLimits &) = default; + void SetMemory(const int64_t &memory) noexcept { m_memory = memory; } + Aws::Crt::Optional GetMemory() noexcept { return m_memory; } + void SetCpus(const double &cpus) noexcept { m_cpus = cpus; } + Aws::Crt::Optional GetCpus() noexcept { return m_cpus; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SystemResourceLimits &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SystemResourceLimits *) noexcept; + /* This needs to be defined so that `SystemResourceLimits` can be used as a + * key in maps. */ + bool operator<(const SystemResourceLimits &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_memory; + Aws::Crt::Optional m_cpus; + }; + + class ValidateConfigurationUpdateEvent : public AbstractShapeBase + { + public: + ValidateConfigurationUpdateEvent() noexcept {} + ValidateConfigurationUpdateEvent(const ValidateConfigurationUpdateEvent &) = default; + void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept + { + m_configuration = configuration; + } + Aws::Crt::Optional GetConfiguration() noexcept { return m_configuration; } + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateConfigurationUpdateEvent &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateConfigurationUpdateEvent *) noexcept; + /* This needs to be defined so that `ValidateConfigurationUpdateEvent` can be + * used as a key in maps. */ + bool operator<(const ValidateConfigurationUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_configuration; + Aws::Crt::Optional m_deploymentId; + }; + + class MQTTMessage : public AbstractShapeBase + { + public: + MQTTMessage() noexcept {} + MQTTMessage(const MQTTMessage &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } + Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MQTTMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MQTTMessage *) noexcept; + /* This needs to be defined so that `MQTTMessage` can be used as a key in + * maps. */ + bool operator<(const MQTTMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional> m_payload; + }; + + class ConfigurationUpdateEvent : public AbstractShapeBase + { + public: + ConfigurationUpdateEvent() noexcept {} + ConfigurationUpdateEvent(const ConfigurationUpdateEvent &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } + Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationUpdateEvent &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationUpdateEvent *) noexcept; + /* This needs to be defined so that `ConfigurationUpdateEvent` can be used as + * a key in maps. */ + bool operator<(const ConfigurationUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; + }; + + class PostComponentUpdateEvent : public AbstractShapeBase + { + public: + PostComponentUpdateEvent() noexcept {} + PostComponentUpdateEvent(const PostComponentUpdateEvent &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PostComponentUpdateEvent &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PostComponentUpdateEvent *) noexcept; + /* This needs to be defined so that `PostComponentUpdateEvent` can be used as + * a key in maps. */ + bool operator<(const PostComponentUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + }; + + class PreComponentUpdateEvent : public AbstractShapeBase + { + public: + PreComponentUpdateEvent() noexcept {} + PreComponentUpdateEvent(const PreComponentUpdateEvent &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SetIsGgcRestarting(const bool &isGgcRestarting) noexcept { m_isGgcRestarting = isGgcRestarting; } + Aws::Crt::Optional GetIsGgcRestarting() noexcept { return m_isGgcRestarting; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PreComponentUpdateEvent &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PreComponentUpdateEvent *) noexcept; + /* This needs to be defined so that `PreComponentUpdateEvent` can be used as a + * key in maps. */ + bool operator<(const PreComponentUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_isGgcRestarting; + }; + + class CertificateUpdate : public AbstractShapeBase + { + public: + CertificateUpdate() noexcept {} + CertificateUpdate(const CertificateUpdate &) = default; + void SetPrivateKey(const Aws::Crt::String &privateKey) noexcept { m_privateKey = privateKey; } + Aws::Crt::Optional GetPrivateKey() noexcept { return m_privateKey; } + void SetPublicKey(const Aws::Crt::String &publicKey) noexcept { m_publicKey = publicKey; } + Aws::Crt::Optional GetPublicKey() noexcept { return m_publicKey; } + void SetCertificate(const Aws::Crt::String &certificate) noexcept { m_certificate = certificate; } + Aws::Crt::Optional GetCertificate() noexcept { return m_certificate; } + void SetCaCertificates(const Aws::Crt::Vector &caCertificates) noexcept + { + m_caCertificates = caCertificates; + } + Aws::Crt::Optional> GetCaCertificates() noexcept + { + return m_caCertificates; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateUpdate &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateUpdate *) noexcept; + /* This needs to be defined so that `CertificateUpdate` can be used as a key + * in maps. */ + bool operator<(const CertificateUpdate &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_privateKey; + Aws::Crt::Optional m_publicKey; + Aws::Crt::Optional m_certificate; + Aws::Crt::Optional> m_caCertificates; + }; + + enum CertificateType + { + CERTIFICATE_TYPE_SERVER + }; + + enum ConfigurationValidityStatus + { + CONFIGURATION_VALIDITY_STATUS_ACCEPTED, + CONFIGURATION_VALIDITY_STATUS_REJECTED + }; + + class Metric : public AbstractShapeBase + { + public: + Metric() noexcept {} + Metric(const Metric &) = default; + void SetName(const Aws::Crt::String &name) noexcept { m_name = name; } + Aws::Crt::Optional GetName() noexcept { return m_name; } + void SetUnit(MetricUnitType unit) noexcept; + Aws::Crt::Optional GetUnit() noexcept; + void SetValue(const double &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(Metric &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(Metric *) noexcept; + /* This needs to be defined so that `Metric` can be used as a key in maps. */ + bool operator<(const Metric &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_name; + Aws::Crt::Optional m_unit; + Aws::Crt::Optional m_value; + }; + + class BinaryMessage : public AbstractShapeBase + { + public: + BinaryMessage() noexcept {} + BinaryMessage(const BinaryMessage &) = default; + void SetMessage(const Aws::Crt::Vector &message) noexcept { m_message = message; } + Aws::Crt::Optional> GetMessage() noexcept { return m_message; } + /* The context is ignored if used in PublishMessage. */ + void SetContext(const MessageContext &context) noexcept { m_context = context; } + /* The context is ignored if used in PublishMessage. */ + Aws::Crt::Optional GetContext() noexcept { return m_context; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(BinaryMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(BinaryMessage *) noexcept; + /* This needs to be defined so that `BinaryMessage` can be used as a key in + * maps. */ + bool operator<(const BinaryMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_message; + Aws::Crt::Optional m_context; + }; + + class JsonMessage : public AbstractShapeBase + { + public: + JsonMessage() noexcept {} + JsonMessage(const JsonMessage &) = default; + void SetMessage(const Aws::Crt::JsonObject &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + /* The context is ignored if used in PublishMessage. */ + void SetContext(const MessageContext &context) noexcept { m_context = context; } + /* The context is ignored if used in PublishMessage. */ + Aws::Crt::Optional GetContext() noexcept { return m_context; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(JsonMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(JsonMessage *) noexcept; + /* This needs to be defined so that `JsonMessage` can be used as a key in + * maps. */ + bool operator<(const JsonMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_context; + }; + + enum DeploymentStatus + { + DEPLOYMENT_STATUS_QUEUED, + DEPLOYMENT_STATUS_IN_PROGRESS, + DEPLOYMENT_STATUS_SUCCEEDED, + DEPLOYMENT_STATUS_FAILED + }; + + enum LifecycleState + { + LIFECYCLE_STATE_RUNNING, + LIFECYCLE_STATE_ERRORED, + LIFECYCLE_STATE_NEW, + LIFECYCLE_STATE_FINISHED, + LIFECYCLE_STATE_INSTALLED, + LIFECYCLE_STATE_BROKEN, + LIFECYCLE_STATE_STARTING, + LIFECYCLE_STATE_STOPPING + }; + + class MQTTCredential : public AbstractShapeBase + { + public: + MQTTCredential() noexcept {} + MQTTCredential(const MQTTCredential &) = default; + void SetClientId(const Aws::Crt::String &clientId) noexcept { m_clientId = clientId; } + Aws::Crt::Optional GetClientId() noexcept { return m_clientId; } + void SetCertificatePem(const Aws::Crt::String &certificatePem) noexcept + { + m_certificatePem = certificatePem; + } + Aws::Crt::Optional GetCertificatePem() noexcept { return m_certificatePem; } + void SetUsername(const Aws::Crt::String &username) noexcept { m_username = username; } + Aws::Crt::Optional GetUsername() noexcept { return m_username; } + void SetPassword(const Aws::Crt::String &password) noexcept { m_password = password; } + Aws::Crt::Optional GetPassword() noexcept { return m_password; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(MQTTCredential &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(MQTTCredential *) noexcept; + /* This needs to be defined so that `MQTTCredential` can be used as a key in + * maps. */ + bool operator<(const MQTTCredential &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_clientId; + Aws::Crt::Optional m_certificatePem; + Aws::Crt::Optional m_username; + Aws::Crt::Optional m_password; + }; + + class RunWithInfo : public AbstractShapeBase + { + public: + RunWithInfo() noexcept {} + RunWithInfo(const RunWithInfo &) = default; + void SetPosixUser(const Aws::Crt::String &posixUser) noexcept { m_posixUser = posixUser; } + Aws::Crt::Optional GetPosixUser() noexcept { return m_posixUser; } + void SetWindowsUser(const Aws::Crt::String &windowsUser) noexcept { m_windowsUser = windowsUser; } + Aws::Crt::Optional GetWindowsUser() noexcept { return m_windowsUser; } + void SetSystemResourceLimits(const SystemResourceLimits &systemResourceLimits) noexcept + { + m_systemResourceLimits = systemResourceLimits; + } + Aws::Crt::Optional GetSystemResourceLimits() noexcept + { + return m_systemResourceLimits; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RunWithInfo &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RunWithInfo *) noexcept; + /* This needs to be defined so that `RunWithInfo` can be used as a key in + * maps. */ + bool operator<(const RunWithInfo &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_posixUser; + Aws::Crt::Optional m_windowsUser; + Aws::Crt::Optional m_systemResourceLimits; + }; + + class ClientDeviceCredential : public AbstractShapeBase + { + public: + ClientDeviceCredential() noexcept {} + ClientDeviceCredential &operator=(const ClientDeviceCredential &) noexcept; + ClientDeviceCredential(const ClientDeviceCredential &objectToCopy) { *this = objectToCopy; } + void SetClientDeviceCertificate(const Aws::Crt::String &clientDeviceCertificate) noexcept + { + m_clientDeviceCertificate = clientDeviceCertificate; + m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; + } + Aws::Crt::Optional GetClientDeviceCertificate() noexcept + { + if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) + { + return m_clientDeviceCertificate; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ClientDeviceCredential &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ClientDeviceCredential *) noexcept; + /* This needs to be defined so that `ClientDeviceCredential` can be used as a + * key in maps. */ + bool operator<(const ClientDeviceCredential &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_CLIENT_DEVICE_CERTIFICATE + } m_chosenMember; + Aws::Crt::Optional m_clientDeviceCertificate; + }; + + enum ReportedLifecycleState + { + REPORTED_LIFECYCLE_STATE_RUNNING, + REPORTED_LIFECYCLE_STATE_ERRORED + }; + + class ValidateConfigurationUpdateEvents : public AbstractShapeBase + { + public: + ValidateConfigurationUpdateEvents() noexcept {} + ValidateConfigurationUpdateEvents &operator=(const ValidateConfigurationUpdateEvents &) noexcept; + ValidateConfigurationUpdateEvents(const ValidateConfigurationUpdateEvents &objectToCopy) + { + *this = objectToCopy; + } + void SetValidateConfigurationUpdateEvent( + const ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent) noexcept + { + m_validateConfigurationUpdateEvent = validateConfigurationUpdateEvent; + m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; + } + Aws::Crt::Optional GetValidateConfigurationUpdateEvent() noexcept + { + if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) + { + return m_validateConfigurationUpdateEvent; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateConfigurationUpdateEvents &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateConfigurationUpdateEvents *) noexcept; + /* This needs to be defined so that `ValidateConfigurationUpdateEvents` can be + * used as a key in maps. */ + bool operator<(const ValidateConfigurationUpdateEvents &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT + } m_chosenMember; + Aws::Crt::Optional m_validateConfigurationUpdateEvent; + }; + + class SubscriptionResponseMessage : public AbstractShapeBase + { + public: + SubscriptionResponseMessage() noexcept {} + SubscriptionResponseMessage &operator=(const SubscriptionResponseMessage &) noexcept; + SubscriptionResponseMessage(const SubscriptionResponseMessage &objectToCopy) { *this = objectToCopy; } + void SetJsonMessage(const JsonMessage &jsonMessage) noexcept + { + m_jsonMessage = jsonMessage; + m_chosenMember = TAG_JSON_MESSAGE; + } + Aws::Crt::Optional GetJsonMessage() noexcept + { + if (m_chosenMember == TAG_JSON_MESSAGE) + { + return m_jsonMessage; + } + else + { + return Aws::Crt::Optional(); + } + } + void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept + { + m_binaryMessage = binaryMessage; + m_chosenMember = TAG_BINARY_MESSAGE; + } + Aws::Crt::Optional GetBinaryMessage() noexcept + { + if (m_chosenMember == TAG_BINARY_MESSAGE) + { + return m_binaryMessage; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscriptionResponseMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscriptionResponseMessage *) noexcept; + /* This needs to be defined so that `SubscriptionResponseMessage` can be used + * as a key in maps. */ + bool operator<(const SubscriptionResponseMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_JSON_MESSAGE, + TAG_BINARY_MESSAGE + } m_chosenMember; + Aws::Crt::Optional m_jsonMessage; + Aws::Crt::Optional m_binaryMessage; + }; + + enum ReceiveMode + { + RECEIVE_MODE_RECEIVE_ALL_MESSAGES, + RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS + }; + + class IoTCoreMessage : public AbstractShapeBase + { + public: + IoTCoreMessage() noexcept {} + IoTCoreMessage &operator=(const IoTCoreMessage &) noexcept; + IoTCoreMessage(const IoTCoreMessage &objectToCopy) { *this = objectToCopy; } + void SetMessage(const MQTTMessage &message) noexcept + { + m_message = message; + m_chosenMember = TAG_MESSAGE; + } + Aws::Crt::Optional GetMessage() noexcept + { + if (m_chosenMember == TAG_MESSAGE) + { + return m_message; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(IoTCoreMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(IoTCoreMessage *) noexcept; + /* This needs to be defined so that `IoTCoreMessage` can be used as a key in + * maps. */ + bool operator<(const IoTCoreMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_MESSAGE + } m_chosenMember; + Aws::Crt::Optional m_message; + }; + + class ConfigurationUpdateEvents : public AbstractShapeBase + { + public: + ConfigurationUpdateEvents() noexcept {} + ConfigurationUpdateEvents &operator=(const ConfigurationUpdateEvents &) noexcept; + ConfigurationUpdateEvents(const ConfigurationUpdateEvents &objectToCopy) { *this = objectToCopy; } + void SetConfigurationUpdateEvent(const ConfigurationUpdateEvent &configurationUpdateEvent) noexcept + { + m_configurationUpdateEvent = configurationUpdateEvent; + m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; + } + Aws::Crt::Optional GetConfigurationUpdateEvent() noexcept + { + if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) + { + return m_configurationUpdateEvent; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationUpdateEvents &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationUpdateEvents *) noexcept; + /* This needs to be defined so that `ConfigurationUpdateEvents` can be used as + * a key in maps. */ + bool operator<(const ConfigurationUpdateEvents &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_CONFIGURATION_UPDATE_EVENT + } m_chosenMember; + Aws::Crt::Optional m_configurationUpdateEvent; + }; + + class ComponentUpdatePolicyEvents : public AbstractShapeBase + { + public: + ComponentUpdatePolicyEvents() noexcept {} + ComponentUpdatePolicyEvents &operator=(const ComponentUpdatePolicyEvents &) noexcept; + ComponentUpdatePolicyEvents(const ComponentUpdatePolicyEvents &objectToCopy) { *this = objectToCopy; } + void SetPreUpdateEvent(const PreComponentUpdateEvent &preUpdateEvent) noexcept + { + m_preUpdateEvent = preUpdateEvent; + m_chosenMember = TAG_PRE_UPDATE_EVENT; + } + Aws::Crt::Optional GetPreUpdateEvent() noexcept + { + if (m_chosenMember == TAG_PRE_UPDATE_EVENT) + { + return m_preUpdateEvent; + } + else + { + return Aws::Crt::Optional(); + } + } + void SetPostUpdateEvent(const PostComponentUpdateEvent &postUpdateEvent) noexcept + { + m_postUpdateEvent = postUpdateEvent; + m_chosenMember = TAG_POST_UPDATE_EVENT; + } + Aws::Crt::Optional GetPostUpdateEvent() noexcept + { + if (m_chosenMember == TAG_POST_UPDATE_EVENT) + { + return m_postUpdateEvent; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentUpdatePolicyEvents &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; + /* This needs to be defined so that `ComponentUpdatePolicyEvents` can be used + * as a key in maps. */ + bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_PRE_UPDATE_EVENT, + TAG_POST_UPDATE_EVENT + } m_chosenMember; + Aws::Crt::Optional m_preUpdateEvent; + Aws::Crt::Optional m_postUpdateEvent; + }; + + class CertificateUpdateEvent : public AbstractShapeBase + { + public: + CertificateUpdateEvent() noexcept {} + CertificateUpdateEvent &operator=(const CertificateUpdateEvent &) noexcept; + CertificateUpdateEvent(const CertificateUpdateEvent &objectToCopy) { *this = objectToCopy; } + void SetCertificateUpdate(const CertificateUpdate &certificateUpdate) noexcept + { + m_certificateUpdate = certificateUpdate; + m_chosenMember = TAG_CERTIFICATE_UPDATE; + } + Aws::Crt::Optional GetCertificateUpdate() noexcept + { + if (m_chosenMember == TAG_CERTIFICATE_UPDATE) + { + return m_certificateUpdate; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateUpdateEvent &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateUpdateEvent *) noexcept; + /* This needs to be defined so that `CertificateUpdateEvent` can be used as a + * key in maps. */ + bool operator<(const CertificateUpdateEvent &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_CERTIFICATE_UPDATE + } m_chosenMember; + Aws::Crt::Optional m_certificateUpdate; + }; + + class CertificateOptions : public AbstractShapeBase + { + public: + CertificateOptions() noexcept {} + CertificateOptions(const CertificateOptions &) = default; + void SetCertificateType(CertificateType certificateType) noexcept; + Aws::Crt::Optional GetCertificateType() noexcept; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CertificateOptions &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CertificateOptions *) noexcept; + /* This needs to be defined so that `CertificateOptions` can be used as a key + * in maps. */ + bool operator<(const CertificateOptions &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_certificateType; + }; + + class ConfigurationValidityReport : public AbstractShapeBase + { + public: + ConfigurationValidityReport() noexcept {} + ConfigurationValidityReport(const ConfigurationValidityReport &) = default; + void SetStatus(ConfigurationValidityStatus status) noexcept; + Aws::Crt::Optional GetStatus() noexcept; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConfigurationValidityReport &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConfigurationValidityReport *) noexcept; + /* This needs to be defined so that `ConfigurationValidityReport` can be used + * as a key in maps. */ + bool operator<(const ConfigurationValidityReport &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_status; + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_message; + }; + + enum RequestStatus + { + REQUEST_STATUS_SUCCEEDED, + REQUEST_STATUS_FAILED + }; + + class PublishMessage : public AbstractShapeBase + { + public: + PublishMessage() noexcept {} + PublishMessage &operator=(const PublishMessage &) noexcept; + PublishMessage(const PublishMessage &objectToCopy) { *this = objectToCopy; } + void SetJsonMessage(const JsonMessage &jsonMessage) noexcept + { + m_jsonMessage = jsonMessage; + m_chosenMember = TAG_JSON_MESSAGE; + } + Aws::Crt::Optional GetJsonMessage() noexcept + { + if (m_chosenMember == TAG_JSON_MESSAGE) + { + return m_jsonMessage; + } + else + { + return Aws::Crt::Optional(); + } + } + void SetBinaryMessage(const BinaryMessage &binaryMessage) noexcept + { + m_binaryMessage = binaryMessage; + m_chosenMember = TAG_BINARY_MESSAGE; + } + Aws::Crt::Optional GetBinaryMessage() noexcept + { + if (m_chosenMember == TAG_BINARY_MESSAGE) + { + return m_binaryMessage; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishMessage &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishMessage *) noexcept; + /* This needs to be defined so that `PublishMessage` can be used as a key in + * maps. */ + bool operator<(const PublishMessage &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_JSON_MESSAGE, + TAG_BINARY_MESSAGE + } m_chosenMember; + Aws::Crt::Optional m_jsonMessage; + Aws::Crt::Optional m_binaryMessage; + }; + + enum QOS + { + QOS_AT_MOST_ONCE, + QOS_AT_LEAST_ONCE + }; + + class SecretValue : public AbstractShapeBase + { + public: + SecretValue() noexcept {} + SecretValue &operator=(const SecretValue &) noexcept; + SecretValue(const SecretValue &objectToCopy) { *this = objectToCopy; } + void SetSecretString(const Aws::Crt::String &secretString) noexcept + { + m_secretString = secretString; + m_chosenMember = TAG_SECRET_STRING; + } + Aws::Crt::Optional GetSecretString() noexcept + { + if (m_chosenMember == TAG_SECRET_STRING) + { + return m_secretString; + } + else + { + return Aws::Crt::Optional(); + } + } + void SetSecretBinary(const Aws::Crt::Vector &secretBinary) noexcept + { + m_secretBinary = secretBinary; + m_chosenMember = TAG_SECRET_BINARY; + } + Aws::Crt::Optional> GetSecretBinary() noexcept + { + if (m_chosenMember == TAG_SECRET_BINARY) + { + return m_secretBinary; + } + else + { + return Aws::Crt::Optional>(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SecretValue &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SecretValue *) noexcept; + /* This needs to be defined so that `SecretValue` can be used as a key in + * maps. */ + bool operator<(const SecretValue &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_SECRET_STRING, + TAG_SECRET_BINARY + } m_chosenMember; + Aws::Crt::Optional m_secretString; + Aws::Crt::Optional> m_secretBinary; + }; + + class LocalDeployment : public AbstractShapeBase + { + public: + LocalDeployment() noexcept {} + LocalDeployment(const LocalDeployment &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SetStatus(DeploymentStatus status) noexcept; + Aws::Crt::Optional GetStatus() noexcept; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(LocalDeployment &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(LocalDeployment *) noexcept; + /* This needs to be defined so that `LocalDeployment` can be used as a key in + * maps. */ + bool operator<(const LocalDeployment &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_status; + }; + + class ComponentDetails : public AbstractShapeBase + { + public: + ComponentDetails() noexcept {} + ComponentDetails(const ComponentDetails &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SetVersion(const Aws::Crt::String &version) noexcept { m_version = version; } + Aws::Crt::Optional GetVersion() noexcept { return m_version; } + void SetState(LifecycleState state) noexcept; + Aws::Crt::Optional GetState() noexcept; + void SetConfiguration(const Aws::Crt::JsonObject &configuration) noexcept + { + m_configuration = configuration; + } + Aws::Crt::Optional GetConfiguration() noexcept { return m_configuration; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentDetails &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentDetails *) noexcept; + /* This needs to be defined so that `ComponentDetails` can be used as a key in + * maps. */ + bool operator<(const ComponentDetails &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional m_version; + Aws::Crt::Optional m_state; + Aws::Crt::Optional m_configuration; + }; + + class CredentialDocument : public AbstractShapeBase + { + public: + CredentialDocument() noexcept {} + CredentialDocument &operator=(const CredentialDocument &) noexcept; + CredentialDocument(const CredentialDocument &objectToCopy) { *this = objectToCopy; } + void SetMqttCredential(const MQTTCredential &mqttCredential) noexcept + { + m_mqttCredential = mqttCredential; + m_chosenMember = TAG_MQTT_CREDENTIAL; + } + Aws::Crt::Optional GetMqttCredential() noexcept + { + if (m_chosenMember == TAG_MQTT_CREDENTIAL) + { + return m_mqttCredential; + } + else + { + return Aws::Crt::Optional(); + } + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CredentialDocument &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CredentialDocument *) noexcept; + /* This needs to be defined so that `CredentialDocument` can be used as a key + * in maps. */ + bool operator<(const CredentialDocument &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + enum ChosenMember + { + TAG_MQTT_CREDENTIAL + } m_chosenMember; + Aws::Crt::Optional m_mqttCredential; + }; + + class VerifyClientDeviceIdentityResponse : public AbstractShapeBase + { + public: + VerifyClientDeviceIdentityResponse() noexcept {} + VerifyClientDeviceIdentityResponse(const VerifyClientDeviceIdentityResponse &) = default; + void SetIsValidClientDevice(const bool &isValidClientDevice) noexcept + { + m_isValidClientDevice = isValidClientDevice; + } + Aws::Crt::Optional GetIsValidClientDevice() noexcept { return m_isValidClientDevice; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(VerifyClientDeviceIdentityResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(VerifyClientDeviceIdentityResponse *) noexcept; + /* This needs to be defined so that `VerifyClientDeviceIdentityResponse` can + * be used as a key in maps. */ + bool operator<(const VerifyClientDeviceIdentityResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_isValidClientDevice; + }; + + class VerifyClientDeviceIdentityRequest : public AbstractShapeBase + { + public: + VerifyClientDeviceIdentityRequest() noexcept {} + VerifyClientDeviceIdentityRequest(const VerifyClientDeviceIdentityRequest &) = default; + void SetCredential(const ClientDeviceCredential &credential) noexcept { m_credential = credential; } + Aws::Crt::Optional GetCredential() noexcept { return m_credential; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(VerifyClientDeviceIdentityRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(VerifyClientDeviceIdentityRequest *) noexcept; + /* This needs to be defined so that `VerifyClientDeviceIdentityRequest` can be + * used as a key in maps. */ + bool operator<(const VerifyClientDeviceIdentityRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_credential; + }; + + class InvalidTokenError : public OperationError + { + public: + InvalidTokenError() noexcept {} + InvalidTokenError(const InvalidTokenError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidTokenError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidTokenError *) noexcept; + /* This needs to be defined so that `InvalidTokenError` can be used as a key + * in maps. */ + bool operator<(const InvalidTokenError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class ValidateAuthorizationTokenResponse : public AbstractShapeBase + { + public: + ValidateAuthorizationTokenResponse() noexcept {} + ValidateAuthorizationTokenResponse(const ValidateAuthorizationTokenResponse &) = default; + void SetIsValid(const bool &isValid) noexcept { m_isValid = isValid; } + Aws::Crt::Optional GetIsValid() noexcept { return m_isValid; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateAuthorizationTokenResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateAuthorizationTokenResponse *) noexcept; + /* This needs to be defined so that `ValidateAuthorizationTokenResponse` can + * be used as a key in maps. */ + bool operator<(const ValidateAuthorizationTokenResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_isValid; + }; + + class ValidateAuthorizationTokenRequest : public AbstractShapeBase + { + public: + ValidateAuthorizationTokenRequest() noexcept {} + ValidateAuthorizationTokenRequest(const ValidateAuthorizationTokenRequest &) = default; + void SetToken(const Aws::Crt::String &token) noexcept { m_token = token; } + Aws::Crt::Optional GetToken() noexcept { return m_token; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ValidateAuthorizationTokenRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ValidateAuthorizationTokenRequest *) noexcept; + /* This needs to be defined so that `ValidateAuthorizationTokenRequest` can be + * used as a key in maps. */ + bool operator<(const ValidateAuthorizationTokenRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_token; + }; + + class UpdateThingShadowResponse : public AbstractShapeBase + { + public: + UpdateThingShadowResponse() noexcept {} + UpdateThingShadowResponse(const UpdateThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateThingShadowResponse *) noexcept; + /* This needs to be defined so that `UpdateThingShadowResponse` can be used as + * a key in maps. */ + bool operator<(const UpdateThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_payload; + }; + + class UpdateThingShadowRequest : public AbstractShapeBase + { + public: + UpdateThingShadowRequest() noexcept {} + UpdateThingShadowRequest(const UpdateThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } + Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } + Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateThingShadowRequest *) noexcept; + /* This needs to be defined so that `UpdateThingShadowRequest` can be used as + * a key in maps. */ + bool operator<(const UpdateThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; + Aws::Crt::Optional> m_payload; + }; + + class UpdateStateResponse : public AbstractShapeBase + { + public: + UpdateStateResponse() noexcept {} + UpdateStateResponse(const UpdateStateResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateStateResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateStateResponse *) noexcept; + /* This needs to be defined so that `UpdateStateResponse` can be used as a key + * in maps. */ + bool operator<(const UpdateStateResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class UpdateStateRequest : public AbstractShapeBase + { + public: + UpdateStateRequest() noexcept {} + UpdateStateRequest(const UpdateStateRequest &) = default; + void SetState(ReportedLifecycleState state) noexcept; + Aws::Crt::Optional GetState() noexcept; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateStateRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateStateRequest *) noexcept; + /* This needs to be defined so that `UpdateStateRequest` can be used as a key + * in maps. */ + bool operator<(const UpdateStateRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_state; + }; + + class FailedUpdateConditionCheckError : public OperationError + { + public: + FailedUpdateConditionCheckError() noexcept {} + FailedUpdateConditionCheckError(const FailedUpdateConditionCheckError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(FailedUpdateConditionCheckError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(FailedUpdateConditionCheckError *) noexcept; + /* This needs to be defined so that `FailedUpdateConditionCheckError` can be + * used as a key in maps. */ + bool operator<(const FailedUpdateConditionCheckError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class ConflictError : public OperationError + { + public: + ConflictError() noexcept {} + ConflictError(const ConflictError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ConflictError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ConflictError *) noexcept; + /* This needs to be defined so that `ConflictError` can be used as a key in + * maps. */ + bool operator<(const ConflictError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class UpdateConfigurationResponse : public AbstractShapeBase + { + public: + UpdateConfigurationResponse() noexcept {} + UpdateConfigurationResponse(const UpdateConfigurationResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateConfigurationResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateConfigurationResponse *) noexcept; + /* This needs to be defined so that `UpdateConfigurationResponse` can be used + * as a key in maps. */ + bool operator<(const UpdateConfigurationResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class UpdateConfigurationRequest : public AbstractShapeBase + { + public: + UpdateConfigurationRequest() noexcept {} + UpdateConfigurationRequest(const UpdateConfigurationRequest &) = default; + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } + Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } + void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { m_timestamp = timestamp; } + Aws::Crt::Optional GetTimestamp() noexcept { return m_timestamp; } + void SetValueToMerge(const Aws::Crt::JsonObject &valueToMerge) noexcept { m_valueToMerge = valueToMerge; } + Aws::Crt::Optional GetValueToMerge() noexcept { return m_valueToMerge; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UpdateConfigurationRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UpdateConfigurationRequest *) noexcept; + /* This needs to be defined so that `UpdateConfigurationRequest` can be used + * as a key in maps. */ + bool operator<(const UpdateConfigurationRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_keyPath; + Aws::Crt::Optional m_timestamp; + Aws::Crt::Optional m_valueToMerge; + }; + + class SubscribeToValidateConfigurationUpdatesResponse : public AbstractShapeBase + { + public: + SubscribeToValidateConfigurationUpdatesResponse() noexcept {} + SubscribeToValidateConfigurationUpdatesResponse(const SubscribeToValidateConfigurationUpdatesResponse &) = + default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToValidateConfigurationUpdatesResponse *) noexcept; + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in + * maps. */ + bool operator<(const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToValidateConfigurationUpdatesRequest : public AbstractShapeBase + { + public: + SubscribeToValidateConfigurationUpdatesRequest() noexcept {} + SubscribeToValidateConfigurationUpdatesRequest(const SubscribeToValidateConfigurationUpdatesRequest &) = + default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToValidateConfigurationUpdatesRequest *) noexcept; + /* This needs to be defined so that + * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in + * maps. */ + bool operator<(const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToTopicResponse : public AbstractShapeBase + { + public: + SubscribeToTopicResponse() noexcept {} + SubscribeToTopicResponse(const SubscribeToTopicResponse &) = default; + /* Deprecated No longer used */ + void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } + /* Deprecated No longer used */ + Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToTopicResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToTopicResponse *) noexcept; + /* This needs to be defined so that `SubscribeToTopicResponse` can be used as + * a key in maps. */ + bool operator<(const SubscribeToTopicResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topicName; + }; + + class SubscribeToTopicRequest : public AbstractShapeBase + { + public: + SubscribeToTopicRequest() noexcept {} + SubscribeToTopicRequest(const SubscribeToTopicRequest &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SetReceiveMode(ReceiveMode receiveMode) noexcept; + Aws::Crt::Optional GetReceiveMode() noexcept; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToTopicRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToTopicRequest *) noexcept; + /* This needs to be defined so that `SubscribeToTopicRequest` can be used as a + * key in maps. */ + bool operator<(const SubscribeToTopicRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topic; + Aws::Crt::Optional m_receiveMode; + }; + + class SubscribeToIoTCoreResponse : public AbstractShapeBase + { + public: + SubscribeToIoTCoreResponse() noexcept {} + SubscribeToIoTCoreResponse(const SubscribeToIoTCoreResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToIoTCoreResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; + /* This needs to be defined so that `SubscribeToIoTCoreResponse` can be used + * as a key in maps. */ + bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToIoTCoreRequest : public AbstractShapeBase + { + public: + SubscribeToIoTCoreRequest() noexcept {} + SubscribeToIoTCoreRequest(const SubscribeToIoTCoreRequest &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } + Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } + void SetQos(QOS qos) noexcept; + Aws::Crt::Optional GetQos() noexcept; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToIoTCoreRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToIoTCoreRequest *) noexcept; + /* This needs to be defined so that `SubscribeToIoTCoreRequest` can be used as + * a key in maps. */ + bool operator<(const SubscribeToIoTCoreRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional m_qos; + }; + + class SubscribeToConfigurationUpdateResponse : public AbstractShapeBase + { + public: + SubscribeToConfigurationUpdateResponse() noexcept {} + SubscribeToConfigurationUpdateResponse(const SubscribeToConfigurationUpdateResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SubscribeToConfigurationUpdateResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToConfigurationUpdateResponse *) noexcept; + /* This needs to be defined so that `SubscribeToConfigurationUpdateResponse` + * can be used as a key in maps. */ + bool operator<(const SubscribeToConfigurationUpdateResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToConfigurationUpdateRequest : public AbstractShapeBase + { + public: + SubscribeToConfigurationUpdateRequest() noexcept {} + SubscribeToConfigurationUpdateRequest(const SubscribeToConfigurationUpdateRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } + Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SubscribeToConfigurationUpdateRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToConfigurationUpdateRequest *) noexcept; + /* This needs to be defined so that `SubscribeToConfigurationUpdateRequest` + * can be used as a key in maps. */ + bool operator<(const SubscribeToConfigurationUpdateRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; + }; + + class SubscribeToComponentUpdatesResponse : public AbstractShapeBase + { + public: + SubscribeToComponentUpdatesResponse() noexcept {} + SubscribeToComponentUpdatesResponse(const SubscribeToComponentUpdatesResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToComponentUpdatesResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToComponentUpdatesResponse *) noexcept; + /* This needs to be defined so that `SubscribeToComponentUpdatesResponse` can + * be used as a key in maps. */ + bool operator<(const SubscribeToComponentUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToComponentUpdatesRequest : public AbstractShapeBase + { + public: + SubscribeToComponentUpdatesRequest() noexcept {} + SubscribeToComponentUpdatesRequest(const SubscribeToComponentUpdatesRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToComponentUpdatesRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToComponentUpdatesRequest *) noexcept; + /* This needs to be defined so that `SubscribeToComponentUpdatesRequest` can + * be used as a key in maps. */ + bool operator<(const SubscribeToComponentUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToCertificateUpdatesResponse : public AbstractShapeBase + { + public: + SubscribeToCertificateUpdatesResponse() noexcept {} + SubscribeToCertificateUpdatesResponse(const SubscribeToCertificateUpdatesResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SubscribeToCertificateUpdatesResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToCertificateUpdatesResponse *) noexcept; + /* This needs to be defined so that `SubscribeToCertificateUpdatesResponse` + * can be used as a key in maps. */ + bool operator<(const SubscribeToCertificateUpdatesResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SubscribeToCertificateUpdatesRequest : public AbstractShapeBase + { + public: + SubscribeToCertificateUpdatesRequest() noexcept {} + SubscribeToCertificateUpdatesRequest(const SubscribeToCertificateUpdatesRequest &) = default; + void SetCertificateOptions(const CertificateOptions &certificateOptions) noexcept + { + m_certificateOptions = certificateOptions; + } + Aws::Crt::Optional GetCertificateOptions() noexcept { return m_certificateOptions; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(SubscribeToCertificateUpdatesRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SubscribeToCertificateUpdatesRequest *) noexcept; + /* This needs to be defined so that `SubscribeToCertificateUpdatesRequest` can + * be used as a key in maps. */ + bool operator<(const SubscribeToCertificateUpdatesRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_certificateOptions; + }; + + class StopComponentResponse : public AbstractShapeBase + { + public: + StopComponentResponse() noexcept {} + StopComponentResponse(const StopComponentResponse &) = default; + void SetStopStatus(RequestStatus stopStatus) noexcept; + Aws::Crt::Optional GetStopStatus() noexcept; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(StopComponentResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(StopComponentResponse *) noexcept; + /* This needs to be defined so that `StopComponentResponse` can be used as a + * key in maps. */ + bool operator<(const StopComponentResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_stopStatus; + Aws::Crt::Optional m_message; + }; + + class StopComponentRequest : public AbstractShapeBase + { + public: + StopComponentRequest() noexcept {} + StopComponentRequest(const StopComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(StopComponentRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(StopComponentRequest *) noexcept; + /* This needs to be defined so that `StopComponentRequest` can be used as a + * key in maps. */ + bool operator<(const StopComponentRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + }; + + class SendConfigurationValidityReportResponse : public AbstractShapeBase + { + public: + SendConfigurationValidityReportResponse() noexcept {} + SendConfigurationValidityReportResponse(const SendConfigurationValidityReportResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SendConfigurationValidityReportResponse &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SendConfigurationValidityReportResponse *) noexcept; + /* This needs to be defined so that `SendConfigurationValidityReportResponse` + * can be used as a key in maps. */ + bool operator<(const SendConfigurationValidityReportResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class SendConfigurationValidityReportRequest : public AbstractShapeBase + { + public: + SendConfigurationValidityReportRequest() noexcept {} + SendConfigurationValidityReportRequest(const SendConfigurationValidityReportRequest &) = default; + void SetConfigurationValidityReport(const ConfigurationValidityReport &configurationValidityReport) noexcept + { + m_configurationValidityReport = configurationValidityReport; + } + Aws::Crt::Optional GetConfigurationValidityReport() noexcept + { + return m_configurationValidityReport; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView( + SendConfigurationValidityReportRequest &, + const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(SendConfigurationValidityReportRequest *) noexcept; + /* This needs to be defined so that `SendConfigurationValidityReportRequest` + * can be used as a key in maps. */ + bool operator<(const SendConfigurationValidityReportRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_configurationValidityReport; + }; + + class ResumeComponentResponse : public AbstractShapeBase + { + public: + ResumeComponentResponse() noexcept {} + ResumeComponentResponse(const ResumeComponentResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResumeComponentResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResumeComponentResponse *) noexcept; + /* This needs to be defined so that `ResumeComponentResponse` can be used as a + * key in maps. */ + bool operator<(const ResumeComponentResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class ResumeComponentRequest : public AbstractShapeBase + { + public: + ResumeComponentRequest() noexcept {} + ResumeComponentRequest(const ResumeComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResumeComponentRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResumeComponentRequest *) noexcept; + /* This needs to be defined so that `ResumeComponentRequest` can be used as a + * key in maps. */ + bool operator<(const ResumeComponentRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + }; + + class ComponentNotFoundError : public OperationError + { + public: + ComponentNotFoundError() noexcept {} + ComponentNotFoundError(const ComponentNotFoundError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ComponentNotFoundError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ComponentNotFoundError *) noexcept; + /* This needs to be defined so that `ComponentNotFoundError` can be used as a + * key in maps. */ + bool operator<(const ComponentNotFoundError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class RestartComponentResponse : public AbstractShapeBase + { + public: + RestartComponentResponse() noexcept {} + RestartComponentResponse(const RestartComponentResponse &) = default; + void SetRestartStatus(RequestStatus restartStatus) noexcept; + Aws::Crt::Optional GetRestartStatus() noexcept; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RestartComponentResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RestartComponentResponse *) noexcept; + /* This needs to be defined so that `RestartComponentResponse` can be used as + * a key in maps. */ + bool operator<(const RestartComponentResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_restartStatus; + Aws::Crt::Optional m_message; + }; + + class RestartComponentRequest : public AbstractShapeBase + { + public: + RestartComponentRequest() noexcept {} + RestartComponentRequest(const RestartComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(RestartComponentRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(RestartComponentRequest *) noexcept; + /* This needs to be defined so that `RestartComponentRequest` can be used as a + * key in maps. */ + bool operator<(const RestartComponentRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + }; + + class PutComponentMetricResponse : public AbstractShapeBase + { + public: + PutComponentMetricResponse() noexcept {} + PutComponentMetricResponse(const PutComponentMetricResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PutComponentMetricResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PutComponentMetricResponse *) noexcept; + /* This needs to be defined so that `PutComponentMetricResponse` can be used + * as a key in maps. */ + bool operator<(const PutComponentMetricResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class PutComponentMetricRequest : public AbstractShapeBase + { + public: + PutComponentMetricRequest() noexcept {} + PutComponentMetricRequest(const PutComponentMetricRequest &) = default; + void SetMetrics(const Aws::Crt::Vector &metrics) noexcept { m_metrics = metrics; } + Aws::Crt::Optional> GetMetrics() noexcept { return m_metrics; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PutComponentMetricRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PutComponentMetricRequest *) noexcept; + /* This needs to be defined so that `PutComponentMetricRequest` can be used as + * a key in maps. */ + bool operator<(const PutComponentMetricRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_metrics; + }; + + class PublishToTopicResponse : public AbstractShapeBase + { + public: + PublishToTopicResponse() noexcept {} + PublishToTopicResponse(const PublishToTopicResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToTopicResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToTopicResponse *) noexcept; + /* This needs to be defined so that `PublishToTopicResponse` can be used as a + * key in maps. */ + bool operator<(const PublishToTopicResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class PublishToTopicRequest : public AbstractShapeBase + { + public: + PublishToTopicRequest() noexcept {} + PublishToTopicRequest(const PublishToTopicRequest &) = default; + void SetTopic(const Aws::Crt::String &topic) noexcept { m_topic = topic; } + Aws::Crt::Optional GetTopic() noexcept { return m_topic; } + void SetPublishMessage(const PublishMessage &publishMessage) noexcept { m_publishMessage = publishMessage; } + Aws::Crt::Optional GetPublishMessage() noexcept { return m_publishMessage; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToTopicRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToTopicRequest *) noexcept; + /* This needs to be defined so that `PublishToTopicRequest` can be used as a + * key in maps. */ + bool operator<(const PublishToTopicRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topic; + Aws::Crt::Optional m_publishMessage; + }; + + class PublishToIoTCoreResponse : public AbstractShapeBase + { + public: + PublishToIoTCoreResponse() noexcept {} + PublishToIoTCoreResponse(const PublishToIoTCoreResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToIoTCoreResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToIoTCoreResponse *) noexcept; + /* This needs to be defined so that `PublishToIoTCoreResponse` can be used as + * a key in maps. */ + bool operator<(const PublishToIoTCoreResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class PublishToIoTCoreRequest : public AbstractShapeBase + { + public: + PublishToIoTCoreRequest() noexcept {} + PublishToIoTCoreRequest(const PublishToIoTCoreRequest &) = default; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } + Aws::Crt::Optional GetTopicName() noexcept { return m_topicName; } + void SetQos(QOS qos) noexcept; + Aws::Crt::Optional GetQos() noexcept; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PublishToIoTCoreRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PublishToIoTCoreRequest *) noexcept; + /* This needs to be defined so that `PublishToIoTCoreRequest` can be used as a + * key in maps. */ + bool operator<(const PublishToIoTCoreRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_topicName; + Aws::Crt::Optional m_qos; + Aws::Crt::Optional> m_payload; + }; + + class PauseComponentResponse : public AbstractShapeBase + { + public: + PauseComponentResponse() noexcept {} + PauseComponentResponse(const PauseComponentResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PauseComponentResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PauseComponentResponse *) noexcept; + /* This needs to be defined so that `PauseComponentResponse` can be used as a + * key in maps. */ + bool operator<(const PauseComponentResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class PauseComponentRequest : public AbstractShapeBase + { + public: + PauseComponentRequest() noexcept {} + PauseComponentRequest(const PauseComponentRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(PauseComponentRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(PauseComponentRequest *) noexcept; + /* This needs to be defined so that `PauseComponentRequest` can be used as a + * key in maps. */ + bool operator<(const PauseComponentRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + }; + + class ListNamedShadowsForThingResponse : public AbstractShapeBase + { + public: + ListNamedShadowsForThingResponse() noexcept {} + ListNamedShadowsForThingResponse(const ListNamedShadowsForThingResponse &) = default; + void SetResults(const Aws::Crt::Vector &results) noexcept { m_results = results; } + Aws::Crt::Optional> GetResults() noexcept { return m_results; } + void SetTimestamp(const Aws::Crt::DateTime ×tamp) noexcept { m_timestamp = timestamp; } + Aws::Crt::Optional GetTimestamp() noexcept { return m_timestamp; } + void SetNextToken(const Aws::Crt::String &nextToken) noexcept { m_nextToken = nextToken; } + Aws::Crt::Optional GetNextToken() noexcept { return m_nextToken; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListNamedShadowsForThingResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListNamedShadowsForThingResponse *) noexcept; + /* This needs to be defined so that `ListNamedShadowsForThingResponse` can be + * used as a key in maps. */ + bool operator<(const ListNamedShadowsForThingResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_results; + Aws::Crt::Optional m_timestamp; + Aws::Crt::Optional m_nextToken; + }; + + class ListNamedShadowsForThingRequest : public AbstractShapeBase + { + public: + ListNamedShadowsForThingRequest() noexcept {} + ListNamedShadowsForThingRequest(const ListNamedShadowsForThingRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } + Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } + void SetNextToken(const Aws::Crt::String &nextToken) noexcept { m_nextToken = nextToken; } + Aws::Crt::Optional GetNextToken() noexcept { return m_nextToken; } + void SetPageSize(const int &pageSize) noexcept { m_pageSize = pageSize; } + Aws::Crt::Optional GetPageSize() noexcept { return m_pageSize; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListNamedShadowsForThingRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListNamedShadowsForThingRequest *) noexcept; + /* This needs to be defined so that `ListNamedShadowsForThingRequest` can be + * used as a key in maps. */ + bool operator<(const ListNamedShadowsForThingRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_nextToken; + Aws::Crt::Optional m_pageSize; + }; + + class ListLocalDeploymentsResponse : public AbstractShapeBase + { + public: + ListLocalDeploymentsResponse() noexcept {} + ListLocalDeploymentsResponse(const ListLocalDeploymentsResponse &) = default; + void SetLocalDeployments(const Aws::Crt::Vector &localDeployments) noexcept + { + m_localDeployments = localDeployments; + } + Aws::Crt::Optional> GetLocalDeployments() noexcept + { + return m_localDeployments; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListLocalDeploymentsResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; + /* This needs to be defined so that `ListLocalDeploymentsResponse` can be used + * as a key in maps. */ + bool operator<(const ListLocalDeploymentsResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_localDeployments; + }; + + class ListLocalDeploymentsRequest : public AbstractShapeBase + { + public: + ListLocalDeploymentsRequest() noexcept {} + ListLocalDeploymentsRequest(const ListLocalDeploymentsRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListLocalDeploymentsRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; + /* This needs to be defined so that `ListLocalDeploymentsRequest` can be used + * as a key in maps. */ + bool operator<(const ListLocalDeploymentsRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class ListComponentsResponse : public AbstractShapeBase + { + public: + ListComponentsResponse() noexcept {} + ListComponentsResponse(const ListComponentsResponse &) = default; + void SetComponents(const Aws::Crt::Vector &components) noexcept + { + m_components = components; + } + Aws::Crt::Optional> GetComponents() noexcept { return m_components; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListComponentsResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListComponentsResponse *) noexcept; + /* This needs to be defined so that `ListComponentsResponse` can be used as a + * key in maps. */ + bool operator<(const ListComponentsResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_components; + }; + + class ListComponentsRequest : public AbstractShapeBase + { + public: + ListComponentsRequest() noexcept {} + ListComponentsRequest(const ListComponentsRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ListComponentsRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ListComponentsRequest *) noexcept; + /* This needs to be defined so that `ListComponentsRequest` can be used as a + * key in maps. */ + bool operator<(const ListComponentsRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class GetThingShadowResponse : public AbstractShapeBase + { + public: + GetThingShadowResponse() noexcept {} + GetThingShadowResponse(const GetThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetThingShadowResponse *) noexcept; + /* This needs to be defined so that `GetThingShadowResponse` can be used as a + * key in maps. */ + bool operator<(const GetThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_payload; + }; + + class GetThingShadowRequest : public AbstractShapeBase + { + public: + GetThingShadowRequest() noexcept {} + GetThingShadowRequest(const GetThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } + Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } + Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetThingShadowRequest *) noexcept; + /* This needs to be defined so that `GetThingShadowRequest` can be used as a + * key in maps. */ + bool operator<(const GetThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; + }; + + class GetSecretValueResponse : public AbstractShapeBase + { + public: + GetSecretValueResponse() noexcept {} + GetSecretValueResponse(const GetSecretValueResponse &) = default; + void SetSecretId(const Aws::Crt::String &secretId) noexcept { m_secretId = secretId; } + Aws::Crt::Optional GetSecretId() noexcept { return m_secretId; } + void SetVersionId(const Aws::Crt::String &versionId) noexcept { m_versionId = versionId; } + Aws::Crt::Optional GetVersionId() noexcept { return m_versionId; } + void SetVersionStage(const Aws::Crt::Vector &versionStage) noexcept + { + m_versionStage = versionStage; + } + Aws::Crt::Optional> GetVersionStage() noexcept { return m_versionStage; } + void SetSecretValue(const SecretValue &secretValue) noexcept { m_secretValue = secretValue; } + Aws::Crt::Optional GetSecretValue() noexcept { return m_secretValue; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetSecretValueResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetSecretValueResponse *) noexcept; + /* This needs to be defined so that `GetSecretValueResponse` can be used as a + * key in maps. */ + bool operator<(const GetSecretValueResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_secretId; + Aws::Crt::Optional m_versionId; + Aws::Crt::Optional> m_versionStage; + Aws::Crt::Optional m_secretValue; + }; + + class GetSecretValueRequest : public AbstractShapeBase + { + public: + GetSecretValueRequest() noexcept {} + GetSecretValueRequest(const GetSecretValueRequest &) = default; + void SetSecretId(const Aws::Crt::String &secretId) noexcept { m_secretId = secretId; } + Aws::Crt::Optional GetSecretId() noexcept { return m_secretId; } + void SetVersionId(const Aws::Crt::String &versionId) noexcept { m_versionId = versionId; } + Aws::Crt::Optional GetVersionId() noexcept { return m_versionId; } + void SetVersionStage(const Aws::Crt::String &versionStage) noexcept { m_versionStage = versionStage; } + Aws::Crt::Optional GetVersionStage() noexcept { return m_versionStage; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetSecretValueRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetSecretValueRequest *) noexcept; + /* This needs to be defined so that `GetSecretValueRequest` can be used as a + * key in maps. */ + bool operator<(const GetSecretValueRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_secretId; + Aws::Crt::Optional m_versionId; + Aws::Crt::Optional m_versionStage; + }; + + class GetLocalDeploymentStatusResponse : public AbstractShapeBase + { + public: + GetLocalDeploymentStatusResponse() noexcept {} + GetLocalDeploymentStatusResponse(const GetLocalDeploymentStatusResponse &) = default; + void SetDeployment(const LocalDeployment &deployment) noexcept { m_deployment = deployment; } + Aws::Crt::Optional GetDeployment() noexcept { return m_deployment; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetLocalDeploymentStatusResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetLocalDeploymentStatusResponse *) noexcept; + /* This needs to be defined so that `GetLocalDeploymentStatusResponse` can be + * used as a key in maps. */ + bool operator<(const GetLocalDeploymentStatusResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deployment; + }; + + class GetLocalDeploymentStatusRequest : public AbstractShapeBase + { + public: + GetLocalDeploymentStatusRequest() noexcept {} + GetLocalDeploymentStatusRequest(const GetLocalDeploymentStatusRequest &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetLocalDeploymentStatusRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetLocalDeploymentStatusRequest *) noexcept; + /* This needs to be defined so that `GetLocalDeploymentStatusRequest` can be + * used as a key in maps. */ + bool operator<(const GetLocalDeploymentStatusRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + }; + + class GetConfigurationResponse : public AbstractShapeBase + { + public: + GetConfigurationResponse() noexcept {} + GetConfigurationResponse(const GetConfigurationResponse &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SetValue(const Aws::Crt::JsonObject &value) noexcept { m_value = value; } + Aws::Crt::Optional GetValue() noexcept { return m_value; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetConfigurationResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetConfigurationResponse *) noexcept; + /* This needs to be defined so that `GetConfigurationResponse` can be used as + * a key in maps. */ + bool operator<(const GetConfigurationResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional m_value; + }; + + class GetConfigurationRequest : public AbstractShapeBase + { + public: + GetConfigurationRequest() noexcept {} + GetConfigurationRequest(const GetConfigurationRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SetKeyPath(const Aws::Crt::Vector &keyPath) noexcept { m_keyPath = keyPath; } + Aws::Crt::Optional> GetKeyPath() noexcept { return m_keyPath; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetConfigurationRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetConfigurationRequest *) noexcept; + /* This needs to be defined so that `GetConfigurationRequest` can be used as a + * key in maps. */ + bool operator<(const GetConfigurationRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + Aws::Crt::Optional> m_keyPath; + }; + + class GetComponentDetailsResponse : public AbstractShapeBase + { + public: + GetComponentDetailsResponse() noexcept {} + GetComponentDetailsResponse(const GetComponentDetailsResponse &) = default; + void SetComponentDetails(const ComponentDetails &componentDetails) noexcept + { + m_componentDetails = componentDetails; + } + Aws::Crt::Optional GetComponentDetails() noexcept { return m_componentDetails; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetComponentDetailsResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetComponentDetailsResponse *) noexcept; + /* This needs to be defined so that `GetComponentDetailsResponse` can be used + * as a key in maps. */ + bool operator<(const GetComponentDetailsResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentDetails; + }; + + class GetComponentDetailsRequest : public AbstractShapeBase + { + public: + GetComponentDetailsRequest() noexcept {} + GetComponentDetailsRequest(const GetComponentDetailsRequest &) = default; + void SetComponentName(const Aws::Crt::String &componentName) noexcept { m_componentName = componentName; } + Aws::Crt::Optional GetComponentName() noexcept { return m_componentName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetComponentDetailsRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetComponentDetailsRequest *) noexcept; + /* This needs to be defined so that `GetComponentDetailsRequest` can be used + * as a key in maps. */ + bool operator<(const GetComponentDetailsRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_componentName; + }; + + class InvalidCredentialError : public OperationError + { + public: + InvalidCredentialError() noexcept {} + InvalidCredentialError(const InvalidCredentialError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidCredentialError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidCredentialError *) noexcept; + /* This needs to be defined so that `InvalidCredentialError` can be used as a + * key in maps. */ + bool operator<(const InvalidCredentialError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class GetClientDeviceAuthTokenResponse : public AbstractShapeBase + { + public: + GetClientDeviceAuthTokenResponse() noexcept {} + GetClientDeviceAuthTokenResponse(const GetClientDeviceAuthTokenResponse &) = default; + void SetClientDeviceAuthToken(const Aws::Crt::String &clientDeviceAuthToken) noexcept + { + m_clientDeviceAuthToken = clientDeviceAuthToken; + } + Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { return m_clientDeviceAuthToken; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetClientDeviceAuthTokenResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetClientDeviceAuthTokenResponse *) noexcept; + /* This needs to be defined so that `GetClientDeviceAuthTokenResponse` can be + * used as a key in maps. */ + bool operator<(const GetClientDeviceAuthTokenResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_clientDeviceAuthToken; + }; + + class GetClientDeviceAuthTokenRequest : public AbstractShapeBase + { + public: + GetClientDeviceAuthTokenRequest() noexcept {} + GetClientDeviceAuthTokenRequest(const GetClientDeviceAuthTokenRequest &) = default; + void SetCredential(const CredentialDocument &credential) noexcept { m_credential = credential; } + Aws::Crt::Optional GetCredential() noexcept { return m_credential; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(GetClientDeviceAuthTokenRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(GetClientDeviceAuthTokenRequest *) noexcept; + /* This needs to be defined so that `GetClientDeviceAuthTokenRequest` can be + * used as a key in maps. */ + bool operator<(const GetClientDeviceAuthTokenRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_credential; + }; + + class DeleteThingShadowResponse : public AbstractShapeBase + { + public: + DeleteThingShadowResponse() noexcept {} + DeleteThingShadowResponse(const DeleteThingShadowResponse &) = default; + void SetPayload(const Aws::Crt::Vector &payload) noexcept { m_payload = payload; } + Aws::Crt::Optional> GetPayload() noexcept { return m_payload; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeleteThingShadowResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeleteThingShadowResponse *) noexcept; + /* This needs to be defined so that `DeleteThingShadowResponse` can be used as + * a key in maps. */ + bool operator<(const DeleteThingShadowResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional> m_payload; + }; + + class DeleteThingShadowRequest : public AbstractShapeBase + { + public: + DeleteThingShadowRequest() noexcept {} + DeleteThingShadowRequest(const DeleteThingShadowRequest &) = default; + void SetThingName(const Aws::Crt::String &thingName) noexcept { m_thingName = thingName; } + Aws::Crt::Optional GetThingName() noexcept { return m_thingName; } + void SetShadowName(const Aws::Crt::String &shadowName) noexcept { m_shadowName = shadowName; } + Aws::Crt::Optional GetShadowName() noexcept { return m_shadowName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeleteThingShadowRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeleteThingShadowRequest *) noexcept; + /* This needs to be defined so that `DeleteThingShadowRequest` can be used as + * a key in maps. */ + bool operator<(const DeleteThingShadowRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_thingName; + Aws::Crt::Optional m_shadowName; + }; + + class ResourceNotFoundError : public OperationError + { + public: + ResourceNotFoundError() noexcept {} + ResourceNotFoundError(const ResourceNotFoundError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SetResourceType(const Aws::Crt::String &resourceType) noexcept { m_resourceType = resourceType; } + Aws::Crt::Optional GetResourceType() noexcept { return m_resourceType; } + void SetResourceName(const Aws::Crt::String &resourceName) noexcept { m_resourceName = resourceName; } + Aws::Crt::Optional GetResourceName() noexcept { return m_resourceName; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ResourceNotFoundError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ResourceNotFoundError *) noexcept; + /* This needs to be defined so that `ResourceNotFoundError` can be used as a + * key in maps. */ + bool operator<(const ResourceNotFoundError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_resourceType; + Aws::Crt::Optional m_resourceName; + }; + + class DeferComponentUpdateResponse : public AbstractShapeBase + { + public: + DeferComponentUpdateResponse() noexcept {} + DeferComponentUpdateResponse(const DeferComponentUpdateResponse &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeferComponentUpdateResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; + /* This needs to be defined so that `DeferComponentUpdateResponse` can be used + * as a key in maps. */ + bool operator<(const DeferComponentUpdateResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class DeferComponentUpdateRequest : public AbstractShapeBase + { + public: + DeferComponentUpdateRequest() noexcept {} + DeferComponentUpdateRequest(const DeferComponentUpdateRequest &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept { return m_message; } + void SetRecheckAfterMs(const int64_t &recheckAfterMs) noexcept { m_recheckAfterMs = recheckAfterMs; } + Aws::Crt::Optional GetRecheckAfterMs() noexcept { return m_recheckAfterMs; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(DeferComponentUpdateRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; + /* This needs to be defined so that `DeferComponentUpdateRequest` can be used + * as a key in maps. */ + bool operator<(const DeferComponentUpdateRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + Aws::Crt::Optional m_message; + Aws::Crt::Optional m_recheckAfterMs; + }; + + class InvalidArtifactsDirectoryPathError : public OperationError + { + public: + InvalidArtifactsDirectoryPathError() noexcept {} + InvalidArtifactsDirectoryPathError(const InvalidArtifactsDirectoryPathError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidArtifactsDirectoryPathError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidArtifactsDirectoryPathError *) noexcept; + /* This needs to be defined so that `InvalidArtifactsDirectoryPathError` can + * be used as a key in maps. */ + bool operator<(const InvalidArtifactsDirectoryPathError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class InvalidRecipeDirectoryPathError : public OperationError + { + public: + InvalidRecipeDirectoryPathError() noexcept {} + InvalidRecipeDirectoryPathError(const InvalidRecipeDirectoryPathError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidRecipeDirectoryPathError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidRecipeDirectoryPathError *) noexcept; + /* This needs to be defined so that `InvalidRecipeDirectoryPathError` can be + * used as a key in maps. */ + bool operator<(const InvalidRecipeDirectoryPathError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class CreateLocalDeploymentResponse : public AbstractShapeBase + { + public: + CreateLocalDeploymentResponse() noexcept {} + CreateLocalDeploymentResponse(const CreateLocalDeploymentResponse &) = default; + void SetDeploymentId(const Aws::Crt::String &deploymentId) noexcept { m_deploymentId = deploymentId; } + Aws::Crt::Optional GetDeploymentId() noexcept { return m_deploymentId; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateLocalDeploymentResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateLocalDeploymentResponse *) noexcept; + /* This needs to be defined so that `CreateLocalDeploymentResponse` can be + * used as a key in maps. */ + bool operator<(const CreateLocalDeploymentResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_deploymentId; + }; + + class CreateLocalDeploymentRequest : public AbstractShapeBase + { + public: + CreateLocalDeploymentRequest() noexcept {} + CreateLocalDeploymentRequest(const CreateLocalDeploymentRequest &) = default; + void SetGroupName(const Aws::Crt::String &groupName) noexcept { m_groupName = groupName; } + Aws::Crt::Optional GetGroupName() noexcept { return m_groupName; } + void SetRootComponentVersionsToAdd( + const Aws::Crt::Map &rootComponentVersionsToAdd) noexcept + { + m_rootComponentVersionsToAdd = rootComponentVersionsToAdd; + } + Aws::Crt::Optional> + GetRootComponentVersionsToAdd() noexcept + { + return m_rootComponentVersionsToAdd; + } + void SetRootComponentsToRemove(const Aws::Crt::Vector &rootComponentsToRemove) noexcept + { + m_rootComponentsToRemove = rootComponentsToRemove; + } + Aws::Crt::Optional> GetRootComponentsToRemove() noexcept + { + return m_rootComponentsToRemove; + } + void SetComponentToConfiguration( + const Aws::Crt::Map &componentToConfiguration) noexcept + { + m_componentToConfiguration = componentToConfiguration; + } + Aws::Crt::Optional> + GetComponentToConfiguration() noexcept + { + return m_componentToConfiguration; + } + void SetComponentToRunWithInfo( + const Aws::Crt::Map &componentToRunWithInfo) noexcept + { + m_componentToRunWithInfo = componentToRunWithInfo; + } + Aws::Crt::Optional> GetComponentToRunWithInfo() noexcept + { + return m_componentToRunWithInfo; + } + void SetRecipeDirectoryPath(const Aws::Crt::String &recipeDirectoryPath) noexcept + { + m_recipeDirectoryPath = recipeDirectoryPath; + } + Aws::Crt::Optional GetRecipeDirectoryPath() noexcept { return m_recipeDirectoryPath; } + void SetArtifactsDirectoryPath(const Aws::Crt::String &artifactsDirectoryPath) noexcept + { + m_artifactsDirectoryPath = artifactsDirectoryPath; + } + Aws::Crt::Optional GetArtifactsDirectoryPath() noexcept + { + return m_artifactsDirectoryPath; + } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateLocalDeploymentRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; + /* This needs to be defined so that `CreateLocalDeploymentRequest` can be used + * as a key in maps. */ + bool operator<(const CreateLocalDeploymentRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_groupName; + Aws::Crt::Optional> m_rootComponentVersionsToAdd; + Aws::Crt::Optional> m_rootComponentsToRemove; + Aws::Crt::Optional> m_componentToConfiguration; + Aws::Crt::Optional> m_componentToRunWithInfo; + Aws::Crt::Optional m_recipeDirectoryPath; + Aws::Crt::Optional m_artifactsDirectoryPath; + }; + + class CreateDebugPasswordResponse : public AbstractShapeBase + { + public: + CreateDebugPasswordResponse() noexcept {} + CreateDebugPasswordResponse(const CreateDebugPasswordResponse &) = default; + void SetPassword(const Aws::Crt::String &password) noexcept { m_password = password; } + Aws::Crt::Optional GetPassword() noexcept { return m_password; } + void SetUsername(const Aws::Crt::String &username) noexcept { m_username = username; } + Aws::Crt::Optional GetUsername() noexcept { return m_username; } + void SetPasswordExpiration(const Aws::Crt::DateTime &passwordExpiration) noexcept + { + m_passwordExpiration = passwordExpiration; + } + Aws::Crt::Optional GetPasswordExpiration() noexcept { return m_passwordExpiration; } + void SetCertificateSHA256Hash(const Aws::Crt::String &certificateSHA256Hash) noexcept + { + m_certificateSHA256Hash = certificateSHA256Hash; + } + Aws::Crt::Optional GetCertificateSHA256Hash() noexcept { return m_certificateSHA256Hash; } + void SetCertificateSHA1Hash(const Aws::Crt::String &certificateSHA1Hash) noexcept + { + m_certificateSHA1Hash = certificateSHA1Hash; + } + Aws::Crt::Optional GetCertificateSHA1Hash() noexcept { return m_certificateSHA1Hash; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateDebugPasswordResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; + /* This needs to be defined so that `CreateDebugPasswordResponse` can be used + * as a key in maps. */ + bool operator<(const CreateDebugPasswordResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_password; + Aws::Crt::Optional m_username; + Aws::Crt::Optional m_passwordExpiration; + Aws::Crt::Optional m_certificateSHA256Hash; + Aws::Crt::Optional m_certificateSHA1Hash; + }; + + class CreateDebugPasswordRequest : public AbstractShapeBase + { + public: + CreateDebugPasswordRequest() noexcept {} + CreateDebugPasswordRequest(const CreateDebugPasswordRequest &) = default; + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(CreateDebugPasswordRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; + /* This needs to be defined so that `CreateDebugPasswordRequest` can be used + * as a key in maps. */ + bool operator<(const CreateDebugPasswordRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + }; + + class InvalidClientDeviceAuthTokenError : public OperationError + { + public: + InvalidClientDeviceAuthTokenError() noexcept {} + InvalidClientDeviceAuthTokenError(const InvalidClientDeviceAuthTokenError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidClientDeviceAuthTokenError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidClientDeviceAuthTokenError *) noexcept; + /* This needs to be defined so that `InvalidClientDeviceAuthTokenError` can be + * used as a key in maps. */ + bool operator<(const InvalidClientDeviceAuthTokenError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class InvalidArgumentsError : public OperationError + { + public: + InvalidArgumentsError() noexcept {} + InvalidArgumentsError(const InvalidArgumentsError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(InvalidArgumentsError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(InvalidArgumentsError *) noexcept; + /* This needs to be defined so that `InvalidArgumentsError` can be used as a + * key in maps. */ + bool operator<(const InvalidArgumentsError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class ServiceError : public OperationError + { + public: + ServiceError() noexcept {} + ServiceError(const ServiceError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(ServiceError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(ServiceError *) noexcept; + /* This needs to be defined so that `ServiceError` can be used as a key in + * maps. */ + bool operator<(const ServiceError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class UnauthorizedError : public OperationError + { + public: + UnauthorizedError() noexcept {} + UnauthorizedError(const UnauthorizedError &) = default; + void SetMessage(const Aws::Crt::String &message) noexcept { m_message = message; } + Aws::Crt::Optional GetMessage() noexcept override { return m_message; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(UnauthorizedError &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(UnauthorizedError *) noexcept; + /* This needs to be defined so that `UnauthorizedError` can be used as a key + * in maps. */ + bool operator<(const UnauthorizedError &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_message; + }; + + class AuthorizeClientDeviceActionResponse : public AbstractShapeBase + { + public: + AuthorizeClientDeviceActionResponse() noexcept {} + AuthorizeClientDeviceActionResponse(const AuthorizeClientDeviceActionResponse &) = default; + void SetIsAuthorized(const bool &isAuthorized) noexcept { m_isAuthorized = isAuthorized; } + Aws::Crt::Optional GetIsAuthorized() noexcept { return m_isAuthorized; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(AuthorizeClientDeviceActionResponse &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(AuthorizeClientDeviceActionResponse *) noexcept; + /* This needs to be defined so that `AuthorizeClientDeviceActionResponse` can + * be used as a key in maps. */ + bool operator<(const AuthorizeClientDeviceActionResponse &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_isAuthorized; + }; + + class AuthorizeClientDeviceActionRequest : public AbstractShapeBase + { + public: + AuthorizeClientDeviceActionRequest() noexcept {} + AuthorizeClientDeviceActionRequest(const AuthorizeClientDeviceActionRequest &) = default; + void SetClientDeviceAuthToken(const Aws::Crt::String &clientDeviceAuthToken) noexcept + { + m_clientDeviceAuthToken = clientDeviceAuthToken; + } + Aws::Crt::Optional GetClientDeviceAuthToken() noexcept { return m_clientDeviceAuthToken; } + void SetOperation(const Aws::Crt::String &operation) noexcept { m_operation = operation; } + Aws::Crt::Optional GetOperation() noexcept { return m_operation; } + void SetResource(const Aws::Crt::String &resource) noexcept { m_resource = resource; } + Aws::Crt::Optional GetResource() noexcept { return m_resource; } + void SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept override; + static void s_loadFromJsonView(AuthorizeClientDeviceActionRequest &, const Aws::Crt::JsonView &) noexcept; + static Aws::Crt::ScopedResource s_allocateFromPayload( + Aws::Crt::StringView, + Aws::Crt::Allocator *) noexcept; + static void s_customDeleter(AuthorizeClientDeviceActionRequest *) noexcept; + /* This needs to be defined so that `AuthorizeClientDeviceActionRequest` can + * be used as a key in maps. */ + bool operator<(const AuthorizeClientDeviceActionRequest &) const noexcept; + static const char *MODEL_NAME; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + + private: + Aws::Crt::Optional m_clientDeviceAuthToken; + Aws::Crt::Optional m_operation; + Aws::Crt::Optional m_resource; + }; + + class SubscribeToIoTCoreStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(IoTCoreMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToIoTCoreOperationContext : public OperationModelContext + { + public: + SubscribeToIoTCoreOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToIoTCoreResult + { + public: + SubscribeToIoTCoreResult() noexcept {} + SubscribeToIoTCoreResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + SubscribeToIoTCoreResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToIoTCoreOperation : public ClientOperation + { + public: + SubscribeToIoTCoreOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToIoTCoreOperation` + * @param request The request used for the `SubscribeToIoTCoreOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class ResumeComponentOperationContext : public OperationModelContext + { + public: + ResumeComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class ResumeComponentResult + { + public: + ResumeComponentResult() noexcept {} + ResumeComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + ResumeComponentResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class ResumeComponentOperation : public ClientOperation + { + public: + ResumeComponentOperation( + ClientConnection &connection, + const ResumeComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ResumeComponentOperation` + * @param request The request used for the `ResumeComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const ResumeComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class PublishToIoTCoreOperationContext : public OperationModelContext + { + public: + PublishToIoTCoreOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class PublishToIoTCoreResult + { + public: + PublishToIoTCoreResult() noexcept {} + PublishToIoTCoreResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + PublishToIoTCoreResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class PublishToIoTCoreOperation : public ClientOperation + { + public: + PublishToIoTCoreOperation( + ClientConnection &connection, + const PublishToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PublishToIoTCoreOperation` + * @param request The request used for the `PublishToIoTCoreOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const PublishToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SubscribeToConfigurationUpdateStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(ConfigurationUpdateEvents *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ResourceNotFoundError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToConfigurationUpdateOperationContext : public OperationModelContext + { + public: + SubscribeToConfigurationUpdateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToConfigurationUpdateResult + { + public: + SubscribeToConfigurationUpdateResult() noexcept {} + SubscribeToConfigurationUpdateResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + SubscribeToConfigurationUpdateResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToConfigurationUpdateOperation : public ClientOperation + { + public: + SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToConfigurationUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToConfigurationUpdateOperation` + * @param request The request used for the + * `SubscribeToConfigurationUpdateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToConfigurationUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class DeleteThingShadowOperationContext : public OperationModelContext + { + public: + DeleteThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class DeleteThingShadowResult + { + public: + DeleteThingShadowResult() noexcept {} + DeleteThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + DeleteThingShadowResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class DeleteThingShadowOperation : public ClientOperation + { + public: + DeleteThingShadowOperation( + ClientConnection &connection, + const DeleteThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `DeleteThingShadowOperation` + * @param request The request used for the `DeleteThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const DeleteThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class PutComponentMetricOperationContext : public OperationModelContext + { + public: + PutComponentMetricOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class PutComponentMetricResult + { + public: + PutComponentMetricResult() noexcept {} + PutComponentMetricResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + PutComponentMetricResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class PutComponentMetricOperation : public ClientOperation + { + public: + PutComponentMetricOperation( + ClientConnection &connection, + const PutComponentMetricOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PutComponentMetricOperation` + * @param request The request used for the `PutComponentMetricOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const PutComponentMetricRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class DeferComponentUpdateOperationContext : public OperationModelContext + { + public: + DeferComponentUpdateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class DeferComponentUpdateResult + { + public: + DeferComponentUpdateResult() noexcept {} + DeferComponentUpdateResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) + { + } + DeferComponentUpdateResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class DeferComponentUpdateOperation : public ClientOperation + { + public: + DeferComponentUpdateOperation( + ClientConnection &connection, + const DeferComponentUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `DeferComponentUpdateOperation` + * @param request The request used for the `DeferComponentUpdateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const DeferComponentUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SubscribeToValidateConfigurationUpdatesStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(ValidateConfigurationUpdateEvents *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToValidateConfigurationUpdatesOperationContext : public OperationModelContext + { + public: + SubscribeToValidateConfigurationUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToValidateConfigurationUpdatesResult + { + public: + SubscribeToValidateConfigurationUpdatesResult() noexcept {} + SubscribeToValidateConfigurationUpdatesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + SubscribeToValidateConfigurationUpdatesResponse *GetOperationResponse() const noexcept + { + return static_cast( + m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToValidateConfigurationUpdatesOperation : public ClientOperation + { + public: + SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToValidateConfigurationUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param request The request used for the + * `SubscribeToValidateConfigurationUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToValidateConfigurationUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetConfigurationOperationContext : public OperationModelContext + { + public: + GetConfigurationOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetConfigurationResult + { + public: + GetConfigurationResult() noexcept {} + GetConfigurationResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetConfigurationResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetConfigurationOperation : public ClientOperation + { + public: + GetConfigurationOperation( + ClientConnection &connection, + const GetConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetConfigurationOperation` + * @param request The request used for the `GetConfigurationOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SubscribeToTopicStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(SubscriptionResponseMessage *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(InvalidArgumentsError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToTopicOperationContext : public OperationModelContext + { + public: + SubscribeToTopicOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToTopicResult + { + public: + SubscribeToTopicResult() noexcept {} + SubscribeToTopicResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + SubscribeToTopicResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToTopicOperation : public ClientOperation + { + public: + SubscribeToTopicOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToTopicOperation` + * @param request The request used for the `SubscribeToTopicOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetComponentDetailsOperationContext : public OperationModelContext + { + public: + GetComponentDetailsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetComponentDetailsResult + { + public: + GetComponentDetailsResult() noexcept {} + GetComponentDetailsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetComponentDetailsResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetComponentDetailsOperation : public ClientOperation + { + public: + GetComponentDetailsOperation( + ClientConnection &connection, + const GetComponentDetailsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetComponentDetailsOperation` + * @param request The request used for the `GetComponentDetailsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetComponentDetailsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetClientDeviceAuthTokenOperationContext : public OperationModelContext + { + public: + GetClientDeviceAuthTokenOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetClientDeviceAuthTokenResult + { + public: + GetClientDeviceAuthTokenResult() noexcept {} + GetClientDeviceAuthTokenResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + GetClientDeviceAuthTokenResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetClientDeviceAuthTokenOperation : public ClientOperation + { + public: + GetClientDeviceAuthTokenOperation( + ClientConnection &connection, + const GetClientDeviceAuthTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetClientDeviceAuthTokenOperation` + * @param request The request used for the `GetClientDeviceAuthTokenOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetClientDeviceAuthTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class PublishToTopicOperationContext : public OperationModelContext + { + public: + PublishToTopicOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class PublishToTopicResult + { + public: + PublishToTopicResult() noexcept {} + PublishToTopicResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + PublishToTopicResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class PublishToTopicOperation : public ClientOperation + { + public: + PublishToTopicOperation( + ClientConnection &connection, + const PublishToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PublishToTopicOperation` + * @param request The request used for the `PublishToTopicOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const PublishToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SubscribeToCertificateUpdatesStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(CertificateUpdateEvent *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `UnauthorizedError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(UnauthorizedError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `InvalidArgumentsError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(InvalidArgumentsError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToCertificateUpdatesOperationContext : public OperationModelContext + { + public: + SubscribeToCertificateUpdatesOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToCertificateUpdatesResult + { + public: + SubscribeToCertificateUpdatesResult() noexcept {} + SubscribeToCertificateUpdatesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + SubscribeToCertificateUpdatesResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToCertificateUpdatesOperation : public ClientOperation + { + public: + SubscribeToCertificateUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToCertificateUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToCertificateUpdatesOperation` + * @param request The request used for the + * `SubscribeToCertificateUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToCertificateUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class VerifyClientDeviceIdentityOperationContext : public OperationModelContext + { + public: + VerifyClientDeviceIdentityOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class VerifyClientDeviceIdentityResult + { + public: + VerifyClientDeviceIdentityResult() noexcept {} + VerifyClientDeviceIdentityResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + VerifyClientDeviceIdentityResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class VerifyClientDeviceIdentityOperation : public ClientOperation + { + public: + VerifyClientDeviceIdentityOperation( + ClientConnection &connection, + const VerifyClientDeviceIdentityOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `VerifyClientDeviceIdentityOperation` + * @param request The request used for the + * `VerifyClientDeviceIdentityOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const VerifyClientDeviceIdentityRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class AuthorizeClientDeviceActionOperationContext : public OperationModelContext + { + public: + AuthorizeClientDeviceActionOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class AuthorizeClientDeviceActionResult + { + public: + AuthorizeClientDeviceActionResult() noexcept {} + AuthorizeClientDeviceActionResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + AuthorizeClientDeviceActionResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class AuthorizeClientDeviceActionOperation : public ClientOperation + { + public: + AuthorizeClientDeviceActionOperation( + ClientConnection &connection, + const AuthorizeClientDeviceActionOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `AuthorizeClientDeviceActionOperation` + * @param request The request used for the + * `AuthorizeClientDeviceActionOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const AuthorizeClientDeviceActionRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class ListComponentsOperationContext : public OperationModelContext + { + public: + ListComponentsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class ListComponentsResult + { + public: + ListComponentsResult() noexcept {} + ListComponentsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + ListComponentsResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class ListComponentsOperation : public ClientOperation + { + public: + ListComponentsOperation( + ClientConnection &connection, + const ListComponentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListComponentsOperation` + * @param request The request used for the `ListComponentsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const ListComponentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class CreateDebugPasswordOperationContext : public OperationModelContext + { + public: + CreateDebugPasswordOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class CreateDebugPasswordResult + { + public: + CreateDebugPasswordResult() noexcept {} + CreateDebugPasswordResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + CreateDebugPasswordResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class CreateDebugPasswordOperation : public ClientOperation + { + public: + CreateDebugPasswordOperation( + ClientConnection &connection, + const CreateDebugPasswordOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CreateDebugPasswordOperation` + * @param request The request used for the `CreateDebugPasswordOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const CreateDebugPasswordRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetThingShadowOperationContext : public OperationModelContext + { + public: + GetThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetThingShadowResult + { + public: + GetThingShadowResult() noexcept {} + GetThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetThingShadowResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetThingShadowOperation : public ClientOperation + { + public: + GetThingShadowOperation( + ClientConnection &connection, + const GetThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetThingShadowOperation` + * @param request The request used for the `GetThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SendConfigurationValidityReportOperationContext : public OperationModelContext + { + public: + SendConfigurationValidityReportOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SendConfigurationValidityReportResult + { + public: + SendConfigurationValidityReportResult() noexcept {} + SendConfigurationValidityReportResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + SendConfigurationValidityReportResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SendConfigurationValidityReportOperation : public ClientOperation + { + public: + SendConfigurationValidityReportOperation( + ClientConnection &connection, + const SendConfigurationValidityReportOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the + * `SendConfigurationValidityReportOperation` + * @param request The request used for the + * `SendConfigurationValidityReportOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SendConfigurationValidityReportRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class UpdateThingShadowOperationContext : public OperationModelContext + { + public: + UpdateThingShadowOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class UpdateThingShadowResult + { + public: + UpdateThingShadowResult() noexcept {} + UpdateThingShadowResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + UpdateThingShadowResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class UpdateThingShadowOperation : public ClientOperation + { + public: + UpdateThingShadowOperation( + ClientConnection &connection, + const UpdateThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateThingShadowOperation` + * @param request The request used for the `UpdateThingShadowOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const UpdateThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class UpdateConfigurationOperationContext : public OperationModelContext + { + public: + UpdateConfigurationOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class UpdateConfigurationResult + { + public: + UpdateConfigurationResult() noexcept {} + UpdateConfigurationResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + UpdateConfigurationResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class UpdateConfigurationOperation : public ClientOperation + { + public: + UpdateConfigurationOperation( + ClientConnection &connection, + const UpdateConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateConfigurationOperation` + * @param request The request used for the `UpdateConfigurationOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const UpdateConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class ValidateAuthorizationTokenOperationContext : public OperationModelContext + { + public: + ValidateAuthorizationTokenOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class ValidateAuthorizationTokenResult + { + public: + ValidateAuthorizationTokenResult() noexcept {} + ValidateAuthorizationTokenResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + ValidateAuthorizationTokenResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class ValidateAuthorizationTokenOperation : public ClientOperation + { + public: + ValidateAuthorizationTokenOperation( + ClientConnection &connection, + const ValidateAuthorizationTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ValidateAuthorizationTokenOperation` + * @param request The request used for the + * `ValidateAuthorizationTokenOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const ValidateAuthorizationTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class RestartComponentOperationContext : public OperationModelContext + { + public: + RestartComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class RestartComponentResult + { + public: + RestartComponentResult() noexcept {} + RestartComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + RestartComponentResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class RestartComponentOperation : public ClientOperation + { + public: + RestartComponentOperation( + ClientConnection &connection, + const RestartComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `RestartComponentOperation` + * @param request The request used for the `RestartComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const RestartComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetLocalDeploymentStatusOperationContext : public OperationModelContext + { + public: + GetLocalDeploymentStatusOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetLocalDeploymentStatusResult + { + public: + GetLocalDeploymentStatusResult() noexcept {} + GetLocalDeploymentStatusResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + GetLocalDeploymentStatusResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetLocalDeploymentStatusOperation : public ClientOperation + { + public: + GetLocalDeploymentStatusOperation( + ClientConnection &connection, + const GetLocalDeploymentStatusOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetLocalDeploymentStatusOperation` + * @param request The request used for the `GetLocalDeploymentStatusOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetLocalDeploymentStatusRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GetSecretValueOperationContext : public OperationModelContext + { + public: + GetSecretValueOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class GetSecretValueResult + { + public: + GetSecretValueResult() noexcept {} + GetSecretValueResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + GetSecretValueResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class GetSecretValueOperation : public ClientOperation + { + public: + GetSecretValueOperation( + ClientConnection &connection, + const GetSecretValueOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `GetSecretValueOperation` + * @param request The request used for the `GetSecretValueOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const GetSecretValueRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class UpdateStateOperationContext : public OperationModelContext + { + public: + UpdateStateOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class UpdateStateResult + { + public: + UpdateStateResult() noexcept {} + UpdateStateResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + UpdateStateResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class UpdateStateOperation : public ClientOperation + { + public: + UpdateStateOperation( + ClientConnection &connection, + const UpdateStateOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `UpdateStateOperation` + * @param request The request used for the `UpdateStateOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const UpdateStateRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class ListNamedShadowsForThingOperationContext : public OperationModelContext + { + public: + ListNamedShadowsForThingOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class ListNamedShadowsForThingResult + { + public: + ListNamedShadowsForThingResult() noexcept {} + ListNamedShadowsForThingResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + ListNamedShadowsForThingResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class ListNamedShadowsForThingOperation : public ClientOperation + { + public: + ListNamedShadowsForThingOperation( + ClientConnection &connection, + const ListNamedShadowsForThingOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListNamedShadowsForThingOperation` + * @param request The request used for the `ListNamedShadowsForThingOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const ListNamedShadowsForThingRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class SubscribeToComponentUpdatesStreamHandler : public StreamResponseHandler + { + public: + virtual void OnStreamEvent(ComponentUpdatePolicyEvents *response) { (void)response; } + + /** + * A callback that is invoked when an error occurs while parsing a message + * from the stream. + * @param rpcError The RPC error containing the status and possibly a CRT + * error. + */ + virtual bool OnStreamError(RpcError rpcError) + { + (void)rpcError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type `ServiceError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ServiceError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving an error of type + * `ResourceNotFoundError`. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(ResourceNotFoundError *operationError) + { + (void)operationError; + return true; + } + + /** + * A callback that is invoked upon receiving ANY error response from the + * server. + * @param operationError The error message being received. + */ + virtual bool OnStreamError(OperationError *operationError) + { + (void)operationError; + return true; + } + + private: + /** + * Invoked when a message is received on this continuation. + */ + void OnStreamEvent(Aws::Crt::ScopedResource response) override; + /** + * Invoked when a message is received on this continuation but results in an + * error. + * + * This callback can return true so that the stream is closed afterwards. + */ + bool OnStreamError(Aws::Crt::ScopedResource error, RpcError rpcError) override; + }; + class SubscribeToComponentUpdatesOperationContext : public OperationModelContext + { + public: + SubscribeToComponentUpdatesOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class SubscribeToComponentUpdatesResult + { + public: + SubscribeToComponentUpdatesResult() noexcept {} + SubscribeToComponentUpdatesResult(TaggedResult &&taggedResult) noexcept + : m_taggedResult(std::move(taggedResult)) + { + } + SubscribeToComponentUpdatesResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class SubscribeToComponentUpdatesOperation : public ClientOperation + { + public: + SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToComponentUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `SubscribeToComponentUpdatesOperation` + * @param request The request used for the + * `SubscribeToComponentUpdatesOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const SubscribeToComponentUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class ListLocalDeploymentsOperationContext : public OperationModelContext + { + public: + ListLocalDeploymentsOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class ListLocalDeploymentsResult + { + public: + ListLocalDeploymentsResult() noexcept {} + ListLocalDeploymentsResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) + { + } + ListLocalDeploymentsResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class ListLocalDeploymentsOperation : public ClientOperation + { + public: + ListLocalDeploymentsOperation( + ClientConnection &connection, + const ListLocalDeploymentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `ListLocalDeploymentsOperation` + * @param request The request used for the `ListLocalDeploymentsOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const ListLocalDeploymentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class StopComponentOperationContext : public OperationModelContext + { + public: + StopComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class StopComponentResult + { + public: + StopComponentResult() noexcept {} + StopComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + StopComponentResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class StopComponentOperation : public ClientOperation + { + public: + StopComponentOperation( + ClientConnection &connection, + const StopComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `StopComponentOperation` + * @param request The request used for the `StopComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const StopComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class PauseComponentOperationContext : public OperationModelContext + { + public: + PauseComponentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class PauseComponentResult + { + public: + PauseComponentResult() noexcept {} + PauseComponentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {} + PauseComponentResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class PauseComponentOperation : public ClientOperation + { + public: + PauseComponentOperation( + ClientConnection &connection, + const PauseComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `PauseComponentOperation` + * @param request The request used for the `PauseComponentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const PauseComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class CreateLocalDeploymentOperationContext : public OperationModelContext + { + public: + CreateLocalDeploymentOperationContext(const GreengrassCoreIpcServiceModel &serviceModel) noexcept; + Aws::Crt::ScopedResource AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::ScopedResource AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + Aws::Crt::String GetRequestModelName() const noexcept override; + Aws::Crt::String GetInitialResponseModelName() const noexcept override; + Aws::Crt::Optional GetStreamingResponseModelName() const noexcept override; + Aws::Crt::String GetOperationName() const noexcept override; + }; + + class CreateLocalDeploymentResult + { + public: + CreateLocalDeploymentResult() noexcept {} + CreateLocalDeploymentResult(TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) + { + } + CreateLocalDeploymentResponse *GetOperationResponse() const noexcept + { + return static_cast(m_taggedResult.GetOperationResponse()); + } + /** + * @return true if the response is associated with an expected response; + * false if the response is associated with an error. + */ + operator bool() const noexcept { return m_taggedResult == true; } + OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); } + RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); } + ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); } + + private: + TaggedResult m_taggedResult; + }; + + class CreateLocalDeploymentOperation : public ClientOperation + { + public: + CreateLocalDeploymentOperation( + ClientConnection &connection, + const CreateLocalDeploymentOperationContext &operationContext, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept; + /** + * Used to activate a stream for the `CreateLocalDeploymentOperation` + * @param request The request used for the `CreateLocalDeploymentOperation` + * @param onMessageFlushCallback An optional callback that is invoked when the + * request is flushed. + * @return An `RpcError` that can be used to check whether the stream was + * activated. + */ + std::future Activate( + const CreateLocalDeploymentRequest &request, + OnMessageFlushCallback onMessageFlushCallback = nullptr) noexcept; + /** + * Retrieve the result from activating the stream. + */ + std::future GetResult() noexcept; + + protected: + Aws::Crt::String GetModelName() const noexcept override; + }; + + class GreengrassCoreIpcServiceModel : public ServiceModel + { + public: + GreengrassCoreIpcServiceModel() noexcept; + Aws::Crt::ScopedResource AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override; + void AssignModelNameToErrorResponse(Aws::Crt::String, ErrorResponseFactory) noexcept; + + private: + friend class GreengrassCoreIpcClient; + SubscribeToIoTCoreOperationContext m_subscribeToIoTCoreOperationContext; + ResumeComponentOperationContext m_resumeComponentOperationContext; + PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext; + SubscribeToConfigurationUpdateOperationContext m_subscribeToConfigurationUpdateOperationContext; + DeleteThingShadowOperationContext m_deleteThingShadowOperationContext; + PutComponentMetricOperationContext m_putComponentMetricOperationContext; + DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; + SubscribeToValidateConfigurationUpdatesOperationContext + m_subscribeToValidateConfigurationUpdatesOperationContext; + GetConfigurationOperationContext m_getConfigurationOperationContext; + SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; + GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; + GetClientDeviceAuthTokenOperationContext m_getClientDeviceAuthTokenOperationContext; + PublishToTopicOperationContext m_publishToTopicOperationContext; + SubscribeToCertificateUpdatesOperationContext m_subscribeToCertificateUpdatesOperationContext; + VerifyClientDeviceIdentityOperationContext m_verifyClientDeviceIdentityOperationContext; + AuthorizeClientDeviceActionOperationContext m_authorizeClientDeviceActionOperationContext; + ListComponentsOperationContext m_listComponentsOperationContext; + CreateDebugPasswordOperationContext m_createDebugPasswordOperationContext; + GetThingShadowOperationContext m_getThingShadowOperationContext; + SendConfigurationValidityReportOperationContext m_sendConfigurationValidityReportOperationContext; + UpdateThingShadowOperationContext m_updateThingShadowOperationContext; + UpdateConfigurationOperationContext m_updateConfigurationOperationContext; + ValidateAuthorizationTokenOperationContext m_validateAuthorizationTokenOperationContext; + RestartComponentOperationContext m_restartComponentOperationContext; + GetLocalDeploymentStatusOperationContext m_getLocalDeploymentStatusOperationContext; + GetSecretValueOperationContext m_getSecretValueOperationContext; + UpdateStateOperationContext m_updateStateOperationContext; + ListNamedShadowsForThingOperationContext m_listNamedShadowsForThingOperationContext; + SubscribeToComponentUpdatesOperationContext m_subscribeToComponentUpdatesOperationContext; + ListLocalDeploymentsOperationContext m_listLocalDeploymentsOperationContext; + StopComponentOperationContext m_stopComponentOperationContext; + PauseComponentOperationContext m_pauseComponentOperationContext; + CreateLocalDeploymentOperationContext m_createLocalDeploymentOperationContext; + Aws::Crt::Map m_modelNameToErrorResponse; + }; + } // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp index 21926939a..01bcd3300 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -9,405 +9,430 @@ #include #include -namespace Aws { -namespace Greengrass { -GreengrassCoreIpcClient::GreengrassCoreIpcClient( - Aws::Crt::Io::ClientBootstrap &clientBootstrap, - Aws::Crt::Allocator *allocator) noexcept - : m_connection(allocator), m_clientBootstrap(clientBootstrap), - m_allocator(allocator), m_asyncLaunchMode(std::launch::deferred) { - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidTokenError"), - InvalidTokenError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#FailedUpdateConditionCheckError"), - FailedUpdateConditionCheckError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ConflictError"), - ConflictError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ComponentNotFoundError"), - ComponentNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidCredentialError"), - InvalidCredentialError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ResourceNotFoundError"), - ResourceNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArtifactsDirectoryPathError"), - InvalidArtifactsDirectoryPathError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidRecipeDirectoryPathError"), - InvalidRecipeDirectoryPathError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidClientDeviceAuthTokenError"), - InvalidClientDeviceAuthTokenError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), - InvalidArgumentsError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#ServiceError"), - ServiceError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#UnauthorizedError"), - UnauthorizedError::s_allocateFromPayload); -} - -std::future GreengrassCoreIpcClient::Connect( - ConnectionLifecycleHandler &lifecycleHandler, - const ConnectionConfig &connectionConfig) noexcept { - return m_connection.Connect(connectionConfig, &lifecycleHandler, - m_clientBootstrap); -} - -void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } - -void GreengrassCoreIpcClient::WithLaunchMode(std::launch mode) noexcept { - m_asyncLaunchMode = mode; -} - -GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToIoTCore( - std::shared_ptr streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewResumeComponent() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( - std::shared_ptr - streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel - .m_subscribeToConfigurationUpdateOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewPutComponentMetric() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_putComponentMetricOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToValidateConfigurationUpdates( - std::shared_ptr - streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel - .m_subscribeToValidateConfigurationUpdatesOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetConfiguration() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToTopic( - std::shared_ptr streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetComponentDetails() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetClientDeviceAuthToken() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_getClientDeviceAuthTokenOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewPublishToTopic() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToCertificateUpdates( - std::shared_ptr - streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel - .m_subscribeToCertificateUpdatesOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewVerifyClientDeviceIdentity() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_verifyClientDeviceIdentityOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewAuthorizeClientDeviceAction() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_authorizeClientDeviceActionOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewListComponents() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetThingShadow() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept { - auto operation = - Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_sendConfigurationValidityReportOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_validateAuthorizationTokenOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewRestartComponent() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_getLocalDeploymentStatusOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewGetSecretValue() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewUpdateState() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel - .m_listNamedShadowsForThingOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( - std::shared_ptr - streamHandler) noexcept { - return Aws::Crt::MakeShared( - m_allocator, m_connection, std::move(streamHandler), - m_greengrassCoreIpcServiceModel - .m_subscribeToComponentUpdatesOperationContext, - m_allocator); -} - -std::shared_ptr -GreengrassCoreIpcClient::NewListLocalDeployments() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewStopComponent() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewPauseComponent() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -std::shared_ptr -GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept { - auto operation = Aws::Crt::MakeShared( - m_allocator, m_connection, - m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, - m_allocator); - operation->WithLaunchMode(m_asyncLaunchMode); - return operation; -} - -} // namespace Greengrass +namespace Aws +{ + namespace Greengrass + { + GreengrassCoreIpcClient::GreengrassCoreIpcClient( + Aws::Crt::Io::ClientBootstrap &clientBootstrap, + Aws::Crt::Allocator *allocator) noexcept + : m_connection(allocator), m_clientBootstrap(clientBootstrap), m_allocator(allocator), + m_asyncLaunchMode(std::launch::deferred) + { + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidTokenError"), InvalidTokenError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#FailedUpdateConditionCheckError"), + FailedUpdateConditionCheckError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ConflictError"), ConflictError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ComponentNotFoundError"), + ComponentNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidCredentialError"), + InvalidCredentialError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ResourceNotFoundError"), ResourceNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArtifactsDirectoryPathError"), + InvalidArtifactsDirectoryPathError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidRecipeDirectoryPathError"), + InvalidRecipeDirectoryPathError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidClientDeviceAuthTokenError"), + InvalidClientDeviceAuthTokenError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), InvalidArgumentsError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#ServiceError"), ServiceError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#UnauthorizedError"), UnauthorizedError::s_allocateFromPayload); + } + + std::future GreengrassCoreIpcClient::Connect( + ConnectionLifecycleHandler &lifecycleHandler, + const ConnectionConfig &connectionConfig) noexcept + { + return m_connection.Connect(connectionConfig, &lifecycleHandler, m_clientBootstrap); + } + + void GreengrassCoreIpcClient::Close() noexcept { m_connection.Close(); } + + void GreengrassCoreIpcClient::WithLaunchMode(std::launch mode) noexcept { m_asyncLaunchMode = mode; } + + GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } + + std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToIoTCore( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient::NewResumeComponent() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewSubscribeToConfigurationUpdate( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToConfigurationUpdateOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewPutComponentMetric() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_putComponentMetricOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewSubscribeToValidateConfigurationUpdates( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToValidateConfigurationUpdatesOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient::NewGetConfiguration() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToTopic( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient::NewGetComponentDetails() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewGetClientDeviceAuthToken() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getClientDeviceAuthTokenOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewPublishToTopic() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewSubscribeToCertificateUpdates( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToCertificateUpdatesOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewVerifyClientDeviceIdentity() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_verifyClientDeviceIdentityOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewAuthorizeClientDeviceAction() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_authorizeClientDeviceActionOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewListComponents() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewGetThingShadow() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewSendConfigurationValidityReport() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_sendConfigurationValidityReportOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewValidateAuthorizationToken() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_validateAuthorizationTokenOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewRestartComponent() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewGetLocalDeploymentStatus() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getLocalDeploymentStatusOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewGetSecretValue() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewUpdateState() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, m_connection, m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient:: + NewListNamedShadowsForThing() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_listNamedShadowsForThingOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( + std::shared_ptr streamHandler) noexcept + { + return Aws::Crt::MakeShared( + m_allocator, + m_connection, + std::move(streamHandler), + m_greengrassCoreIpcServiceModel.m_subscribeToComponentUpdatesOperationContext, + m_allocator); + } + + std::shared_ptr GreengrassCoreIpcClient::NewListLocalDeployments() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewStopComponent() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewPauseComponent() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + std::shared_ptr GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept + { + auto operation = Aws::Crt::MakeShared( + m_allocator, + m_connection, + m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, + m_allocator); + operation->WithLaunchMode(m_asyncLaunchMode); + return operation; + } + + } // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index 3103e94c9..a3f68537b 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -8,8517 +8,8794 @@ #include #include -namespace Aws { -namespace Greengrass { -void MessageContext::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topic.has_value()) { - payloadObject.WithString("topic", m_topic.value()); - } -} - -void MessageContext::s_loadFromJsonView( - MessageContext &messageContext, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topic")) { - messageContext.m_topic = - Aws::Crt::Optional(jsonView.GetString("topic")); - } -} - -const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; - -Aws::Crt::String MessageContext::GetModelName() const noexcept { - return MessageContext::MODEL_NAME; -} - -Aws::Crt::ScopedResource -MessageContext::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - MessageContext::s_customDeleter); - shape->m_allocator = allocator; - MessageContext::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void MessageContext::s_customDeleter(MessageContext *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SystemResourceLimits::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_memory.has_value()) { - payloadObject.WithInt64("memory", m_memory.value()); - } - if (m_cpus.has_value()) { - payloadObject.WithDouble("cpus", m_cpus.value()); - } -} - -void SystemResourceLimits::s_loadFromJsonView( - SystemResourceLimits &systemResourceLimits, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("memory")) { - systemResourceLimits.m_memory = - Aws::Crt::Optional(jsonView.GetInt64("memory")); - } - if (jsonView.ValueExists("cpus")) { - systemResourceLimits.m_cpus = - Aws::Crt::Optional(jsonView.GetDouble("cpus")); - } -} - -const char *SystemResourceLimits::MODEL_NAME = - "aws.greengrass#SystemResourceLimits"; - -Aws::Crt::String SystemResourceLimits::GetModelName() const noexcept { - return SystemResourceLimits::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SystemResourceLimits::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SystemResourceLimits::s_customDeleter); - shape->m_allocator = allocator; - SystemResourceLimits::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SystemResourceLimits::s_customDeleter( - SystemResourceLimits *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ValidateConfigurationUpdateEvent::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_configuration.has_value()) { - payloadObject.WithObject("configuration", m_configuration.value()); - } - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } -} - -void ValidateConfigurationUpdateEvent::s_loadFromJsonView( - ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("configuration")) { - validateConfigurationUpdateEvent.m_configuration = - Aws::Crt::Optional( - jsonView.GetJsonObject("configuration").Materialize()); - } - if (jsonView.ValueExists("deploymentId")) { - validateConfigurationUpdateEvent.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } -} - -const char *ValidateConfigurationUpdateEvent::MODEL_NAME = - "aws.greengrass#ValidateConfigurationUpdateEvent"; - -Aws::Crt::String -ValidateConfigurationUpdateEvent::GetModelName() const noexcept { - return ValidateConfigurationUpdateEvent::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ValidateConfigurationUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateConfigurationUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - ValidateConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ValidateConfigurationUpdateEvent::s_customDeleter( - ValidateConfigurationUpdateEvent *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void MQTTMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topicName.has_value()) { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void MQTTMessage::s_loadFromJsonView( - MQTTMessage &mQTTMessage, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topicName")) { - mQTTMessage.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - mQTTMessage.m_payload = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; - -Aws::Crt::String MQTTMessage::GetModelName() const noexcept { - return MQTTMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -MQTTMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), MQTTMessage::s_customDeleter); - shape->m_allocator = allocator; - MQTTMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void MQTTMessage::s_customDeleter(MQTTMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ConfigurationUpdateEvent::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } -} - -void ConfigurationUpdateEvent::s_loadFromJsonView( - ConfigurationUpdateEvent &configurationUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - configurationUpdateEvent.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) { - configurationUpdateEvent.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : - jsonView.GetArray("keyPath")) { - Aws::Crt::Optional keyPathItem; - keyPathItem = - Aws::Crt::Optional(keyPathJsonView.AsString()); - configurationUpdateEvent.m_keyPath.value().push_back(keyPathItem.value()); - } - } -} - -const char *ConfigurationUpdateEvent::MODEL_NAME = - "aws.greengrass#ConfigurationUpdateEvent"; - -Aws::Crt::String ConfigurationUpdateEvent::GetModelName() const noexcept { - return ConfigurationUpdateEvent::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ConfigurationUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ConfigurationUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ConfigurationUpdateEvent::s_customDeleter( - ConfigurationUpdateEvent *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PostComponentUpdateEvent::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } -} - -void PostComponentUpdateEvent::s_loadFromJsonView( - PostComponentUpdateEvent &postComponentUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - postComponentUpdateEvent.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } -} - -const char *PostComponentUpdateEvent::MODEL_NAME = - "aws.greengrass#PostComponentUpdateEvent"; - -Aws::Crt::String PostComponentUpdateEvent::GetModelName() const noexcept { - return PostComponentUpdateEvent::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PostComponentUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PostComponentUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - PostComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PostComponentUpdateEvent::s_customDeleter( - PostComponentUpdateEvent *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PreComponentUpdateEvent::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_isGgcRestarting.has_value()) { - payloadObject.WithBool("isGgcRestarting", m_isGgcRestarting.value()); - } -} - -void PreComponentUpdateEvent::s_loadFromJsonView( - PreComponentUpdateEvent &preComponentUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - preComponentUpdateEvent.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("isGgcRestarting")) { - preComponentUpdateEvent.m_isGgcRestarting = - Aws::Crt::Optional(jsonView.GetBool("isGgcRestarting")); - } -} - -const char *PreComponentUpdateEvent::MODEL_NAME = - "aws.greengrass#PreComponentUpdateEvent"; - -Aws::Crt::String PreComponentUpdateEvent::GetModelName() const noexcept { - return PreComponentUpdateEvent::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PreComponentUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PreComponentUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - PreComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PreComponentUpdateEvent::s_customDeleter( - PreComponentUpdateEvent *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CertificateUpdate::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_privateKey.has_value()) { - payloadObject.WithString("privateKey", m_privateKey.value()); - } - if (m_publicKey.has_value()) { - payloadObject.WithString("publicKey", m_publicKey.value()); - } - if (m_certificate.has_value()) { - payloadObject.WithString("certificate", m_certificate.value()); - } - if (m_caCertificates.has_value()) { - Aws::Crt::JsonObject cACertificates; - Aws::Crt::Vector cACertificatesJsonArray; - for (const auto &cACertificatesItem : m_caCertificates.value()) { - Aws::Crt::JsonObject cACertificatesJsonArrayItem; - cACertificatesJsonArrayItem.AsString(cACertificatesItem); - cACertificatesJsonArray.emplace_back( - std::move(cACertificatesJsonArrayItem)); - } - cACertificates.AsArray(std::move(cACertificatesJsonArray)); - payloadObject.WithObject("caCertificates", std::move(cACertificates)); - } -} - -void CertificateUpdate::s_loadFromJsonView( - CertificateUpdate &certificateUpdate, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("privateKey")) { - certificateUpdate.m_privateKey = - Aws::Crt::Optional(jsonView.GetString("privateKey")); - } - if (jsonView.ValueExists("publicKey")) { - certificateUpdate.m_publicKey = - Aws::Crt::Optional(jsonView.GetString("publicKey")); - } - if (jsonView.ValueExists("certificate")) { - certificateUpdate.m_certificate = - Aws::Crt::Optional(jsonView.GetString("certificate")); - } - if (jsonView.ValueExists("caCertificates")) { - certificateUpdate.m_caCertificates = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &cACertificatesJsonView : - jsonView.GetArray("caCertificates")) { - Aws::Crt::Optional cACertificatesItem; - cACertificatesItem = Aws::Crt::Optional( - cACertificatesJsonView.AsString()); - certificateUpdate.m_caCertificates.value().push_back( - cACertificatesItem.value()); - } - } -} - -const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; - -Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { - return CertificateUpdate::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CertificateUpdate::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CertificateUpdate::s_customDeleter); - shape->m_allocator = allocator; - CertificateUpdate::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CertificateUpdate::s_customDeleter(CertificateUpdate *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void Metric::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_name.has_value()) { - payloadObject.WithString("name", m_name.value()); - } - if (m_unit.has_value()) { - payloadObject.WithString("unit", m_unit.value()); - } - if (m_value.has_value()) { - payloadObject.WithDouble("value", m_value.value()); - } -} - -void Metric::s_loadFromJsonView(Metric &metric, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("name")) { - metric.m_name = - Aws::Crt::Optional(jsonView.GetString("name")); - } - if (jsonView.ValueExists("unit")) { - metric.m_unit = - Aws::Crt::Optional(jsonView.GetString("unit")); - } - if (jsonView.ValueExists("value")) { - metric.m_value = Aws::Crt::Optional(jsonView.GetDouble("value")); - } -} - -void Metric::SetUnit(MetricUnitType unit) noexcept { - switch (unit) { - case METRIC_UNIT_TYPE_BYTES: - m_unit = Aws::Crt::String("BYTES"); - break; - case METRIC_UNIT_TYPE_BYTES_PER_SECOND: - m_unit = Aws::Crt::String("BYTES_PER_SECOND"); - break; - case METRIC_UNIT_TYPE_COUNT: - m_unit = Aws::Crt::String("COUNT"); - break; - case METRIC_UNIT_TYPE_COUNT_PER_SECOND: - m_unit = Aws::Crt::String("COUNT_PER_SECOND"); - break; - case METRIC_UNIT_TYPE_MEGABYTES: - m_unit = Aws::Crt::String("MEGABYTES"); - break; - case METRIC_UNIT_TYPE_SECONDS: - m_unit = Aws::Crt::String("SECONDS"); - break; - default: - break; - } -} - -Aws::Crt::Optional Metric::GetUnit() noexcept { - if (!m_unit.has_value()) - return Aws::Crt::Optional(); - if (m_unit.value() == Aws::Crt::String("BYTES")) { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES); - } - if (m_unit.value() == Aws::Crt::String("BYTES_PER_SECOND")) { - return Aws::Crt::Optional( - METRIC_UNIT_TYPE_BYTES_PER_SECOND); - } - if (m_unit.value() == Aws::Crt::String("COUNT")) { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT); - } - if (m_unit.value() == Aws::Crt::String("COUNT_PER_SECOND")) { - return Aws::Crt::Optional( - METRIC_UNIT_TYPE_COUNT_PER_SECOND); - } - if (m_unit.value() == Aws::Crt::String("MEGABYTES")) { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_MEGABYTES); - } - if (m_unit.value() == Aws::Crt::String("SECONDS")) { - return Aws::Crt::Optional(METRIC_UNIT_TYPE_SECONDS); - } - - return Aws::Crt::Optional(); -} - -const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; - -Aws::Crt::String Metric::GetModelName() const noexcept { - return Metric::MODEL_NAME; -} - -Aws::Crt::ScopedResource -Metric::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), - Metric::s_customDeleter); - shape->m_allocator = allocator; - Metric::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void Metric::s_customDeleter(Metric *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void BinaryMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - if (m_message.value().size() > 0) { - payloadObject.WithString("message", - Aws::Crt::Base64Encode(m_message.value())); - } - } - if (m_context.has_value()) { - Aws::Crt::JsonObject messageContextValue; - m_context.value().SerializeToJsonObject(messageContextValue); - payloadObject.WithObject("context", std::move(messageContextValue)); - } -} - -void BinaryMessage::s_loadFromJsonView( - BinaryMessage &binaryMessage, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - if (jsonView.GetString("message").size() > 0) { - binaryMessage.m_message = Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("message"))); - } - } - if (jsonView.ValueExists("context")) { - binaryMessage.m_context = MessageContext(); - MessageContext::s_loadFromJsonView(binaryMessage.m_context.value(), - jsonView.GetJsonObject("context")); - } -} - -const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; - -Aws::Crt::String BinaryMessage::GetModelName() const noexcept { - return BinaryMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -BinaryMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), BinaryMessage::s_customDeleter); - shape->m_allocator = allocator; - BinaryMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void BinaryMessage::s_customDeleter(BinaryMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void JsonMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithObject("message", m_message.value()); - } - if (m_context.has_value()) { - Aws::Crt::JsonObject messageContextValue; - m_context.value().SerializeToJsonObject(messageContextValue); - payloadObject.WithObject("context", std::move(messageContextValue)); - } -} - -void JsonMessage::s_loadFromJsonView( - JsonMessage &jsonMessage, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - jsonMessage.m_message = Aws::Crt::Optional( - jsonView.GetJsonObject("message").Materialize()); - } - if (jsonView.ValueExists("context")) { - jsonMessage.m_context = MessageContext(); - MessageContext::s_loadFromJsonView(jsonMessage.m_context.value(), - jsonView.GetJsonObject("context")); - } -} - -const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; - -Aws::Crt::String JsonMessage::GetModelName() const noexcept { - return JsonMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -JsonMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), JsonMessage::s_customDeleter); - shape->m_allocator = allocator; - JsonMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void JsonMessage::s_customDeleter(JsonMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void MQTTCredential::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_clientId.has_value()) { - payloadObject.WithString("clientId", m_clientId.value()); - } - if (m_certificatePem.has_value()) { - payloadObject.WithString("certificatePem", m_certificatePem.value()); - } - if (m_username.has_value()) { - payloadObject.WithString("username", m_username.value()); - } - if (m_password.has_value()) { - payloadObject.WithString("password", m_password.value()); - } -} - -void MQTTCredential::s_loadFromJsonView( - MQTTCredential &mQTTCredential, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("clientId")) { - mQTTCredential.m_clientId = - Aws::Crt::Optional(jsonView.GetString("clientId")); - } - if (jsonView.ValueExists("certificatePem")) { - mQTTCredential.m_certificatePem = Aws::Crt::Optional( - jsonView.GetString("certificatePem")); - } - if (jsonView.ValueExists("username")) { - mQTTCredential.m_username = - Aws::Crt::Optional(jsonView.GetString("username")); - } - if (jsonView.ValueExists("password")) { - mQTTCredential.m_password = - Aws::Crt::Optional(jsonView.GetString("password")); - } -} - -const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; - -Aws::Crt::String MQTTCredential::GetModelName() const noexcept { - return MQTTCredential::MODEL_NAME; -} - -Aws::Crt::ScopedResource -MQTTCredential::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - MQTTCredential::s_customDeleter); - shape->m_allocator = allocator; - MQTTCredential::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void MQTTCredential::s_customDeleter(MQTTCredential *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void RunWithInfo::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_posixUser.has_value()) { - payloadObject.WithString("posixUser", m_posixUser.value()); - } - if (m_windowsUser.has_value()) { - payloadObject.WithString("windowsUser", m_windowsUser.value()); - } - if (m_systemResourceLimits.has_value()) { - Aws::Crt::JsonObject systemResourceLimitsValue; - m_systemResourceLimits.value().SerializeToJsonObject( - systemResourceLimitsValue); - payloadObject.WithObject("systemResourceLimits", - std::move(systemResourceLimitsValue)); - } -} - -void RunWithInfo::s_loadFromJsonView( - RunWithInfo &runWithInfo, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("posixUser")) { - runWithInfo.m_posixUser = - Aws::Crt::Optional(jsonView.GetString("posixUser")); - } - if (jsonView.ValueExists("windowsUser")) { - runWithInfo.m_windowsUser = - Aws::Crt::Optional(jsonView.GetString("windowsUser")); - } - if (jsonView.ValueExists("systemResourceLimits")) { - runWithInfo.m_systemResourceLimits = SystemResourceLimits(); - SystemResourceLimits::s_loadFromJsonView( - runWithInfo.m_systemResourceLimits.value(), - jsonView.GetJsonObject("systemResourceLimits")); - } -} - -const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; - -Aws::Crt::String RunWithInfo::GetModelName() const noexcept { - return RunWithInfo::MODEL_NAME; -} - -Aws::Crt::ScopedResource -RunWithInfo::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), RunWithInfo::s_customDeleter); - shape->m_allocator = allocator; - RunWithInfo::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void RunWithInfo::s_customDeleter(RunWithInfo *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ClientDeviceCredential::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE && - m_clientDeviceCertificate.has_value()) { - payloadObject.WithString("clientDeviceCertificate", - m_clientDeviceCertificate.value()); - } -} - -void ClientDeviceCredential::s_loadFromJsonView( - ClientDeviceCredential &clientDeviceCredential, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("clientDeviceCertificate")) { - clientDeviceCredential.m_clientDeviceCertificate = - Aws::Crt::Optional( - jsonView.GetString("clientDeviceCertificate")); - clientDeviceCredential.m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; - } -} - -ClientDeviceCredential &ClientDeviceCredential::operator=( - const ClientDeviceCredential &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) { - m_clientDeviceCertificate = objectToCopy.m_clientDeviceCertificate; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *ClientDeviceCredential::MODEL_NAME = - "aws.greengrass#ClientDeviceCredential"; - -Aws::Crt::String ClientDeviceCredential::GetModelName() const noexcept { - return ClientDeviceCredential::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ClientDeviceCredential::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ClientDeviceCredential::s_customDeleter); - shape->m_allocator = allocator; - ClientDeviceCredential::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ClientDeviceCredential::s_customDeleter( - ClientDeviceCredential *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ValidateConfigurationUpdateEvents::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && - m_validateConfigurationUpdateEvent.has_value()) { - Aws::Crt::JsonObject validateConfigurationUpdateEventValue; - m_validateConfigurationUpdateEvent.value().SerializeToJsonObject( - validateConfigurationUpdateEventValue); - payloadObject.WithObject("validateConfigurationUpdateEvent", - std::move(validateConfigurationUpdateEventValue)); - } -} - -void ValidateConfigurationUpdateEvents::s_loadFromJsonView( - ValidateConfigurationUpdateEvents &validateConfigurationUpdateEvents, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("validateConfigurationUpdateEvent")) { - validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent = - ValidateConfigurationUpdateEvent(); - ValidateConfigurationUpdateEvent::s_loadFromJsonView( - validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent - .value(), - jsonView.GetJsonObject("validateConfigurationUpdateEvent")); - validateConfigurationUpdateEvents.m_chosenMember = - TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; - } -} - -ValidateConfigurationUpdateEvents &ValidateConfigurationUpdateEvents::operator=( - const ValidateConfigurationUpdateEvents &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) { - m_validateConfigurationUpdateEvent = - objectToCopy.m_validateConfigurationUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *ValidateConfigurationUpdateEvents::MODEL_NAME = - "aws.greengrass#ValidateConfigurationUpdateEvents"; - -Aws::Crt::String -ValidateConfigurationUpdateEvents::GetModelName() const noexcept { - return ValidateConfigurationUpdateEvents::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ValidateConfigurationUpdateEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateConfigurationUpdateEvents::s_customDeleter); - shape->m_allocator = allocator; - ValidateConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ValidateConfigurationUpdateEvents::s_customDeleter( - ValidateConfigurationUpdateEvents *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscriptionResponseMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) { - Aws::Crt::JsonObject jsonMessageValue; - m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); - payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); - } else if (m_chosenMember == TAG_BINARY_MESSAGE && - m_binaryMessage.has_value()) { - Aws::Crt::JsonObject binaryMessageValue; - m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); - payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); - } -} - -void SubscriptionResponseMessage::s_loadFromJsonView( - SubscriptionResponseMessage &subscriptionResponseMessage, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("jsonMessage")) { - subscriptionResponseMessage.m_jsonMessage = JsonMessage(); - JsonMessage::s_loadFromJsonView( - subscriptionResponseMessage.m_jsonMessage.value(), - jsonView.GetJsonObject("jsonMessage")); - subscriptionResponseMessage.m_chosenMember = TAG_JSON_MESSAGE; - } else if (jsonView.ValueExists("binaryMessage")) { - subscriptionResponseMessage.m_binaryMessage = BinaryMessage(); - BinaryMessage::s_loadFromJsonView( - subscriptionResponseMessage.m_binaryMessage.value(), - jsonView.GetJsonObject("binaryMessage")); - subscriptionResponseMessage.m_chosenMember = TAG_BINARY_MESSAGE; - } -} - -SubscriptionResponseMessage &SubscriptionResponseMessage::operator=( - const SubscriptionResponseMessage &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) { - m_jsonMessage = objectToCopy.m_jsonMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) { - m_binaryMessage = objectToCopy.m_binaryMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *SubscriptionResponseMessage::MODEL_NAME = - "aws.greengrass#SubscriptionResponseMessage"; - -Aws::Crt::String SubscriptionResponseMessage::GetModelName() const noexcept { - return SubscriptionResponseMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscriptionResponseMessage::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscriptionResponseMessage::s_customDeleter); - shape->m_allocator = allocator; - SubscriptionResponseMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscriptionResponseMessage::s_customDeleter( - SubscriptionResponseMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void IoTCoreMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_MESSAGE && m_message.has_value()) { - Aws::Crt::JsonObject mQTTMessageValue; - m_message.value().SerializeToJsonObject(mQTTMessageValue); - payloadObject.WithObject("message", std::move(mQTTMessageValue)); - } -} - -void IoTCoreMessage::s_loadFromJsonView( - IoTCoreMessage &ioTCoreMessage, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - ioTCoreMessage.m_message = MQTTMessage(); - MQTTMessage::s_loadFromJsonView(ioTCoreMessage.m_message.value(), - jsonView.GetJsonObject("message")); - ioTCoreMessage.m_chosenMember = TAG_MESSAGE; - } -} - -IoTCoreMessage & -IoTCoreMessage::operator=(const IoTCoreMessage &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_MESSAGE) { - m_message = objectToCopy.m_message; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; - -Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { - return IoTCoreMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -IoTCoreMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - IoTCoreMessage::s_customDeleter); - shape->m_allocator = allocator; - IoTCoreMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void IoTCoreMessage::s_customDeleter(IoTCoreMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ConfigurationUpdateEvents::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT && - m_configurationUpdateEvent.has_value()) { - Aws::Crt::JsonObject configurationUpdateEventValue; - m_configurationUpdateEvent.value().SerializeToJsonObject( - configurationUpdateEventValue); - payloadObject.WithObject("configurationUpdateEvent", - std::move(configurationUpdateEventValue)); - } -} - -void ConfigurationUpdateEvents::s_loadFromJsonView( - ConfigurationUpdateEvents &configurationUpdateEvents, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("configurationUpdateEvent")) { - configurationUpdateEvents.m_configurationUpdateEvent = - ConfigurationUpdateEvent(); - ConfigurationUpdateEvent::s_loadFromJsonView( - configurationUpdateEvents.m_configurationUpdateEvent.value(), - jsonView.GetJsonObject("configurationUpdateEvent")); - configurationUpdateEvents.m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; - } -} - -ConfigurationUpdateEvents &ConfigurationUpdateEvents::operator=( - const ConfigurationUpdateEvents &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) { - m_configurationUpdateEvent = objectToCopy.m_configurationUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *ConfigurationUpdateEvents::MODEL_NAME = - "aws.greengrass#ConfigurationUpdateEvents"; - -Aws::Crt::String ConfigurationUpdateEvents::GetModelName() const noexcept { - return ConfigurationUpdateEvents::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ConfigurationUpdateEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ConfigurationUpdateEvents::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ConfigurationUpdateEvents::s_customDeleter( - ConfigurationUpdateEvents *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ComponentUpdatePolicyEvents::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_PRE_UPDATE_EVENT && m_preUpdateEvent.has_value()) { - Aws::Crt::JsonObject preComponentUpdateEventValue; - m_preUpdateEvent.value().SerializeToJsonObject( - preComponentUpdateEventValue); - payloadObject.WithObject("preUpdateEvent", - std::move(preComponentUpdateEventValue)); - } else if (m_chosenMember == TAG_POST_UPDATE_EVENT && - m_postUpdateEvent.has_value()) { - Aws::Crt::JsonObject postComponentUpdateEventValue; - m_postUpdateEvent.value().SerializeToJsonObject( - postComponentUpdateEventValue); - payloadObject.WithObject("postUpdateEvent", - std::move(postComponentUpdateEventValue)); - } -} - -void ComponentUpdatePolicyEvents::s_loadFromJsonView( - ComponentUpdatePolicyEvents &componentUpdatePolicyEvents, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("preUpdateEvent")) { - componentUpdatePolicyEvents.m_preUpdateEvent = PreComponentUpdateEvent(); - PreComponentUpdateEvent::s_loadFromJsonView( - componentUpdatePolicyEvents.m_preUpdateEvent.value(), - jsonView.GetJsonObject("preUpdateEvent")); - componentUpdatePolicyEvents.m_chosenMember = TAG_PRE_UPDATE_EVENT; - } else if (jsonView.ValueExists("postUpdateEvent")) { - componentUpdatePolicyEvents.m_postUpdateEvent = PostComponentUpdateEvent(); - PostComponentUpdateEvent::s_loadFromJsonView( - componentUpdatePolicyEvents.m_postUpdateEvent.value(), - jsonView.GetJsonObject("postUpdateEvent")); - componentUpdatePolicyEvents.m_chosenMember = TAG_POST_UPDATE_EVENT; - } -} - -ComponentUpdatePolicyEvents &ComponentUpdatePolicyEvents::operator=( - const ComponentUpdatePolicyEvents &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_PRE_UPDATE_EVENT) { - m_preUpdateEvent = objectToCopy.m_preUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } else if (objectToCopy.m_chosenMember == TAG_POST_UPDATE_EVENT) { - m_postUpdateEvent = objectToCopy.m_postUpdateEvent; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *ComponentUpdatePolicyEvents::MODEL_NAME = - "aws.greengrass#ComponentUpdatePolicyEvents"; - -Aws::Crt::String ComponentUpdatePolicyEvents::GetModelName() const noexcept { - return ComponentUpdatePolicyEvents::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ComponentUpdatePolicyEvents::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ComponentUpdatePolicyEvents::s_customDeleter); - shape->m_allocator = allocator; - ComponentUpdatePolicyEvents::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ComponentUpdatePolicyEvents::s_customDeleter( - ComponentUpdatePolicyEvents *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CertificateUpdateEvent::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_CERTIFICATE_UPDATE && - m_certificateUpdate.has_value()) { - Aws::Crt::JsonObject certificateUpdateValue; - m_certificateUpdate.value().SerializeToJsonObject(certificateUpdateValue); - payloadObject.WithObject("certificateUpdate", - std::move(certificateUpdateValue)); - } -} - -void CertificateUpdateEvent::s_loadFromJsonView( - CertificateUpdateEvent &certificateUpdateEvent, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("certificateUpdate")) { - certificateUpdateEvent.m_certificateUpdate = CertificateUpdate(); - CertificateUpdate::s_loadFromJsonView( - certificateUpdateEvent.m_certificateUpdate.value(), - jsonView.GetJsonObject("certificateUpdate")); - certificateUpdateEvent.m_chosenMember = TAG_CERTIFICATE_UPDATE; - } -} - -CertificateUpdateEvent &CertificateUpdateEvent::operator=( - const CertificateUpdateEvent &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_CERTIFICATE_UPDATE) { - m_certificateUpdate = objectToCopy.m_certificateUpdate; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *CertificateUpdateEvent::MODEL_NAME = - "aws.greengrass#CertificateUpdateEvent"; - -Aws::Crt::String CertificateUpdateEvent::GetModelName() const noexcept { - return CertificateUpdateEvent::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CertificateUpdateEvent::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CertificateUpdateEvent::s_customDeleter); - shape->m_allocator = allocator; - CertificateUpdateEvent::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CertificateUpdateEvent::s_customDeleter( - CertificateUpdateEvent *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CertificateOptions::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_certificateType.has_value()) { - payloadObject.WithString("certificateType", m_certificateType.value()); - } -} - -void CertificateOptions::s_loadFromJsonView( - CertificateOptions &certificateOptions, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("certificateType")) { - certificateOptions.m_certificateType = Aws::Crt::Optional( - jsonView.GetString("certificateType")); - } -} - -void CertificateOptions::SetCertificateType( - CertificateType certificateType) noexcept { - switch (certificateType) { - case CERTIFICATE_TYPE_SERVER: - m_certificateType = Aws::Crt::String("SERVER"); - break; - default: - break; - } -} - -Aws::Crt::Optional -CertificateOptions::GetCertificateType() noexcept { - if (!m_certificateType.has_value()) - return Aws::Crt::Optional(); - if (m_certificateType.value() == Aws::Crt::String("SERVER")) { - return Aws::Crt::Optional(CERTIFICATE_TYPE_SERVER); - } - - return Aws::Crt::Optional(); -} - -const char *CertificateOptions::MODEL_NAME = - "aws.greengrass#CertificateOptions"; - -Aws::Crt::String CertificateOptions::GetModelName() const noexcept { - return CertificateOptions::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CertificateOptions::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CertificateOptions::s_customDeleter); - shape->m_allocator = allocator; - CertificateOptions::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CertificateOptions::s_customDeleter(CertificateOptions *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ConfigurationValidityReport::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_status.has_value()) { - payloadObject.WithString("status", m_status.value()); - } - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void ConfigurationValidityReport::s_loadFromJsonView( - ConfigurationValidityReport &configurationValidityReport, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("status")) { - configurationValidityReport.m_status = - Aws::Crt::Optional(jsonView.GetString("status")); - } - if (jsonView.ValueExists("deploymentId")) { - configurationValidityReport.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("message")) { - configurationValidityReport.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -void ConfigurationValidityReport::SetStatus( - ConfigurationValidityStatus status) noexcept { - switch (status) { - case CONFIGURATION_VALIDITY_STATUS_ACCEPTED: - m_status = Aws::Crt::String("ACCEPTED"); - break; - case CONFIGURATION_VALIDITY_STATUS_REJECTED: - m_status = Aws::Crt::String("REJECTED"); - break; - default: - break; - } -} - -Aws::Crt::Optional -ConfigurationValidityReport::GetStatus() noexcept { - if (!m_status.has_value()) - return Aws::Crt::Optional(); - if (m_status.value() == Aws::Crt::String("ACCEPTED")) { - return Aws::Crt::Optional( - CONFIGURATION_VALIDITY_STATUS_ACCEPTED); - } - if (m_status.value() == Aws::Crt::String("REJECTED")) { - return Aws::Crt::Optional( - CONFIGURATION_VALIDITY_STATUS_REJECTED); - } - - return Aws::Crt::Optional(); -} - -const char *ConfigurationValidityReport::MODEL_NAME = - "aws.greengrass#ConfigurationValidityReport"; - -Aws::Crt::String ConfigurationValidityReport::GetModelName() const noexcept { - return ConfigurationValidityReport::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ConfigurationValidityReport::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ConfigurationValidityReport::s_customDeleter); - shape->m_allocator = allocator; - ConfigurationValidityReport::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ConfigurationValidityReport::s_customDeleter( - ConfigurationValidityReport *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PublishMessage::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) { - Aws::Crt::JsonObject jsonMessageValue; - m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); - payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); - } else if (m_chosenMember == TAG_BINARY_MESSAGE && - m_binaryMessage.has_value()) { - Aws::Crt::JsonObject binaryMessageValue; - m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); - payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); - } -} - -void PublishMessage::s_loadFromJsonView( - PublishMessage &publishMessage, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("jsonMessage")) { - publishMessage.m_jsonMessage = JsonMessage(); - JsonMessage::s_loadFromJsonView(publishMessage.m_jsonMessage.value(), - jsonView.GetJsonObject("jsonMessage")); - publishMessage.m_chosenMember = TAG_JSON_MESSAGE; - } else if (jsonView.ValueExists("binaryMessage")) { - publishMessage.m_binaryMessage = BinaryMessage(); - BinaryMessage::s_loadFromJsonView(publishMessage.m_binaryMessage.value(), - jsonView.GetJsonObject("binaryMessage")); - publishMessage.m_chosenMember = TAG_BINARY_MESSAGE; - } -} - -PublishMessage & -PublishMessage::operator=(const PublishMessage &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) { - m_jsonMessage = objectToCopy.m_jsonMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) { - m_binaryMessage = objectToCopy.m_binaryMessage; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; - -Aws::Crt::String PublishMessage::GetModelName() const noexcept { - return PublishMessage::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PublishMessage::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PublishMessage::s_customDeleter); - shape->m_allocator = allocator; - PublishMessage::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PublishMessage::s_customDeleter(PublishMessage *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SecretValue::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_SECRET_STRING && m_secretString.has_value()) { - payloadObject.WithString("secretString", m_secretString.value()); - } else if (m_chosenMember == TAG_SECRET_BINARY && - m_secretBinary.has_value()) { - if (m_secretBinary.value().size() > 0) { - payloadObject.WithString("secretBinary", - Aws::Crt::Base64Encode(m_secretBinary.value())); - } - } -} - -void SecretValue::s_loadFromJsonView( - SecretValue &secretValue, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("secretString")) { - secretValue.m_secretString = Aws::Crt::Optional( - jsonView.GetString("secretString")); - secretValue.m_chosenMember = TAG_SECRET_STRING; - } else if (jsonView.ValueExists("secretBinary")) { - if (jsonView.GetString("secretBinary").size() > 0) { - secretValue.m_secretBinary = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("secretBinary"))); - } - secretValue.m_chosenMember = TAG_SECRET_BINARY; - } -} - -SecretValue &SecretValue::operator=(const SecretValue &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_SECRET_STRING) { - m_secretString = objectToCopy.m_secretString; - m_chosenMember = objectToCopy.m_chosenMember; - } else if (objectToCopy.m_chosenMember == TAG_SECRET_BINARY) { - m_secretBinary = objectToCopy.m_secretBinary; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; - -Aws::Crt::String SecretValue::GetModelName() const noexcept { - return SecretValue::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SecretValue::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), SecretValue::s_customDeleter); - shape->m_allocator = allocator; - SecretValue::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SecretValue::s_customDeleter(SecretValue *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void LocalDeployment::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_status.has_value()) { - payloadObject.WithString("status", m_status.value()); - } -} - -void LocalDeployment::s_loadFromJsonView( - LocalDeployment &localDeployment, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - localDeployment.m_deploymentId = Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("status")) { - localDeployment.m_status = - Aws::Crt::Optional(jsonView.GetString("status")); - } -} - -void LocalDeployment::SetStatus(DeploymentStatus status) noexcept { - switch (status) { - case DEPLOYMENT_STATUS_QUEUED: - m_status = Aws::Crt::String("QUEUED"); - break; - case DEPLOYMENT_STATUS_IN_PROGRESS: - m_status = Aws::Crt::String("IN_PROGRESS"); - break; - case DEPLOYMENT_STATUS_SUCCEEDED: - m_status = Aws::Crt::String("SUCCEEDED"); - break; - case DEPLOYMENT_STATUS_FAILED: - m_status = Aws::Crt::String("FAILED"); - break; - default: - break; - } -} - -Aws::Crt::Optional LocalDeployment::GetStatus() noexcept { - if (!m_status.has_value()) - return Aws::Crt::Optional(); - if (m_status.value() == Aws::Crt::String("QUEUED")) { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_QUEUED); - } - if (m_status.value() == Aws::Crt::String("IN_PROGRESS")) { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_IN_PROGRESS); - } - if (m_status.value() == Aws::Crt::String("SUCCEEDED")) { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_SUCCEEDED); - } - if (m_status.value() == Aws::Crt::String("FAILED")) { - return Aws::Crt::Optional(DEPLOYMENT_STATUS_FAILED); - } - - return Aws::Crt::Optional(); -} - -const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; - -Aws::Crt::String LocalDeployment::GetModelName() const noexcept { - return LocalDeployment::MODEL_NAME; -} - -Aws::Crt::ScopedResource -LocalDeployment::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - LocalDeployment::s_customDeleter); - shape->m_allocator = allocator; - LocalDeployment::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void LocalDeployment::s_customDeleter(LocalDeployment *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ComponentDetails::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_version.has_value()) { - payloadObject.WithString("version", m_version.value()); - } - if (m_state.has_value()) { - payloadObject.WithString("state", m_state.value()); - } - if (m_configuration.has_value()) { - payloadObject.WithObject("configuration", m_configuration.value()); - } -} - -void ComponentDetails::s_loadFromJsonView( - ComponentDetails &componentDetails, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - componentDetails.m_componentName = Aws::Crt::Optional( - jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("version")) { - componentDetails.m_version = - Aws::Crt::Optional(jsonView.GetString("version")); - } - if (jsonView.ValueExists("state")) { - componentDetails.m_state = - Aws::Crt::Optional(jsonView.GetString("state")); - } - if (jsonView.ValueExists("configuration")) { - componentDetails.m_configuration = Aws::Crt::Optional( - jsonView.GetJsonObject("configuration").Materialize()); - } -} - -void ComponentDetails::SetState(LifecycleState state) noexcept { - switch (state) { - case LIFECYCLE_STATE_RUNNING: - m_state = Aws::Crt::String("RUNNING"); - break; - case LIFECYCLE_STATE_ERRORED: - m_state = Aws::Crt::String("ERRORED"); - break; - case LIFECYCLE_STATE_NEW: - m_state = Aws::Crt::String("NEW"); - break; - case LIFECYCLE_STATE_FINISHED: - m_state = Aws::Crt::String("FINISHED"); - break; - case LIFECYCLE_STATE_INSTALLED: - m_state = Aws::Crt::String("INSTALLED"); - break; - case LIFECYCLE_STATE_BROKEN: - m_state = Aws::Crt::String("BROKEN"); - break; - case LIFECYCLE_STATE_STARTING: - m_state = Aws::Crt::String("STARTING"); - break; - case LIFECYCLE_STATE_STOPPING: - m_state = Aws::Crt::String("STOPPING"); - break; - default: - break; - } -} - -Aws::Crt::Optional ComponentDetails::GetState() noexcept { - if (!m_state.has_value()) - return Aws::Crt::Optional(); - if (m_state.value() == Aws::Crt::String("RUNNING")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_RUNNING); - } - if (m_state.value() == Aws::Crt::String("ERRORED")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_ERRORED); - } - if (m_state.value() == Aws::Crt::String("NEW")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_NEW); - } - if (m_state.value() == Aws::Crt::String("FINISHED")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_FINISHED); - } - if (m_state.value() == Aws::Crt::String("INSTALLED")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_INSTALLED); - } - if (m_state.value() == Aws::Crt::String("BROKEN")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_BROKEN); - } - if (m_state.value() == Aws::Crt::String("STARTING")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_STARTING); - } - if (m_state.value() == Aws::Crt::String("STOPPING")) { - return Aws::Crt::Optional(LIFECYCLE_STATE_STOPPING); - } - - return Aws::Crt::Optional(); -} - -const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; - -Aws::Crt::String ComponentDetails::GetModelName() const noexcept { - return ComponentDetails::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ComponentDetails::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ComponentDetails::s_customDeleter); - shape->m_allocator = allocator; - ComponentDetails::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ComponentDetails::s_customDeleter(ComponentDetails *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CredentialDocument::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_chosenMember == TAG_MQTT_CREDENTIAL && m_mqttCredential.has_value()) { - Aws::Crt::JsonObject mQTTCredentialValue; - m_mqttCredential.value().SerializeToJsonObject(mQTTCredentialValue); - payloadObject.WithObject("mqttCredential", std::move(mQTTCredentialValue)); - } -} - -void CredentialDocument::s_loadFromJsonView( - CredentialDocument &credentialDocument, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("mqttCredential")) { - credentialDocument.m_mqttCredential = MQTTCredential(); - MQTTCredential::s_loadFromJsonView( - credentialDocument.m_mqttCredential.value(), - jsonView.GetJsonObject("mqttCredential")); - credentialDocument.m_chosenMember = TAG_MQTT_CREDENTIAL; - } -} - -CredentialDocument & -CredentialDocument::operator=(const CredentialDocument &objectToCopy) noexcept { - if (objectToCopy.m_chosenMember == TAG_MQTT_CREDENTIAL) { - m_mqttCredential = objectToCopy.m_mqttCredential; - m_chosenMember = objectToCopy.m_chosenMember; - } - return *this; -} - -const char *CredentialDocument::MODEL_NAME = - "aws.greengrass#CredentialDocument"; - -Aws::Crt::String CredentialDocument::GetModelName() const noexcept { - return CredentialDocument::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CredentialDocument::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CredentialDocument::s_customDeleter); - shape->m_allocator = allocator; - CredentialDocument::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CredentialDocument::s_customDeleter(CredentialDocument *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void VerifyClientDeviceIdentityResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_isValidClientDevice.has_value()) { - payloadObject.WithBool("isValidClientDevice", - m_isValidClientDevice.value()); - } -} - -void VerifyClientDeviceIdentityResponse::s_loadFromJsonView( - VerifyClientDeviceIdentityResponse &verifyClientDeviceIdentityResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("isValidClientDevice")) { - verifyClientDeviceIdentityResponse.m_isValidClientDevice = - Aws::Crt::Optional(jsonView.GetBool("isValidClientDevice")); - } -} - -const char *VerifyClientDeviceIdentityResponse::MODEL_NAME = - "aws.greengrass#VerifyClientDeviceIdentityResponse"; - -Aws::Crt::String -VerifyClientDeviceIdentityResponse::GetModelName() const noexcept { - return VerifyClientDeviceIdentityResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -VerifyClientDeviceIdentityResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - VerifyClientDeviceIdentityResponse::s_customDeleter); - shape->m_allocator = allocator; - VerifyClientDeviceIdentityResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void VerifyClientDeviceIdentityResponse::s_customDeleter( - VerifyClientDeviceIdentityResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void VerifyClientDeviceIdentityRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_credential.has_value()) { - Aws::Crt::JsonObject clientDeviceCredentialValue; - m_credential.value().SerializeToJsonObject(clientDeviceCredentialValue); - payloadObject.WithObject("credential", - std::move(clientDeviceCredentialValue)); - } -} - -void VerifyClientDeviceIdentityRequest::s_loadFromJsonView( - VerifyClientDeviceIdentityRequest &verifyClientDeviceIdentityRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("credential")) { - verifyClientDeviceIdentityRequest.m_credential = ClientDeviceCredential(); - ClientDeviceCredential::s_loadFromJsonView( - verifyClientDeviceIdentityRequest.m_credential.value(), - jsonView.GetJsonObject("credential")); - } -} - -const char *VerifyClientDeviceIdentityRequest::MODEL_NAME = - "aws.greengrass#VerifyClientDeviceIdentityRequest"; - -Aws::Crt::String -VerifyClientDeviceIdentityRequest::GetModelName() const noexcept { - return VerifyClientDeviceIdentityRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -VerifyClientDeviceIdentityRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - VerifyClientDeviceIdentityRequest::s_customDeleter); - shape->m_allocator = allocator; - VerifyClientDeviceIdentityRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void VerifyClientDeviceIdentityRequest::s_customDeleter( - VerifyClientDeviceIdentityRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void InvalidTokenError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidTokenError::s_loadFromJsonView( - InvalidTokenError &invalidTokenError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidTokenError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; - -Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { - return InvalidTokenError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidTokenError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidTokenError::s_customDeleter); - shape->m_allocator = allocator; - InvalidTokenError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidTokenError::s_customDeleter(InvalidTokenError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void ValidateAuthorizationTokenResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_isValid.has_value()) { - payloadObject.WithBool("isValid", m_isValid.value()); - } -} - -void ValidateAuthorizationTokenResponse::s_loadFromJsonView( - ValidateAuthorizationTokenResponse &validateAuthorizationTokenResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("isValid")) { - validateAuthorizationTokenResponse.m_isValid = - Aws::Crt::Optional(jsonView.GetBool("isValid")); - } -} - -const char *ValidateAuthorizationTokenResponse::MODEL_NAME = - "aws.greengrass#ValidateAuthorizationTokenResponse"; - -Aws::Crt::String -ValidateAuthorizationTokenResponse::GetModelName() const noexcept { - return ValidateAuthorizationTokenResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ValidateAuthorizationTokenResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateAuthorizationTokenResponse::s_customDeleter); - shape->m_allocator = allocator; - ValidateAuthorizationTokenResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ValidateAuthorizationTokenResponse::s_customDeleter( - ValidateAuthorizationTokenResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ValidateAuthorizationTokenRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_token.has_value()) { - payloadObject.WithString("token", m_token.value()); - } -} - -void ValidateAuthorizationTokenRequest::s_loadFromJsonView( - ValidateAuthorizationTokenRequest &validateAuthorizationTokenRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("token")) { - validateAuthorizationTokenRequest.m_token = - Aws::Crt::Optional(jsonView.GetString("token")); - } -} - -const char *ValidateAuthorizationTokenRequest::MODEL_NAME = - "aws.greengrass#ValidateAuthorizationTokenRequest"; - -Aws::Crt::String -ValidateAuthorizationTokenRequest::GetModelName() const noexcept { - return ValidateAuthorizationTokenRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ValidateAuthorizationTokenRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ValidateAuthorizationTokenRequest::s_customDeleter); - shape->m_allocator = allocator; - ValidateAuthorizationTokenRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ValidateAuthorizationTokenRequest::s_customDeleter( - ValidateAuthorizationTokenRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void UpdateThingShadowResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void UpdateThingShadowResponse::s_loadFromJsonView( - UpdateThingShadowResponse &updateThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - updateThingShadowResponse.m_payload = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -const char *UpdateThingShadowResponse::MODEL_NAME = - "aws.greengrass#UpdateThingShadowResponse"; - -Aws::Crt::String UpdateThingShadowResponse::GetModelName() const noexcept { - return UpdateThingShadowResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateThingShadowResponse::s_customDeleter( - UpdateThingShadowResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void UpdateThingShadowRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_thingName.has_value()) { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) { - payloadObject.WithString("shadowName", m_shadowName.value()); - } - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void UpdateThingShadowRequest::s_loadFromJsonView( - UpdateThingShadowRequest &updateThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("thingName")) { - updateThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) { - updateThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - updateThingShadowRequest.m_payload = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -const char *UpdateThingShadowRequest::MODEL_NAME = - "aws.greengrass#UpdateThingShadowRequest"; - -Aws::Crt::String UpdateThingShadowRequest::GetModelName() const noexcept { - return UpdateThingShadowRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateThingShadowRequest::s_customDeleter( - UpdateThingShadowRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void UpdateStateResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void UpdateStateResponse::s_loadFromJsonView( - UpdateStateResponse &updateStateResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)updateStateResponse; - (void)jsonView; -} - -const char *UpdateStateResponse::MODEL_NAME = - "aws.greengrass#UpdateStateResponse"; - -Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { - return UpdateStateResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateStateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateStateResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateStateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateStateResponse::s_customDeleter(UpdateStateResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void UpdateStateRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_state.has_value()) { - payloadObject.WithString("state", m_state.value()); - } -} - -void UpdateStateRequest::s_loadFromJsonView( - UpdateStateRequest &updateStateRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("state")) { - updateStateRequest.m_state = - Aws::Crt::Optional(jsonView.GetString("state")); - } -} - -void UpdateStateRequest::SetState(ReportedLifecycleState state) noexcept { - switch (state) { - case REPORTED_LIFECYCLE_STATE_RUNNING: - m_state = Aws::Crt::String("RUNNING"); - break; - case REPORTED_LIFECYCLE_STATE_ERRORED: - m_state = Aws::Crt::String("ERRORED"); - break; - default: - break; - } -} - -Aws::Crt::Optional -UpdateStateRequest::GetState() noexcept { - if (!m_state.has_value()) - return Aws::Crt::Optional(); - if (m_state.value() == Aws::Crt::String("RUNNING")) { - return Aws::Crt::Optional( - REPORTED_LIFECYCLE_STATE_RUNNING); - } - if (m_state.value() == Aws::Crt::String("ERRORED")) { - return Aws::Crt::Optional( - REPORTED_LIFECYCLE_STATE_ERRORED); - } - - return Aws::Crt::Optional(); -} - -const char *UpdateStateRequest::MODEL_NAME = - "aws.greengrass#UpdateStateRequest"; - -Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { - return UpdateStateRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateStateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateStateRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateStateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateStateRequest::s_customDeleter(UpdateStateRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void FailedUpdateConditionCheckError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void FailedUpdateConditionCheckError::s_loadFromJsonView( - FailedUpdateConditionCheckError &failedUpdateConditionCheckError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - failedUpdateConditionCheckError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *FailedUpdateConditionCheckError::MODEL_NAME = - "aws.greengrass#FailedUpdateConditionCheckError"; - -Aws::Crt::String -FailedUpdateConditionCheckError::GetModelName() const noexcept { - return FailedUpdateConditionCheckError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -FailedUpdateConditionCheckError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - FailedUpdateConditionCheckError::s_customDeleter); - shape->m_allocator = allocator; - FailedUpdateConditionCheckError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void FailedUpdateConditionCheckError::s_customDeleter( - FailedUpdateConditionCheckError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void ConflictError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void ConflictError::s_loadFromJsonView( - ConflictError &conflictError, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - conflictError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; - -Aws::Crt::String ConflictError::GetModelName() const noexcept { - return ConflictError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ConflictError::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ConflictError::s_customDeleter); - shape->m_allocator = allocator; - ConflictError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void ConflictError::s_customDeleter(ConflictError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void UpdateConfigurationResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void UpdateConfigurationResponse::s_loadFromJsonView( - UpdateConfigurationResponse &updateConfigurationResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)updateConfigurationResponse; - (void)jsonView; -} - -const char *UpdateConfigurationResponse::MODEL_NAME = - "aws.greengrass#UpdateConfigurationResponse"; - -Aws::Crt::String UpdateConfigurationResponse::GetModelName() const noexcept { - return UpdateConfigurationResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateConfigurationResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateConfigurationResponse::s_customDeleter); - shape->m_allocator = allocator; - UpdateConfigurationResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateConfigurationResponse::s_customDeleter( - UpdateConfigurationResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void UpdateConfigurationRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_keyPath.has_value()) { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } - if (m_timestamp.has_value()) { - payloadObject.WithDouble("timestamp", - m_timestamp.value().SecondsWithMSPrecision()); - } - if (m_valueToMerge.has_value()) { - payloadObject.WithObject("valueToMerge", m_valueToMerge.value()); - } -} - -void UpdateConfigurationRequest::s_loadFromJsonView( - UpdateConfigurationRequest &updateConfigurationRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("keyPath")) { - updateConfigurationRequest.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : - jsonView.GetArray("keyPath")) { - Aws::Crt::Optional keyPathItem; - keyPathItem = - Aws::Crt::Optional(keyPathJsonView.AsString()); - updateConfigurationRequest.m_keyPath.value().push_back( - keyPathItem.value()); - } - } - if (jsonView.ValueExists("timestamp")) { - updateConfigurationRequest.m_timestamp = - Aws::Crt::Optional( - Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); - } - if (jsonView.ValueExists("valueToMerge")) { - updateConfigurationRequest.m_valueToMerge = - Aws::Crt::Optional( - jsonView.GetJsonObject("valueToMerge").Materialize()); - } -} - -const char *UpdateConfigurationRequest::MODEL_NAME = - "aws.greengrass#UpdateConfigurationRequest"; - -Aws::Crt::String UpdateConfigurationRequest::GetModelName() const noexcept { - return UpdateConfigurationRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UpdateConfigurationRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UpdateConfigurationRequest::s_customDeleter); - shape->m_allocator = allocator; - UpdateConfigurationRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void UpdateConfigurationRequest::s_customDeleter( - UpdateConfigurationRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToValidateConfigurationUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesResponse - &subscribeToValidateConfigurationUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToValidateConfigurationUpdatesResponse; - (void)jsonView; -} - -const char *SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"; - -Aws::Crt::String -SubscribeToValidateConfigurationUpdatesResponse::GetModelName() const noexcept { - return SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource - shape(Aws::Crt::New( - allocator), - SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView(*shape, - jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter( - SubscribeToValidateConfigurationUpdatesResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToValidateConfigurationUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView( - SubscribeToValidateConfigurationUpdatesRequest - &subscribeToValidateConfigurationUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToValidateConfigurationUpdatesRequest; - (void)jsonView; -} - -const char *SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"; - -Aws::Crt::String -SubscribeToValidateConfigurationUpdatesRequest::GetModelName() const noexcept { - return SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToValidateConfigurationUpdatesRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource - shape(Aws::Crt::New( - allocator), - SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView(*shape, - jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter( - SubscribeToValidateConfigurationUpdatesRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToTopicResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topicName.has_value()) { - payloadObject.WithString("topicName", m_topicName.value()); - } -} - -void SubscribeToTopicResponse::s_loadFromJsonView( - SubscribeToTopicResponse &subscribeToTopicResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topicName")) { - subscribeToTopicResponse.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } -} - -const char *SubscribeToTopicResponse::MODEL_NAME = - "aws.greengrass#SubscribeToTopicResponse"; - -Aws::Crt::String SubscribeToTopicResponse::GetModelName() const noexcept { - return SubscribeToTopicResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToTopicResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToTopicResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToTopicResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToTopicResponse::s_customDeleter( - SubscribeToTopicResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToTopicRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topic.has_value()) { - payloadObject.WithString("topic", m_topic.value()); - } - if (m_receiveMode.has_value()) { - payloadObject.WithString("receiveMode", m_receiveMode.value()); - } -} - -void SubscribeToTopicRequest::s_loadFromJsonView( - SubscribeToTopicRequest &subscribeToTopicRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topic")) { - subscribeToTopicRequest.m_topic = - Aws::Crt::Optional(jsonView.GetString("topic")); - } - if (jsonView.ValueExists("receiveMode")) { - subscribeToTopicRequest.m_receiveMode = - Aws::Crt::Optional(jsonView.GetString("receiveMode")); - } -} - -void SubscribeToTopicRequest::SetReceiveMode(ReceiveMode receiveMode) noexcept { - switch (receiveMode) { - case RECEIVE_MODE_RECEIVE_ALL_MESSAGES: - m_receiveMode = Aws::Crt::String("RECEIVE_ALL_MESSAGES"); - break; - case RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS: - m_receiveMode = Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS"); - break; - default: - break; - } -} - -Aws::Crt::Optional -SubscribeToTopicRequest::GetReceiveMode() noexcept { - if (!m_receiveMode.has_value()) - return Aws::Crt::Optional(); - if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_ALL_MESSAGES")) { - return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_ALL_MESSAGES); - } - if (m_receiveMode.value() == - Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS")) { - return Aws::Crt::Optional( - RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS); - } - - return Aws::Crt::Optional(); -} - -const char *SubscribeToTopicRequest::MODEL_NAME = - "aws.greengrass#SubscribeToTopicRequest"; - -Aws::Crt::String SubscribeToTopicRequest::GetModelName() const noexcept { - return SubscribeToTopicRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToTopicRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToTopicRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToTopicRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToTopicRequest::s_customDeleter( - SubscribeToTopicRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToIoTCoreResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToIoTCoreResponse::s_loadFromJsonView( - SubscribeToIoTCoreResponse &subscribeToIoTCoreResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToIoTCoreResponse; - (void)jsonView; -} - -const char *SubscribeToIoTCoreResponse::MODEL_NAME = - "aws.greengrass#SubscribeToIoTCoreResponse"; - -Aws::Crt::String SubscribeToIoTCoreResponse::GetModelName() const noexcept { - return SubscribeToIoTCoreResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToIoTCoreResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToIoTCoreResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToIoTCoreResponse::s_customDeleter( - SubscribeToIoTCoreResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToIoTCoreRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topicName.has_value()) { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_qos.has_value()) { - payloadObject.WithString("qos", m_qos.value()); - } -} - -void SubscribeToIoTCoreRequest::s_loadFromJsonView( - SubscribeToIoTCoreRequest &subscribeToIoTCoreRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topicName")) { - subscribeToIoTCoreRequest.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("qos")) { - subscribeToIoTCoreRequest.m_qos = - Aws::Crt::Optional(jsonView.GetString("qos")); - } -} - -void SubscribeToIoTCoreRequest::SetQos(QOS qos) noexcept { - switch (qos) { - case QOS_AT_MOST_ONCE: - m_qos = Aws::Crt::String("0"); - break; - case QOS_AT_LEAST_ONCE: - m_qos = Aws::Crt::String("1"); - break; - default: - break; - } -} - -Aws::Crt::Optional SubscribeToIoTCoreRequest::GetQos() noexcept { - if (!m_qos.has_value()) - return Aws::Crt::Optional(); - if (m_qos.value() == Aws::Crt::String("0")) { - return Aws::Crt::Optional(QOS_AT_MOST_ONCE); - } - if (m_qos.value() == Aws::Crt::String("1")) { - return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); - } - - return Aws::Crt::Optional(); -} - -const char *SubscribeToIoTCoreRequest::MODEL_NAME = - "aws.greengrass#SubscribeToIoTCoreRequest"; - -Aws::Crt::String SubscribeToIoTCoreRequest::GetModelName() const noexcept { - return SubscribeToIoTCoreRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToIoTCoreRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToIoTCoreRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToIoTCoreRequest::s_customDeleter( - SubscribeToIoTCoreRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToConfigurationUpdateResponse::s_loadFromJsonView( - SubscribeToConfigurationUpdateResponse - &subscribeToConfigurationUpdateResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToConfigurationUpdateResponse; - (void)jsonView; -} - -const char *SubscribeToConfigurationUpdateResponse::MODEL_NAME = - "aws.greengrass#SubscribeToConfigurationUpdateResponse"; - -Aws::Crt::String -SubscribeToConfigurationUpdateResponse::GetModelName() const noexcept { - return SubscribeToConfigurationUpdateResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToConfigurationUpdateResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToConfigurationUpdateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToConfigurationUpdateResponse::s_customDeleter( - SubscribeToConfigurationUpdateResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } -} - -void SubscribeToConfigurationUpdateRequest::s_loadFromJsonView( - SubscribeToConfigurationUpdateRequest - &subscribeToConfigurationUpdateRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - subscribeToConfigurationUpdateRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) { - subscribeToConfigurationUpdateRequest.m_keyPath = - Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : - jsonView.GetArray("keyPath")) { - Aws::Crt::Optional keyPathItem; - keyPathItem = - Aws::Crt::Optional(keyPathJsonView.AsString()); - subscribeToConfigurationUpdateRequest.m_keyPath.value().push_back( - keyPathItem.value()); - } - } -} - -const char *SubscribeToConfigurationUpdateRequest::MODEL_NAME = - "aws.greengrass#SubscribeToConfigurationUpdateRequest"; - -Aws::Crt::String -SubscribeToConfigurationUpdateRequest::GetModelName() const noexcept { - return SubscribeToConfigurationUpdateRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToConfigurationUpdateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToConfigurationUpdateRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToConfigurationUpdateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToConfigurationUpdateRequest::s_customDeleter( - SubscribeToConfigurationUpdateRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToComponentUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToComponentUpdatesResponse::s_loadFromJsonView( - SubscribeToComponentUpdatesResponse &subscribeToComponentUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToComponentUpdatesResponse; - (void)jsonView; -} - -const char *SubscribeToComponentUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToComponentUpdatesResponse"; - -Aws::Crt::String -SubscribeToComponentUpdatesResponse::GetModelName() const noexcept { - return SubscribeToComponentUpdatesResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToComponentUpdatesResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToComponentUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToComponentUpdatesResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToComponentUpdatesResponse::s_customDeleter( - SubscribeToComponentUpdatesResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToComponentUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToComponentUpdatesRequest::s_loadFromJsonView( - SubscribeToComponentUpdatesRequest &subscribeToComponentUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToComponentUpdatesRequest; - (void)jsonView; -} - -const char *SubscribeToComponentUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToComponentUpdatesRequest"; - -Aws::Crt::String -SubscribeToComponentUpdatesRequest::GetModelName() const noexcept { - return SubscribeToComponentUpdatesRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToComponentUpdatesRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToComponentUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToComponentUpdatesRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToComponentUpdatesRequest::s_customDeleter( - SubscribeToComponentUpdatesRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SubscribeToCertificateUpdatesResponse::s_loadFromJsonView( - SubscribeToCertificateUpdatesResponse - &subscribeToCertificateUpdatesResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)subscribeToCertificateUpdatesResponse; - (void)jsonView; -} - -const char *SubscribeToCertificateUpdatesResponse::MODEL_NAME = - "aws.greengrass#SubscribeToCertificateUpdatesResponse"; - -Aws::Crt::String -SubscribeToCertificateUpdatesResponse::GetModelName() const noexcept { - return SubscribeToCertificateUpdatesResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToCertificateUpdatesResponse::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToCertificateUpdatesResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToCertificateUpdatesResponse::s_customDeleter( - SubscribeToCertificateUpdatesResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_certificateOptions.has_value()) { - Aws::Crt::JsonObject certificateOptionsValue; - m_certificateOptions.value().SerializeToJsonObject(certificateOptionsValue); - payloadObject.WithObject("certificateOptions", - std::move(certificateOptionsValue)); - } -} - -void SubscribeToCertificateUpdatesRequest::s_loadFromJsonView( - SubscribeToCertificateUpdatesRequest &subscribeToCertificateUpdatesRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("certificateOptions")) { - subscribeToCertificateUpdatesRequest.m_certificateOptions = - CertificateOptions(); - CertificateOptions::s_loadFromJsonView( - subscribeToCertificateUpdatesRequest.m_certificateOptions.value(), - jsonView.GetJsonObject("certificateOptions")); - } -} - -const char *SubscribeToCertificateUpdatesRequest::MODEL_NAME = - "aws.greengrass#SubscribeToCertificateUpdatesRequest"; - -Aws::Crt::String -SubscribeToCertificateUpdatesRequest::GetModelName() const noexcept { - return SubscribeToCertificateUpdatesRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SubscribeToCertificateUpdatesRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SubscribeToCertificateUpdatesRequest::s_customDeleter); - shape->m_allocator = allocator; - SubscribeToCertificateUpdatesRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SubscribeToCertificateUpdatesRequest::s_customDeleter( - SubscribeToCertificateUpdatesRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void StopComponentResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_stopStatus.has_value()) { - payloadObject.WithString("stopStatus", m_stopStatus.value()); - } - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void StopComponentResponse::s_loadFromJsonView( - StopComponentResponse &stopComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("stopStatus")) { - stopComponentResponse.m_stopStatus = - Aws::Crt::Optional(jsonView.GetString("stopStatus")); - } - if (jsonView.ValueExists("message")) { - stopComponentResponse.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -void StopComponentResponse::SetStopStatus(RequestStatus stopStatus) noexcept { - switch (stopStatus) { - case REQUEST_STATUS_SUCCEEDED: - m_stopStatus = Aws::Crt::String("SUCCEEDED"); - break; - case REQUEST_STATUS_FAILED: - m_stopStatus = Aws::Crt::String("FAILED"); - break; - default: - break; - } -} - -Aws::Crt::Optional -StopComponentResponse::GetStopStatus() noexcept { - if (!m_stopStatus.has_value()) - return Aws::Crt::Optional(); - if (m_stopStatus.value() == Aws::Crt::String("SUCCEEDED")) { - return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); - } - if (m_stopStatus.value() == Aws::Crt::String("FAILED")) { - return Aws::Crt::Optional(REQUEST_STATUS_FAILED); - } - - return Aws::Crt::Optional(); -} - -const char *StopComponentResponse::MODEL_NAME = - "aws.greengrass#StopComponentResponse"; - -Aws::Crt::String StopComponentResponse::GetModelName() const noexcept { - return StopComponentResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -StopComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - StopComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - StopComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void StopComponentResponse::s_customDeleter( - StopComponentResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void StopComponentRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } -} - -void StopComponentRequest::s_loadFromJsonView( - StopComponentRequest &stopComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - stopComponentRequest.m_componentName = Aws::Crt::Optional( - jsonView.GetString("componentName")); - } -} - -const char *StopComponentRequest::MODEL_NAME = - "aws.greengrass#StopComponentRequest"; - -Aws::Crt::String StopComponentRequest::GetModelName() const noexcept { - return StopComponentRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -StopComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - StopComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - StopComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void StopComponentRequest::s_customDeleter( - StopComponentRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SendConfigurationValidityReportResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void SendConfigurationValidityReportResponse::s_loadFromJsonView( - SendConfigurationValidityReportResponse - &sendConfigurationValidityReportResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)sendConfigurationValidityReportResponse; - (void)jsonView; -} - -const char *SendConfigurationValidityReportResponse::MODEL_NAME = - "aws.greengrass#SendConfigurationValidityReportResponse"; - -Aws::Crt::String -SendConfigurationValidityReportResponse::GetModelName() const noexcept { - return SendConfigurationValidityReportResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SendConfigurationValidityReportResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SendConfigurationValidityReportResponse::s_customDeleter); - shape->m_allocator = allocator; - SendConfigurationValidityReportResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SendConfigurationValidityReportResponse::s_customDeleter( - SendConfigurationValidityReportResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SendConfigurationValidityReportRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_configurationValidityReport.has_value()) { - Aws::Crt::JsonObject configurationValidityReportValue; - m_configurationValidityReport.value().SerializeToJsonObject( - configurationValidityReportValue); - payloadObject.WithObject("configurationValidityReport", - std::move(configurationValidityReportValue)); - } -} - -void SendConfigurationValidityReportRequest::s_loadFromJsonView( - SendConfigurationValidityReportRequest - &sendConfigurationValidityReportRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("configurationValidityReport")) { - sendConfigurationValidityReportRequest.m_configurationValidityReport = - ConfigurationValidityReport(); - ConfigurationValidityReport::s_loadFromJsonView( - sendConfigurationValidityReportRequest.m_configurationValidityReport - .value(), - jsonView.GetJsonObject("configurationValidityReport")); - } -} - -const char *SendConfigurationValidityReportRequest::MODEL_NAME = - "aws.greengrass#SendConfigurationValidityReportRequest"; - -Aws::Crt::String -SendConfigurationValidityReportRequest::GetModelName() const noexcept { - return SendConfigurationValidityReportRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -SendConfigurationValidityReportRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - SendConfigurationValidityReportRequest::s_customDeleter); - shape->m_allocator = allocator; - SendConfigurationValidityReportRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void SendConfigurationValidityReportRequest::s_customDeleter( - SendConfigurationValidityReportRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ResumeComponentResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void ResumeComponentResponse::s_loadFromJsonView( - ResumeComponentResponse &resumeComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)resumeComponentResponse; - (void)jsonView; -} - -const char *ResumeComponentResponse::MODEL_NAME = - "aws.greengrass#ResumeComponentResponse"; - -Aws::Crt::String ResumeComponentResponse::GetModelName() const noexcept { - return ResumeComponentResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ResumeComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ResumeComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - ResumeComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ResumeComponentResponse::s_customDeleter( - ResumeComponentResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ResumeComponentRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } -} - -void ResumeComponentRequest::s_loadFromJsonView( - ResumeComponentRequest &resumeComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - resumeComponentRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } -} - -const char *ResumeComponentRequest::MODEL_NAME = - "aws.greengrass#ResumeComponentRequest"; - -Aws::Crt::String ResumeComponentRequest::GetModelName() const noexcept { - return ResumeComponentRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ResumeComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ResumeComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - ResumeComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ResumeComponentRequest::s_customDeleter( - ResumeComponentRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ComponentNotFoundError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void ComponentNotFoundError::s_loadFromJsonView( - ComponentNotFoundError &componentNotFoundError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - componentNotFoundError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *ComponentNotFoundError::MODEL_NAME = - "aws.greengrass#ComponentNotFoundError"; - -Aws::Crt::String ComponentNotFoundError::GetModelName() const noexcept { - return ComponentNotFoundError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ComponentNotFoundError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ComponentNotFoundError::s_customDeleter); - shape->m_allocator = allocator; - ComponentNotFoundError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void ComponentNotFoundError::s_customDeleter( - ComponentNotFoundError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void RestartComponentResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_restartStatus.has_value()) { - payloadObject.WithString("restartStatus", m_restartStatus.value()); - } - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void RestartComponentResponse::s_loadFromJsonView( - RestartComponentResponse &restartComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("restartStatus")) { - restartComponentResponse.m_restartStatus = - Aws::Crt::Optional( - jsonView.GetString("restartStatus")); - } - if (jsonView.ValueExists("message")) { - restartComponentResponse.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -void RestartComponentResponse::SetRestartStatus( - RequestStatus restartStatus) noexcept { - switch (restartStatus) { - case REQUEST_STATUS_SUCCEEDED: - m_restartStatus = Aws::Crt::String("SUCCEEDED"); - break; - case REQUEST_STATUS_FAILED: - m_restartStatus = Aws::Crt::String("FAILED"); - break; - default: - break; - } -} - -Aws::Crt::Optional -RestartComponentResponse::GetRestartStatus() noexcept { - if (!m_restartStatus.has_value()) - return Aws::Crt::Optional(); - if (m_restartStatus.value() == Aws::Crt::String("SUCCEEDED")) { - return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); - } - if (m_restartStatus.value() == Aws::Crt::String("FAILED")) { - return Aws::Crt::Optional(REQUEST_STATUS_FAILED); - } - - return Aws::Crt::Optional(); -} - -const char *RestartComponentResponse::MODEL_NAME = - "aws.greengrass#RestartComponentResponse"; - -Aws::Crt::String RestartComponentResponse::GetModelName() const noexcept { - return RestartComponentResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -RestartComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - RestartComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - RestartComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void RestartComponentResponse::s_customDeleter( - RestartComponentResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void RestartComponentRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } -} - -void RestartComponentRequest::s_loadFromJsonView( - RestartComponentRequest &restartComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - restartComponentRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } -} - -const char *RestartComponentRequest::MODEL_NAME = - "aws.greengrass#RestartComponentRequest"; - -Aws::Crt::String RestartComponentRequest::GetModelName() const noexcept { - return RestartComponentRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -RestartComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - RestartComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - RestartComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void RestartComponentRequest::s_customDeleter( - RestartComponentRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PutComponentMetricResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void PutComponentMetricResponse::s_loadFromJsonView( - PutComponentMetricResponse &putComponentMetricResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)putComponentMetricResponse; - (void)jsonView; -} - -const char *PutComponentMetricResponse::MODEL_NAME = - "aws.greengrass#PutComponentMetricResponse"; - -Aws::Crt::String PutComponentMetricResponse::GetModelName() const noexcept { - return PutComponentMetricResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PutComponentMetricResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PutComponentMetricResponse::s_customDeleter); - shape->m_allocator = allocator; - PutComponentMetricResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PutComponentMetricResponse::s_customDeleter( - PutComponentMetricResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PutComponentMetricRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_metrics.has_value()) { - Aws::Crt::JsonObject metricsList; - Aws::Crt::Vector metricsListJsonArray; - for (const auto &metricsListItem : m_metrics.value()) { - Aws::Crt::JsonObject metricsListJsonArrayItem; - metricsListItem.SerializeToJsonObject(metricsListJsonArrayItem); - metricsListJsonArray.emplace_back(std::move(metricsListJsonArrayItem)); - } - metricsList.AsArray(std::move(metricsListJsonArray)); - payloadObject.WithObject("metrics", std::move(metricsList)); - } -} - -void PutComponentMetricRequest::s_loadFromJsonView( - PutComponentMetricRequest &putComponentMetricRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("metrics")) { - putComponentMetricRequest.m_metrics = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &metricsListJsonView : - jsonView.GetArray("metrics")) { - Aws::Crt::Optional metricsListItem; - metricsListItem = Metric(); - Metric::s_loadFromJsonView(metricsListItem.value(), metricsListJsonView); - putComponentMetricRequest.m_metrics.value().push_back( - metricsListItem.value()); - } - } -} - -const char *PutComponentMetricRequest::MODEL_NAME = - "aws.greengrass#PutComponentMetricRequest"; - -Aws::Crt::String PutComponentMetricRequest::GetModelName() const noexcept { - return PutComponentMetricRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PutComponentMetricRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PutComponentMetricRequest::s_customDeleter); - shape->m_allocator = allocator; - PutComponentMetricRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PutComponentMetricRequest::s_customDeleter( - PutComponentMetricRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PublishToTopicResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void PublishToTopicResponse::s_loadFromJsonView( - PublishToTopicResponse &publishToTopicResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)publishToTopicResponse; - (void)jsonView; -} - -const char *PublishToTopicResponse::MODEL_NAME = - "aws.greengrass#PublishToTopicResponse"; - -Aws::Crt::String PublishToTopicResponse::GetModelName() const noexcept { - return PublishToTopicResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PublishToTopicResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PublishToTopicResponse::s_customDeleter); - shape->m_allocator = allocator; - PublishToTopicResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PublishToTopicResponse::s_customDeleter( - PublishToTopicResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PublishToTopicRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topic.has_value()) { - payloadObject.WithString("topic", m_topic.value()); - } - if (m_publishMessage.has_value()) { - Aws::Crt::JsonObject publishMessageValue; - m_publishMessage.value().SerializeToJsonObject(publishMessageValue); - payloadObject.WithObject("publishMessage", std::move(publishMessageValue)); - } -} - -void PublishToTopicRequest::s_loadFromJsonView( - PublishToTopicRequest &publishToTopicRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topic")) { - publishToTopicRequest.m_topic = - Aws::Crt::Optional(jsonView.GetString("topic")); - } - if (jsonView.ValueExists("publishMessage")) { - publishToTopicRequest.m_publishMessage = PublishMessage(); - PublishMessage::s_loadFromJsonView( - publishToTopicRequest.m_publishMessage.value(), - jsonView.GetJsonObject("publishMessage")); - } -} - -const char *PublishToTopicRequest::MODEL_NAME = - "aws.greengrass#PublishToTopicRequest"; - -Aws::Crt::String PublishToTopicRequest::GetModelName() const noexcept { - return PublishToTopicRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PublishToTopicRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PublishToTopicRequest::s_customDeleter); - shape->m_allocator = allocator; - PublishToTopicRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PublishToTopicRequest::s_customDeleter( - PublishToTopicRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PublishToIoTCoreResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void PublishToIoTCoreResponse::s_loadFromJsonView( - PublishToIoTCoreResponse &publishToIoTCoreResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)publishToIoTCoreResponse; - (void)jsonView; -} - -const char *PublishToIoTCoreResponse::MODEL_NAME = - "aws.greengrass#PublishToIoTCoreResponse"; - -Aws::Crt::String PublishToIoTCoreResponse::GetModelName() const noexcept { - return PublishToIoTCoreResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PublishToIoTCoreResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PublishToIoTCoreResponse::s_customDeleter); - shape->m_allocator = allocator; - PublishToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PublishToIoTCoreResponse::s_customDeleter( - PublishToIoTCoreResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PublishToIoTCoreRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_topicName.has_value()) { - payloadObject.WithString("topicName", m_topicName.value()); - } - if (m_qos.has_value()) { - payloadObject.WithString("qos", m_qos.value()); - } - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void PublishToIoTCoreRequest::s_loadFromJsonView( - PublishToIoTCoreRequest &publishToIoTCoreRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("topicName")) { - publishToIoTCoreRequest.m_topicName = - Aws::Crt::Optional(jsonView.GetString("topicName")); - } - if (jsonView.ValueExists("qos")) { - publishToIoTCoreRequest.m_qos = - Aws::Crt::Optional(jsonView.GetString("qos")); - } - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - publishToIoTCoreRequest.m_payload = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -void PublishToIoTCoreRequest::SetQos(QOS qos) noexcept { - switch (qos) { - case QOS_AT_MOST_ONCE: - m_qos = Aws::Crt::String("0"); - break; - case QOS_AT_LEAST_ONCE: - m_qos = Aws::Crt::String("1"); - break; - default: - break; - } -} - -Aws::Crt::Optional PublishToIoTCoreRequest::GetQos() noexcept { - if (!m_qos.has_value()) - return Aws::Crt::Optional(); - if (m_qos.value() == Aws::Crt::String("0")) { - return Aws::Crt::Optional(QOS_AT_MOST_ONCE); - } - if (m_qos.value() == Aws::Crt::String("1")) { - return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); - } - - return Aws::Crt::Optional(); -} - -const char *PublishToIoTCoreRequest::MODEL_NAME = - "aws.greengrass#PublishToIoTCoreRequest"; - -Aws::Crt::String PublishToIoTCoreRequest::GetModelName() const noexcept { - return PublishToIoTCoreRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PublishToIoTCoreRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PublishToIoTCoreRequest::s_customDeleter); - shape->m_allocator = allocator; - PublishToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PublishToIoTCoreRequest::s_customDeleter( - PublishToIoTCoreRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PauseComponentResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void PauseComponentResponse::s_loadFromJsonView( - PauseComponentResponse &pauseComponentResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)pauseComponentResponse; - (void)jsonView; -} - -const char *PauseComponentResponse::MODEL_NAME = - "aws.greengrass#PauseComponentResponse"; - -Aws::Crt::String PauseComponentResponse::GetModelName() const noexcept { - return PauseComponentResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PauseComponentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PauseComponentResponse::s_customDeleter); - shape->m_allocator = allocator; - PauseComponentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PauseComponentResponse::s_customDeleter( - PauseComponentResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void PauseComponentRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } -} - -void PauseComponentRequest::s_loadFromJsonView( - PauseComponentRequest &pauseComponentRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - pauseComponentRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } -} - -const char *PauseComponentRequest::MODEL_NAME = - "aws.greengrass#PauseComponentRequest"; - -Aws::Crt::String PauseComponentRequest::GetModelName() const noexcept { - return PauseComponentRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -PauseComponentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - PauseComponentRequest::s_customDeleter); - shape->m_allocator = allocator; - PauseComponentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void PauseComponentRequest::s_customDeleter( - PauseComponentRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListNamedShadowsForThingResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_results.has_value()) { - Aws::Crt::JsonObject namedShadowList; - Aws::Crt::Vector namedShadowListJsonArray; - for (const auto &namedShadowListItem : m_results.value()) { - Aws::Crt::JsonObject namedShadowListJsonArrayItem; - namedShadowListJsonArrayItem.AsString(namedShadowListItem); - namedShadowListJsonArray.emplace_back( - std::move(namedShadowListJsonArrayItem)); - } - namedShadowList.AsArray(std::move(namedShadowListJsonArray)); - payloadObject.WithObject("results", std::move(namedShadowList)); - } - if (m_timestamp.has_value()) { - payloadObject.WithDouble("timestamp", - m_timestamp.value().SecondsWithMSPrecision()); - } - if (m_nextToken.has_value()) { - payloadObject.WithString("nextToken", m_nextToken.value()); - } -} - -void ListNamedShadowsForThingResponse::s_loadFromJsonView( - ListNamedShadowsForThingResponse &listNamedShadowsForThingResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("results")) { - listNamedShadowsForThingResponse.m_results = - Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &namedShadowListJsonView : - jsonView.GetArray("results")) { - Aws::Crt::Optional namedShadowListItem; - namedShadowListItem = Aws::Crt::Optional( - namedShadowListJsonView.AsString()); - listNamedShadowsForThingResponse.m_results.value().push_back( - namedShadowListItem.value()); - } - } - if (jsonView.ValueExists("timestamp")) { - listNamedShadowsForThingResponse.m_timestamp = - Aws::Crt::Optional( - Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); - } - if (jsonView.ValueExists("nextToken")) { - listNamedShadowsForThingResponse.m_nextToken = - Aws::Crt::Optional(jsonView.GetString("nextToken")); - } -} - -const char *ListNamedShadowsForThingResponse::MODEL_NAME = - "aws.greengrass#ListNamedShadowsForThingResponse"; - -Aws::Crt::String -ListNamedShadowsForThingResponse::GetModelName() const noexcept { - return ListNamedShadowsForThingResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListNamedShadowsForThingResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListNamedShadowsForThingResponse::s_customDeleter); - shape->m_allocator = allocator; - ListNamedShadowsForThingResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListNamedShadowsForThingResponse::s_customDeleter( - ListNamedShadowsForThingResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListNamedShadowsForThingRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_thingName.has_value()) { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_nextToken.has_value()) { - payloadObject.WithString("nextToken", m_nextToken.value()); - } - if (m_pageSize.has_value()) { - payloadObject.WithInteger("pageSize", m_pageSize.value()); - } -} - -void ListNamedShadowsForThingRequest::s_loadFromJsonView( - ListNamedShadowsForThingRequest &listNamedShadowsForThingRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("thingName")) { - listNamedShadowsForThingRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("nextToken")) { - listNamedShadowsForThingRequest.m_nextToken = - Aws::Crt::Optional(jsonView.GetString("nextToken")); - } - if (jsonView.ValueExists("pageSize")) { - listNamedShadowsForThingRequest.m_pageSize = - Aws::Crt::Optional(jsonView.GetInteger("pageSize")); - } -} - -const char *ListNamedShadowsForThingRequest::MODEL_NAME = - "aws.greengrass#ListNamedShadowsForThingRequest"; - -Aws::Crt::String -ListNamedShadowsForThingRequest::GetModelName() const noexcept { - return ListNamedShadowsForThingRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListNamedShadowsForThingRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListNamedShadowsForThingRequest::s_customDeleter); - shape->m_allocator = allocator; - ListNamedShadowsForThingRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListNamedShadowsForThingRequest::s_customDeleter( - ListNamedShadowsForThingRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListLocalDeploymentsResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_localDeployments.has_value()) { - Aws::Crt::JsonObject listOfLocalDeployments; - Aws::Crt::Vector listOfLocalDeploymentsJsonArray; - for (const auto &listOfLocalDeploymentsItem : m_localDeployments.value()) { - Aws::Crt::JsonObject listOfLocalDeploymentsJsonArrayItem; - listOfLocalDeploymentsItem.SerializeToJsonObject( - listOfLocalDeploymentsJsonArrayItem); - listOfLocalDeploymentsJsonArray.emplace_back( - std::move(listOfLocalDeploymentsJsonArrayItem)); - } - listOfLocalDeployments.AsArray(std::move(listOfLocalDeploymentsJsonArray)); - payloadObject.WithObject("localDeployments", - std::move(listOfLocalDeployments)); - } -} - -void ListLocalDeploymentsResponse::s_loadFromJsonView( - ListLocalDeploymentsResponse &listLocalDeploymentsResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("localDeployments")) { - listLocalDeploymentsResponse.m_localDeployments = - Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &listOfLocalDeploymentsJsonView : - jsonView.GetArray("localDeployments")) { - Aws::Crt::Optional listOfLocalDeploymentsItem; - listOfLocalDeploymentsItem = LocalDeployment(); - LocalDeployment::s_loadFromJsonView(listOfLocalDeploymentsItem.value(), - listOfLocalDeploymentsJsonView); - listLocalDeploymentsResponse.m_localDeployments.value().push_back( - listOfLocalDeploymentsItem.value()); - } - } -} - -const char *ListLocalDeploymentsResponse::MODEL_NAME = - "aws.greengrass#ListLocalDeploymentsResponse"; - -Aws::Crt::String ListLocalDeploymentsResponse::GetModelName() const noexcept { - return ListLocalDeploymentsResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListLocalDeploymentsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListLocalDeploymentsResponse::s_customDeleter); - shape->m_allocator = allocator; - ListLocalDeploymentsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListLocalDeploymentsResponse::s_customDeleter( - ListLocalDeploymentsResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListLocalDeploymentsRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void ListLocalDeploymentsRequest::s_loadFromJsonView( - ListLocalDeploymentsRequest &listLocalDeploymentsRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)listLocalDeploymentsRequest; - (void)jsonView; -} - -const char *ListLocalDeploymentsRequest::MODEL_NAME = - "aws.greengrass#ListLocalDeploymentsRequest"; - -Aws::Crt::String ListLocalDeploymentsRequest::GetModelName() const noexcept { - return ListLocalDeploymentsRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListLocalDeploymentsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListLocalDeploymentsRequest::s_customDeleter); - shape->m_allocator = allocator; - ListLocalDeploymentsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListLocalDeploymentsRequest::s_customDeleter( - ListLocalDeploymentsRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListComponentsResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_components.has_value()) { - Aws::Crt::JsonObject listOfComponents; - Aws::Crt::Vector listOfComponentsJsonArray; - for (const auto &listOfComponentsItem : m_components.value()) { - Aws::Crt::JsonObject listOfComponentsJsonArrayItem; - listOfComponentsItem.SerializeToJsonObject(listOfComponentsJsonArrayItem); - listOfComponentsJsonArray.emplace_back( - std::move(listOfComponentsJsonArrayItem)); - } - listOfComponents.AsArray(std::move(listOfComponentsJsonArray)); - payloadObject.WithObject("components", std::move(listOfComponents)); - } -} - -void ListComponentsResponse::s_loadFromJsonView( - ListComponentsResponse &listComponentsResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("components")) { - listComponentsResponse.m_components = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &listOfComponentsJsonView : - jsonView.GetArray("components")) { - Aws::Crt::Optional listOfComponentsItem; - listOfComponentsItem = ComponentDetails(); - ComponentDetails::s_loadFromJsonView(listOfComponentsItem.value(), - listOfComponentsJsonView); - listComponentsResponse.m_components.value().push_back( - listOfComponentsItem.value()); - } - } -} - -const char *ListComponentsResponse::MODEL_NAME = - "aws.greengrass#ListComponentsResponse"; - -Aws::Crt::String ListComponentsResponse::GetModelName() const noexcept { - return ListComponentsResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListComponentsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListComponentsResponse::s_customDeleter); - shape->m_allocator = allocator; - ListComponentsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListComponentsResponse::s_customDeleter( - ListComponentsResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ListComponentsRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void ListComponentsRequest::s_loadFromJsonView( - ListComponentsRequest &listComponentsRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)listComponentsRequest; - (void)jsonView; -} - -const char *ListComponentsRequest::MODEL_NAME = - "aws.greengrass#ListComponentsRequest"; - -Aws::Crt::String ListComponentsRequest::GetModelName() const noexcept { - return ListComponentsRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ListComponentsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ListComponentsRequest::s_customDeleter); - shape->m_allocator = allocator; - ListComponentsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void ListComponentsRequest::s_customDeleter( - ListComponentsRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetThingShadowResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void GetThingShadowResponse::s_loadFromJsonView( - GetThingShadowResponse &getThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - getThingShadowResponse.m_payload = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -const char *GetThingShadowResponse::MODEL_NAME = - "aws.greengrass#GetThingShadowResponse"; - -Aws::Crt::String GetThingShadowResponse::GetModelName() const noexcept { - return GetThingShadowResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - GetThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetThingShadowResponse::s_customDeleter( - GetThingShadowResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetThingShadowRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_thingName.has_value()) { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) { - payloadObject.WithString("shadowName", m_shadowName.value()); - } -} - -void GetThingShadowRequest::s_loadFromJsonView( - GetThingShadowRequest &getThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("thingName")) { - getThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) { - getThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } -} - -const char *GetThingShadowRequest::MODEL_NAME = - "aws.greengrass#GetThingShadowRequest"; - -Aws::Crt::String GetThingShadowRequest::GetModelName() const noexcept { - return GetThingShadowRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - GetThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetThingShadowRequest::s_customDeleter( - GetThingShadowRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetSecretValueResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_secretId.has_value()) { - payloadObject.WithString("secretId", m_secretId.value()); - } - if (m_versionId.has_value()) { - payloadObject.WithString("versionId", m_versionId.value()); - } - if (m_versionStage.has_value()) { - Aws::Crt::JsonObject secretVersionList; - Aws::Crt::Vector secretVersionListJsonArray; - for (const auto &secretVersionListItem : m_versionStage.value()) { - Aws::Crt::JsonObject secretVersionListJsonArrayItem; - secretVersionListJsonArrayItem.AsString(secretVersionListItem); - secretVersionListJsonArray.emplace_back( - std::move(secretVersionListJsonArrayItem)); - } - secretVersionList.AsArray(std::move(secretVersionListJsonArray)); - payloadObject.WithObject("versionStage", std::move(secretVersionList)); - } - if (m_secretValue.has_value()) { - Aws::Crt::JsonObject secretValueValue; - m_secretValue.value().SerializeToJsonObject(secretValueValue); - payloadObject.WithObject("secretValue", std::move(secretValueValue)); - } -} - -void GetSecretValueResponse::s_loadFromJsonView( - GetSecretValueResponse &getSecretValueResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("secretId")) { - getSecretValueResponse.m_secretId = - Aws::Crt::Optional(jsonView.GetString("secretId")); - } - if (jsonView.ValueExists("versionId")) { - getSecretValueResponse.m_versionId = - Aws::Crt::Optional(jsonView.GetString("versionId")); - } - if (jsonView.ValueExists("versionStage")) { - getSecretValueResponse.m_versionStage = - Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &secretVersionListJsonView : - jsonView.GetArray("versionStage")) { - Aws::Crt::Optional secretVersionListItem; - secretVersionListItem = Aws::Crt::Optional( - secretVersionListJsonView.AsString()); - getSecretValueResponse.m_versionStage.value().push_back( - secretVersionListItem.value()); - } - } - if (jsonView.ValueExists("secretValue")) { - getSecretValueResponse.m_secretValue = SecretValue(); - SecretValue::s_loadFromJsonView( - getSecretValueResponse.m_secretValue.value(), - jsonView.GetJsonObject("secretValue")); - } -} - -const char *GetSecretValueResponse::MODEL_NAME = - "aws.greengrass#GetSecretValueResponse"; - -Aws::Crt::String GetSecretValueResponse::GetModelName() const noexcept { - return GetSecretValueResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetSecretValueResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetSecretValueResponse::s_customDeleter); - shape->m_allocator = allocator; - GetSecretValueResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetSecretValueResponse::s_customDeleter( - GetSecretValueResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetSecretValueRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_secretId.has_value()) { - payloadObject.WithString("secretId", m_secretId.value()); - } - if (m_versionId.has_value()) { - payloadObject.WithString("versionId", m_versionId.value()); - } - if (m_versionStage.has_value()) { - payloadObject.WithString("versionStage", m_versionStage.value()); - } -} - -void GetSecretValueRequest::s_loadFromJsonView( - GetSecretValueRequest &getSecretValueRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("secretId")) { - getSecretValueRequest.m_secretId = - Aws::Crt::Optional(jsonView.GetString("secretId")); - } - if (jsonView.ValueExists("versionId")) { - getSecretValueRequest.m_versionId = - Aws::Crt::Optional(jsonView.GetString("versionId")); - } - if (jsonView.ValueExists("versionStage")) { - getSecretValueRequest.m_versionStage = Aws::Crt::Optional( - jsonView.GetString("versionStage")); - } -} - -const char *GetSecretValueRequest::MODEL_NAME = - "aws.greengrass#GetSecretValueRequest"; - -Aws::Crt::String GetSecretValueRequest::GetModelName() const noexcept { - return GetSecretValueRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetSecretValueRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetSecretValueRequest::s_customDeleter); - shape->m_allocator = allocator; - GetSecretValueRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetSecretValueRequest::s_customDeleter( - GetSecretValueRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetLocalDeploymentStatusResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deployment.has_value()) { - Aws::Crt::JsonObject localDeploymentValue; - m_deployment.value().SerializeToJsonObject(localDeploymentValue); - payloadObject.WithObject("deployment", std::move(localDeploymentValue)); - } -} - -void GetLocalDeploymentStatusResponse::s_loadFromJsonView( - GetLocalDeploymentStatusResponse &getLocalDeploymentStatusResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deployment")) { - getLocalDeploymentStatusResponse.m_deployment = LocalDeployment(); - LocalDeployment::s_loadFromJsonView( - getLocalDeploymentStatusResponse.m_deployment.value(), - jsonView.GetJsonObject("deployment")); - } -} - -const char *GetLocalDeploymentStatusResponse::MODEL_NAME = - "aws.greengrass#GetLocalDeploymentStatusResponse"; - -Aws::Crt::String -GetLocalDeploymentStatusResponse::GetModelName() const noexcept { - return GetLocalDeploymentStatusResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetLocalDeploymentStatusResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetLocalDeploymentStatusResponse::s_customDeleter); - shape->m_allocator = allocator; - GetLocalDeploymentStatusResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetLocalDeploymentStatusResponse::s_customDeleter( - GetLocalDeploymentStatusResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetLocalDeploymentStatusRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } -} - -void GetLocalDeploymentStatusRequest::s_loadFromJsonView( - GetLocalDeploymentStatusRequest &getLocalDeploymentStatusRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - getLocalDeploymentStatusRequest.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } -} - -const char *GetLocalDeploymentStatusRequest::MODEL_NAME = - "aws.greengrass#GetLocalDeploymentStatusRequest"; - -Aws::Crt::String -GetLocalDeploymentStatusRequest::GetModelName() const noexcept { - return GetLocalDeploymentStatusRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetLocalDeploymentStatusRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetLocalDeploymentStatusRequest::s_customDeleter); - shape->m_allocator = allocator; - GetLocalDeploymentStatusRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetLocalDeploymentStatusRequest::s_customDeleter( - GetLocalDeploymentStatusRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetConfigurationResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_value.has_value()) { - payloadObject.WithObject("value", m_value.value()); - } -} - -void GetConfigurationResponse::s_loadFromJsonView( - GetConfigurationResponse &getConfigurationResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - getConfigurationResponse.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("value")) { - getConfigurationResponse.m_value = Aws::Crt::Optional( - jsonView.GetJsonObject("value").Materialize()); - } -} - -const char *GetConfigurationResponse::MODEL_NAME = - "aws.greengrass#GetConfigurationResponse"; - -Aws::Crt::String GetConfigurationResponse::GetModelName() const noexcept { - return GetConfigurationResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetConfigurationResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetConfigurationResponse::s_customDeleter); - shape->m_allocator = allocator; - GetConfigurationResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetConfigurationResponse::s_customDeleter( - GetConfigurationResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetConfigurationRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } - if (m_keyPath.has_value()) { - Aws::Crt::JsonObject keyPath; - Aws::Crt::Vector keyPathJsonArray; - for (const auto &keyPathItem : m_keyPath.value()) { - Aws::Crt::JsonObject keyPathJsonArrayItem; - keyPathJsonArrayItem.AsString(keyPathItem); - keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); - } - keyPath.AsArray(std::move(keyPathJsonArray)); - payloadObject.WithObject("keyPath", std::move(keyPath)); - } -} - -void GetConfigurationRequest::s_loadFromJsonView( - GetConfigurationRequest &getConfigurationRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - getConfigurationRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } - if (jsonView.ValueExists("keyPath")) { - getConfigurationRequest.m_keyPath = Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &keyPathJsonView : - jsonView.GetArray("keyPath")) { - Aws::Crt::Optional keyPathItem; - keyPathItem = - Aws::Crt::Optional(keyPathJsonView.AsString()); - getConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); - } - } -} - -const char *GetConfigurationRequest::MODEL_NAME = - "aws.greengrass#GetConfigurationRequest"; - -Aws::Crt::String GetConfigurationRequest::GetModelName() const noexcept { - return GetConfigurationRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetConfigurationRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetConfigurationRequest::s_customDeleter); - shape->m_allocator = allocator; - GetConfigurationRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetConfigurationRequest::s_customDeleter( - GetConfigurationRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetComponentDetailsResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentDetails.has_value()) { - Aws::Crt::JsonObject componentDetailsValue; - m_componentDetails.value().SerializeToJsonObject(componentDetailsValue); - payloadObject.WithObject("componentDetails", - std::move(componentDetailsValue)); - } -} - -void GetComponentDetailsResponse::s_loadFromJsonView( - GetComponentDetailsResponse &getComponentDetailsResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentDetails")) { - getComponentDetailsResponse.m_componentDetails = ComponentDetails(); - ComponentDetails::s_loadFromJsonView( - getComponentDetailsResponse.m_componentDetails.value(), - jsonView.GetJsonObject("componentDetails")); - } -} - -const char *GetComponentDetailsResponse::MODEL_NAME = - "aws.greengrass#GetComponentDetailsResponse"; - -Aws::Crt::String GetComponentDetailsResponse::GetModelName() const noexcept { - return GetComponentDetailsResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetComponentDetailsResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetComponentDetailsResponse::s_customDeleter); - shape->m_allocator = allocator; - GetComponentDetailsResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetComponentDetailsResponse::s_customDeleter( - GetComponentDetailsResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetComponentDetailsRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_componentName.has_value()) { - payloadObject.WithString("componentName", m_componentName.value()); - } -} - -void GetComponentDetailsRequest::s_loadFromJsonView( - GetComponentDetailsRequest &getComponentDetailsRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("componentName")) { - getComponentDetailsRequest.m_componentName = - Aws::Crt::Optional( - jsonView.GetString("componentName")); - } -} - -const char *GetComponentDetailsRequest::MODEL_NAME = - "aws.greengrass#GetComponentDetailsRequest"; - -Aws::Crt::String GetComponentDetailsRequest::GetModelName() const noexcept { - return GetComponentDetailsRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetComponentDetailsRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetComponentDetailsRequest::s_customDeleter); - shape->m_allocator = allocator; - GetComponentDetailsRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetComponentDetailsRequest::s_customDeleter( - GetComponentDetailsRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void InvalidCredentialError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidCredentialError::s_loadFromJsonView( - InvalidCredentialError &invalidCredentialError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidCredentialError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidCredentialError::MODEL_NAME = - "aws.greengrass#InvalidCredentialError"; - -Aws::Crt::String InvalidCredentialError::GetModelName() const noexcept { - return InvalidCredentialError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidCredentialError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidCredentialError::s_customDeleter); - shape->m_allocator = allocator; - InvalidCredentialError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidCredentialError::s_customDeleter( - InvalidCredentialError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void GetClientDeviceAuthTokenResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_clientDeviceAuthToken.has_value()) { - payloadObject.WithString("clientDeviceAuthToken", - m_clientDeviceAuthToken.value()); - } -} - -void GetClientDeviceAuthTokenResponse::s_loadFromJsonView( - GetClientDeviceAuthTokenResponse &getClientDeviceAuthTokenResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("clientDeviceAuthToken")) { - getClientDeviceAuthTokenResponse.m_clientDeviceAuthToken = - Aws::Crt::Optional( - jsonView.GetString("clientDeviceAuthToken")); - } -} - -const char *GetClientDeviceAuthTokenResponse::MODEL_NAME = - "aws.greengrass#GetClientDeviceAuthTokenResponse"; - -Aws::Crt::String -GetClientDeviceAuthTokenResponse::GetModelName() const noexcept { - return GetClientDeviceAuthTokenResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetClientDeviceAuthTokenResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetClientDeviceAuthTokenResponse::s_customDeleter); - shape->m_allocator = allocator; - GetClientDeviceAuthTokenResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetClientDeviceAuthTokenResponse::s_customDeleter( - GetClientDeviceAuthTokenResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void GetClientDeviceAuthTokenRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_credential.has_value()) { - Aws::Crt::JsonObject credentialDocumentValue; - m_credential.value().SerializeToJsonObject(credentialDocumentValue); - payloadObject.WithObject("credential", std::move(credentialDocumentValue)); - } -} - -void GetClientDeviceAuthTokenRequest::s_loadFromJsonView( - GetClientDeviceAuthTokenRequest &getClientDeviceAuthTokenRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("credential")) { - getClientDeviceAuthTokenRequest.m_credential = CredentialDocument(); - CredentialDocument::s_loadFromJsonView( - getClientDeviceAuthTokenRequest.m_credential.value(), - jsonView.GetJsonObject("credential")); - } -} - -const char *GetClientDeviceAuthTokenRequest::MODEL_NAME = - "aws.greengrass#GetClientDeviceAuthTokenRequest"; - -Aws::Crt::String -GetClientDeviceAuthTokenRequest::GetModelName() const noexcept { - return GetClientDeviceAuthTokenRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -GetClientDeviceAuthTokenRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - GetClientDeviceAuthTokenRequest::s_customDeleter); - shape->m_allocator = allocator; - GetClientDeviceAuthTokenRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void GetClientDeviceAuthTokenRequest::s_customDeleter( - GetClientDeviceAuthTokenRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void DeleteThingShadowResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_payload.has_value()) { - if (m_payload.value().size() > 0) { - payloadObject.WithString("payload", - Aws::Crt::Base64Encode(m_payload.value())); - } - } -} - -void DeleteThingShadowResponse::s_loadFromJsonView( - DeleteThingShadowResponse &deleteThingShadowResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("payload")) { - if (jsonView.GetString("payload").size() > 0) { - deleteThingShadowResponse.m_payload = - Aws::Crt::Optional>( - Aws::Crt::Base64Decode(jsonView.GetString("payload"))); - } - } -} - -const char *DeleteThingShadowResponse::MODEL_NAME = - "aws.greengrass#DeleteThingShadowResponse"; - -Aws::Crt::String DeleteThingShadowResponse::GetModelName() const noexcept { - return DeleteThingShadowResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -DeleteThingShadowResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - DeleteThingShadowResponse::s_customDeleter); - shape->m_allocator = allocator; - DeleteThingShadowResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void DeleteThingShadowResponse::s_customDeleter( - DeleteThingShadowResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void DeleteThingShadowRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_thingName.has_value()) { - payloadObject.WithString("thingName", m_thingName.value()); - } - if (m_shadowName.has_value()) { - payloadObject.WithString("shadowName", m_shadowName.value()); - } -} - -void DeleteThingShadowRequest::s_loadFromJsonView( - DeleteThingShadowRequest &deleteThingShadowRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("thingName")) { - deleteThingShadowRequest.m_thingName = - Aws::Crt::Optional(jsonView.GetString("thingName")); - } - if (jsonView.ValueExists("shadowName")) { - deleteThingShadowRequest.m_shadowName = - Aws::Crt::Optional(jsonView.GetString("shadowName")); - } -} - -const char *DeleteThingShadowRequest::MODEL_NAME = - "aws.greengrass#DeleteThingShadowRequest"; - -Aws::Crt::String DeleteThingShadowRequest::GetModelName() const noexcept { - return DeleteThingShadowRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -DeleteThingShadowRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - DeleteThingShadowRequest::s_customDeleter); - shape->m_allocator = allocator; - DeleteThingShadowRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void DeleteThingShadowRequest::s_customDeleter( - DeleteThingShadowRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void ResourceNotFoundError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } - if (m_resourceType.has_value()) { - payloadObject.WithString("resourceType", m_resourceType.value()); - } - if (m_resourceName.has_value()) { - payloadObject.WithString("resourceName", m_resourceName.value()); - } -} - -void ResourceNotFoundError::s_loadFromJsonView( - ResourceNotFoundError &resourceNotFoundError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - resourceNotFoundError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("resourceType")) { - resourceNotFoundError.m_resourceType = Aws::Crt::Optional( - jsonView.GetString("resourceType")); - } - if (jsonView.ValueExists("resourceName")) { - resourceNotFoundError.m_resourceName = Aws::Crt::Optional( - jsonView.GetString("resourceName")); - } -} - -const char *ResourceNotFoundError::MODEL_NAME = - "aws.greengrass#ResourceNotFoundError"; - -Aws::Crt::String ResourceNotFoundError::GetModelName() const noexcept { - return ResourceNotFoundError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ResourceNotFoundError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - ResourceNotFoundError::s_customDeleter); - shape->m_allocator = allocator; - ResourceNotFoundError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void ResourceNotFoundError::s_customDeleter( - ResourceNotFoundError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void DeferComponentUpdateResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void DeferComponentUpdateResponse::s_loadFromJsonView( - DeferComponentUpdateResponse &deferComponentUpdateResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)deferComponentUpdateResponse; - (void)jsonView; -} - -const char *DeferComponentUpdateResponse::MODEL_NAME = - "aws.greengrass#DeferComponentUpdateResponse"; - -Aws::Crt::String DeferComponentUpdateResponse::GetModelName() const noexcept { - return DeferComponentUpdateResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -DeferComponentUpdateResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - DeferComponentUpdateResponse::s_customDeleter); - shape->m_allocator = allocator; - DeferComponentUpdateResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void DeferComponentUpdateResponse::s_customDeleter( - DeferComponentUpdateResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void DeferComponentUpdateRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } - if (m_recheckAfterMs.has_value()) { - payloadObject.WithInt64("recheckAfterMs", m_recheckAfterMs.value()); - } -} - -void DeferComponentUpdateRequest::s_loadFromJsonView( - DeferComponentUpdateRequest &deferComponentUpdateRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - deferComponentUpdateRequest.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } - if (jsonView.ValueExists("message")) { - deferComponentUpdateRequest.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } - if (jsonView.ValueExists("recheckAfterMs")) { - deferComponentUpdateRequest.m_recheckAfterMs = - Aws::Crt::Optional(jsonView.GetInt64("recheckAfterMs")); - } -} - -const char *DeferComponentUpdateRequest::MODEL_NAME = - "aws.greengrass#DeferComponentUpdateRequest"; - -Aws::Crt::String DeferComponentUpdateRequest::GetModelName() const noexcept { - return DeferComponentUpdateRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -DeferComponentUpdateRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - DeferComponentUpdateRequest::s_customDeleter); - shape->m_allocator = allocator; - DeferComponentUpdateRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void DeferComponentUpdateRequest::s_customDeleter( - DeferComponentUpdateRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void InvalidArtifactsDirectoryPathError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidArtifactsDirectoryPathError::s_loadFromJsonView( - InvalidArtifactsDirectoryPathError &invalidArtifactsDirectoryPathError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidArtifactsDirectoryPathError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidArtifactsDirectoryPathError::MODEL_NAME = - "aws.greengrass#InvalidArtifactsDirectoryPathError"; - -Aws::Crt::String -InvalidArtifactsDirectoryPathError::GetModelName() const noexcept { - return InvalidArtifactsDirectoryPathError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidArtifactsDirectoryPathError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidArtifactsDirectoryPathError::s_customDeleter); - shape->m_allocator = allocator; - InvalidArtifactsDirectoryPathError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidArtifactsDirectoryPathError::s_customDeleter( - InvalidArtifactsDirectoryPathError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void InvalidRecipeDirectoryPathError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidRecipeDirectoryPathError::s_loadFromJsonView( - InvalidRecipeDirectoryPathError &invalidRecipeDirectoryPathError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidRecipeDirectoryPathError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidRecipeDirectoryPathError::MODEL_NAME = - "aws.greengrass#InvalidRecipeDirectoryPathError"; - -Aws::Crt::String -InvalidRecipeDirectoryPathError::GetModelName() const noexcept { - return InvalidRecipeDirectoryPathError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidRecipeDirectoryPathError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidRecipeDirectoryPathError::s_customDeleter); - shape->m_allocator = allocator; - InvalidRecipeDirectoryPathError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidRecipeDirectoryPathError::s_customDeleter( - InvalidRecipeDirectoryPathError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void CreateLocalDeploymentResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_deploymentId.has_value()) { - payloadObject.WithString("deploymentId", m_deploymentId.value()); - } -} - -void CreateLocalDeploymentResponse::s_loadFromJsonView( - CreateLocalDeploymentResponse &createLocalDeploymentResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("deploymentId")) { - createLocalDeploymentResponse.m_deploymentId = - Aws::Crt::Optional( - jsonView.GetString("deploymentId")); - } -} - -const char *CreateLocalDeploymentResponse::MODEL_NAME = - "aws.greengrass#CreateLocalDeploymentResponse"; - -Aws::Crt::String CreateLocalDeploymentResponse::GetModelName() const noexcept { - return CreateLocalDeploymentResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CreateLocalDeploymentResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CreateLocalDeploymentResponse::s_customDeleter); - shape->m_allocator = allocator; - CreateLocalDeploymentResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CreateLocalDeploymentResponse::s_customDeleter( - CreateLocalDeploymentResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CreateLocalDeploymentRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_groupName.has_value()) { - payloadObject.WithString("groupName", m_groupName.value()); - } - if (m_rootComponentVersionsToAdd.has_value()) { - Aws::Crt::JsonObject componentToVersionMapValue; - for (const auto &componentToVersionMapItem : - m_rootComponentVersionsToAdd.value()) { - Aws::Crt::JsonObject componentToVersionMapJsonObject; - componentToVersionMapJsonObject.AsString( - componentToVersionMapItem.second); - componentToVersionMapValue.WithObject( - componentToVersionMapItem.first, - std::move(componentToVersionMapJsonObject)); - } - payloadObject.WithObject("rootComponentVersionsToAdd", - std::move(componentToVersionMapValue)); - } - if (m_rootComponentsToRemove.has_value()) { - Aws::Crt::JsonObject componentList; - Aws::Crt::Vector componentListJsonArray; - for (const auto &componentListItem : m_rootComponentsToRemove.value()) { - Aws::Crt::JsonObject componentListJsonArrayItem; - componentListJsonArrayItem.AsString(componentListItem); - componentListJsonArray.emplace_back( - std::move(componentListJsonArrayItem)); - } - componentList.AsArray(std::move(componentListJsonArray)); - payloadObject.WithObject("rootComponentsToRemove", - std::move(componentList)); - } - if (m_componentToConfiguration.has_value()) { - Aws::Crt::JsonObject componentToConfigurationValue; - for (const auto &componentToConfigurationItem : - m_componentToConfiguration.value()) { - Aws::Crt::JsonObject componentToConfigurationJsonObject; - componentToConfigurationJsonObject.AsObject( - componentToConfigurationItem.second); - componentToConfigurationValue.WithObject( - componentToConfigurationItem.first, - std::move(componentToConfigurationJsonObject)); - } - payloadObject.WithObject("componentToConfiguration", - std::move(componentToConfigurationValue)); - } - if (m_componentToRunWithInfo.has_value()) { - Aws::Crt::JsonObject componentToRunWithInfoValue; - for (const auto &componentToRunWithInfoItem : - m_componentToRunWithInfo.value()) { - Aws::Crt::JsonObject componentToRunWithInfoJsonObject; - componentToRunWithInfoItem.second.SerializeToJsonObject( - componentToRunWithInfoJsonObject); - componentToRunWithInfoValue.WithObject( - componentToRunWithInfoItem.first, - std::move(componentToRunWithInfoJsonObject)); - } - payloadObject.WithObject("componentToRunWithInfo", - std::move(componentToRunWithInfoValue)); - } - if (m_recipeDirectoryPath.has_value()) { - payloadObject.WithString("recipeDirectoryPath", - m_recipeDirectoryPath.value()); - } - if (m_artifactsDirectoryPath.has_value()) { - payloadObject.WithString("artifactsDirectoryPath", - m_artifactsDirectoryPath.value()); - } -} - -void CreateLocalDeploymentRequest::s_loadFromJsonView( - CreateLocalDeploymentRequest &createLocalDeploymentRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("groupName")) { - createLocalDeploymentRequest.m_groupName = - Aws::Crt::Optional(jsonView.GetString("groupName")); - } - if (jsonView.ValueExists("rootComponentVersionsToAdd")) { - createLocalDeploymentRequest.m_rootComponentVersionsToAdd = - Aws::Crt::Map(); - for (const auto &componentToVersionMapPair : - jsonView.GetJsonObject("rootComponentVersionsToAdd").GetAllObjects()) { - Aws::Crt::Optional componentToVersionMapValue; - componentToVersionMapValue = Aws::Crt::Optional( - componentToVersionMapPair.second.AsString()); - createLocalDeploymentRequest.m_rootComponentVersionsToAdd - .value()[componentToVersionMapPair.first] = - componentToVersionMapValue.value(); - } - } - if (jsonView.ValueExists("rootComponentsToRemove")) { - createLocalDeploymentRequest.m_rootComponentsToRemove = - Aws::Crt::Vector(); - for (const Aws::Crt::JsonView &componentListJsonView : - jsonView.GetArray("rootComponentsToRemove")) { - Aws::Crt::Optional componentListItem; - componentListItem = Aws::Crt::Optional( - componentListJsonView.AsString()); - createLocalDeploymentRequest.m_rootComponentsToRemove.value().push_back( - componentListItem.value()); - } - } - if (jsonView.ValueExists("componentToConfiguration")) { - createLocalDeploymentRequest.m_componentToConfiguration = - Aws::Crt::Map(); - for (const auto &componentToConfigurationPair : - jsonView.GetJsonObject("componentToConfiguration").GetAllObjects()) { - Aws::Crt::Optional componentToConfigurationValue; - componentToConfigurationValue = Aws::Crt::Optional( - componentToConfigurationPair.second.AsObject().Materialize()); - createLocalDeploymentRequest.m_componentToConfiguration - .value()[componentToConfigurationPair.first] = - componentToConfigurationValue.value(); - } - } - if (jsonView.ValueExists("componentToRunWithInfo")) { - createLocalDeploymentRequest.m_componentToRunWithInfo = - Aws::Crt::Map(); - for (const auto &componentToRunWithInfoPair : - jsonView.GetJsonObject("componentToRunWithInfo").GetAllObjects()) { - Aws::Crt::Optional componentToRunWithInfoValue; - componentToRunWithInfoValue = RunWithInfo(); - RunWithInfo::s_loadFromJsonView(componentToRunWithInfoValue.value(), - componentToRunWithInfoPair.second); - createLocalDeploymentRequest.m_componentToRunWithInfo - .value()[componentToRunWithInfoPair.first] = - componentToRunWithInfoValue.value(); - } - } - if (jsonView.ValueExists("recipeDirectoryPath")) { - createLocalDeploymentRequest.m_recipeDirectoryPath = - Aws::Crt::Optional( - jsonView.GetString("recipeDirectoryPath")); - } - if (jsonView.ValueExists("artifactsDirectoryPath")) { - createLocalDeploymentRequest.m_artifactsDirectoryPath = - Aws::Crt::Optional( - jsonView.GetString("artifactsDirectoryPath")); - } -} - -const char *CreateLocalDeploymentRequest::MODEL_NAME = - "aws.greengrass#CreateLocalDeploymentRequest"; - -Aws::Crt::String CreateLocalDeploymentRequest::GetModelName() const noexcept { - return CreateLocalDeploymentRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CreateLocalDeploymentRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CreateLocalDeploymentRequest::s_customDeleter); - shape->m_allocator = allocator; - CreateLocalDeploymentRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CreateLocalDeploymentRequest::s_customDeleter( - CreateLocalDeploymentRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CreateDebugPasswordResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_password.has_value()) { - payloadObject.WithString("password", m_password.value()); - } - if (m_username.has_value()) { - payloadObject.WithString("username", m_username.value()); - } - if (m_passwordExpiration.has_value()) { - payloadObject.WithDouble( - "passwordExpiration", - m_passwordExpiration.value().SecondsWithMSPrecision()); - } - if (m_certificateSHA256Hash.has_value()) { - payloadObject.WithString("certificateSHA256Hash", - m_certificateSHA256Hash.value()); - } - if (m_certificateSHA1Hash.has_value()) { - payloadObject.WithString("certificateSHA1Hash", - m_certificateSHA1Hash.value()); - } -} - -void CreateDebugPasswordResponse::s_loadFromJsonView( - CreateDebugPasswordResponse &createDebugPasswordResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("password")) { - createDebugPasswordResponse.m_password = - Aws::Crt::Optional(jsonView.GetString("password")); - } - if (jsonView.ValueExists("username")) { - createDebugPasswordResponse.m_username = - Aws::Crt::Optional(jsonView.GetString("username")); - } - if (jsonView.ValueExists("passwordExpiration")) { - createDebugPasswordResponse.m_passwordExpiration = - Aws::Crt::Optional( - Aws::Crt::DateTime(jsonView.GetDouble("passwordExpiration"))); - } - if (jsonView.ValueExists("certificateSHA256Hash")) { - createDebugPasswordResponse.m_certificateSHA256Hash = - Aws::Crt::Optional( - jsonView.GetString("certificateSHA256Hash")); - } - if (jsonView.ValueExists("certificateSHA1Hash")) { - createDebugPasswordResponse.m_certificateSHA1Hash = - Aws::Crt::Optional( - jsonView.GetString("certificateSHA1Hash")); - } -} - -const char *CreateDebugPasswordResponse::MODEL_NAME = - "aws.greengrass#CreateDebugPasswordResponse"; - -Aws::Crt::String CreateDebugPasswordResponse::GetModelName() const noexcept { - return CreateDebugPasswordResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CreateDebugPasswordResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CreateDebugPasswordResponse::s_customDeleter); - shape->m_allocator = allocator; - CreateDebugPasswordResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CreateDebugPasswordResponse::s_customDeleter( - CreateDebugPasswordResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void CreateDebugPasswordRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - (void)payloadObject; -} - -void CreateDebugPasswordRequest::s_loadFromJsonView( - CreateDebugPasswordRequest &createDebugPasswordRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - (void)createDebugPasswordRequest; - (void)jsonView; -} - -const char *CreateDebugPasswordRequest::MODEL_NAME = - "aws.greengrass#CreateDebugPasswordRequest"; - -Aws::Crt::String CreateDebugPasswordRequest::GetModelName() const noexcept { - return CreateDebugPasswordRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -CreateDebugPasswordRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - CreateDebugPasswordRequest::s_customDeleter); - shape->m_allocator = allocator; - CreateDebugPasswordRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void CreateDebugPasswordRequest::s_customDeleter( - CreateDebugPasswordRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void InvalidClientDeviceAuthTokenError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidClientDeviceAuthTokenError::s_loadFromJsonView( - InvalidClientDeviceAuthTokenError &invalidClientDeviceAuthTokenError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidClientDeviceAuthTokenError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidClientDeviceAuthTokenError::MODEL_NAME = - "aws.greengrass#InvalidClientDeviceAuthTokenError"; - -Aws::Crt::String -InvalidClientDeviceAuthTokenError::GetModelName() const noexcept { - return InvalidClientDeviceAuthTokenError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidClientDeviceAuthTokenError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidClientDeviceAuthTokenError::s_customDeleter); - shape->m_allocator = allocator; - InvalidClientDeviceAuthTokenError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidClientDeviceAuthTokenError::s_customDeleter( - InvalidClientDeviceAuthTokenError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void InvalidArgumentsError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void InvalidArgumentsError::s_loadFromJsonView( - InvalidArgumentsError &invalidArgumentsError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - invalidArgumentsError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *InvalidArgumentsError::MODEL_NAME = - "aws.greengrass#InvalidArgumentsError"; - -Aws::Crt::String InvalidArgumentsError::GetModelName() const noexcept { - return InvalidArgumentsError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -InvalidArgumentsError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - InvalidArgumentsError::s_customDeleter); - shape->m_allocator = allocator; - InvalidArgumentsError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void InvalidArgumentsError::s_customDeleter( - InvalidArgumentsError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void ServiceError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void ServiceError::s_loadFromJsonView( - ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - serviceError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; - -Aws::Crt::String ServiceError::GetModelName() const noexcept { - return ServiceError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -ServiceError::s_allocateFromPayload(Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), ServiceError::s_customDeleter); - shape->m_allocator = allocator; - ServiceError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void ServiceError::s_customDeleter(ServiceError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void UnauthorizedError::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_message.has_value()) { - payloadObject.WithString("message", m_message.value()); - } -} - -void UnauthorizedError::s_loadFromJsonView( - UnauthorizedError &unauthorizedError, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("message")) { - unauthorizedError.m_message = - Aws::Crt::Optional(jsonView.GetString("message")); - } -} - -const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; - -Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { - return UnauthorizedError::MODEL_NAME; -} - -Aws::Crt::ScopedResource -UnauthorizedError::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - UnauthorizedError::s_customDeleter); - shape->m_allocator = allocator; - UnauthorizedError::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, OperationError::s_customDeleter); -} - -void UnauthorizedError::s_customDeleter(UnauthorizedError *shape) noexcept { - OperationError::s_customDeleter(static_cast(shape)); -} - -void AuthorizeClientDeviceActionResponse::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_isAuthorized.has_value()) { - payloadObject.WithBool("isAuthorized", m_isAuthorized.value()); - } -} - -void AuthorizeClientDeviceActionResponse::s_loadFromJsonView( - AuthorizeClientDeviceActionResponse &authorizeClientDeviceActionResponse, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("isAuthorized")) { - authorizeClientDeviceActionResponse.m_isAuthorized = - Aws::Crt::Optional(jsonView.GetBool("isAuthorized")); - } -} - -const char *AuthorizeClientDeviceActionResponse::MODEL_NAME = - "aws.greengrass#AuthorizeClientDeviceActionResponse"; - -Aws::Crt::String -AuthorizeClientDeviceActionResponse::GetModelName() const noexcept { - return AuthorizeClientDeviceActionResponse::MODEL_NAME; -} - -Aws::Crt::ScopedResource -AuthorizeClientDeviceActionResponse::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - AuthorizeClientDeviceActionResponse::s_customDeleter); - shape->m_allocator = allocator; - AuthorizeClientDeviceActionResponse::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void AuthorizeClientDeviceActionResponse::s_customDeleter( - AuthorizeClientDeviceActionResponse *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void AuthorizeClientDeviceActionRequest::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_clientDeviceAuthToken.has_value()) { - payloadObject.WithString("clientDeviceAuthToken", - m_clientDeviceAuthToken.value()); - } - if (m_operation.has_value()) { - payloadObject.WithString("operation", m_operation.value()); - } - if (m_resource.has_value()) { - payloadObject.WithString("resource", m_resource.value()); - } -} - -void AuthorizeClientDeviceActionRequest::s_loadFromJsonView( - AuthorizeClientDeviceActionRequest &authorizeClientDeviceActionRequest, - const Aws::Crt::JsonView &jsonView) noexcept { - if (jsonView.ValueExists("clientDeviceAuthToken")) { - authorizeClientDeviceActionRequest.m_clientDeviceAuthToken = - Aws::Crt::Optional( - jsonView.GetString("clientDeviceAuthToken")); - } - if (jsonView.ValueExists("operation")) { - authorizeClientDeviceActionRequest.m_operation = - Aws::Crt::Optional(jsonView.GetString("operation")); - } - if (jsonView.ValueExists("resource")) { - authorizeClientDeviceActionRequest.m_resource = - Aws::Crt::Optional(jsonView.GetString("resource")); - } -} - -const char *AuthorizeClientDeviceActionRequest::MODEL_NAME = - "aws.greengrass#AuthorizeClientDeviceActionRequest"; - -Aws::Crt::String -AuthorizeClientDeviceActionRequest::GetModelName() const noexcept { - return AuthorizeClientDeviceActionRequest::MODEL_NAME; -} - -Aws::Crt::ScopedResource -AuthorizeClientDeviceActionRequest::s_allocateFromPayload( - Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept { - Aws::Crt::String payload = {stringView.begin(), stringView.end()}; - Aws::Crt::JsonObject jsonObject(payload); - Aws::Crt::JsonView jsonView(jsonObject); - - Aws::Crt::ScopedResource shape( - Aws::Crt::New(allocator), - AuthorizeClientDeviceActionRequest::s_customDeleter); - shape->m_allocator = allocator; - AuthorizeClientDeviceActionRequest::s_loadFromJsonView(*shape, jsonView); - auto operationResponse = static_cast(shape.release()); - return Aws::Crt::ScopedResource( - operationResponse, AbstractShapeBase::s_customDeleter); -} - -void AuthorizeClientDeviceActionRequest::s_customDeleter( - AuthorizeClientDeviceActionRequest *shape) noexcept { - AbstractShapeBase::s_customDeleter(static_cast(shape)); -} - -void SubscribeToIoTCoreStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool SubscribeToIoTCoreStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToIoTCoreOperationContext::SubscribeToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToIoTCoreOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -SubscribeToIoTCoreOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::String -SubscribeToIoTCoreOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreRequest"); -} - -Aws::Crt::String -SubscribeToIoTCoreOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); -} - -Aws::Crt::Optional -SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); -} - -Aws::Crt::String -SubscribeToIoTCoreOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToIoTCore"); -} - -std::future -SubscribeToIoTCoreOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToIoTCoreResult(GetOperationResult().get()); - }); -} - -SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future SubscribeToIoTCoreOperation::Activate( - const SubscribeToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String SubscribeToIoTCoreOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -ResumeComponentOperationContext::ResumeComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -ResumeComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ResumeComponentResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -ResumeComponentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -ResumeComponentOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ResumeComponentRequest"); -} - -Aws::Crt::String -ResumeComponentOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); -} - -Aws::Crt::Optional -ResumeComponentOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -ResumeComponentOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#ResumeComponent"); -} - -std::future -ResumeComponentOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return ResumeComponentResult(GetOperationResult().get()); - }); -} - -ResumeComponentOperation::ResumeComponentOperation( - ClientConnection &connection, - const ResumeComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future ResumeComponentOperation::Activate( - const ResumeComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String ResumeComponentOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -PublishToIoTCoreOperationContext::PublishToIoTCoreOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -PublishToIoTCoreOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -PublishToIoTCoreOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -PublishToIoTCoreOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToIoTCoreRequest"); -} - -Aws::Crt::String -PublishToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); -} - -Aws::Crt::Optional -PublishToIoTCoreOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -PublishToIoTCoreOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToIoTCore"); -} - -std::future -PublishToIoTCoreOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return PublishToIoTCoreResult(GetOperationResult().get()); - }); -} - -PublishToIoTCoreOperation::PublishToIoTCoreOperation( - ClientConnection &connection, - const PublishToIoTCoreOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future PublishToIoTCoreOperation::Activate( - const PublishToIoTCoreRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String PublishToIoTCoreOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void SubscribeToConfigurationUpdateStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool SubscribeToConfigurationUpdateStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && - !streamShouldTerminate) { - streamShouldTerminate = OnStreamError( - static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToConfigurationUpdateOperationContext:: - SubscribeToConfigurationUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToConfigurationUpdateOperationContext:: - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( - stringView, allocator); -} - -Aws::Crt::ScopedResource -SubscribeToConfigurationUpdateOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::String -SubscribeToConfigurationUpdateOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToConfigurationUpdateRequest"); -} - -Aws::Crt::String -SubscribeToConfigurationUpdateOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToConfigurationUpdateResponse"); -} - -Aws::Crt::Optional -SubscribeToConfigurationUpdateOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ConfigurationUpdateEvents"); -} - -Aws::Crt::String -SubscribeToConfigurationUpdateOperationContext::GetOperationName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdate"); -} - -std::future -SubscribeToConfigurationUpdateOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); -} - -SubscribeToConfigurationUpdateOperation:: - SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - std::shared_ptr - streamHandler, - const SubscribeToConfigurationUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future SubscribeToConfigurationUpdateOperation::Activate( - const SubscribeToConfigurationUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -SubscribeToConfigurationUpdateOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -DeleteThingShadowOperationContext::DeleteThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -DeleteThingShadowOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return DeleteThingShadowResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -DeleteThingShadowOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -DeleteThingShadowOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#DeleteThingShadowRequest"); -} - -Aws::Crt::String -DeleteThingShadowOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); -} - -Aws::Crt::Optional -DeleteThingShadowOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -DeleteThingShadowOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#DeleteThingShadow"); -} - -std::future -DeleteThingShadowOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return DeleteThingShadowResult(GetOperationResult().get()); - }); -} - -DeleteThingShadowOperation::DeleteThingShadowOperation( - ClientConnection &connection, - const DeleteThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future DeleteThingShadowOperation::Activate( - const DeleteThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String DeleteThingShadowOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -PutComponentMetricOperationContext::PutComponentMetricOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -PutComponentMetricOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return PutComponentMetricResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -PutComponentMetricOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -PutComponentMetricOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PutComponentMetricRequest"); -} - -Aws::Crt::String -PutComponentMetricOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); -} - -Aws::Crt::Optional -PutComponentMetricOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -PutComponentMetricOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#PutComponentMetric"); -} - -std::future -PutComponentMetricOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return PutComponentMetricResult(GetOperationResult().get()); - }); -} - -PutComponentMetricOperation::PutComponentMetricOperation( - ClientConnection &connection, - const PutComponentMetricOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future PutComponentMetricOperation::Activate( - const PutComponentMetricRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String PutComponentMetricOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -DeferComponentUpdateOperationContext::DeferComponentUpdateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -DeferComponentUpdateOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -DeferComponentUpdateOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -DeferComponentUpdateOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdateRequest"); -} - -Aws::Crt::String -DeferComponentUpdateOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); -} - -Aws::Crt::Optional -DeferComponentUpdateOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -DeferComponentUpdateOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#DeferComponentUpdate"); -} - -std::future -DeferComponentUpdateOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return DeferComponentUpdateResult(GetOperationResult().get()); - }); -} - -DeferComponentUpdateOperation::DeferComponentUpdateOperation( - ClientConnection &connection, - const DeferComponentUpdateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future DeferComponentUpdateOperation::Activate( - const DeferComponentUpdateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String DeferComponentUpdateOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent( - static_cast(response.get())); -} - -bool SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToValidateConfigurationUpdatesOperationContext:: - SubscribeToValidateConfigurationUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload( - stringView, allocator); -} - -Aws::Crt::ScopedResource -SubscribeToValidateConfigurationUpdatesOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::String -SubscribeToValidateConfigurationUpdatesOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); -} - -Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext:: - GetInitialResponseModelName() const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); -} - -Aws::Crt::Optional -SubscribeToValidateConfigurationUpdatesOperationContext:: - GetStreamingResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ValidateConfigurationUpdateEvents"); -} - -Aws::Crt::String -SubscribeToValidateConfigurationUpdatesOperationContext::GetOperationName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToValidateConfigurationUpdates"); -} - -std::future -SubscribeToValidateConfigurationUpdatesOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToValidateConfigurationUpdatesResult( - GetOperationResult().get()); - }); -} - -SubscribeToValidateConfigurationUpdatesOperation:: - SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - std::shared_ptr - streamHandler, - const SubscribeToValidateConfigurationUpdatesOperationContext - &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future -SubscribeToValidateConfigurationUpdatesOperation::Activate( - const SubscribeToValidateConfigurationUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -SubscribeToValidateConfigurationUpdatesOperation::GetModelName() - const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetConfigurationOperationContext::GetConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetConfigurationOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -GetConfigurationOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetConfigurationOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetConfigurationRequest"); -} - -Aws::Crt::String -GetConfigurationOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); -} - -Aws::Crt::Optional -GetConfigurationOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetConfigurationOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetConfiguration"); -} - -std::future -GetConfigurationOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetConfigurationResult(GetOperationResult().get()); - }); -} - -GetConfigurationOperation::GetConfigurationOperation( - ClientConnection &connection, - const GetConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetConfigurationOperation::Activate( - const GetConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetConfigurationOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void SubscribeToTopicStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool SubscribeToTopicStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && - !streamShouldTerminate) { - streamShouldTerminate = OnStreamError( - static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToTopicOperationContext::SubscribeToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToTopicOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -SubscribeToTopicOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscriptionResponseMessage::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::String -SubscribeToTopicOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToTopicRequest"); -} - -Aws::Crt::String -SubscribeToTopicOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); -} - -Aws::Crt::Optional -SubscribeToTopicOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); -} - -Aws::Crt::String -SubscribeToTopicOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToTopic"); -} - -std::future -SubscribeToTopicOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToTopicResult(GetOperationResult().get()); - }); -} - -SubscribeToTopicOperation::SubscribeToTopicOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future SubscribeToTopicOperation::Activate( - const SubscribeToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String SubscribeToTopicOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetComponentDetailsOperationContext::GetComponentDetailsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetComponentDetailsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetComponentDetailsResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -GetComponentDetailsOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetComponentDetailsOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetComponentDetailsRequest"); -} - -Aws::Crt::String -GetComponentDetailsOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); -} - -Aws::Crt::Optional -GetComponentDetailsOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetComponentDetailsOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetComponentDetails"); -} - -std::future -GetComponentDetailsOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetComponentDetailsResult(GetOperationResult().get()); - }); -} - -GetComponentDetailsOperation::GetComponentDetailsOperation( - ClientConnection &connection, - const GetComponentDetailsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetComponentDetailsOperation::Activate( - const GetComponentDetailsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetComponentDetailsOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetClientDeviceAuthTokenOperationContext:: - GetClientDeviceAuthTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetClientDeviceAuthTokenOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -GetClientDeviceAuthTokenOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetClientDeviceAuthTokenOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenRequest"); -} - -Aws::Crt::String -GetClientDeviceAuthTokenOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenResponse"); -} - -Aws::Crt::Optional -GetClientDeviceAuthTokenOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetClientDeviceAuthTokenOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthToken"); -} - -std::future -GetClientDeviceAuthTokenOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetClientDeviceAuthTokenResult(GetOperationResult().get()); - }); -} - -GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( - ClientConnection &connection, - const GetClientDeviceAuthTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetClientDeviceAuthTokenOperation::Activate( - const GetClientDeviceAuthTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -GetClientDeviceAuthTokenOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -PublishToTopicOperationContext::PublishToTopicOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -PublishToTopicOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return PublishToTopicResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -PublishToTopicOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -PublishToTopicOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToTopicRequest"); -} - -Aws::Crt::String -PublishToTopicOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); -} - -Aws::Crt::Optional -PublishToTopicOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -PublishToTopicOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#PublishToTopic"); -} - -std::future -PublishToTopicOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return PublishToTopicResult(GetOperationResult().get()); - }); -} - -PublishToTopicOperation::PublishToTopicOperation( - ClientConnection &connection, - const PublishToTopicOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future PublishToTopicOperation::Activate( - const PublishToTopicRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String PublishToTopicOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void SubscribeToCertificateUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool SubscribeToCertificateUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#UnauthorizedError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && - !streamShouldTerminate) { - streamShouldTerminate = OnStreamError( - static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToCertificateUpdatesOperationContext:: - SubscribeToCertificateUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToCertificateUpdatesOperationContext:: - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( - stringView, allocator); -} - -Aws::Crt::ScopedResource -SubscribeToCertificateUpdatesOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::String -SubscribeToCertificateUpdatesOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToCertificateUpdatesRequest"); -} - -Aws::Crt::String -SubscribeToCertificateUpdatesOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SubscribeToCertificateUpdatesResponse"); -} - -Aws::Crt::Optional -SubscribeToCertificateUpdatesOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#CertificateUpdateEvent"); -} - -Aws::Crt::String -SubscribeToCertificateUpdatesOperationContext::GetOperationName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdates"); -} - -std::future -SubscribeToCertificateUpdatesOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); - }); -} - -SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToCertificateUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future SubscribeToCertificateUpdatesOperation::Activate( - const SubscribeToCertificateUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -SubscribeToCertificateUpdatesOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -VerifyClientDeviceIdentityOperationContext:: - VerifyClientDeviceIdentityOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -VerifyClientDeviceIdentityOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -VerifyClientDeviceIdentityOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -VerifyClientDeviceIdentityOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityRequest"); -} - -Aws::Crt::String -VerifyClientDeviceIdentityOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityResponse"); -} - -Aws::Crt::Optional -VerifyClientDeviceIdentityOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -VerifyClientDeviceIdentityOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentity"); -} - -std::future -VerifyClientDeviceIdentityOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return VerifyClientDeviceIdentityResult(GetOperationResult().get()); - }); -} - -VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( - ClientConnection &connection, - const VerifyClientDeviceIdentityOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future VerifyClientDeviceIdentityOperation::Activate( - const VerifyClientDeviceIdentityRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -VerifyClientDeviceIdentityOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -AuthorizeClientDeviceActionOperationContext:: - AuthorizeClientDeviceActionOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -AuthorizeClientDeviceActionOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -AuthorizeClientDeviceActionOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -AuthorizeClientDeviceActionOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionRequest"); -} - -Aws::Crt::String -AuthorizeClientDeviceActionOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionResponse"); -} - -Aws::Crt::Optional -AuthorizeClientDeviceActionOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -AuthorizeClientDeviceActionOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceAction"); -} - -std::future -AuthorizeClientDeviceActionOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return AuthorizeClientDeviceActionResult(GetOperationResult().get()); - }); -} - -AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( - ClientConnection &connection, - const AuthorizeClientDeviceActionOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future AuthorizeClientDeviceActionOperation::Activate( - const AuthorizeClientDeviceActionRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -AuthorizeClientDeviceActionOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -ListComponentsOperationContext::ListComponentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -ListComponentsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ListComponentsResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -ListComponentsOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -ListComponentsOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListComponentsRequest"); -} - -Aws::Crt::String -ListComponentsOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); -} - -Aws::Crt::Optional -ListComponentsOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -ListComponentsOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListComponents"); -} - -std::future -ListComponentsOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return ListComponentsResult(GetOperationResult().get()); - }); -} - -ListComponentsOperation::ListComponentsOperation( - ClientConnection &connection, - const ListComponentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future ListComponentsOperation::Activate( - const ListComponentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String ListComponentsOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -CreateDebugPasswordOperationContext::CreateDebugPasswordOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -CreateDebugPasswordOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -CreateDebugPasswordOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -CreateDebugPasswordOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#CreateDebugPasswordRequest"); -} - -Aws::Crt::String -CreateDebugPasswordOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); -} - -Aws::Crt::Optional -CreateDebugPasswordOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -CreateDebugPasswordOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#CreateDebugPassword"); -} - -std::future -CreateDebugPasswordOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return CreateDebugPasswordResult(GetOperationResult().get()); - }); -} - -CreateDebugPasswordOperation::CreateDebugPasswordOperation( - ClientConnection &connection, - const CreateDebugPasswordOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future CreateDebugPasswordOperation::Activate( - const CreateDebugPasswordRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String CreateDebugPasswordOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetThingShadowOperationContext::GetThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetThingShadowOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetThingShadowResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -GetThingShadowOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetThingShadowOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetThingShadowRequest"); -} - -Aws::Crt::String -GetThingShadowOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); -} - -Aws::Crt::Optional -GetThingShadowOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetThingShadowOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetThingShadow"); -} - -std::future -GetThingShadowOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetThingShadowResult(GetOperationResult().get()); - }); -} - -GetThingShadowOperation::GetThingShadowOperation( - ClientConnection &connection, - const GetThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetThingShadowOperation::Activate( - const GetThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetThingShadowOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -SendConfigurationValidityReportOperationContext:: - SendConfigurationValidityReportOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SendConfigurationValidityReportOperationContext:: - AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SendConfigurationValidityReportResponse::s_allocateFromPayload( - stringView, allocator); -} - -Aws::Crt::ScopedResource -SendConfigurationValidityReportOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -SendConfigurationValidityReportOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SendConfigurationValidityReportRequest"); -} - -Aws::Crt::String -SendConfigurationValidityReportOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String( - "aws.greengrass#SendConfigurationValidityReportResponse"); -} - -Aws::Crt::Optional -SendConfigurationValidityReportOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -SendConfigurationValidityReportOperationContext::GetOperationName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReport"); -} - -std::future -SendConfigurationValidityReportOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SendConfigurationValidityReportResult(GetOperationResult().get()); - }); -} - -SendConfigurationValidityReportOperation:: - SendConfigurationValidityReportOperation( - ClientConnection &connection, - const SendConfigurationValidityReportOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future SendConfigurationValidityReportOperation::Activate( - const SendConfigurationValidityReportRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -SendConfigurationValidityReportOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -UpdateThingShadowOperationContext::UpdateThingShadowOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -UpdateThingShadowOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return UpdateThingShadowResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -UpdateThingShadowOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -UpdateThingShadowOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateThingShadowRequest"); -} - -Aws::Crt::String -UpdateThingShadowOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); -} - -Aws::Crt::Optional -UpdateThingShadowOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -UpdateThingShadowOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateThingShadow"); -} - -std::future -UpdateThingShadowOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return UpdateThingShadowResult(GetOperationResult().get()); - }); -} - -UpdateThingShadowOperation::UpdateThingShadowOperation( - ClientConnection &connection, - const UpdateThingShadowOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future UpdateThingShadowOperation::Activate( - const UpdateThingShadowRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String UpdateThingShadowOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -UpdateConfigurationOperationContext::UpdateConfigurationOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -UpdateConfigurationOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return UpdateConfigurationResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -UpdateConfigurationOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -UpdateConfigurationOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateConfigurationRequest"); -} - -Aws::Crt::String -UpdateConfigurationOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); -} - -Aws::Crt::Optional -UpdateConfigurationOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -UpdateConfigurationOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateConfiguration"); -} - -std::future -UpdateConfigurationOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return UpdateConfigurationResult(GetOperationResult().get()); - }); -} - -UpdateConfigurationOperation::UpdateConfigurationOperation( - ClientConnection &connection, - const UpdateConfigurationOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future UpdateConfigurationOperation::Activate( - const UpdateConfigurationRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String UpdateConfigurationOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -ValidateAuthorizationTokenOperationContext:: - ValidateAuthorizationTokenOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -ValidateAuthorizationTokenOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -ValidateAuthorizationTokenOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -ValidateAuthorizationTokenOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenRequest"); -} - -Aws::Crt::String -ValidateAuthorizationTokenOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenResponse"); -} - -Aws::Crt::Optional -ValidateAuthorizationTokenOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -ValidateAuthorizationTokenOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#ValidateAuthorizationToken"); -} - -std::future -ValidateAuthorizationTokenOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return ValidateAuthorizationTokenResult(GetOperationResult().get()); - }); -} - -ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( - ClientConnection &connection, - const ValidateAuthorizationTokenOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future ValidateAuthorizationTokenOperation::Activate( - const ValidateAuthorizationTokenRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -ValidateAuthorizationTokenOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -RestartComponentOperationContext::RestartComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -RestartComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -RestartComponentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -RestartComponentOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#RestartComponentRequest"); -} - -Aws::Crt::String -RestartComponentOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); -} - -Aws::Crt::Optional -RestartComponentOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -RestartComponentOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#RestartComponent"); -} - -std::future -RestartComponentOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return RestartComponentResult(GetOperationResult().get()); - }); -} - -RestartComponentOperation::RestartComponentOperation( - ClientConnection &connection, - const RestartComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future RestartComponentOperation::Activate( - const RestartComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String RestartComponentOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetLocalDeploymentStatusOperationContext:: - GetLocalDeploymentStatusOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetLocalDeploymentStatusOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -GetLocalDeploymentStatusOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetLocalDeploymentStatusOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusRequest"); -} - -Aws::Crt::String -GetLocalDeploymentStatusOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusResponse"); -} - -Aws::Crt::Optional -GetLocalDeploymentStatusOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetLocalDeploymentStatusOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatus"); -} - -std::future -GetLocalDeploymentStatusOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetLocalDeploymentStatusResult(GetOperationResult().get()); - }); -} - -GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( - ClientConnection &connection, - const GetLocalDeploymentStatusOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetLocalDeploymentStatusOperation::Activate( - const GetLocalDeploymentStatusRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -GetLocalDeploymentStatusOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GetSecretValueOperationContext::GetSecretValueOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -GetSecretValueOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return GetSecretValueResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -GetSecretValueOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -GetSecretValueOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetSecretValueRequest"); -} - -Aws::Crt::String -GetSecretValueOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); -} - -Aws::Crt::Optional -GetSecretValueOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -GetSecretValueOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#GetSecretValue"); -} - -std::future -GetSecretValueOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return GetSecretValueResult(GetOperationResult().get()); - }); -} - -GetSecretValueOperation::GetSecretValueOperation( - ClientConnection &connection, - const GetSecretValueOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future GetSecretValueOperation::Activate( - const GetSecretValueRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String GetSecretValueOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -UpdateStateOperationContext::UpdateStateOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -UpdateStateOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return UpdateStateResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -UpdateStateOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -UpdateStateOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateStateRequest"); -} - -Aws::Crt::String -UpdateStateOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateStateResponse"); -} - -Aws::Crt::Optional -UpdateStateOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -UpdateStateOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#UpdateState"); -} - -std::future UpdateStateOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return UpdateStateResult(GetOperationResult().get()); - }); -} - -UpdateStateOperation::UpdateStateOperation( - ClientConnection &connection, - const UpdateStateOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future UpdateStateOperation::Activate( - const UpdateStateRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String UpdateStateOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -ListNamedShadowsForThingOperationContext:: - ListNamedShadowsForThingOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -ListNamedShadowsForThingOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -ListNamedShadowsForThingOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -ListNamedShadowsForThingOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingRequest"); -} - -Aws::Crt::String -ListNamedShadowsForThingOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingResponse"); -} - -Aws::Crt::Optional -ListNamedShadowsForThingOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -ListNamedShadowsForThingOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThing"); -} - -std::future -ListNamedShadowsForThingOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return ListNamedShadowsForThingResult(GetOperationResult().get()); - }); -} - -ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( - ClientConnection &connection, - const ListNamedShadowsForThingOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future ListNamedShadowsForThingOperation::Activate( - const ListNamedShadowsForThingRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -ListNamedShadowsForThingOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -void SubscribeToComponentUpdatesStreamHandler::OnStreamEvent( - Aws::Crt::ScopedResource response) { - OnStreamEvent(static_cast(response.get())); -} - -bool SubscribeToComponentUpdatesStreamHandler::OnStreamError( - Aws::Crt::ScopedResource operationError, - RpcError rpcError) { - bool streamShouldTerminate = false; - if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) { - streamShouldTerminate = OnStreamError(rpcError); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ServiceError") && - !streamShouldTerminate) { - streamShouldTerminate = - OnStreamError(static_cast(operationError.get())); - } - if (operationError != nullptr && - operationError->GetModelName() == - Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && - !streamShouldTerminate) { - streamShouldTerminate = OnStreamError( - static_cast(operationError.get())); - } - if (operationError != nullptr && !streamShouldTerminate) - streamShouldTerminate = OnStreamError(operationError.get()); - return streamShouldTerminate; -} - -SubscribeToComponentUpdatesOperationContext:: - SubscribeToComponentUpdatesOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -SubscribeToComponentUpdatesOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -SubscribeToComponentUpdatesOperationContext:: - AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::String -SubscribeToComponentUpdatesOperationContext::GetRequestModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesRequest"); -} - -Aws::Crt::String -SubscribeToComponentUpdatesOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesResponse"); -} - -Aws::Crt::Optional -SubscribeToComponentUpdatesOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ComponentUpdatePolicyEvents"); -} - -Aws::Crt::String -SubscribeToComponentUpdatesOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdates"); -} - -std::future -SubscribeToComponentUpdatesOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); -} - -SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - std::shared_ptr streamHandler, - const SubscribeToComponentUpdatesOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, streamHandler, operationContext, allocator) {} - -std::future SubscribeToComponentUpdatesOperation::Activate( - const SubscribeToComponentUpdatesRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String -SubscribeToComponentUpdatesOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -ListLocalDeploymentsOperationContext::ListLocalDeploymentsOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -ListLocalDeploymentsOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -ListLocalDeploymentsOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -ListLocalDeploymentsOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsRequest"); -} - -Aws::Crt::String -ListLocalDeploymentsOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); -} - -Aws::Crt::Optional -ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -ListLocalDeploymentsOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#ListLocalDeployments"); -} - -std::future -ListLocalDeploymentsOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return ListLocalDeploymentsResult(GetOperationResult().get()); - }); -} - -ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( - ClientConnection &connection, - const ListLocalDeploymentsOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future ListLocalDeploymentsOperation::Activate( - const ListLocalDeploymentsRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String ListLocalDeploymentsOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -StopComponentOperationContext::StopComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -StopComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return StopComponentResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -StopComponentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -StopComponentOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#StopComponentRequest"); -} - -Aws::Crt::String -StopComponentOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#StopComponentResponse"); -} - -Aws::Crt::Optional -StopComponentOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -StopComponentOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#StopComponent"); -} - -std::future StopComponentOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return StopComponentResult(GetOperationResult().get()); - }); -} - -StopComponentOperation::StopComponentOperation( - ClientConnection &connection, - const StopComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future StopComponentOperation::Activate( - const StopComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String StopComponentOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -PauseComponentOperationContext::PauseComponentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -PauseComponentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return PauseComponentResponse::s_allocateFromPayload(stringView, allocator); -} - -Aws::Crt::ScopedResource -PauseComponentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -PauseComponentOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PauseComponentRequest"); -} - -Aws::Crt::String -PauseComponentOperationContext::GetInitialResponseModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); -} - -Aws::Crt::Optional -PauseComponentOperationContext::GetStreamingResponseModelName() const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -PauseComponentOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#PauseComponent"); -} - -std::future -PauseComponentOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return PauseComponentResult(GetOperationResult().get()); - }); -} - -PauseComponentOperation::PauseComponentOperation( - ClientConnection &connection, - const PauseComponentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future PauseComponentOperation::Activate( - const PauseComponentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String PauseComponentOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -CreateLocalDeploymentOperationContext::CreateLocalDeploymentOperationContext( - const GreengrassCoreIpcServiceModel &serviceModel) noexcept - : OperationModelContext(serviceModel) {} - -Aws::Crt::ScopedResource -CreateLocalDeploymentOperationContext::AllocateInitialResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, - allocator); -} - -Aws::Crt::ScopedResource -CreateLocalDeploymentOperationContext::AllocateStreamingResponseFromPayload( - Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - (void)stringView; - (void)allocator; - return nullptr; -} - -Aws::Crt::String -CreateLocalDeploymentOperationContext::GetRequestModelName() const noexcept { - return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentRequest"); -} - -Aws::Crt::String -CreateLocalDeploymentOperationContext::GetInitialResponseModelName() - const noexcept { - return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentResponse"); -} - -Aws::Crt::Optional -CreateLocalDeploymentOperationContext::GetStreamingResponseModelName() - const noexcept { - return Aws::Crt::Optional(); -} - -Aws::Crt::String -CreateLocalDeploymentOperationContext::GetOperationName() const noexcept { - return Aws::Crt::String("aws.greengrass#CreateLocalDeployment"); -} - -std::future -CreateLocalDeploymentOperation::GetResult() noexcept { - return std::async(m_asyncLaunchMode, [this]() { - return CreateLocalDeploymentResult(GetOperationResult().get()); - }); -} - -CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( - ClientConnection &connection, - const CreateLocalDeploymentOperationContext &operationContext, - Aws::Crt::Allocator *allocator) noexcept - : ClientOperation(connection, nullptr, operationContext, allocator) {} - -std::future CreateLocalDeploymentOperation::Activate( - const CreateLocalDeploymentRequest &request, - OnMessageFlushCallback onMessageFlushCallback) noexcept { - return ClientOperation::Activate( - static_cast(&request), onMessageFlushCallback); -} - -Aws::Crt::String CreateLocalDeploymentOperation::GetModelName() const noexcept { - return m_operationModelContext.GetOperationName(); -} - -GreengrassCoreIpcServiceModel::GreengrassCoreIpcServiceModel() noexcept - : m_subscribeToIoTCoreOperationContext(*this), - m_resumeComponentOperationContext(*this), - m_publishToIoTCoreOperationContext(*this), - m_subscribeToConfigurationUpdateOperationContext(*this), - m_deleteThingShadowOperationContext(*this), - m_putComponentMetricOperationContext(*this), - m_deferComponentUpdateOperationContext(*this), - m_subscribeToValidateConfigurationUpdatesOperationContext(*this), - m_getConfigurationOperationContext(*this), - m_subscribeToTopicOperationContext(*this), - m_getComponentDetailsOperationContext(*this), - m_getClientDeviceAuthTokenOperationContext(*this), - m_publishToTopicOperationContext(*this), - m_subscribeToCertificateUpdatesOperationContext(*this), - m_verifyClientDeviceIdentityOperationContext(*this), - m_authorizeClientDeviceActionOperationContext(*this), - m_listComponentsOperationContext(*this), - m_createDebugPasswordOperationContext(*this), - m_getThingShadowOperationContext(*this), - m_sendConfigurationValidityReportOperationContext(*this), - m_updateThingShadowOperationContext(*this), - m_updateConfigurationOperationContext(*this), - m_validateAuthorizationTokenOperationContext(*this), - m_restartComponentOperationContext(*this), - m_getLocalDeploymentStatusOperationContext(*this), - m_getSecretValueOperationContext(*this), - m_updateStateOperationContext(*this), - m_listNamedShadowsForThingOperationContext(*this), - m_subscribeToComponentUpdatesOperationContext(*this), - m_listLocalDeploymentsOperationContext(*this), - m_stopComponentOperationContext(*this), - m_pauseComponentOperationContext(*this), - m_createLocalDeploymentOperationContext(*this) {} - -Aws::Crt::ScopedResource -GreengrassCoreIpcServiceModel::AllocateOperationErrorFromPayload( - const Aws::Crt::String &errorModelName, Aws::Crt::StringView stringView, - Aws::Crt::Allocator *allocator) const noexcept { - auto it = m_modelNameToErrorResponse.find(errorModelName); - if (it == m_modelNameToErrorResponse.end()) { - return nullptr; - } else { - return it->second(stringView, allocator); - } -} - -void GreengrassCoreIpcServiceModel::AssignModelNameToErrorResponse( - Aws::Crt::String modelName, ErrorResponseFactory factory) noexcept { - m_modelNameToErrorResponse[modelName] = factory; -} -} // namespace Greengrass +namespace Aws +{ + namespace Greengrass + { + void MessageContext::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topic.has_value()) + { + payloadObject.WithString("topic", m_topic.value()); + } + } + + void MessageContext::s_loadFromJsonView( + MessageContext &messageContext, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topic")) + { + messageContext.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); + } + } + + const char *MessageContext::MODEL_NAME = "aws.greengrass#MessageContext"; + + Aws::Crt::String MessageContext::GetModelName() const noexcept { return MessageContext::MODEL_NAME; } + + Aws::Crt::ScopedResource MessageContext::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MessageContext::s_customDeleter); + shape->m_allocator = allocator; + MessageContext::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void MessageContext::s_customDeleter(MessageContext *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SystemResourceLimits::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_memory.has_value()) + { + payloadObject.WithInt64("memory", m_memory.value()); + } + if (m_cpus.has_value()) + { + payloadObject.WithDouble("cpus", m_cpus.value()); + } + } + + void SystemResourceLimits::s_loadFromJsonView( + SystemResourceLimits &systemResourceLimits, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("memory")) + { + systemResourceLimits.m_memory = Aws::Crt::Optional(jsonView.GetInt64("memory")); + } + if (jsonView.ValueExists("cpus")) + { + systemResourceLimits.m_cpus = Aws::Crt::Optional(jsonView.GetDouble("cpus")); + } + } + + const char *SystemResourceLimits::MODEL_NAME = "aws.greengrass#SystemResourceLimits"; + + Aws::Crt::String SystemResourceLimits::GetModelName() const noexcept + { + return SystemResourceLimits::MODEL_NAME; + } + + Aws::Crt::ScopedResource SystemResourceLimits::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SystemResourceLimits::s_customDeleter); + shape->m_allocator = allocator; + SystemResourceLimits::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SystemResourceLimits::s_customDeleter(SystemResourceLimits *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ValidateConfigurationUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_configuration.has_value()) + { + payloadObject.WithObject("configuration", m_configuration.value()); + } + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + } + + void ValidateConfigurationUpdateEvent::s_loadFromJsonView( + ValidateConfigurationUpdateEvent &validateConfigurationUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("configuration")) + { + validateConfigurationUpdateEvent.m_configuration = + Aws::Crt::Optional(jsonView.GetJsonObject("configuration").Materialize()); + } + if (jsonView.ValueExists("deploymentId")) + { + validateConfigurationUpdateEvent.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + } + + const char *ValidateConfigurationUpdateEvent::MODEL_NAME = "aws.greengrass#ValidateConfigurationUpdateEvent"; + + Aws::Crt::String ValidateConfigurationUpdateEvent::GetModelName() const noexcept + { + return ValidateConfigurationUpdateEvent::MODEL_NAME; + } + + Aws::Crt::ScopedResource ValidateConfigurationUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateConfigurationUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + ValidateConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ValidateConfigurationUpdateEvent::s_customDeleter(ValidateConfigurationUpdateEvent *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void MQTTMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topicName.has_value()) + { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void MQTTMessage::s_loadFromJsonView(MQTTMessage &mQTTMessage, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topicName")) + { + mQTTMessage.m_topicName = Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + mQTTMessage.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + const char *MQTTMessage::MODEL_NAME = "aws.greengrass#MQTTMessage"; + + Aws::Crt::String MQTTMessage::GetModelName() const noexcept { return MQTTMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource MQTTMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MQTTMessage::s_customDeleter); + shape->m_allocator = allocator; + MQTTMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void MQTTMessage::s_customDeleter(MQTTMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ConfigurationUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) + { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) + { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } + } + + void ConfigurationUpdateEvent::s_loadFromJsonView( + ConfigurationUpdateEvent &configurationUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + configurationUpdateEvent.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) + { + configurationUpdateEvent.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) + { + Aws::Crt::Optional keyPathItem; + keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); + configurationUpdateEvent.m_keyPath.value().push_back(keyPathItem.value()); + } + } + } + + const char *ConfigurationUpdateEvent::MODEL_NAME = "aws.greengrass#ConfigurationUpdateEvent"; + + Aws::Crt::String ConfigurationUpdateEvent::GetModelName() const noexcept + { + return ConfigurationUpdateEvent::MODEL_NAME; + } + + Aws::Crt::ScopedResource ConfigurationUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ConfigurationUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ConfigurationUpdateEvent::s_customDeleter(ConfigurationUpdateEvent *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PostComponentUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + } + + void PostComponentUpdateEvent::s_loadFromJsonView( + PostComponentUpdateEvent &postComponentUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + postComponentUpdateEvent.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + } + + const char *PostComponentUpdateEvent::MODEL_NAME = "aws.greengrass#PostComponentUpdateEvent"; + + Aws::Crt::String PostComponentUpdateEvent::GetModelName() const noexcept + { + return PostComponentUpdateEvent::MODEL_NAME; + } + + Aws::Crt::ScopedResource PostComponentUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PostComponentUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + PostComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PostComponentUpdateEvent::s_customDeleter(PostComponentUpdateEvent *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PreComponentUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_isGgcRestarting.has_value()) + { + payloadObject.WithBool("isGgcRestarting", m_isGgcRestarting.value()); + } + } + + void PreComponentUpdateEvent::s_loadFromJsonView( + PreComponentUpdateEvent &preComponentUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + preComponentUpdateEvent.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("isGgcRestarting")) + { + preComponentUpdateEvent.m_isGgcRestarting = + Aws::Crt::Optional(jsonView.GetBool("isGgcRestarting")); + } + } + + const char *PreComponentUpdateEvent::MODEL_NAME = "aws.greengrass#PreComponentUpdateEvent"; + + Aws::Crt::String PreComponentUpdateEvent::GetModelName() const noexcept + { + return PreComponentUpdateEvent::MODEL_NAME; + } + + Aws::Crt::ScopedResource PreComponentUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PreComponentUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + PreComponentUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PreComponentUpdateEvent::s_customDeleter(PreComponentUpdateEvent *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CertificateUpdate::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_privateKey.has_value()) + { + payloadObject.WithString("privateKey", m_privateKey.value()); + } + if (m_publicKey.has_value()) + { + payloadObject.WithString("publicKey", m_publicKey.value()); + } + if (m_certificate.has_value()) + { + payloadObject.WithString("certificate", m_certificate.value()); + } + if (m_caCertificates.has_value()) + { + Aws::Crt::JsonObject cACertificates; + Aws::Crt::Vector cACertificatesJsonArray; + for (const auto &cACertificatesItem : m_caCertificates.value()) + { + Aws::Crt::JsonObject cACertificatesJsonArrayItem; + cACertificatesJsonArrayItem.AsString(cACertificatesItem); + cACertificatesJsonArray.emplace_back(std::move(cACertificatesJsonArrayItem)); + } + cACertificates.AsArray(std::move(cACertificatesJsonArray)); + payloadObject.WithObject("caCertificates", std::move(cACertificates)); + } + } + + void CertificateUpdate::s_loadFromJsonView( + CertificateUpdate &certificateUpdate, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("privateKey")) + { + certificateUpdate.m_privateKey = Aws::Crt::Optional(jsonView.GetString("privateKey")); + } + if (jsonView.ValueExists("publicKey")) + { + certificateUpdate.m_publicKey = Aws::Crt::Optional(jsonView.GetString("publicKey")); + } + if (jsonView.ValueExists("certificate")) + { + certificateUpdate.m_certificate = + Aws::Crt::Optional(jsonView.GetString("certificate")); + } + if (jsonView.ValueExists("caCertificates")) + { + certificateUpdate.m_caCertificates = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &cACertificatesJsonView : jsonView.GetArray("caCertificates")) + { + Aws::Crt::Optional cACertificatesItem; + cACertificatesItem = Aws::Crt::Optional(cACertificatesJsonView.AsString()); + certificateUpdate.m_caCertificates.value().push_back(cACertificatesItem.value()); + } + } + } + + const char *CertificateUpdate::MODEL_NAME = "aws.greengrass#CertificateUpdate"; + + Aws::Crt::String CertificateUpdate::GetModelName() const noexcept { return CertificateUpdate::MODEL_NAME; } + + Aws::Crt::ScopedResource CertificateUpdate::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CertificateUpdate::s_customDeleter); + shape->m_allocator = allocator; + CertificateUpdate::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CertificateUpdate::s_customDeleter(CertificateUpdate *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void Metric::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_name.has_value()) + { + payloadObject.WithString("name", m_name.value()); + } + if (m_unit.has_value()) + { + payloadObject.WithString("unit", m_unit.value()); + } + if (m_value.has_value()) + { + payloadObject.WithDouble("value", m_value.value()); + } + } + + void Metric::s_loadFromJsonView(Metric &metric, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("name")) + { + metric.m_name = Aws::Crt::Optional(jsonView.GetString("name")); + } + if (jsonView.ValueExists("unit")) + { + metric.m_unit = Aws::Crt::Optional(jsonView.GetString("unit")); + } + if (jsonView.ValueExists("value")) + { + metric.m_value = Aws::Crt::Optional(jsonView.GetDouble("value")); + } + } + + void Metric::SetUnit(MetricUnitType unit) noexcept + { + switch (unit) + { + case METRIC_UNIT_TYPE_BYTES: + m_unit = Aws::Crt::String("BYTES"); + break; + case METRIC_UNIT_TYPE_BYTES_PER_SECOND: + m_unit = Aws::Crt::String("BYTES_PER_SECOND"); + break; + case METRIC_UNIT_TYPE_COUNT: + m_unit = Aws::Crt::String("COUNT"); + break; + case METRIC_UNIT_TYPE_COUNT_PER_SECOND: + m_unit = Aws::Crt::String("COUNT_PER_SECOND"); + break; + case METRIC_UNIT_TYPE_MEGABYTES: + m_unit = Aws::Crt::String("MEGABYTES"); + break; + case METRIC_UNIT_TYPE_SECONDS: + m_unit = Aws::Crt::String("SECONDS"); + break; + default: + break; + } + } + + Aws::Crt::Optional Metric::GetUnit() noexcept + { + if (!m_unit.has_value()) + return Aws::Crt::Optional(); + if (m_unit.value() == Aws::Crt::String("BYTES")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES); + } + if (m_unit.value() == Aws::Crt::String("BYTES_PER_SECOND")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_BYTES_PER_SECOND); + } + if (m_unit.value() == Aws::Crt::String("COUNT")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT); + } + if (m_unit.value() == Aws::Crt::String("COUNT_PER_SECOND")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_COUNT_PER_SECOND); + } + if (m_unit.value() == Aws::Crt::String("MEGABYTES")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_MEGABYTES); + } + if (m_unit.value() == Aws::Crt::String("SECONDS")) + { + return Aws::Crt::Optional(METRIC_UNIT_TYPE_SECONDS); + } + + return Aws::Crt::Optional(); + } + + const char *Metric::MODEL_NAME = "aws.greengrass#Metric"; + + Aws::Crt::String Metric::GetModelName() const noexcept { return Metric::MODEL_NAME; } + + Aws::Crt::ScopedResource Metric::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape(Aws::Crt::New(allocator), Metric::s_customDeleter); + shape->m_allocator = allocator; + Metric::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void Metric::s_customDeleter(Metric *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void BinaryMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + if (m_message.value().size() > 0) + { + payloadObject.WithString("message", Aws::Crt::Base64Encode(m_message.value())); + } + } + if (m_context.has_value()) + { + Aws::Crt::JsonObject messageContextValue; + m_context.value().SerializeToJsonObject(messageContextValue); + payloadObject.WithObject("context", std::move(messageContextValue)); + } + } + + void BinaryMessage::s_loadFromJsonView( + BinaryMessage &binaryMessage, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + if (jsonView.GetString("message").size() > 0) + { + binaryMessage.m_message = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("message"))); + } + } + if (jsonView.ValueExists("context")) + { + binaryMessage.m_context = MessageContext(); + MessageContext::s_loadFromJsonView(binaryMessage.m_context.value(), jsonView.GetJsonObject("context")); + } + } + + const char *BinaryMessage::MODEL_NAME = "aws.greengrass#BinaryMessage"; + + Aws::Crt::String BinaryMessage::GetModelName() const noexcept { return BinaryMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource BinaryMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), BinaryMessage::s_customDeleter); + shape->m_allocator = allocator; + BinaryMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void BinaryMessage::s_customDeleter(BinaryMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void JsonMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithObject("message", m_message.value()); + } + if (m_context.has_value()) + { + Aws::Crt::JsonObject messageContextValue; + m_context.value().SerializeToJsonObject(messageContextValue); + payloadObject.WithObject("context", std::move(messageContextValue)); + } + } + + void JsonMessage::s_loadFromJsonView(JsonMessage &jsonMessage, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + jsonMessage.m_message = + Aws::Crt::Optional(jsonView.GetJsonObject("message").Materialize()); + } + if (jsonView.ValueExists("context")) + { + jsonMessage.m_context = MessageContext(); + MessageContext::s_loadFromJsonView(jsonMessage.m_context.value(), jsonView.GetJsonObject("context")); + } + } + + const char *JsonMessage::MODEL_NAME = "aws.greengrass#JsonMessage"; + + Aws::Crt::String JsonMessage::GetModelName() const noexcept { return JsonMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource JsonMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), JsonMessage::s_customDeleter); + shape->m_allocator = allocator; + JsonMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void JsonMessage::s_customDeleter(JsonMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void MQTTCredential::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_clientId.has_value()) + { + payloadObject.WithString("clientId", m_clientId.value()); + } + if (m_certificatePem.has_value()) + { + payloadObject.WithString("certificatePem", m_certificatePem.value()); + } + if (m_username.has_value()) + { + payloadObject.WithString("username", m_username.value()); + } + if (m_password.has_value()) + { + payloadObject.WithString("password", m_password.value()); + } + } + + void MQTTCredential::s_loadFromJsonView( + MQTTCredential &mQTTCredential, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("clientId")) + { + mQTTCredential.m_clientId = Aws::Crt::Optional(jsonView.GetString("clientId")); + } + if (jsonView.ValueExists("certificatePem")) + { + mQTTCredential.m_certificatePem = + Aws::Crt::Optional(jsonView.GetString("certificatePem")); + } + if (jsonView.ValueExists("username")) + { + mQTTCredential.m_username = Aws::Crt::Optional(jsonView.GetString("username")); + } + if (jsonView.ValueExists("password")) + { + mQTTCredential.m_password = Aws::Crt::Optional(jsonView.GetString("password")); + } + } + + const char *MQTTCredential::MODEL_NAME = "aws.greengrass#MQTTCredential"; + + Aws::Crt::String MQTTCredential::GetModelName() const noexcept { return MQTTCredential::MODEL_NAME; } + + Aws::Crt::ScopedResource MQTTCredential::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), MQTTCredential::s_customDeleter); + shape->m_allocator = allocator; + MQTTCredential::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void MQTTCredential::s_customDeleter(MQTTCredential *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void RunWithInfo::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_posixUser.has_value()) + { + payloadObject.WithString("posixUser", m_posixUser.value()); + } + if (m_windowsUser.has_value()) + { + payloadObject.WithString("windowsUser", m_windowsUser.value()); + } + if (m_systemResourceLimits.has_value()) + { + Aws::Crt::JsonObject systemResourceLimitsValue; + m_systemResourceLimits.value().SerializeToJsonObject(systemResourceLimitsValue); + payloadObject.WithObject("systemResourceLimits", std::move(systemResourceLimitsValue)); + } + } + + void RunWithInfo::s_loadFromJsonView(RunWithInfo &runWithInfo, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("posixUser")) + { + runWithInfo.m_posixUser = Aws::Crt::Optional(jsonView.GetString("posixUser")); + } + if (jsonView.ValueExists("windowsUser")) + { + runWithInfo.m_windowsUser = Aws::Crt::Optional(jsonView.GetString("windowsUser")); + } + if (jsonView.ValueExists("systemResourceLimits")) + { + runWithInfo.m_systemResourceLimits = SystemResourceLimits(); + SystemResourceLimits::s_loadFromJsonView( + runWithInfo.m_systemResourceLimits.value(), jsonView.GetJsonObject("systemResourceLimits")); + } + } + + const char *RunWithInfo::MODEL_NAME = "aws.greengrass#RunWithInfo"; + + Aws::Crt::String RunWithInfo::GetModelName() const noexcept { return RunWithInfo::MODEL_NAME; } + + Aws::Crt::ScopedResource RunWithInfo::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), RunWithInfo::s_customDeleter); + shape->m_allocator = allocator; + RunWithInfo::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void RunWithInfo::s_customDeleter(RunWithInfo *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ClientDeviceCredential::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE && m_clientDeviceCertificate.has_value()) + { + payloadObject.WithString("clientDeviceCertificate", m_clientDeviceCertificate.value()); + } + } + + void ClientDeviceCredential::s_loadFromJsonView( + ClientDeviceCredential &clientDeviceCredential, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("clientDeviceCertificate")) + { + clientDeviceCredential.m_clientDeviceCertificate = + Aws::Crt::Optional(jsonView.GetString("clientDeviceCertificate")); + clientDeviceCredential.m_chosenMember = TAG_CLIENT_DEVICE_CERTIFICATE; + } + } + + ClientDeviceCredential &ClientDeviceCredential::operator=(const ClientDeviceCredential &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_CLIENT_DEVICE_CERTIFICATE) + { + m_clientDeviceCertificate = objectToCopy.m_clientDeviceCertificate; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *ClientDeviceCredential::MODEL_NAME = "aws.greengrass#ClientDeviceCredential"; + + Aws::Crt::String ClientDeviceCredential::GetModelName() const noexcept + { + return ClientDeviceCredential::MODEL_NAME; + } + + Aws::Crt::ScopedResource ClientDeviceCredential::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ClientDeviceCredential::s_customDeleter); + shape->m_allocator = allocator; + ClientDeviceCredential::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ClientDeviceCredential::s_customDeleter(ClientDeviceCredential *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ValidateConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT && + m_validateConfigurationUpdateEvent.has_value()) + { + Aws::Crt::JsonObject validateConfigurationUpdateEventValue; + m_validateConfigurationUpdateEvent.value().SerializeToJsonObject(validateConfigurationUpdateEventValue); + payloadObject.WithObject( + "validateConfigurationUpdateEvent", std::move(validateConfigurationUpdateEventValue)); + } + } + + void ValidateConfigurationUpdateEvents::s_loadFromJsonView( + ValidateConfigurationUpdateEvents &validateConfigurationUpdateEvents, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("validateConfigurationUpdateEvent")) + { + validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent = + ValidateConfigurationUpdateEvent(); + ValidateConfigurationUpdateEvent::s_loadFromJsonView( + validateConfigurationUpdateEvents.m_validateConfigurationUpdateEvent.value(), + jsonView.GetJsonObject("validateConfigurationUpdateEvent")); + validateConfigurationUpdateEvents.m_chosenMember = TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT; + } + } + + ValidateConfigurationUpdateEvents &ValidateConfigurationUpdateEvents::operator=( + const ValidateConfigurationUpdateEvents &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_VALIDATE_CONFIGURATION_UPDATE_EVENT) + { + m_validateConfigurationUpdateEvent = objectToCopy.m_validateConfigurationUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *ValidateConfigurationUpdateEvents::MODEL_NAME = "aws.greengrass#ValidateConfigurationUpdateEvents"; + + Aws::Crt::String ValidateConfigurationUpdateEvents::GetModelName() const noexcept + { + return ValidateConfigurationUpdateEvents::MODEL_NAME; + } + + Aws::Crt::ScopedResource ValidateConfigurationUpdateEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateConfigurationUpdateEvents::s_customDeleter); + shape->m_allocator = allocator; + ValidateConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ValidateConfigurationUpdateEvents::s_customDeleter(ValidateConfigurationUpdateEvents *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscriptionResponseMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) + { + Aws::Crt::JsonObject jsonMessageValue; + m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); + payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); + } + else if (m_chosenMember == TAG_BINARY_MESSAGE && m_binaryMessage.has_value()) + { + Aws::Crt::JsonObject binaryMessageValue; + m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); + payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); + } + } + + void SubscriptionResponseMessage::s_loadFromJsonView( + SubscriptionResponseMessage &subscriptionResponseMessage, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("jsonMessage")) + { + subscriptionResponseMessage.m_jsonMessage = JsonMessage(); + JsonMessage::s_loadFromJsonView( + subscriptionResponseMessage.m_jsonMessage.value(), jsonView.GetJsonObject("jsonMessage")); + subscriptionResponseMessage.m_chosenMember = TAG_JSON_MESSAGE; + } + else if (jsonView.ValueExists("binaryMessage")) + { + subscriptionResponseMessage.m_binaryMessage = BinaryMessage(); + BinaryMessage::s_loadFromJsonView( + subscriptionResponseMessage.m_binaryMessage.value(), jsonView.GetJsonObject("binaryMessage")); + subscriptionResponseMessage.m_chosenMember = TAG_BINARY_MESSAGE; + } + } + + SubscriptionResponseMessage &SubscriptionResponseMessage::operator=( + const SubscriptionResponseMessage &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) + { + m_jsonMessage = objectToCopy.m_jsonMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) + { + m_binaryMessage = objectToCopy.m_binaryMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *SubscriptionResponseMessage::MODEL_NAME = "aws.greengrass#SubscriptionResponseMessage"; + + Aws::Crt::String SubscriptionResponseMessage::GetModelName() const noexcept + { + return SubscriptionResponseMessage::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscriptionResponseMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SubscriptionResponseMessage::s_customDeleter); + shape->m_allocator = allocator; + SubscriptionResponseMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscriptionResponseMessage::s_customDeleter(SubscriptionResponseMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void IoTCoreMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_MESSAGE && m_message.has_value()) + { + Aws::Crt::JsonObject mQTTMessageValue; + m_message.value().SerializeToJsonObject(mQTTMessageValue); + payloadObject.WithObject("message", std::move(mQTTMessageValue)); + } + } + + void IoTCoreMessage::s_loadFromJsonView( + IoTCoreMessage &ioTCoreMessage, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + ioTCoreMessage.m_message = MQTTMessage(); + MQTTMessage::s_loadFromJsonView(ioTCoreMessage.m_message.value(), jsonView.GetJsonObject("message")); + ioTCoreMessage.m_chosenMember = TAG_MESSAGE; + } + } + + IoTCoreMessage &IoTCoreMessage::operator=(const IoTCoreMessage &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_MESSAGE) + { + m_message = objectToCopy.m_message; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *IoTCoreMessage::MODEL_NAME = "aws.greengrass#IoTCoreMessage"; + + Aws::Crt::String IoTCoreMessage::GetModelName() const noexcept { return IoTCoreMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource IoTCoreMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), IoTCoreMessage::s_customDeleter); + shape->m_allocator = allocator; + IoTCoreMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void IoTCoreMessage::s_customDeleter(IoTCoreMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ConfigurationUpdateEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT && m_configurationUpdateEvent.has_value()) + { + Aws::Crt::JsonObject configurationUpdateEventValue; + m_configurationUpdateEvent.value().SerializeToJsonObject(configurationUpdateEventValue); + payloadObject.WithObject("configurationUpdateEvent", std::move(configurationUpdateEventValue)); + } + } + + void ConfigurationUpdateEvents::s_loadFromJsonView( + ConfigurationUpdateEvents &configurationUpdateEvents, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("configurationUpdateEvent")) + { + configurationUpdateEvents.m_configurationUpdateEvent = ConfigurationUpdateEvent(); + ConfigurationUpdateEvent::s_loadFromJsonView( + configurationUpdateEvents.m_configurationUpdateEvent.value(), + jsonView.GetJsonObject("configurationUpdateEvent")); + configurationUpdateEvents.m_chosenMember = TAG_CONFIGURATION_UPDATE_EVENT; + } + } + + ConfigurationUpdateEvents &ConfigurationUpdateEvents::operator=( + const ConfigurationUpdateEvents &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_CONFIGURATION_UPDATE_EVENT) + { + m_configurationUpdateEvent = objectToCopy.m_configurationUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *ConfigurationUpdateEvents::MODEL_NAME = "aws.greengrass#ConfigurationUpdateEvents"; + + Aws::Crt::String ConfigurationUpdateEvents::GetModelName() const noexcept + { + return ConfigurationUpdateEvents::MODEL_NAME; + } + + Aws::Crt::ScopedResource ConfigurationUpdateEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ConfigurationUpdateEvents::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationUpdateEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ConfigurationUpdateEvents::s_customDeleter(ConfigurationUpdateEvents *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ComponentUpdatePolicyEvents::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_PRE_UPDATE_EVENT && m_preUpdateEvent.has_value()) + { + Aws::Crt::JsonObject preComponentUpdateEventValue; + m_preUpdateEvent.value().SerializeToJsonObject(preComponentUpdateEventValue); + payloadObject.WithObject("preUpdateEvent", std::move(preComponentUpdateEventValue)); + } + else if (m_chosenMember == TAG_POST_UPDATE_EVENT && m_postUpdateEvent.has_value()) + { + Aws::Crt::JsonObject postComponentUpdateEventValue; + m_postUpdateEvent.value().SerializeToJsonObject(postComponentUpdateEventValue); + payloadObject.WithObject("postUpdateEvent", std::move(postComponentUpdateEventValue)); + } + } + + void ComponentUpdatePolicyEvents::s_loadFromJsonView( + ComponentUpdatePolicyEvents &componentUpdatePolicyEvents, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("preUpdateEvent")) + { + componentUpdatePolicyEvents.m_preUpdateEvent = PreComponentUpdateEvent(); + PreComponentUpdateEvent::s_loadFromJsonView( + componentUpdatePolicyEvents.m_preUpdateEvent.value(), jsonView.GetJsonObject("preUpdateEvent")); + componentUpdatePolicyEvents.m_chosenMember = TAG_PRE_UPDATE_EVENT; + } + else if (jsonView.ValueExists("postUpdateEvent")) + { + componentUpdatePolicyEvents.m_postUpdateEvent = PostComponentUpdateEvent(); + PostComponentUpdateEvent::s_loadFromJsonView( + componentUpdatePolicyEvents.m_postUpdateEvent.value(), jsonView.GetJsonObject("postUpdateEvent")); + componentUpdatePolicyEvents.m_chosenMember = TAG_POST_UPDATE_EVENT; + } + } + + ComponentUpdatePolicyEvents &ComponentUpdatePolicyEvents::operator=( + const ComponentUpdatePolicyEvents &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_PRE_UPDATE_EVENT) + { + m_preUpdateEvent = objectToCopy.m_preUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + else if (objectToCopy.m_chosenMember == TAG_POST_UPDATE_EVENT) + { + m_postUpdateEvent = objectToCopy.m_postUpdateEvent; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *ComponentUpdatePolicyEvents::MODEL_NAME = "aws.greengrass#ComponentUpdatePolicyEvents"; + + Aws::Crt::String ComponentUpdatePolicyEvents::GetModelName() const noexcept + { + return ComponentUpdatePolicyEvents::MODEL_NAME; + } + + Aws::Crt::ScopedResource ComponentUpdatePolicyEvents::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ComponentUpdatePolicyEvents::s_customDeleter); + shape->m_allocator = allocator; + ComponentUpdatePolicyEvents::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ComponentUpdatePolicyEvents::s_customDeleter(ComponentUpdatePolicyEvents *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CertificateUpdateEvent::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_CERTIFICATE_UPDATE && m_certificateUpdate.has_value()) + { + Aws::Crt::JsonObject certificateUpdateValue; + m_certificateUpdate.value().SerializeToJsonObject(certificateUpdateValue); + payloadObject.WithObject("certificateUpdate", std::move(certificateUpdateValue)); + } + } + + void CertificateUpdateEvent::s_loadFromJsonView( + CertificateUpdateEvent &certificateUpdateEvent, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("certificateUpdate")) + { + certificateUpdateEvent.m_certificateUpdate = CertificateUpdate(); + CertificateUpdate::s_loadFromJsonView( + certificateUpdateEvent.m_certificateUpdate.value(), jsonView.GetJsonObject("certificateUpdate")); + certificateUpdateEvent.m_chosenMember = TAG_CERTIFICATE_UPDATE; + } + } + + CertificateUpdateEvent &CertificateUpdateEvent::operator=(const CertificateUpdateEvent &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_CERTIFICATE_UPDATE) + { + m_certificateUpdate = objectToCopy.m_certificateUpdate; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *CertificateUpdateEvent::MODEL_NAME = "aws.greengrass#CertificateUpdateEvent"; + + Aws::Crt::String CertificateUpdateEvent::GetModelName() const noexcept + { + return CertificateUpdateEvent::MODEL_NAME; + } + + Aws::Crt::ScopedResource CertificateUpdateEvent::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CertificateUpdateEvent::s_customDeleter); + shape->m_allocator = allocator; + CertificateUpdateEvent::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CertificateUpdateEvent::s_customDeleter(CertificateUpdateEvent *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CertificateOptions::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_certificateType.has_value()) + { + payloadObject.WithString("certificateType", m_certificateType.value()); + } + } + + void CertificateOptions::s_loadFromJsonView( + CertificateOptions &certificateOptions, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("certificateType")) + { + certificateOptions.m_certificateType = + Aws::Crt::Optional(jsonView.GetString("certificateType")); + } + } + + void CertificateOptions::SetCertificateType(CertificateType certificateType) noexcept + { + switch (certificateType) + { + case CERTIFICATE_TYPE_SERVER: + m_certificateType = Aws::Crt::String("SERVER"); + break; + default: + break; + } + } + + Aws::Crt::Optional CertificateOptions::GetCertificateType() noexcept + { + if (!m_certificateType.has_value()) + return Aws::Crt::Optional(); + if (m_certificateType.value() == Aws::Crt::String("SERVER")) + { + return Aws::Crt::Optional(CERTIFICATE_TYPE_SERVER); + } + + return Aws::Crt::Optional(); + } + + const char *CertificateOptions::MODEL_NAME = "aws.greengrass#CertificateOptions"; + + Aws::Crt::String CertificateOptions::GetModelName() const noexcept { return CertificateOptions::MODEL_NAME; } + + Aws::Crt::ScopedResource CertificateOptions::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CertificateOptions::s_customDeleter); + shape->m_allocator = allocator; + CertificateOptions::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CertificateOptions::s_customDeleter(CertificateOptions *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ConfigurationValidityReport::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_status.has_value()) + { + payloadObject.WithString("status", m_status.value()); + } + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void ConfigurationValidityReport::s_loadFromJsonView( + ConfigurationValidityReport &configurationValidityReport, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("status")) + { + configurationValidityReport.m_status = + Aws::Crt::Optional(jsonView.GetString("status")); + } + if (jsonView.ValueExists("deploymentId")) + { + configurationValidityReport.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("message")) + { + configurationValidityReport.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + void ConfigurationValidityReport::SetStatus(ConfigurationValidityStatus status) noexcept + { + switch (status) + { + case CONFIGURATION_VALIDITY_STATUS_ACCEPTED: + m_status = Aws::Crt::String("ACCEPTED"); + break; + case CONFIGURATION_VALIDITY_STATUS_REJECTED: + m_status = Aws::Crt::String("REJECTED"); + break; + default: + break; + } + } + + Aws::Crt::Optional ConfigurationValidityReport::GetStatus() noexcept + { + if (!m_status.has_value()) + return Aws::Crt::Optional(); + if (m_status.value() == Aws::Crt::String("ACCEPTED")) + { + return Aws::Crt::Optional(CONFIGURATION_VALIDITY_STATUS_ACCEPTED); + } + if (m_status.value() == Aws::Crt::String("REJECTED")) + { + return Aws::Crt::Optional(CONFIGURATION_VALIDITY_STATUS_REJECTED); + } + + return Aws::Crt::Optional(); + } + + const char *ConfigurationValidityReport::MODEL_NAME = "aws.greengrass#ConfigurationValidityReport"; + + Aws::Crt::String ConfigurationValidityReport::GetModelName() const noexcept + { + return ConfigurationValidityReport::MODEL_NAME; + } + + Aws::Crt::ScopedResource ConfigurationValidityReport::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ConfigurationValidityReport::s_customDeleter); + shape->m_allocator = allocator; + ConfigurationValidityReport::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ConfigurationValidityReport::s_customDeleter(ConfigurationValidityReport *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PublishMessage::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_JSON_MESSAGE && m_jsonMessage.has_value()) + { + Aws::Crt::JsonObject jsonMessageValue; + m_jsonMessage.value().SerializeToJsonObject(jsonMessageValue); + payloadObject.WithObject("jsonMessage", std::move(jsonMessageValue)); + } + else if (m_chosenMember == TAG_BINARY_MESSAGE && m_binaryMessage.has_value()) + { + Aws::Crt::JsonObject binaryMessageValue; + m_binaryMessage.value().SerializeToJsonObject(binaryMessageValue); + payloadObject.WithObject("binaryMessage", std::move(binaryMessageValue)); + } + } + + void PublishMessage::s_loadFromJsonView( + PublishMessage &publishMessage, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("jsonMessage")) + { + publishMessage.m_jsonMessage = JsonMessage(); + JsonMessage::s_loadFromJsonView( + publishMessage.m_jsonMessage.value(), jsonView.GetJsonObject("jsonMessage")); + publishMessage.m_chosenMember = TAG_JSON_MESSAGE; + } + else if (jsonView.ValueExists("binaryMessage")) + { + publishMessage.m_binaryMessage = BinaryMessage(); + BinaryMessage::s_loadFromJsonView( + publishMessage.m_binaryMessage.value(), jsonView.GetJsonObject("binaryMessage")); + publishMessage.m_chosenMember = TAG_BINARY_MESSAGE; + } + } + + PublishMessage &PublishMessage::operator=(const PublishMessage &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_JSON_MESSAGE) + { + m_jsonMessage = objectToCopy.m_jsonMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + else if (objectToCopy.m_chosenMember == TAG_BINARY_MESSAGE) + { + m_binaryMessage = objectToCopy.m_binaryMessage; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *PublishMessage::MODEL_NAME = "aws.greengrass#PublishMessage"; + + Aws::Crt::String PublishMessage::GetModelName() const noexcept { return PublishMessage::MODEL_NAME; } + + Aws::Crt::ScopedResource PublishMessage::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PublishMessage::s_customDeleter); + shape->m_allocator = allocator; + PublishMessage::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PublishMessage::s_customDeleter(PublishMessage *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SecretValue::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_SECRET_STRING && m_secretString.has_value()) + { + payloadObject.WithString("secretString", m_secretString.value()); + } + else if (m_chosenMember == TAG_SECRET_BINARY && m_secretBinary.has_value()) + { + if (m_secretBinary.value().size() > 0) + { + payloadObject.WithString("secretBinary", Aws::Crt::Base64Encode(m_secretBinary.value())); + } + } + } + + void SecretValue::s_loadFromJsonView(SecretValue &secretValue, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("secretString")) + { + secretValue.m_secretString = Aws::Crt::Optional(jsonView.GetString("secretString")); + secretValue.m_chosenMember = TAG_SECRET_STRING; + } + else if (jsonView.ValueExists("secretBinary")) + { + if (jsonView.GetString("secretBinary").size() > 0) + { + secretValue.m_secretBinary = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("secretBinary"))); + } + secretValue.m_chosenMember = TAG_SECRET_BINARY; + } + } + + SecretValue &SecretValue::operator=(const SecretValue &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_SECRET_STRING) + { + m_secretString = objectToCopy.m_secretString; + m_chosenMember = objectToCopy.m_chosenMember; + } + else if (objectToCopy.m_chosenMember == TAG_SECRET_BINARY) + { + m_secretBinary = objectToCopy.m_secretBinary; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *SecretValue::MODEL_NAME = "aws.greengrass#SecretValue"; + + Aws::Crt::String SecretValue::GetModelName() const noexcept { return SecretValue::MODEL_NAME; } + + Aws::Crt::ScopedResource SecretValue::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SecretValue::s_customDeleter); + shape->m_allocator = allocator; + SecretValue::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SecretValue::s_customDeleter(SecretValue *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void LocalDeployment::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_status.has_value()) + { + payloadObject.WithString("status", m_status.value()); + } + } + + void LocalDeployment::s_loadFromJsonView( + LocalDeployment &localDeployment, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + localDeployment.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("status")) + { + localDeployment.m_status = Aws::Crt::Optional(jsonView.GetString("status")); + } + } + + void LocalDeployment::SetStatus(DeploymentStatus status) noexcept + { + switch (status) + { + case DEPLOYMENT_STATUS_QUEUED: + m_status = Aws::Crt::String("QUEUED"); + break; + case DEPLOYMENT_STATUS_IN_PROGRESS: + m_status = Aws::Crt::String("IN_PROGRESS"); + break; + case DEPLOYMENT_STATUS_SUCCEEDED: + m_status = Aws::Crt::String("SUCCEEDED"); + break; + case DEPLOYMENT_STATUS_FAILED: + m_status = Aws::Crt::String("FAILED"); + break; + default: + break; + } + } + + Aws::Crt::Optional LocalDeployment::GetStatus() noexcept + { + if (!m_status.has_value()) + return Aws::Crt::Optional(); + if (m_status.value() == Aws::Crt::String("QUEUED")) + { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_QUEUED); + } + if (m_status.value() == Aws::Crt::String("IN_PROGRESS")) + { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_IN_PROGRESS); + } + if (m_status.value() == Aws::Crt::String("SUCCEEDED")) + { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_SUCCEEDED); + } + if (m_status.value() == Aws::Crt::String("FAILED")) + { + return Aws::Crt::Optional(DEPLOYMENT_STATUS_FAILED); + } + + return Aws::Crt::Optional(); + } + + const char *LocalDeployment::MODEL_NAME = "aws.greengrass#LocalDeployment"; + + Aws::Crt::String LocalDeployment::GetModelName() const noexcept { return LocalDeployment::MODEL_NAME; } + + Aws::Crt::ScopedResource LocalDeployment::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), LocalDeployment::s_customDeleter); + shape->m_allocator = allocator; + LocalDeployment::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void LocalDeployment::s_customDeleter(LocalDeployment *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ComponentDetails::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_version.has_value()) + { + payloadObject.WithString("version", m_version.value()); + } + if (m_state.has_value()) + { + payloadObject.WithString("state", m_state.value()); + } + if (m_configuration.has_value()) + { + payloadObject.WithObject("configuration", m_configuration.value()); + } + } + + void ComponentDetails::s_loadFromJsonView( + ComponentDetails &componentDetails, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + componentDetails.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("version")) + { + componentDetails.m_version = Aws::Crt::Optional(jsonView.GetString("version")); + } + if (jsonView.ValueExists("state")) + { + componentDetails.m_state = Aws::Crt::Optional(jsonView.GetString("state")); + } + if (jsonView.ValueExists("configuration")) + { + componentDetails.m_configuration = + Aws::Crt::Optional(jsonView.GetJsonObject("configuration").Materialize()); + } + } + + void ComponentDetails::SetState(LifecycleState state) noexcept + { + switch (state) + { + case LIFECYCLE_STATE_RUNNING: + m_state = Aws::Crt::String("RUNNING"); + break; + case LIFECYCLE_STATE_ERRORED: + m_state = Aws::Crt::String("ERRORED"); + break; + case LIFECYCLE_STATE_NEW: + m_state = Aws::Crt::String("NEW"); + break; + case LIFECYCLE_STATE_FINISHED: + m_state = Aws::Crt::String("FINISHED"); + break; + case LIFECYCLE_STATE_INSTALLED: + m_state = Aws::Crt::String("INSTALLED"); + break; + case LIFECYCLE_STATE_BROKEN: + m_state = Aws::Crt::String("BROKEN"); + break; + case LIFECYCLE_STATE_STARTING: + m_state = Aws::Crt::String("STARTING"); + break; + case LIFECYCLE_STATE_STOPPING: + m_state = Aws::Crt::String("STOPPING"); + break; + default: + break; + } + } + + Aws::Crt::Optional ComponentDetails::GetState() noexcept + { + if (!m_state.has_value()) + return Aws::Crt::Optional(); + if (m_state.value() == Aws::Crt::String("RUNNING")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_RUNNING); + } + if (m_state.value() == Aws::Crt::String("ERRORED")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_ERRORED); + } + if (m_state.value() == Aws::Crt::String("NEW")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_NEW); + } + if (m_state.value() == Aws::Crt::String("FINISHED")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_FINISHED); + } + if (m_state.value() == Aws::Crt::String("INSTALLED")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_INSTALLED); + } + if (m_state.value() == Aws::Crt::String("BROKEN")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_BROKEN); + } + if (m_state.value() == Aws::Crt::String("STARTING")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_STARTING); + } + if (m_state.value() == Aws::Crt::String("STOPPING")) + { + return Aws::Crt::Optional(LIFECYCLE_STATE_STOPPING); + } + + return Aws::Crt::Optional(); + } + + const char *ComponentDetails::MODEL_NAME = "aws.greengrass#ComponentDetails"; + + Aws::Crt::String ComponentDetails::GetModelName() const noexcept { return ComponentDetails::MODEL_NAME; } + + Aws::Crt::ScopedResource ComponentDetails::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ComponentDetails::s_customDeleter); + shape->m_allocator = allocator; + ComponentDetails::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ComponentDetails::s_customDeleter(ComponentDetails *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CredentialDocument::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_chosenMember == TAG_MQTT_CREDENTIAL && m_mqttCredential.has_value()) + { + Aws::Crt::JsonObject mQTTCredentialValue; + m_mqttCredential.value().SerializeToJsonObject(mQTTCredentialValue); + payloadObject.WithObject("mqttCredential", std::move(mQTTCredentialValue)); + } + } + + void CredentialDocument::s_loadFromJsonView( + CredentialDocument &credentialDocument, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("mqttCredential")) + { + credentialDocument.m_mqttCredential = MQTTCredential(); + MQTTCredential::s_loadFromJsonView( + credentialDocument.m_mqttCredential.value(), jsonView.GetJsonObject("mqttCredential")); + credentialDocument.m_chosenMember = TAG_MQTT_CREDENTIAL; + } + } + + CredentialDocument &CredentialDocument::operator=(const CredentialDocument &objectToCopy) noexcept + { + if (objectToCopy.m_chosenMember == TAG_MQTT_CREDENTIAL) + { + m_mqttCredential = objectToCopy.m_mqttCredential; + m_chosenMember = objectToCopy.m_chosenMember; + } + return *this; + } + + const char *CredentialDocument::MODEL_NAME = "aws.greengrass#CredentialDocument"; + + Aws::Crt::String CredentialDocument::GetModelName() const noexcept { return CredentialDocument::MODEL_NAME; } + + Aws::Crt::ScopedResource CredentialDocument::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CredentialDocument::s_customDeleter); + shape->m_allocator = allocator; + CredentialDocument::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CredentialDocument::s_customDeleter(CredentialDocument *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void VerifyClientDeviceIdentityResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_isValidClientDevice.has_value()) + { + payloadObject.WithBool("isValidClientDevice", m_isValidClientDevice.value()); + } + } + + void VerifyClientDeviceIdentityResponse::s_loadFromJsonView( + VerifyClientDeviceIdentityResponse &verifyClientDeviceIdentityResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("isValidClientDevice")) + { + verifyClientDeviceIdentityResponse.m_isValidClientDevice = + Aws::Crt::Optional(jsonView.GetBool("isValidClientDevice")); + } + } + + const char *VerifyClientDeviceIdentityResponse::MODEL_NAME = + "aws.greengrass#VerifyClientDeviceIdentityResponse"; + + Aws::Crt::String VerifyClientDeviceIdentityResponse::GetModelName() const noexcept + { + return VerifyClientDeviceIdentityResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource VerifyClientDeviceIdentityResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + VerifyClientDeviceIdentityResponse::s_customDeleter); + shape->m_allocator = allocator; + VerifyClientDeviceIdentityResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void VerifyClientDeviceIdentityResponse::s_customDeleter(VerifyClientDeviceIdentityResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void VerifyClientDeviceIdentityRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_credential.has_value()) + { + Aws::Crt::JsonObject clientDeviceCredentialValue; + m_credential.value().SerializeToJsonObject(clientDeviceCredentialValue); + payloadObject.WithObject("credential", std::move(clientDeviceCredentialValue)); + } + } + + void VerifyClientDeviceIdentityRequest::s_loadFromJsonView( + VerifyClientDeviceIdentityRequest &verifyClientDeviceIdentityRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("credential")) + { + verifyClientDeviceIdentityRequest.m_credential = ClientDeviceCredential(); + ClientDeviceCredential::s_loadFromJsonView( + verifyClientDeviceIdentityRequest.m_credential.value(), jsonView.GetJsonObject("credential")); + } + } + + const char *VerifyClientDeviceIdentityRequest::MODEL_NAME = "aws.greengrass#VerifyClientDeviceIdentityRequest"; + + Aws::Crt::String VerifyClientDeviceIdentityRequest::GetModelName() const noexcept + { + return VerifyClientDeviceIdentityRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource VerifyClientDeviceIdentityRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + VerifyClientDeviceIdentityRequest::s_customDeleter); + shape->m_allocator = allocator; + VerifyClientDeviceIdentityRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void VerifyClientDeviceIdentityRequest::s_customDeleter(VerifyClientDeviceIdentityRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void InvalidTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidTokenError::s_loadFromJsonView( + InvalidTokenError &invalidTokenError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidTokenError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidTokenError::MODEL_NAME = "aws.greengrass#InvalidTokenError"; + + Aws::Crt::String InvalidTokenError::GetModelName() const noexcept { return InvalidTokenError::MODEL_NAME; } + + Aws::Crt::ScopedResource InvalidTokenError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), InvalidTokenError::s_customDeleter); + shape->m_allocator = allocator; + InvalidTokenError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidTokenError::s_customDeleter(InvalidTokenError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void ValidateAuthorizationTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_isValid.has_value()) + { + payloadObject.WithBool("isValid", m_isValid.value()); + } + } + + void ValidateAuthorizationTokenResponse::s_loadFromJsonView( + ValidateAuthorizationTokenResponse &validateAuthorizationTokenResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("isValid")) + { + validateAuthorizationTokenResponse.m_isValid = Aws::Crt::Optional(jsonView.GetBool("isValid")); + } + } + + const char *ValidateAuthorizationTokenResponse::MODEL_NAME = + "aws.greengrass#ValidateAuthorizationTokenResponse"; + + Aws::Crt::String ValidateAuthorizationTokenResponse::GetModelName() const noexcept + { + return ValidateAuthorizationTokenResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource ValidateAuthorizationTokenResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateAuthorizationTokenResponse::s_customDeleter); + shape->m_allocator = allocator; + ValidateAuthorizationTokenResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ValidateAuthorizationTokenResponse::s_customDeleter(ValidateAuthorizationTokenResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ValidateAuthorizationTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_token.has_value()) + { + payloadObject.WithString("token", m_token.value()); + } + } + + void ValidateAuthorizationTokenRequest::s_loadFromJsonView( + ValidateAuthorizationTokenRequest &validateAuthorizationTokenRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("token")) + { + validateAuthorizationTokenRequest.m_token = + Aws::Crt::Optional(jsonView.GetString("token")); + } + } + + const char *ValidateAuthorizationTokenRequest::MODEL_NAME = "aws.greengrass#ValidateAuthorizationTokenRequest"; + + Aws::Crt::String ValidateAuthorizationTokenRequest::GetModelName() const noexcept + { + return ValidateAuthorizationTokenRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource ValidateAuthorizationTokenRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ValidateAuthorizationTokenRequest::s_customDeleter); + shape->m_allocator = allocator; + ValidateAuthorizationTokenRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ValidateAuthorizationTokenRequest::s_customDeleter(ValidateAuthorizationTokenRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void UpdateThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void UpdateThingShadowResponse::s_loadFromJsonView( + UpdateThingShadowResponse &updateThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + updateThingShadowResponse.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + const char *UpdateThingShadowResponse::MODEL_NAME = "aws.greengrass#UpdateThingShadowResponse"; + + Aws::Crt::String UpdateThingShadowResponse::GetModelName() const noexcept + { + return UpdateThingShadowResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource UpdateThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateThingShadowResponse::s_customDeleter(UpdateThingShadowResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void UpdateThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_thingName.has_value()) + { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) + { + payloadObject.WithString("shadowName", m_shadowName.value()); + } + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void UpdateThingShadowRequest::s_loadFromJsonView( + UpdateThingShadowRequest &updateThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("thingName")) + { + updateThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) + { + updateThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + updateThingShadowRequest.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + const char *UpdateThingShadowRequest::MODEL_NAME = "aws.greengrass#UpdateThingShadowRequest"; + + Aws::Crt::String UpdateThingShadowRequest::GetModelName() const noexcept + { + return UpdateThingShadowRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource UpdateThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateThingShadowRequest::s_customDeleter(UpdateThingShadowRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void UpdateStateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void UpdateStateResponse::s_loadFromJsonView( + UpdateStateResponse &updateStateResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)updateStateResponse; + (void)jsonView; + } + + const char *UpdateStateResponse::MODEL_NAME = "aws.greengrass#UpdateStateResponse"; + + Aws::Crt::String UpdateStateResponse::GetModelName() const noexcept { return UpdateStateResponse::MODEL_NAME; } + + Aws::Crt::ScopedResource UpdateStateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateStateResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateStateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateStateResponse::s_customDeleter(UpdateStateResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void UpdateStateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_state.has_value()) + { + payloadObject.WithString("state", m_state.value()); + } + } + + void UpdateStateRequest::s_loadFromJsonView( + UpdateStateRequest &updateStateRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("state")) + { + updateStateRequest.m_state = Aws::Crt::Optional(jsonView.GetString("state")); + } + } + + void UpdateStateRequest::SetState(ReportedLifecycleState state) noexcept + { + switch (state) + { + case REPORTED_LIFECYCLE_STATE_RUNNING: + m_state = Aws::Crt::String("RUNNING"); + break; + case REPORTED_LIFECYCLE_STATE_ERRORED: + m_state = Aws::Crt::String("ERRORED"); + break; + default: + break; + } + } + + Aws::Crt::Optional UpdateStateRequest::GetState() noexcept + { + if (!m_state.has_value()) + return Aws::Crt::Optional(); + if (m_state.value() == Aws::Crt::String("RUNNING")) + { + return Aws::Crt::Optional(REPORTED_LIFECYCLE_STATE_RUNNING); + } + if (m_state.value() == Aws::Crt::String("ERRORED")) + { + return Aws::Crt::Optional(REPORTED_LIFECYCLE_STATE_ERRORED); + } + + return Aws::Crt::Optional(); + } + + const char *UpdateStateRequest::MODEL_NAME = "aws.greengrass#UpdateStateRequest"; + + Aws::Crt::String UpdateStateRequest::GetModelName() const noexcept { return UpdateStateRequest::MODEL_NAME; } + + Aws::Crt::ScopedResource UpdateStateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateStateRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateStateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateStateRequest::s_customDeleter(UpdateStateRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void FailedUpdateConditionCheckError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void FailedUpdateConditionCheckError::s_loadFromJsonView( + FailedUpdateConditionCheckError &failedUpdateConditionCheckError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + failedUpdateConditionCheckError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *FailedUpdateConditionCheckError::MODEL_NAME = "aws.greengrass#FailedUpdateConditionCheckError"; + + Aws::Crt::String FailedUpdateConditionCheckError::GetModelName() const noexcept + { + return FailedUpdateConditionCheckError::MODEL_NAME; + } + + Aws::Crt::ScopedResource FailedUpdateConditionCheckError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + FailedUpdateConditionCheckError::s_customDeleter); + shape->m_allocator = allocator; + FailedUpdateConditionCheckError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void FailedUpdateConditionCheckError::s_customDeleter(FailedUpdateConditionCheckError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void ConflictError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void ConflictError::s_loadFromJsonView( + ConflictError &conflictError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + conflictError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *ConflictError::MODEL_NAME = "aws.greengrass#ConflictError"; + + Aws::Crt::String ConflictError::GetModelName() const noexcept { return ConflictError::MODEL_NAME; } + + Aws::Crt::ScopedResource ConflictError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ConflictError::s_customDeleter); + shape->m_allocator = allocator; + ConflictError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void ConflictError::s_customDeleter(ConflictError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void UpdateConfigurationResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void UpdateConfigurationResponse::s_loadFromJsonView( + UpdateConfigurationResponse &updateConfigurationResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)updateConfigurationResponse; + (void)jsonView; + } + + const char *UpdateConfigurationResponse::MODEL_NAME = "aws.greengrass#UpdateConfigurationResponse"; + + Aws::Crt::String UpdateConfigurationResponse::GetModelName() const noexcept + { + return UpdateConfigurationResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource UpdateConfigurationResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateConfigurationResponse::s_customDeleter); + shape->m_allocator = allocator; + UpdateConfigurationResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateConfigurationResponse::s_customDeleter(UpdateConfigurationResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void UpdateConfigurationRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_keyPath.has_value()) + { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) + { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } + if (m_timestamp.has_value()) + { + payloadObject.WithDouble("timestamp", m_timestamp.value().SecondsWithMSPrecision()); + } + if (m_valueToMerge.has_value()) + { + payloadObject.WithObject("valueToMerge", m_valueToMerge.value()); + } + } + + void UpdateConfigurationRequest::s_loadFromJsonView( + UpdateConfigurationRequest &updateConfigurationRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("keyPath")) + { + updateConfigurationRequest.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) + { + Aws::Crt::Optional keyPathItem; + keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); + updateConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); + } + } + if (jsonView.ValueExists("timestamp")) + { + updateConfigurationRequest.m_timestamp = + Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); + } + if (jsonView.ValueExists("valueToMerge")) + { + updateConfigurationRequest.m_valueToMerge = + Aws::Crt::Optional(jsonView.GetJsonObject("valueToMerge").Materialize()); + } + } + + const char *UpdateConfigurationRequest::MODEL_NAME = "aws.greengrass#UpdateConfigurationRequest"; + + Aws::Crt::String UpdateConfigurationRequest::GetModelName() const noexcept + { + return UpdateConfigurationRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource UpdateConfigurationRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UpdateConfigurationRequest::s_customDeleter); + shape->m_allocator = allocator; + UpdateConfigurationRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void UpdateConfigurationRequest::s_customDeleter(UpdateConfigurationRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToValidateConfigurationUpdatesResponse::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesResponse &subscribeToValidateConfigurationUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToValidateConfigurationUpdatesResponse; + (void)jsonView; + } + + const char *SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"; + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesResponse::GetModelName() const noexcept + { + return SubscribeToValidateConfigurationUpdatesResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesResponse:: + s_allocateFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToValidateConfigurationUpdatesResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToValidateConfigurationUpdatesResponse::s_customDeleter( + SubscribeToValidateConfigurationUpdatesResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToValidateConfigurationUpdatesRequest::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView( + SubscribeToValidateConfigurationUpdatesRequest &subscribeToValidateConfigurationUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToValidateConfigurationUpdatesRequest; + (void)jsonView; + } + + const char *SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"; + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesRequest::GetModelName() const noexcept + { + return SubscribeToValidateConfigurationUpdatesRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesRequest:: + s_allocateFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToValidateConfigurationUpdatesRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToValidateConfigurationUpdatesRequest::s_customDeleter( + SubscribeToValidateConfigurationUpdatesRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToTopicResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topicName.has_value()) + { + payloadObject.WithString("topicName", m_topicName.value()); + } + } + + void SubscribeToTopicResponse::s_loadFromJsonView( + SubscribeToTopicResponse &subscribeToTopicResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topicName")) + { + subscribeToTopicResponse.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + } + + const char *SubscribeToTopicResponse::MODEL_NAME = "aws.greengrass#SubscribeToTopicResponse"; + + Aws::Crt::String SubscribeToTopicResponse::GetModelName() const noexcept + { + return SubscribeToTopicResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToTopicResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SubscribeToTopicResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToTopicResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToTopicResponse::s_customDeleter(SubscribeToTopicResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToTopicRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topic.has_value()) + { + payloadObject.WithString("topic", m_topic.value()); + } + if (m_receiveMode.has_value()) + { + payloadObject.WithString("receiveMode", m_receiveMode.value()); + } + } + + void SubscribeToTopicRequest::s_loadFromJsonView( + SubscribeToTopicRequest &subscribeToTopicRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topic")) + { + subscribeToTopicRequest.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); + } + if (jsonView.ValueExists("receiveMode")) + { + subscribeToTopicRequest.m_receiveMode = + Aws::Crt::Optional(jsonView.GetString("receiveMode")); + } + } + + void SubscribeToTopicRequest::SetReceiveMode(ReceiveMode receiveMode) noexcept + { + switch (receiveMode) + { + case RECEIVE_MODE_RECEIVE_ALL_MESSAGES: + m_receiveMode = Aws::Crt::String("RECEIVE_ALL_MESSAGES"); + break; + case RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS: + m_receiveMode = Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS"); + break; + default: + break; + } + } + + Aws::Crt::Optional SubscribeToTopicRequest::GetReceiveMode() noexcept + { + if (!m_receiveMode.has_value()) + return Aws::Crt::Optional(); + if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_ALL_MESSAGES")) + { + return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_ALL_MESSAGES); + } + if (m_receiveMode.value() == Aws::Crt::String("RECEIVE_MESSAGES_FROM_OTHERS")) + { + return Aws::Crt::Optional(RECEIVE_MODE_RECEIVE_MESSAGES_FROM_OTHERS); + } + + return Aws::Crt::Optional(); + } + + const char *SubscribeToTopicRequest::MODEL_NAME = "aws.greengrass#SubscribeToTopicRequest"; + + Aws::Crt::String SubscribeToTopicRequest::GetModelName() const noexcept + { + return SubscribeToTopicRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToTopicRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SubscribeToTopicRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToTopicRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToTopicRequest::s_customDeleter(SubscribeToTopicRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToIoTCoreResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void SubscribeToIoTCoreResponse::s_loadFromJsonView( + SubscribeToIoTCoreResponse &subscribeToIoTCoreResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToIoTCoreResponse; + (void)jsonView; + } + + const char *SubscribeToIoTCoreResponse::MODEL_NAME = "aws.greengrass#SubscribeToIoTCoreResponse"; + + Aws::Crt::String SubscribeToIoTCoreResponse::GetModelName() const noexcept + { + return SubscribeToIoTCoreResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToIoTCoreResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SubscribeToIoTCoreResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToIoTCoreResponse::s_customDeleter(SubscribeToIoTCoreResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToIoTCoreRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topicName.has_value()) + { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_qos.has_value()) + { + payloadObject.WithString("qos", m_qos.value()); + } + } + + void SubscribeToIoTCoreRequest::s_loadFromJsonView( + SubscribeToIoTCoreRequest &subscribeToIoTCoreRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topicName")) + { + subscribeToIoTCoreRequest.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("qos")) + { + subscribeToIoTCoreRequest.m_qos = Aws::Crt::Optional(jsonView.GetString("qos")); + } + } + + void SubscribeToIoTCoreRequest::SetQos(QOS qos) noexcept + { + switch (qos) + { + case QOS_AT_MOST_ONCE: + m_qos = Aws::Crt::String("0"); + break; + case QOS_AT_LEAST_ONCE: + m_qos = Aws::Crt::String("1"); + break; + default: + break; + } + } + + Aws::Crt::Optional SubscribeToIoTCoreRequest::GetQos() noexcept + { + if (!m_qos.has_value()) + return Aws::Crt::Optional(); + if (m_qos.value() == Aws::Crt::String("0")) + { + return Aws::Crt::Optional(QOS_AT_MOST_ONCE); + } + if (m_qos.value() == Aws::Crt::String("1")) + { + return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); + } + + return Aws::Crt::Optional(); + } + + const char *SubscribeToIoTCoreRequest::MODEL_NAME = "aws.greengrass#SubscribeToIoTCoreRequest"; + + Aws::Crt::String SubscribeToIoTCoreRequest::GetModelName() const noexcept + { + return SubscribeToIoTCoreRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToIoTCoreRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), SubscribeToIoTCoreRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToIoTCoreRequest::s_customDeleter(SubscribeToIoTCoreRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToConfigurationUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + (void)payloadObject; + } + + void SubscribeToConfigurationUpdateResponse::s_loadFromJsonView( + SubscribeToConfigurationUpdateResponse &subscribeToConfigurationUpdateResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToConfigurationUpdateResponse; + (void)jsonView; + } + + const char *SubscribeToConfigurationUpdateResponse::MODEL_NAME = + "aws.greengrass#SubscribeToConfigurationUpdateResponse"; + + Aws::Crt::String SubscribeToConfigurationUpdateResponse::GetModelName() const noexcept + { + return SubscribeToConfigurationUpdateResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToConfigurationUpdateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToConfigurationUpdateResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToConfigurationUpdateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToConfigurationUpdateResponse::s_customDeleter( + SubscribeToConfigurationUpdateResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToConfigurationUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) + { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) + { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } + } + + void SubscribeToConfigurationUpdateRequest::s_loadFromJsonView( + SubscribeToConfigurationUpdateRequest &subscribeToConfigurationUpdateRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + subscribeToConfigurationUpdateRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) + { + subscribeToConfigurationUpdateRequest.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) + { + Aws::Crt::Optional keyPathItem; + keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); + subscribeToConfigurationUpdateRequest.m_keyPath.value().push_back(keyPathItem.value()); + } + } + } + + const char *SubscribeToConfigurationUpdateRequest::MODEL_NAME = + "aws.greengrass#SubscribeToConfigurationUpdateRequest"; + + Aws::Crt::String SubscribeToConfigurationUpdateRequest::GetModelName() const noexcept + { + return SubscribeToConfigurationUpdateRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToConfigurationUpdateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToConfigurationUpdateRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToConfigurationUpdateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToConfigurationUpdateRequest::s_customDeleter( + SubscribeToConfigurationUpdateRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToComponentUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + (void)payloadObject; + } + + void SubscribeToComponentUpdatesResponse::s_loadFromJsonView( + SubscribeToComponentUpdatesResponse &subscribeToComponentUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToComponentUpdatesResponse; + (void)jsonView; + } + + const char *SubscribeToComponentUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToComponentUpdatesResponse"; + + Aws::Crt::String SubscribeToComponentUpdatesResponse::GetModelName() const noexcept + { + return SubscribeToComponentUpdatesResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToComponentUpdatesResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToComponentUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToComponentUpdatesResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToComponentUpdatesResponse::s_customDeleter(SubscribeToComponentUpdatesResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToComponentUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + (void)payloadObject; + } + + void SubscribeToComponentUpdatesRequest::s_loadFromJsonView( + SubscribeToComponentUpdatesRequest &subscribeToComponentUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToComponentUpdatesRequest; + (void)jsonView; + } + + const char *SubscribeToComponentUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToComponentUpdatesRequest"; + + Aws::Crt::String SubscribeToComponentUpdatesRequest::GetModelName() const noexcept + { + return SubscribeToComponentUpdatesRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToComponentUpdatesRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToComponentUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToComponentUpdatesRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToComponentUpdatesRequest::s_customDeleter(SubscribeToComponentUpdatesRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToCertificateUpdatesResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + (void)payloadObject; + } + + void SubscribeToCertificateUpdatesResponse::s_loadFromJsonView( + SubscribeToCertificateUpdatesResponse &subscribeToCertificateUpdatesResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)subscribeToCertificateUpdatesResponse; + (void)jsonView; + } + + const char *SubscribeToCertificateUpdatesResponse::MODEL_NAME = + "aws.greengrass#SubscribeToCertificateUpdatesResponse"; + + Aws::Crt::String SubscribeToCertificateUpdatesResponse::GetModelName() const noexcept + { + return SubscribeToCertificateUpdatesResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToCertificateUpdatesResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToCertificateUpdatesResponse::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToCertificateUpdatesResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToCertificateUpdatesResponse::s_customDeleter( + SubscribeToCertificateUpdatesResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToCertificateUpdatesRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_certificateOptions.has_value()) + { + Aws::Crt::JsonObject certificateOptionsValue; + m_certificateOptions.value().SerializeToJsonObject(certificateOptionsValue); + payloadObject.WithObject("certificateOptions", std::move(certificateOptionsValue)); + } + } + + void SubscribeToCertificateUpdatesRequest::s_loadFromJsonView( + SubscribeToCertificateUpdatesRequest &subscribeToCertificateUpdatesRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("certificateOptions")) + { + subscribeToCertificateUpdatesRequest.m_certificateOptions = CertificateOptions(); + CertificateOptions::s_loadFromJsonView( + subscribeToCertificateUpdatesRequest.m_certificateOptions.value(), + jsonView.GetJsonObject("certificateOptions")); + } + } + + const char *SubscribeToCertificateUpdatesRequest::MODEL_NAME = + "aws.greengrass#SubscribeToCertificateUpdatesRequest"; + + Aws::Crt::String SubscribeToCertificateUpdatesRequest::GetModelName() const noexcept + { + return SubscribeToCertificateUpdatesRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SubscribeToCertificateUpdatesRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SubscribeToCertificateUpdatesRequest::s_customDeleter); + shape->m_allocator = allocator; + SubscribeToCertificateUpdatesRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SubscribeToCertificateUpdatesRequest::s_customDeleter(SubscribeToCertificateUpdatesRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void StopComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_stopStatus.has_value()) + { + payloadObject.WithString("stopStatus", m_stopStatus.value()); + } + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void StopComponentResponse::s_loadFromJsonView( + StopComponentResponse &stopComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("stopStatus")) + { + stopComponentResponse.m_stopStatus = + Aws::Crt::Optional(jsonView.GetString("stopStatus")); + } + if (jsonView.ValueExists("message")) + { + stopComponentResponse.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + void StopComponentResponse::SetStopStatus(RequestStatus stopStatus) noexcept + { + switch (stopStatus) + { + case REQUEST_STATUS_SUCCEEDED: + m_stopStatus = Aws::Crt::String("SUCCEEDED"); + break; + case REQUEST_STATUS_FAILED: + m_stopStatus = Aws::Crt::String("FAILED"); + break; + default: + break; + } + } + + Aws::Crt::Optional StopComponentResponse::GetStopStatus() noexcept + { + if (!m_stopStatus.has_value()) + return Aws::Crt::Optional(); + if (m_stopStatus.value() == Aws::Crt::String("SUCCEEDED")) + { + return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); + } + if (m_stopStatus.value() == Aws::Crt::String("FAILED")) + { + return Aws::Crt::Optional(REQUEST_STATUS_FAILED); + } + + return Aws::Crt::Optional(); + } + + const char *StopComponentResponse::MODEL_NAME = "aws.greengrass#StopComponentResponse"; + + Aws::Crt::String StopComponentResponse::GetModelName() const noexcept + { + return StopComponentResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource StopComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), StopComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + StopComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void StopComponentResponse::s_customDeleter(StopComponentResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void StopComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + } + + void StopComponentRequest::s_loadFromJsonView( + StopComponentRequest &stopComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + stopComponentRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + } + + const char *StopComponentRequest::MODEL_NAME = "aws.greengrass#StopComponentRequest"; + + Aws::Crt::String StopComponentRequest::GetModelName() const noexcept + { + return StopComponentRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource StopComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), StopComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + StopComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void StopComponentRequest::s_customDeleter(StopComponentRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SendConfigurationValidityReportResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + (void)payloadObject; + } + + void SendConfigurationValidityReportResponse::s_loadFromJsonView( + SendConfigurationValidityReportResponse &sendConfigurationValidityReportResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)sendConfigurationValidityReportResponse; + (void)jsonView; + } + + const char *SendConfigurationValidityReportResponse::MODEL_NAME = + "aws.greengrass#SendConfigurationValidityReportResponse"; + + Aws::Crt::String SendConfigurationValidityReportResponse::GetModelName() const noexcept + { + return SendConfigurationValidityReportResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource SendConfigurationValidityReportResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SendConfigurationValidityReportResponse::s_customDeleter); + shape->m_allocator = allocator; + SendConfigurationValidityReportResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SendConfigurationValidityReportResponse::s_customDeleter( + SendConfigurationValidityReportResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SendConfigurationValidityReportRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_configurationValidityReport.has_value()) + { + Aws::Crt::JsonObject configurationValidityReportValue; + m_configurationValidityReport.value().SerializeToJsonObject(configurationValidityReportValue); + payloadObject.WithObject("configurationValidityReport", std::move(configurationValidityReportValue)); + } + } + + void SendConfigurationValidityReportRequest::s_loadFromJsonView( + SendConfigurationValidityReportRequest &sendConfigurationValidityReportRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("configurationValidityReport")) + { + sendConfigurationValidityReportRequest.m_configurationValidityReport = ConfigurationValidityReport(); + ConfigurationValidityReport::s_loadFromJsonView( + sendConfigurationValidityReportRequest.m_configurationValidityReport.value(), + jsonView.GetJsonObject("configurationValidityReport")); + } + } + + const char *SendConfigurationValidityReportRequest::MODEL_NAME = + "aws.greengrass#SendConfigurationValidityReportRequest"; + + Aws::Crt::String SendConfigurationValidityReportRequest::GetModelName() const noexcept + { + return SendConfigurationValidityReportRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource SendConfigurationValidityReportRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + SendConfigurationValidityReportRequest::s_customDeleter); + shape->m_allocator = allocator; + SendConfigurationValidityReportRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void SendConfigurationValidityReportRequest::s_customDeleter( + SendConfigurationValidityReportRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ResumeComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void ResumeComponentResponse::s_loadFromJsonView( + ResumeComponentResponse &resumeComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)resumeComponentResponse; + (void)jsonView; + } + + const char *ResumeComponentResponse::MODEL_NAME = "aws.greengrass#ResumeComponentResponse"; + + Aws::Crt::String ResumeComponentResponse::GetModelName() const noexcept + { + return ResumeComponentResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource ResumeComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ResumeComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + ResumeComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ResumeComponentResponse::s_customDeleter(ResumeComponentResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ResumeComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + } + + void ResumeComponentRequest::s_loadFromJsonView( + ResumeComponentRequest &resumeComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + resumeComponentRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + } + + const char *ResumeComponentRequest::MODEL_NAME = "aws.greengrass#ResumeComponentRequest"; + + Aws::Crt::String ResumeComponentRequest::GetModelName() const noexcept + { + return ResumeComponentRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource ResumeComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ResumeComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + ResumeComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ResumeComponentRequest::s_customDeleter(ResumeComponentRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ComponentNotFoundError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void ComponentNotFoundError::s_loadFromJsonView( + ComponentNotFoundError &componentNotFoundError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + componentNotFoundError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *ComponentNotFoundError::MODEL_NAME = "aws.greengrass#ComponentNotFoundError"; + + Aws::Crt::String ComponentNotFoundError::GetModelName() const noexcept + { + return ComponentNotFoundError::MODEL_NAME; + } + + Aws::Crt::ScopedResource ComponentNotFoundError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ComponentNotFoundError::s_customDeleter); + shape->m_allocator = allocator; + ComponentNotFoundError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void ComponentNotFoundError::s_customDeleter(ComponentNotFoundError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void RestartComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_restartStatus.has_value()) + { + payloadObject.WithString("restartStatus", m_restartStatus.value()); + } + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void RestartComponentResponse::s_loadFromJsonView( + RestartComponentResponse &restartComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("restartStatus")) + { + restartComponentResponse.m_restartStatus = + Aws::Crt::Optional(jsonView.GetString("restartStatus")); + } + if (jsonView.ValueExists("message")) + { + restartComponentResponse.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + void RestartComponentResponse::SetRestartStatus(RequestStatus restartStatus) noexcept + { + switch (restartStatus) + { + case REQUEST_STATUS_SUCCEEDED: + m_restartStatus = Aws::Crt::String("SUCCEEDED"); + break; + case REQUEST_STATUS_FAILED: + m_restartStatus = Aws::Crt::String("FAILED"); + break; + default: + break; + } + } + + Aws::Crt::Optional RestartComponentResponse::GetRestartStatus() noexcept + { + if (!m_restartStatus.has_value()) + return Aws::Crt::Optional(); + if (m_restartStatus.value() == Aws::Crt::String("SUCCEEDED")) + { + return Aws::Crt::Optional(REQUEST_STATUS_SUCCEEDED); + } + if (m_restartStatus.value() == Aws::Crt::String("FAILED")) + { + return Aws::Crt::Optional(REQUEST_STATUS_FAILED); + } + + return Aws::Crt::Optional(); + } + + const char *RestartComponentResponse::MODEL_NAME = "aws.greengrass#RestartComponentResponse"; + + Aws::Crt::String RestartComponentResponse::GetModelName() const noexcept + { + return RestartComponentResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource RestartComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), RestartComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + RestartComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void RestartComponentResponse::s_customDeleter(RestartComponentResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void RestartComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + } + + void RestartComponentRequest::s_loadFromJsonView( + RestartComponentRequest &restartComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + restartComponentRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + } + + const char *RestartComponentRequest::MODEL_NAME = "aws.greengrass#RestartComponentRequest"; + + Aws::Crt::String RestartComponentRequest::GetModelName() const noexcept + { + return RestartComponentRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource RestartComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), RestartComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + RestartComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void RestartComponentRequest::s_customDeleter(RestartComponentRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PutComponentMetricResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void PutComponentMetricResponse::s_loadFromJsonView( + PutComponentMetricResponse &putComponentMetricResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)putComponentMetricResponse; + (void)jsonView; + } + + const char *PutComponentMetricResponse::MODEL_NAME = "aws.greengrass#PutComponentMetricResponse"; + + Aws::Crt::String PutComponentMetricResponse::GetModelName() const noexcept + { + return PutComponentMetricResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource PutComponentMetricResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PutComponentMetricResponse::s_customDeleter); + shape->m_allocator = allocator; + PutComponentMetricResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PutComponentMetricResponse::s_customDeleter(PutComponentMetricResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PutComponentMetricRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_metrics.has_value()) + { + Aws::Crt::JsonObject metricsList; + Aws::Crt::Vector metricsListJsonArray; + for (const auto &metricsListItem : m_metrics.value()) + { + Aws::Crt::JsonObject metricsListJsonArrayItem; + metricsListItem.SerializeToJsonObject(metricsListJsonArrayItem); + metricsListJsonArray.emplace_back(std::move(metricsListJsonArrayItem)); + } + metricsList.AsArray(std::move(metricsListJsonArray)); + payloadObject.WithObject("metrics", std::move(metricsList)); + } + } + + void PutComponentMetricRequest::s_loadFromJsonView( + PutComponentMetricRequest &putComponentMetricRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("metrics")) + { + putComponentMetricRequest.m_metrics = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &metricsListJsonView : jsonView.GetArray("metrics")) + { + Aws::Crt::Optional metricsListItem; + metricsListItem = Metric(); + Metric::s_loadFromJsonView(metricsListItem.value(), metricsListJsonView); + putComponentMetricRequest.m_metrics.value().push_back(metricsListItem.value()); + } + } + } + + const char *PutComponentMetricRequest::MODEL_NAME = "aws.greengrass#PutComponentMetricRequest"; + + Aws::Crt::String PutComponentMetricRequest::GetModelName() const noexcept + { + return PutComponentMetricRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource PutComponentMetricRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PutComponentMetricRequest::s_customDeleter); + shape->m_allocator = allocator; + PutComponentMetricRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PutComponentMetricRequest::s_customDeleter(PutComponentMetricRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PublishToTopicResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void PublishToTopicResponse::s_loadFromJsonView( + PublishToTopicResponse &publishToTopicResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)publishToTopicResponse; + (void)jsonView; + } + + const char *PublishToTopicResponse::MODEL_NAME = "aws.greengrass#PublishToTopicResponse"; + + Aws::Crt::String PublishToTopicResponse::GetModelName() const noexcept + { + return PublishToTopicResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource PublishToTopicResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PublishToTopicResponse::s_customDeleter); + shape->m_allocator = allocator; + PublishToTopicResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PublishToTopicResponse::s_customDeleter(PublishToTopicResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PublishToTopicRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topic.has_value()) + { + payloadObject.WithString("topic", m_topic.value()); + } + if (m_publishMessage.has_value()) + { + Aws::Crt::JsonObject publishMessageValue; + m_publishMessage.value().SerializeToJsonObject(publishMessageValue); + payloadObject.WithObject("publishMessage", std::move(publishMessageValue)); + } + } + + void PublishToTopicRequest::s_loadFromJsonView( + PublishToTopicRequest &publishToTopicRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topic")) + { + publishToTopicRequest.m_topic = Aws::Crt::Optional(jsonView.GetString("topic")); + } + if (jsonView.ValueExists("publishMessage")) + { + publishToTopicRequest.m_publishMessage = PublishMessage(); + PublishMessage::s_loadFromJsonView( + publishToTopicRequest.m_publishMessage.value(), jsonView.GetJsonObject("publishMessage")); + } + } + + const char *PublishToTopicRequest::MODEL_NAME = "aws.greengrass#PublishToTopicRequest"; + + Aws::Crt::String PublishToTopicRequest::GetModelName() const noexcept + { + return PublishToTopicRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource PublishToTopicRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PublishToTopicRequest::s_customDeleter); + shape->m_allocator = allocator; + PublishToTopicRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PublishToTopicRequest::s_customDeleter(PublishToTopicRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PublishToIoTCoreResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void PublishToIoTCoreResponse::s_loadFromJsonView( + PublishToIoTCoreResponse &publishToIoTCoreResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)publishToIoTCoreResponse; + (void)jsonView; + } + + const char *PublishToIoTCoreResponse::MODEL_NAME = "aws.greengrass#PublishToIoTCoreResponse"; + + Aws::Crt::String PublishToIoTCoreResponse::GetModelName() const noexcept + { + return PublishToIoTCoreResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource PublishToIoTCoreResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PublishToIoTCoreResponse::s_customDeleter); + shape->m_allocator = allocator; + PublishToIoTCoreResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PublishToIoTCoreResponse::s_customDeleter(PublishToIoTCoreResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PublishToIoTCoreRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_topicName.has_value()) + { + payloadObject.WithString("topicName", m_topicName.value()); + } + if (m_qos.has_value()) + { + payloadObject.WithString("qos", m_qos.value()); + } + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void PublishToIoTCoreRequest::s_loadFromJsonView( + PublishToIoTCoreRequest &publishToIoTCoreRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("topicName")) + { + publishToIoTCoreRequest.m_topicName = + Aws::Crt::Optional(jsonView.GetString("topicName")); + } + if (jsonView.ValueExists("qos")) + { + publishToIoTCoreRequest.m_qos = Aws::Crt::Optional(jsonView.GetString("qos")); + } + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + publishToIoTCoreRequest.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + void PublishToIoTCoreRequest::SetQos(QOS qos) noexcept + { + switch (qos) + { + case QOS_AT_MOST_ONCE: + m_qos = Aws::Crt::String("0"); + break; + case QOS_AT_LEAST_ONCE: + m_qos = Aws::Crt::String("1"); + break; + default: + break; + } + } + + Aws::Crt::Optional PublishToIoTCoreRequest::GetQos() noexcept + { + if (!m_qos.has_value()) + return Aws::Crt::Optional(); + if (m_qos.value() == Aws::Crt::String("0")) + { + return Aws::Crt::Optional(QOS_AT_MOST_ONCE); + } + if (m_qos.value() == Aws::Crt::String("1")) + { + return Aws::Crt::Optional(QOS_AT_LEAST_ONCE); + } + + return Aws::Crt::Optional(); + } + + const char *PublishToIoTCoreRequest::MODEL_NAME = "aws.greengrass#PublishToIoTCoreRequest"; + + Aws::Crt::String PublishToIoTCoreRequest::GetModelName() const noexcept + { + return PublishToIoTCoreRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource PublishToIoTCoreRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PublishToIoTCoreRequest::s_customDeleter); + shape->m_allocator = allocator; + PublishToIoTCoreRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PublishToIoTCoreRequest::s_customDeleter(PublishToIoTCoreRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PauseComponentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void PauseComponentResponse::s_loadFromJsonView( + PauseComponentResponse &pauseComponentResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)pauseComponentResponse; + (void)jsonView; + } + + const char *PauseComponentResponse::MODEL_NAME = "aws.greengrass#PauseComponentResponse"; + + Aws::Crt::String PauseComponentResponse::GetModelName() const noexcept + { + return PauseComponentResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource PauseComponentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PauseComponentResponse::s_customDeleter); + shape->m_allocator = allocator; + PauseComponentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PauseComponentResponse::s_customDeleter(PauseComponentResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void PauseComponentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + } + + void PauseComponentRequest::s_loadFromJsonView( + PauseComponentRequest &pauseComponentRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + pauseComponentRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + } + + const char *PauseComponentRequest::MODEL_NAME = "aws.greengrass#PauseComponentRequest"; + + Aws::Crt::String PauseComponentRequest::GetModelName() const noexcept + { + return PauseComponentRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource PauseComponentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), PauseComponentRequest::s_customDeleter); + shape->m_allocator = allocator; + PauseComponentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void PauseComponentRequest::s_customDeleter(PauseComponentRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListNamedShadowsForThingResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_results.has_value()) + { + Aws::Crt::JsonObject namedShadowList; + Aws::Crt::Vector namedShadowListJsonArray; + for (const auto &namedShadowListItem : m_results.value()) + { + Aws::Crt::JsonObject namedShadowListJsonArrayItem; + namedShadowListJsonArrayItem.AsString(namedShadowListItem); + namedShadowListJsonArray.emplace_back(std::move(namedShadowListJsonArrayItem)); + } + namedShadowList.AsArray(std::move(namedShadowListJsonArray)); + payloadObject.WithObject("results", std::move(namedShadowList)); + } + if (m_timestamp.has_value()) + { + payloadObject.WithDouble("timestamp", m_timestamp.value().SecondsWithMSPrecision()); + } + if (m_nextToken.has_value()) + { + payloadObject.WithString("nextToken", m_nextToken.value()); + } + } + + void ListNamedShadowsForThingResponse::s_loadFromJsonView( + ListNamedShadowsForThingResponse &listNamedShadowsForThingResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("results")) + { + listNamedShadowsForThingResponse.m_results = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &namedShadowListJsonView : jsonView.GetArray("results")) + { + Aws::Crt::Optional namedShadowListItem; + namedShadowListItem = Aws::Crt::Optional(namedShadowListJsonView.AsString()); + listNamedShadowsForThingResponse.m_results.value().push_back(namedShadowListItem.value()); + } + } + if (jsonView.ValueExists("timestamp")) + { + listNamedShadowsForThingResponse.m_timestamp = + Aws::Crt::Optional(Aws::Crt::DateTime(jsonView.GetDouble("timestamp"))); + } + if (jsonView.ValueExists("nextToken")) + { + listNamedShadowsForThingResponse.m_nextToken = + Aws::Crt::Optional(jsonView.GetString("nextToken")); + } + } + + const char *ListNamedShadowsForThingResponse::MODEL_NAME = "aws.greengrass#ListNamedShadowsForThingResponse"; + + Aws::Crt::String ListNamedShadowsForThingResponse::GetModelName() const noexcept + { + return ListNamedShadowsForThingResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListNamedShadowsForThingResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListNamedShadowsForThingResponse::s_customDeleter); + shape->m_allocator = allocator; + ListNamedShadowsForThingResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListNamedShadowsForThingResponse::s_customDeleter(ListNamedShadowsForThingResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListNamedShadowsForThingRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_thingName.has_value()) + { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_nextToken.has_value()) + { + payloadObject.WithString("nextToken", m_nextToken.value()); + } + if (m_pageSize.has_value()) + { + payloadObject.WithInteger("pageSize", m_pageSize.value()); + } + } + + void ListNamedShadowsForThingRequest::s_loadFromJsonView( + ListNamedShadowsForThingRequest &listNamedShadowsForThingRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("thingName")) + { + listNamedShadowsForThingRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("nextToken")) + { + listNamedShadowsForThingRequest.m_nextToken = + Aws::Crt::Optional(jsonView.GetString("nextToken")); + } + if (jsonView.ValueExists("pageSize")) + { + listNamedShadowsForThingRequest.m_pageSize = Aws::Crt::Optional(jsonView.GetInteger("pageSize")); + } + } + + const char *ListNamedShadowsForThingRequest::MODEL_NAME = "aws.greengrass#ListNamedShadowsForThingRequest"; + + Aws::Crt::String ListNamedShadowsForThingRequest::GetModelName() const noexcept + { + return ListNamedShadowsForThingRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListNamedShadowsForThingRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + ListNamedShadowsForThingRequest::s_customDeleter); + shape->m_allocator = allocator; + ListNamedShadowsForThingRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListNamedShadowsForThingRequest::s_customDeleter(ListNamedShadowsForThingRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListLocalDeploymentsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_localDeployments.has_value()) + { + Aws::Crt::JsonObject listOfLocalDeployments; + Aws::Crt::Vector listOfLocalDeploymentsJsonArray; + for (const auto &listOfLocalDeploymentsItem : m_localDeployments.value()) + { + Aws::Crt::JsonObject listOfLocalDeploymentsJsonArrayItem; + listOfLocalDeploymentsItem.SerializeToJsonObject(listOfLocalDeploymentsJsonArrayItem); + listOfLocalDeploymentsJsonArray.emplace_back(std::move(listOfLocalDeploymentsJsonArrayItem)); + } + listOfLocalDeployments.AsArray(std::move(listOfLocalDeploymentsJsonArray)); + payloadObject.WithObject("localDeployments", std::move(listOfLocalDeployments)); + } + } + + void ListLocalDeploymentsResponse::s_loadFromJsonView( + ListLocalDeploymentsResponse &listLocalDeploymentsResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("localDeployments")) + { + listLocalDeploymentsResponse.m_localDeployments = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &listOfLocalDeploymentsJsonView : jsonView.GetArray("localDeployments")) + { + Aws::Crt::Optional listOfLocalDeploymentsItem; + listOfLocalDeploymentsItem = LocalDeployment(); + LocalDeployment::s_loadFromJsonView( + listOfLocalDeploymentsItem.value(), listOfLocalDeploymentsJsonView); + listLocalDeploymentsResponse.m_localDeployments.value().push_back( + listOfLocalDeploymentsItem.value()); + } + } + } + + const char *ListLocalDeploymentsResponse::MODEL_NAME = "aws.greengrass#ListLocalDeploymentsResponse"; + + Aws::Crt::String ListLocalDeploymentsResponse::GetModelName() const noexcept + { + return ListLocalDeploymentsResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListLocalDeploymentsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ListLocalDeploymentsResponse::s_customDeleter); + shape->m_allocator = allocator; + ListLocalDeploymentsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListLocalDeploymentsResponse::s_customDeleter(ListLocalDeploymentsResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListLocalDeploymentsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void ListLocalDeploymentsRequest::s_loadFromJsonView( + ListLocalDeploymentsRequest &listLocalDeploymentsRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)listLocalDeploymentsRequest; + (void)jsonView; + } + + const char *ListLocalDeploymentsRequest::MODEL_NAME = "aws.greengrass#ListLocalDeploymentsRequest"; + + Aws::Crt::String ListLocalDeploymentsRequest::GetModelName() const noexcept + { + return ListLocalDeploymentsRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListLocalDeploymentsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ListLocalDeploymentsRequest::s_customDeleter); + shape->m_allocator = allocator; + ListLocalDeploymentsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListLocalDeploymentsRequest::s_customDeleter(ListLocalDeploymentsRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListComponentsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_components.has_value()) + { + Aws::Crt::JsonObject listOfComponents; + Aws::Crt::Vector listOfComponentsJsonArray; + for (const auto &listOfComponentsItem : m_components.value()) + { + Aws::Crt::JsonObject listOfComponentsJsonArrayItem; + listOfComponentsItem.SerializeToJsonObject(listOfComponentsJsonArrayItem); + listOfComponentsJsonArray.emplace_back(std::move(listOfComponentsJsonArrayItem)); + } + listOfComponents.AsArray(std::move(listOfComponentsJsonArray)); + payloadObject.WithObject("components", std::move(listOfComponents)); + } + } + + void ListComponentsResponse::s_loadFromJsonView( + ListComponentsResponse &listComponentsResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("components")) + { + listComponentsResponse.m_components = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &listOfComponentsJsonView : jsonView.GetArray("components")) + { + Aws::Crt::Optional listOfComponentsItem; + listOfComponentsItem = ComponentDetails(); + ComponentDetails::s_loadFromJsonView(listOfComponentsItem.value(), listOfComponentsJsonView); + listComponentsResponse.m_components.value().push_back(listOfComponentsItem.value()); + } + } + } + + const char *ListComponentsResponse::MODEL_NAME = "aws.greengrass#ListComponentsResponse"; + + Aws::Crt::String ListComponentsResponse::GetModelName() const noexcept + { + return ListComponentsResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListComponentsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ListComponentsResponse::s_customDeleter); + shape->m_allocator = allocator; + ListComponentsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListComponentsResponse::s_customDeleter(ListComponentsResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ListComponentsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void ListComponentsRequest::s_loadFromJsonView( + ListComponentsRequest &listComponentsRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)listComponentsRequest; + (void)jsonView; + } + + const char *ListComponentsRequest::MODEL_NAME = "aws.greengrass#ListComponentsRequest"; + + Aws::Crt::String ListComponentsRequest::GetModelName() const noexcept + { + return ListComponentsRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource ListComponentsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ListComponentsRequest::s_customDeleter); + shape->m_allocator = allocator; + ListComponentsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void ListComponentsRequest::s_customDeleter(ListComponentsRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void GetThingShadowResponse::s_loadFromJsonView( + GetThingShadowResponse &getThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + getThingShadowResponse.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + const char *GetThingShadowResponse::MODEL_NAME = "aws.greengrass#GetThingShadowResponse"; + + Aws::Crt::String GetThingShadowResponse::GetModelName() const noexcept + { + return GetThingShadowResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + GetThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetThingShadowResponse::s_customDeleter(GetThingShadowResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_thingName.has_value()) + { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) + { + payloadObject.WithString("shadowName", m_shadowName.value()); + } + } + + void GetThingShadowRequest::s_loadFromJsonView( + GetThingShadowRequest &getThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("thingName")) + { + getThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) + { + getThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } + } + + const char *GetThingShadowRequest::MODEL_NAME = "aws.greengrass#GetThingShadowRequest"; + + Aws::Crt::String GetThingShadowRequest::GetModelName() const noexcept + { + return GetThingShadowRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + GetThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetThingShadowRequest::s_customDeleter(GetThingShadowRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetSecretValueResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_secretId.has_value()) + { + payloadObject.WithString("secretId", m_secretId.value()); + } + if (m_versionId.has_value()) + { + payloadObject.WithString("versionId", m_versionId.value()); + } + if (m_versionStage.has_value()) + { + Aws::Crt::JsonObject secretVersionList; + Aws::Crt::Vector secretVersionListJsonArray; + for (const auto &secretVersionListItem : m_versionStage.value()) + { + Aws::Crt::JsonObject secretVersionListJsonArrayItem; + secretVersionListJsonArrayItem.AsString(secretVersionListItem); + secretVersionListJsonArray.emplace_back(std::move(secretVersionListJsonArrayItem)); + } + secretVersionList.AsArray(std::move(secretVersionListJsonArray)); + payloadObject.WithObject("versionStage", std::move(secretVersionList)); + } + if (m_secretValue.has_value()) + { + Aws::Crt::JsonObject secretValueValue; + m_secretValue.value().SerializeToJsonObject(secretValueValue); + payloadObject.WithObject("secretValue", std::move(secretValueValue)); + } + } + + void GetSecretValueResponse::s_loadFromJsonView( + GetSecretValueResponse &getSecretValueResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("secretId")) + { + getSecretValueResponse.m_secretId = + Aws::Crt::Optional(jsonView.GetString("secretId")); + } + if (jsonView.ValueExists("versionId")) + { + getSecretValueResponse.m_versionId = + Aws::Crt::Optional(jsonView.GetString("versionId")); + } + if (jsonView.ValueExists("versionStage")) + { + getSecretValueResponse.m_versionStage = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &secretVersionListJsonView : jsonView.GetArray("versionStage")) + { + Aws::Crt::Optional secretVersionListItem; + secretVersionListItem = Aws::Crt::Optional(secretVersionListJsonView.AsString()); + getSecretValueResponse.m_versionStage.value().push_back(secretVersionListItem.value()); + } + } + if (jsonView.ValueExists("secretValue")) + { + getSecretValueResponse.m_secretValue = SecretValue(); + SecretValue::s_loadFromJsonView( + getSecretValueResponse.m_secretValue.value(), jsonView.GetJsonObject("secretValue")); + } + } + + const char *GetSecretValueResponse::MODEL_NAME = "aws.greengrass#GetSecretValueResponse"; + + Aws::Crt::String GetSecretValueResponse::GetModelName() const noexcept + { + return GetSecretValueResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetSecretValueResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetSecretValueResponse::s_customDeleter); + shape->m_allocator = allocator; + GetSecretValueResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetSecretValueResponse::s_customDeleter(GetSecretValueResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetSecretValueRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_secretId.has_value()) + { + payloadObject.WithString("secretId", m_secretId.value()); + } + if (m_versionId.has_value()) + { + payloadObject.WithString("versionId", m_versionId.value()); + } + if (m_versionStage.has_value()) + { + payloadObject.WithString("versionStage", m_versionStage.value()); + } + } + + void GetSecretValueRequest::s_loadFromJsonView( + GetSecretValueRequest &getSecretValueRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("secretId")) + { + getSecretValueRequest.m_secretId = Aws::Crt::Optional(jsonView.GetString("secretId")); + } + if (jsonView.ValueExists("versionId")) + { + getSecretValueRequest.m_versionId = + Aws::Crt::Optional(jsonView.GetString("versionId")); + } + if (jsonView.ValueExists("versionStage")) + { + getSecretValueRequest.m_versionStage = + Aws::Crt::Optional(jsonView.GetString("versionStage")); + } + } + + const char *GetSecretValueRequest::MODEL_NAME = "aws.greengrass#GetSecretValueRequest"; + + Aws::Crt::String GetSecretValueRequest::GetModelName() const noexcept + { + return GetSecretValueRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetSecretValueRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetSecretValueRequest::s_customDeleter); + shape->m_allocator = allocator; + GetSecretValueRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetSecretValueRequest::s_customDeleter(GetSecretValueRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetLocalDeploymentStatusResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deployment.has_value()) + { + Aws::Crt::JsonObject localDeploymentValue; + m_deployment.value().SerializeToJsonObject(localDeploymentValue); + payloadObject.WithObject("deployment", std::move(localDeploymentValue)); + } + } + + void GetLocalDeploymentStatusResponse::s_loadFromJsonView( + GetLocalDeploymentStatusResponse &getLocalDeploymentStatusResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deployment")) + { + getLocalDeploymentStatusResponse.m_deployment = LocalDeployment(); + LocalDeployment::s_loadFromJsonView( + getLocalDeploymentStatusResponse.m_deployment.value(), jsonView.GetJsonObject("deployment")); + } + } + + const char *GetLocalDeploymentStatusResponse::MODEL_NAME = "aws.greengrass#GetLocalDeploymentStatusResponse"; + + Aws::Crt::String GetLocalDeploymentStatusResponse::GetModelName() const noexcept + { + return GetLocalDeploymentStatusResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetLocalDeploymentStatusResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetLocalDeploymentStatusResponse::s_customDeleter); + shape->m_allocator = allocator; + GetLocalDeploymentStatusResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetLocalDeploymentStatusResponse::s_customDeleter(GetLocalDeploymentStatusResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetLocalDeploymentStatusRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + } + + void GetLocalDeploymentStatusRequest::s_loadFromJsonView( + GetLocalDeploymentStatusRequest &getLocalDeploymentStatusRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + getLocalDeploymentStatusRequest.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + } + + const char *GetLocalDeploymentStatusRequest::MODEL_NAME = "aws.greengrass#GetLocalDeploymentStatusRequest"; + + Aws::Crt::String GetLocalDeploymentStatusRequest::GetModelName() const noexcept + { + return GetLocalDeploymentStatusRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetLocalDeploymentStatusRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetLocalDeploymentStatusRequest::s_customDeleter); + shape->m_allocator = allocator; + GetLocalDeploymentStatusRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetLocalDeploymentStatusRequest::s_customDeleter(GetLocalDeploymentStatusRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetConfigurationResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_value.has_value()) + { + payloadObject.WithObject("value", m_value.value()); + } + } + + void GetConfigurationResponse::s_loadFromJsonView( + GetConfigurationResponse &getConfigurationResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + getConfigurationResponse.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("value")) + { + getConfigurationResponse.m_value = + Aws::Crt::Optional(jsonView.GetJsonObject("value").Materialize()); + } + } + + const char *GetConfigurationResponse::MODEL_NAME = "aws.greengrass#GetConfigurationResponse"; + + Aws::Crt::String GetConfigurationResponse::GetModelName() const noexcept + { + return GetConfigurationResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetConfigurationResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetConfigurationResponse::s_customDeleter); + shape->m_allocator = allocator; + GetConfigurationResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetConfigurationResponse::s_customDeleter(GetConfigurationResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetConfigurationRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + if (m_keyPath.has_value()) + { + Aws::Crt::JsonObject keyPath; + Aws::Crt::Vector keyPathJsonArray; + for (const auto &keyPathItem : m_keyPath.value()) + { + Aws::Crt::JsonObject keyPathJsonArrayItem; + keyPathJsonArrayItem.AsString(keyPathItem); + keyPathJsonArray.emplace_back(std::move(keyPathJsonArrayItem)); + } + keyPath.AsArray(std::move(keyPathJsonArray)); + payloadObject.WithObject("keyPath", std::move(keyPath)); + } + } + + void GetConfigurationRequest::s_loadFromJsonView( + GetConfigurationRequest &getConfigurationRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + getConfigurationRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + if (jsonView.ValueExists("keyPath")) + { + getConfigurationRequest.m_keyPath = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &keyPathJsonView : jsonView.GetArray("keyPath")) + { + Aws::Crt::Optional keyPathItem; + keyPathItem = Aws::Crt::Optional(keyPathJsonView.AsString()); + getConfigurationRequest.m_keyPath.value().push_back(keyPathItem.value()); + } + } + } + + const char *GetConfigurationRequest::MODEL_NAME = "aws.greengrass#GetConfigurationRequest"; + + Aws::Crt::String GetConfigurationRequest::GetModelName() const noexcept + { + return GetConfigurationRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetConfigurationRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetConfigurationRequest::s_customDeleter); + shape->m_allocator = allocator; + GetConfigurationRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetConfigurationRequest::s_customDeleter(GetConfigurationRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetComponentDetailsResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentDetails.has_value()) + { + Aws::Crt::JsonObject componentDetailsValue; + m_componentDetails.value().SerializeToJsonObject(componentDetailsValue); + payloadObject.WithObject("componentDetails", std::move(componentDetailsValue)); + } + } + + void GetComponentDetailsResponse::s_loadFromJsonView( + GetComponentDetailsResponse &getComponentDetailsResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentDetails")) + { + getComponentDetailsResponse.m_componentDetails = ComponentDetails(); + ComponentDetails::s_loadFromJsonView( + getComponentDetailsResponse.m_componentDetails.value(), jsonView.GetJsonObject("componentDetails")); + } + } + + const char *GetComponentDetailsResponse::MODEL_NAME = "aws.greengrass#GetComponentDetailsResponse"; + + Aws::Crt::String GetComponentDetailsResponse::GetModelName() const noexcept + { + return GetComponentDetailsResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetComponentDetailsResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetComponentDetailsResponse::s_customDeleter); + shape->m_allocator = allocator; + GetComponentDetailsResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetComponentDetailsResponse::s_customDeleter(GetComponentDetailsResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetComponentDetailsRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_componentName.has_value()) + { + payloadObject.WithString("componentName", m_componentName.value()); + } + } + + void GetComponentDetailsRequest::s_loadFromJsonView( + GetComponentDetailsRequest &getComponentDetailsRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("componentName")) + { + getComponentDetailsRequest.m_componentName = + Aws::Crt::Optional(jsonView.GetString("componentName")); + } + } + + const char *GetComponentDetailsRequest::MODEL_NAME = "aws.greengrass#GetComponentDetailsRequest"; + + Aws::Crt::String GetComponentDetailsRequest::GetModelName() const noexcept + { + return GetComponentDetailsRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetComponentDetailsRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), GetComponentDetailsRequest::s_customDeleter); + shape->m_allocator = allocator; + GetComponentDetailsRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetComponentDetailsRequest::s_customDeleter(GetComponentDetailsRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void InvalidCredentialError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidCredentialError::s_loadFromJsonView( + InvalidCredentialError &invalidCredentialError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidCredentialError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidCredentialError::MODEL_NAME = "aws.greengrass#InvalidCredentialError"; + + Aws::Crt::String InvalidCredentialError::GetModelName() const noexcept + { + return InvalidCredentialError::MODEL_NAME; + } + + Aws::Crt::ScopedResource InvalidCredentialError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), InvalidCredentialError::s_customDeleter); + shape->m_allocator = allocator; + InvalidCredentialError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidCredentialError::s_customDeleter(InvalidCredentialError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void GetClientDeviceAuthTokenResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_clientDeviceAuthToken.has_value()) + { + payloadObject.WithString("clientDeviceAuthToken", m_clientDeviceAuthToken.value()); + } + } + + void GetClientDeviceAuthTokenResponse::s_loadFromJsonView( + GetClientDeviceAuthTokenResponse &getClientDeviceAuthTokenResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("clientDeviceAuthToken")) + { + getClientDeviceAuthTokenResponse.m_clientDeviceAuthToken = + Aws::Crt::Optional(jsonView.GetString("clientDeviceAuthToken")); + } + } + + const char *GetClientDeviceAuthTokenResponse::MODEL_NAME = "aws.greengrass#GetClientDeviceAuthTokenResponse"; + + Aws::Crt::String GetClientDeviceAuthTokenResponse::GetModelName() const noexcept + { + return GetClientDeviceAuthTokenResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetClientDeviceAuthTokenResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetClientDeviceAuthTokenResponse::s_customDeleter); + shape->m_allocator = allocator; + GetClientDeviceAuthTokenResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetClientDeviceAuthTokenResponse::s_customDeleter(GetClientDeviceAuthTokenResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void GetClientDeviceAuthTokenRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_credential.has_value()) + { + Aws::Crt::JsonObject credentialDocumentValue; + m_credential.value().SerializeToJsonObject(credentialDocumentValue); + payloadObject.WithObject("credential", std::move(credentialDocumentValue)); + } + } + + void GetClientDeviceAuthTokenRequest::s_loadFromJsonView( + GetClientDeviceAuthTokenRequest &getClientDeviceAuthTokenRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("credential")) + { + getClientDeviceAuthTokenRequest.m_credential = CredentialDocument(); + CredentialDocument::s_loadFromJsonView( + getClientDeviceAuthTokenRequest.m_credential.value(), jsonView.GetJsonObject("credential")); + } + } + + const char *GetClientDeviceAuthTokenRequest::MODEL_NAME = "aws.greengrass#GetClientDeviceAuthTokenRequest"; + + Aws::Crt::String GetClientDeviceAuthTokenRequest::GetModelName() const noexcept + { + return GetClientDeviceAuthTokenRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource GetClientDeviceAuthTokenRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + GetClientDeviceAuthTokenRequest::s_customDeleter); + shape->m_allocator = allocator; + GetClientDeviceAuthTokenRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void GetClientDeviceAuthTokenRequest::s_customDeleter(GetClientDeviceAuthTokenRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void DeleteThingShadowResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_payload.has_value()) + { + if (m_payload.value().size() > 0) + { + payloadObject.WithString("payload", Aws::Crt::Base64Encode(m_payload.value())); + } + } + } + + void DeleteThingShadowResponse::s_loadFromJsonView( + DeleteThingShadowResponse &deleteThingShadowResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("payload")) + { + if (jsonView.GetString("payload").size() > 0) + { + deleteThingShadowResponse.m_payload = Aws::Crt::Optional>( + Aws::Crt::Base64Decode(jsonView.GetString("payload"))); + } + } + } + + const char *DeleteThingShadowResponse::MODEL_NAME = "aws.greengrass#DeleteThingShadowResponse"; + + Aws::Crt::String DeleteThingShadowResponse::GetModelName() const noexcept + { + return DeleteThingShadowResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource DeleteThingShadowResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), DeleteThingShadowResponse::s_customDeleter); + shape->m_allocator = allocator; + DeleteThingShadowResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void DeleteThingShadowResponse::s_customDeleter(DeleteThingShadowResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void DeleteThingShadowRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_thingName.has_value()) + { + payloadObject.WithString("thingName", m_thingName.value()); + } + if (m_shadowName.has_value()) + { + payloadObject.WithString("shadowName", m_shadowName.value()); + } + } + + void DeleteThingShadowRequest::s_loadFromJsonView( + DeleteThingShadowRequest &deleteThingShadowRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("thingName")) + { + deleteThingShadowRequest.m_thingName = + Aws::Crt::Optional(jsonView.GetString("thingName")); + } + if (jsonView.ValueExists("shadowName")) + { + deleteThingShadowRequest.m_shadowName = + Aws::Crt::Optional(jsonView.GetString("shadowName")); + } + } + + const char *DeleteThingShadowRequest::MODEL_NAME = "aws.greengrass#DeleteThingShadowRequest"; + + Aws::Crt::String DeleteThingShadowRequest::GetModelName() const noexcept + { + return DeleteThingShadowRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource DeleteThingShadowRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), DeleteThingShadowRequest::s_customDeleter); + shape->m_allocator = allocator; + DeleteThingShadowRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void DeleteThingShadowRequest::s_customDeleter(DeleteThingShadowRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void ResourceNotFoundError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + if (m_resourceType.has_value()) + { + payloadObject.WithString("resourceType", m_resourceType.value()); + } + if (m_resourceName.has_value()) + { + payloadObject.WithString("resourceName", m_resourceName.value()); + } + } + + void ResourceNotFoundError::s_loadFromJsonView( + ResourceNotFoundError &resourceNotFoundError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + resourceNotFoundError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("resourceType")) + { + resourceNotFoundError.m_resourceType = + Aws::Crt::Optional(jsonView.GetString("resourceType")); + } + if (jsonView.ValueExists("resourceName")) + { + resourceNotFoundError.m_resourceName = + Aws::Crt::Optional(jsonView.GetString("resourceName")); + } + } + + const char *ResourceNotFoundError::MODEL_NAME = "aws.greengrass#ResourceNotFoundError"; + + Aws::Crt::String ResourceNotFoundError::GetModelName() const noexcept + { + return ResourceNotFoundError::MODEL_NAME; + } + + Aws::Crt::ScopedResource ResourceNotFoundError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ResourceNotFoundError::s_customDeleter); + shape->m_allocator = allocator; + ResourceNotFoundError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void ResourceNotFoundError::s_customDeleter(ResourceNotFoundError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void DeferComponentUpdateResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void DeferComponentUpdateResponse::s_loadFromJsonView( + DeferComponentUpdateResponse &deferComponentUpdateResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)deferComponentUpdateResponse; + (void)jsonView; + } + + const char *DeferComponentUpdateResponse::MODEL_NAME = "aws.greengrass#DeferComponentUpdateResponse"; + + Aws::Crt::String DeferComponentUpdateResponse::GetModelName() const noexcept + { + return DeferComponentUpdateResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource DeferComponentUpdateResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), DeferComponentUpdateResponse::s_customDeleter); + shape->m_allocator = allocator; + DeferComponentUpdateResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void DeferComponentUpdateResponse::s_customDeleter(DeferComponentUpdateResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void DeferComponentUpdateRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + if (m_recheckAfterMs.has_value()) + { + payloadObject.WithInt64("recheckAfterMs", m_recheckAfterMs.value()); + } + } + + void DeferComponentUpdateRequest::s_loadFromJsonView( + DeferComponentUpdateRequest &deferComponentUpdateRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + deferComponentUpdateRequest.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + if (jsonView.ValueExists("message")) + { + deferComponentUpdateRequest.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + if (jsonView.ValueExists("recheckAfterMs")) + { + deferComponentUpdateRequest.m_recheckAfterMs = + Aws::Crt::Optional(jsonView.GetInt64("recheckAfterMs")); + } + } + + const char *DeferComponentUpdateRequest::MODEL_NAME = "aws.greengrass#DeferComponentUpdateRequest"; + + Aws::Crt::String DeferComponentUpdateRequest::GetModelName() const noexcept + { + return DeferComponentUpdateRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource DeferComponentUpdateRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), DeferComponentUpdateRequest::s_customDeleter); + shape->m_allocator = allocator; + DeferComponentUpdateRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void DeferComponentUpdateRequest::s_customDeleter(DeferComponentUpdateRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void InvalidArtifactsDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidArtifactsDirectoryPathError::s_loadFromJsonView( + InvalidArtifactsDirectoryPathError &invalidArtifactsDirectoryPathError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidArtifactsDirectoryPathError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidArtifactsDirectoryPathError::MODEL_NAME = + "aws.greengrass#InvalidArtifactsDirectoryPathError"; + + Aws::Crt::String InvalidArtifactsDirectoryPathError::GetModelName() const noexcept + { + return InvalidArtifactsDirectoryPathError::MODEL_NAME; + } + + Aws::Crt::ScopedResource InvalidArtifactsDirectoryPathError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidArtifactsDirectoryPathError::s_customDeleter); + shape->m_allocator = allocator; + InvalidArtifactsDirectoryPathError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidArtifactsDirectoryPathError::s_customDeleter(InvalidArtifactsDirectoryPathError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void InvalidRecipeDirectoryPathError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidRecipeDirectoryPathError::s_loadFromJsonView( + InvalidRecipeDirectoryPathError &invalidRecipeDirectoryPathError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidRecipeDirectoryPathError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidRecipeDirectoryPathError::MODEL_NAME = "aws.greengrass#InvalidRecipeDirectoryPathError"; + + Aws::Crt::String InvalidRecipeDirectoryPathError::GetModelName() const noexcept + { + return InvalidRecipeDirectoryPathError::MODEL_NAME; + } + + Aws::Crt::ScopedResource InvalidRecipeDirectoryPathError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidRecipeDirectoryPathError::s_customDeleter); + shape->m_allocator = allocator; + InvalidRecipeDirectoryPathError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidRecipeDirectoryPathError::s_customDeleter(InvalidRecipeDirectoryPathError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void CreateLocalDeploymentResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_deploymentId.has_value()) + { + payloadObject.WithString("deploymentId", m_deploymentId.value()); + } + } + + void CreateLocalDeploymentResponse::s_loadFromJsonView( + CreateLocalDeploymentResponse &createLocalDeploymentResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("deploymentId")) + { + createLocalDeploymentResponse.m_deploymentId = + Aws::Crt::Optional(jsonView.GetString("deploymentId")); + } + } + + const char *CreateLocalDeploymentResponse::MODEL_NAME = "aws.greengrass#CreateLocalDeploymentResponse"; + + Aws::Crt::String CreateLocalDeploymentResponse::GetModelName() const noexcept + { + return CreateLocalDeploymentResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource CreateLocalDeploymentResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + CreateLocalDeploymentResponse::s_customDeleter); + shape->m_allocator = allocator; + CreateLocalDeploymentResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CreateLocalDeploymentResponse::s_customDeleter(CreateLocalDeploymentResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CreateLocalDeploymentRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_groupName.has_value()) + { + payloadObject.WithString("groupName", m_groupName.value()); + } + if (m_rootComponentVersionsToAdd.has_value()) + { + Aws::Crt::JsonObject componentToVersionMapValue; + for (const auto &componentToVersionMapItem : m_rootComponentVersionsToAdd.value()) + { + Aws::Crt::JsonObject componentToVersionMapJsonObject; + componentToVersionMapJsonObject.AsString(componentToVersionMapItem.second); + componentToVersionMapValue.WithObject( + componentToVersionMapItem.first, std::move(componentToVersionMapJsonObject)); + } + payloadObject.WithObject("rootComponentVersionsToAdd", std::move(componentToVersionMapValue)); + } + if (m_rootComponentsToRemove.has_value()) + { + Aws::Crt::JsonObject componentList; + Aws::Crt::Vector componentListJsonArray; + for (const auto &componentListItem : m_rootComponentsToRemove.value()) + { + Aws::Crt::JsonObject componentListJsonArrayItem; + componentListJsonArrayItem.AsString(componentListItem); + componentListJsonArray.emplace_back(std::move(componentListJsonArrayItem)); + } + componentList.AsArray(std::move(componentListJsonArray)); + payloadObject.WithObject("rootComponentsToRemove", std::move(componentList)); + } + if (m_componentToConfiguration.has_value()) + { + Aws::Crt::JsonObject componentToConfigurationValue; + for (const auto &componentToConfigurationItem : m_componentToConfiguration.value()) + { + Aws::Crt::JsonObject componentToConfigurationJsonObject; + componentToConfigurationJsonObject.AsObject(componentToConfigurationItem.second); + componentToConfigurationValue.WithObject( + componentToConfigurationItem.first, std::move(componentToConfigurationJsonObject)); + } + payloadObject.WithObject("componentToConfiguration", std::move(componentToConfigurationValue)); + } + if (m_componentToRunWithInfo.has_value()) + { + Aws::Crt::JsonObject componentToRunWithInfoValue; + for (const auto &componentToRunWithInfoItem : m_componentToRunWithInfo.value()) + { + Aws::Crt::JsonObject componentToRunWithInfoJsonObject; + componentToRunWithInfoItem.second.SerializeToJsonObject(componentToRunWithInfoJsonObject); + componentToRunWithInfoValue.WithObject( + componentToRunWithInfoItem.first, std::move(componentToRunWithInfoJsonObject)); + } + payloadObject.WithObject("componentToRunWithInfo", std::move(componentToRunWithInfoValue)); + } + if (m_recipeDirectoryPath.has_value()) + { + payloadObject.WithString("recipeDirectoryPath", m_recipeDirectoryPath.value()); + } + if (m_artifactsDirectoryPath.has_value()) + { + payloadObject.WithString("artifactsDirectoryPath", m_artifactsDirectoryPath.value()); + } + } + + void CreateLocalDeploymentRequest::s_loadFromJsonView( + CreateLocalDeploymentRequest &createLocalDeploymentRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("groupName")) + { + createLocalDeploymentRequest.m_groupName = + Aws::Crt::Optional(jsonView.GetString("groupName")); + } + if (jsonView.ValueExists("rootComponentVersionsToAdd")) + { + createLocalDeploymentRequest.m_rootComponentVersionsToAdd = + Aws::Crt::Map(); + for (const auto &componentToVersionMapPair : + jsonView.GetJsonObject("rootComponentVersionsToAdd").GetAllObjects()) + { + Aws::Crt::Optional componentToVersionMapValue; + componentToVersionMapValue = + Aws::Crt::Optional(componentToVersionMapPair.second.AsString()); + createLocalDeploymentRequest.m_rootComponentVersionsToAdd.value()[componentToVersionMapPair.first] = + componentToVersionMapValue.value(); + } + } + if (jsonView.ValueExists("rootComponentsToRemove")) + { + createLocalDeploymentRequest.m_rootComponentsToRemove = Aws::Crt::Vector(); + for (const Aws::Crt::JsonView &componentListJsonView : jsonView.GetArray("rootComponentsToRemove")) + { + Aws::Crt::Optional componentListItem; + componentListItem = Aws::Crt::Optional(componentListJsonView.AsString()); + createLocalDeploymentRequest.m_rootComponentsToRemove.value().push_back(componentListItem.value()); + } + } + if (jsonView.ValueExists("componentToConfiguration")) + { + createLocalDeploymentRequest.m_componentToConfiguration = + Aws::Crt::Map(); + for (const auto &componentToConfigurationPair : + jsonView.GetJsonObject("componentToConfiguration").GetAllObjects()) + { + Aws::Crt::Optional componentToConfigurationValue; + componentToConfigurationValue = Aws::Crt::Optional( + componentToConfigurationPair.second.AsObject().Materialize()); + createLocalDeploymentRequest.m_componentToConfiguration + .value()[componentToConfigurationPair.first] = componentToConfigurationValue.value(); + } + } + if (jsonView.ValueExists("componentToRunWithInfo")) + { + createLocalDeploymentRequest.m_componentToRunWithInfo = Aws::Crt::Map(); + for (const auto &componentToRunWithInfoPair : + jsonView.GetJsonObject("componentToRunWithInfo").GetAllObjects()) + { + Aws::Crt::Optional componentToRunWithInfoValue; + componentToRunWithInfoValue = RunWithInfo(); + RunWithInfo::s_loadFromJsonView( + componentToRunWithInfoValue.value(), componentToRunWithInfoPair.second); + createLocalDeploymentRequest.m_componentToRunWithInfo.value()[componentToRunWithInfoPair.first] = + componentToRunWithInfoValue.value(); + } + } + if (jsonView.ValueExists("recipeDirectoryPath")) + { + createLocalDeploymentRequest.m_recipeDirectoryPath = + Aws::Crt::Optional(jsonView.GetString("recipeDirectoryPath")); + } + if (jsonView.ValueExists("artifactsDirectoryPath")) + { + createLocalDeploymentRequest.m_artifactsDirectoryPath = + Aws::Crt::Optional(jsonView.GetString("artifactsDirectoryPath")); + } + } + + const char *CreateLocalDeploymentRequest::MODEL_NAME = "aws.greengrass#CreateLocalDeploymentRequest"; + + Aws::Crt::String CreateLocalDeploymentRequest::GetModelName() const noexcept + { + return CreateLocalDeploymentRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource CreateLocalDeploymentRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CreateLocalDeploymentRequest::s_customDeleter); + shape->m_allocator = allocator; + CreateLocalDeploymentRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CreateLocalDeploymentRequest::s_customDeleter(CreateLocalDeploymentRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CreateDebugPasswordResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_password.has_value()) + { + payloadObject.WithString("password", m_password.value()); + } + if (m_username.has_value()) + { + payloadObject.WithString("username", m_username.value()); + } + if (m_passwordExpiration.has_value()) + { + payloadObject.WithDouble("passwordExpiration", m_passwordExpiration.value().SecondsWithMSPrecision()); + } + if (m_certificateSHA256Hash.has_value()) + { + payloadObject.WithString("certificateSHA256Hash", m_certificateSHA256Hash.value()); + } + if (m_certificateSHA1Hash.has_value()) + { + payloadObject.WithString("certificateSHA1Hash", m_certificateSHA1Hash.value()); + } + } + + void CreateDebugPasswordResponse::s_loadFromJsonView( + CreateDebugPasswordResponse &createDebugPasswordResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("password")) + { + createDebugPasswordResponse.m_password = + Aws::Crt::Optional(jsonView.GetString("password")); + } + if (jsonView.ValueExists("username")) + { + createDebugPasswordResponse.m_username = + Aws::Crt::Optional(jsonView.GetString("username")); + } + if (jsonView.ValueExists("passwordExpiration")) + { + createDebugPasswordResponse.m_passwordExpiration = Aws::Crt::Optional( + Aws::Crt::DateTime(jsonView.GetDouble("passwordExpiration"))); + } + if (jsonView.ValueExists("certificateSHA256Hash")) + { + createDebugPasswordResponse.m_certificateSHA256Hash = + Aws::Crt::Optional(jsonView.GetString("certificateSHA256Hash")); + } + if (jsonView.ValueExists("certificateSHA1Hash")) + { + createDebugPasswordResponse.m_certificateSHA1Hash = + Aws::Crt::Optional(jsonView.GetString("certificateSHA1Hash")); + } + } + + const char *CreateDebugPasswordResponse::MODEL_NAME = "aws.greengrass#CreateDebugPasswordResponse"; + + Aws::Crt::String CreateDebugPasswordResponse::GetModelName() const noexcept + { + return CreateDebugPasswordResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource CreateDebugPasswordResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CreateDebugPasswordResponse::s_customDeleter); + shape->m_allocator = allocator; + CreateDebugPasswordResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CreateDebugPasswordResponse::s_customDeleter(CreateDebugPasswordResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void CreateDebugPasswordRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + (void)payloadObject; + } + + void CreateDebugPasswordRequest::s_loadFromJsonView( + CreateDebugPasswordRequest &createDebugPasswordRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + (void)createDebugPasswordRequest; + (void)jsonView; + } + + const char *CreateDebugPasswordRequest::MODEL_NAME = "aws.greengrass#CreateDebugPasswordRequest"; + + Aws::Crt::String CreateDebugPasswordRequest::GetModelName() const noexcept + { + return CreateDebugPasswordRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource CreateDebugPasswordRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), CreateDebugPasswordRequest::s_customDeleter); + shape->m_allocator = allocator; + CreateDebugPasswordRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void CreateDebugPasswordRequest::s_customDeleter(CreateDebugPasswordRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void InvalidClientDeviceAuthTokenError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidClientDeviceAuthTokenError::s_loadFromJsonView( + InvalidClientDeviceAuthTokenError &invalidClientDeviceAuthTokenError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidClientDeviceAuthTokenError.m_message = + Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidClientDeviceAuthTokenError::MODEL_NAME = "aws.greengrass#InvalidClientDeviceAuthTokenError"; + + Aws::Crt::String InvalidClientDeviceAuthTokenError::GetModelName() const noexcept + { + return InvalidClientDeviceAuthTokenError::MODEL_NAME; + } + + Aws::Crt::ScopedResource InvalidClientDeviceAuthTokenError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + InvalidClientDeviceAuthTokenError::s_customDeleter); + shape->m_allocator = allocator; + InvalidClientDeviceAuthTokenError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidClientDeviceAuthTokenError::s_customDeleter(InvalidClientDeviceAuthTokenError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void InvalidArgumentsError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void InvalidArgumentsError::s_loadFromJsonView( + InvalidArgumentsError &invalidArgumentsError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + invalidArgumentsError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *InvalidArgumentsError::MODEL_NAME = "aws.greengrass#InvalidArgumentsError"; + + Aws::Crt::String InvalidArgumentsError::GetModelName() const noexcept + { + return InvalidArgumentsError::MODEL_NAME; + } + + Aws::Crt::ScopedResource InvalidArgumentsError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), InvalidArgumentsError::s_customDeleter); + shape->m_allocator = allocator; + InvalidArgumentsError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void InvalidArgumentsError::s_customDeleter(InvalidArgumentsError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void ServiceError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void ServiceError::s_loadFromJsonView(ServiceError &serviceError, const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + serviceError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *ServiceError::MODEL_NAME = "aws.greengrass#ServiceError"; + + Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; } + + Aws::Crt::ScopedResource ServiceError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), ServiceError::s_customDeleter); + shape->m_allocator = allocator; + ServiceError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void ServiceError::s_customDeleter(ServiceError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void UnauthorizedError::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_message.has_value()) + { + payloadObject.WithString("message", m_message.value()); + } + } + + void UnauthorizedError::s_loadFromJsonView( + UnauthorizedError &unauthorizedError, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("message")) + { + unauthorizedError.m_message = Aws::Crt::Optional(jsonView.GetString("message")); + } + } + + const char *UnauthorizedError::MODEL_NAME = "aws.greengrass#UnauthorizedError"; + + Aws::Crt::String UnauthorizedError::GetModelName() const noexcept { return UnauthorizedError::MODEL_NAME; } + + Aws::Crt::ScopedResource UnauthorizedError::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), UnauthorizedError::s_customDeleter); + shape->m_allocator = allocator; + UnauthorizedError::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, OperationError::s_customDeleter); + } + + void UnauthorizedError::s_customDeleter(UnauthorizedError *shape) noexcept + { + OperationError::s_customDeleter(static_cast(shape)); + } + + void AuthorizeClientDeviceActionResponse::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_isAuthorized.has_value()) + { + payloadObject.WithBool("isAuthorized", m_isAuthorized.value()); + } + } + + void AuthorizeClientDeviceActionResponse::s_loadFromJsonView( + AuthorizeClientDeviceActionResponse &authorizeClientDeviceActionResponse, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("isAuthorized")) + { + authorizeClientDeviceActionResponse.m_isAuthorized = + Aws::Crt::Optional(jsonView.GetBool("isAuthorized")); + } + } + + const char *AuthorizeClientDeviceActionResponse::MODEL_NAME = + "aws.greengrass#AuthorizeClientDeviceActionResponse"; + + Aws::Crt::String AuthorizeClientDeviceActionResponse::GetModelName() const noexcept + { + return AuthorizeClientDeviceActionResponse::MODEL_NAME; + } + + Aws::Crt::ScopedResource AuthorizeClientDeviceActionResponse::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + AuthorizeClientDeviceActionResponse::s_customDeleter); + shape->m_allocator = allocator; + AuthorizeClientDeviceActionResponse::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void AuthorizeClientDeviceActionResponse::s_customDeleter(AuthorizeClientDeviceActionResponse *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void AuthorizeClientDeviceActionRequest::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const + noexcept + { + if (m_clientDeviceAuthToken.has_value()) + { + payloadObject.WithString("clientDeviceAuthToken", m_clientDeviceAuthToken.value()); + } + if (m_operation.has_value()) + { + payloadObject.WithString("operation", m_operation.value()); + } + if (m_resource.has_value()) + { + payloadObject.WithString("resource", m_resource.value()); + } + } + + void AuthorizeClientDeviceActionRequest::s_loadFromJsonView( + AuthorizeClientDeviceActionRequest &authorizeClientDeviceActionRequest, + const Aws::Crt::JsonView &jsonView) noexcept + { + if (jsonView.ValueExists("clientDeviceAuthToken")) + { + authorizeClientDeviceActionRequest.m_clientDeviceAuthToken = + Aws::Crt::Optional(jsonView.GetString("clientDeviceAuthToken")); + } + if (jsonView.ValueExists("operation")) + { + authorizeClientDeviceActionRequest.m_operation = + Aws::Crt::Optional(jsonView.GetString("operation")); + } + if (jsonView.ValueExists("resource")) + { + authorizeClientDeviceActionRequest.m_resource = + Aws::Crt::Optional(jsonView.GetString("resource")); + } + } + + const char *AuthorizeClientDeviceActionRequest::MODEL_NAME = + "aws.greengrass#AuthorizeClientDeviceActionRequest"; + + Aws::Crt::String AuthorizeClientDeviceActionRequest::GetModelName() const noexcept + { + return AuthorizeClientDeviceActionRequest::MODEL_NAME; + } + + Aws::Crt::ScopedResource AuthorizeClientDeviceActionRequest::s_allocateFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) noexcept + { + Aws::Crt::String payload = {stringView.begin(), stringView.end()}; + Aws::Crt::JsonObject jsonObject(payload); + Aws::Crt::JsonView jsonView(jsonObject); + + Aws::Crt::ScopedResource shape( + Aws::Crt::New(allocator), + AuthorizeClientDeviceActionRequest::s_customDeleter); + shape->m_allocator = allocator; + AuthorizeClientDeviceActionRequest::s_loadFromJsonView(*shape, jsonView); + auto operationResponse = static_cast(shape.release()); + return Aws::Crt::ScopedResource(operationResponse, AbstractShapeBase::s_customDeleter); + } + + void AuthorizeClientDeviceActionRequest::s_customDeleter(AuthorizeClientDeviceActionRequest *shape) noexcept + { + AbstractShapeBase::s_customDeleter(static_cast(shape)); + } + + void SubscribeToIoTCoreStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToIoTCoreStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToIoTCoreOperationContext::SubscribeToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToIoTCoreOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return IoTCoreMessage::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToIoTCoreOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreRequest"); + } + + Aws::Crt::String SubscribeToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCoreResponse"); + } + + Aws::Crt::Optional SubscribeToIoTCoreOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::String("aws.greengrass#IoTCoreMessage"); + } + + Aws::Crt::String SubscribeToIoTCoreOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToIoTCore"); + } + + std::future SubscribeToIoTCoreOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + } + + SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToIoTCoreOperation::Activate( + const SubscribeToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToIoTCoreOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + ResumeComponentOperationContext::ResumeComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource ResumeComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return ResumeComponentResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource ResumeComponentOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String ResumeComponentOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ResumeComponentRequest"); + } + + Aws::Crt::String ResumeComponentOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ResumeComponentResponse"); + } + + Aws::Crt::Optional ResumeComponentOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String ResumeComponentOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ResumeComponent"); + } + + std::future ResumeComponentOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return ResumeComponentResult(GetOperationResult().get()); }); + } + + ResumeComponentOperation::ResumeComponentOperation( + ClientConnection &connection, + const ResumeComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future ResumeComponentOperation::Activate( + const ResumeComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String ResumeComponentOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + PublishToIoTCoreOperationContext::PublishToIoTCoreOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return PublishToIoTCoreResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource PublishToIoTCoreOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String PublishToIoTCoreOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToIoTCoreRequest"); + } + + Aws::Crt::String PublishToIoTCoreOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToIoTCoreResponse"); + } + + Aws::Crt::Optional PublishToIoTCoreOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String PublishToIoTCoreOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToIoTCore"); + } + + std::future PublishToIoTCoreOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return PublishToIoTCoreResult(GetOperationResult().get()); }); + } + + PublishToIoTCoreOperation::PublishToIoTCoreOperation( + ClientConnection &connection, + const PublishToIoTCoreOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future PublishToIoTCoreOperation::Activate( + const PublishToIoTCoreRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String PublishToIoTCoreOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void SubscribeToConfigurationUpdateStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToConfigurationUpdateStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToConfigurationUpdateOperationContext::SubscribeToConfigurationUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToConfigurationUpdateResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToConfigurationUpdateOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdateRequest"); + } + + Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdateResponse"); + } + + Aws::Crt::Optional SubscribeToConfigurationUpdateOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ConfigurationUpdateEvents"); + } + + Aws::Crt::String SubscribeToConfigurationUpdateOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToConfigurationUpdate"); + } + + std::future SubscribeToConfigurationUpdateOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); + } + + SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToConfigurationUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToConfigurationUpdateOperation::Activate( + const SubscribeToConfigurationUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToConfigurationUpdateOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + DeleteThingShadowOperationContext::DeleteThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return DeleteThingShadowResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource DeleteThingShadowOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String DeleteThingShadowOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeleteThingShadowRequest"); + } + + Aws::Crt::String DeleteThingShadowOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeleteThingShadowResponse"); + } + + Aws::Crt::Optional DeleteThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String DeleteThingShadowOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeleteThingShadow"); + } + + std::future DeleteThingShadowOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return DeleteThingShadowResult(GetOperationResult().get()); }); + } + + DeleteThingShadowOperation::DeleteThingShadowOperation( + ClientConnection &connection, + const DeleteThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future DeleteThingShadowOperation::Activate( + const DeleteThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String DeleteThingShadowOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + PutComponentMetricOperationContext::PutComponentMetricOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource PutComponentMetricOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return PutComponentMetricResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource PutComponentMetricOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String PutComponentMetricOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PutComponentMetricRequest"); + } + + Aws::Crt::String PutComponentMetricOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PutComponentMetricResponse"); + } + + Aws::Crt::Optional PutComponentMetricOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String PutComponentMetricOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PutComponentMetric"); + } + + std::future PutComponentMetricOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return PutComponentMetricResult(GetOperationResult().get()); }); + } + + PutComponentMetricOperation::PutComponentMetricOperation( + ClientConnection &connection, + const PutComponentMetricOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future PutComponentMetricOperation::Activate( + const PutComponentMetricRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String PutComponentMetricOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + DeferComponentUpdateOperationContext::DeferComponentUpdateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return DeferComponentUpdateResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource DeferComponentUpdateOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String DeferComponentUpdateOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdateRequest"); + } + + Aws::Crt::String DeferComponentUpdateOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdateResponse"); + } + + Aws::Crt::Optional DeferComponentUpdateOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String DeferComponentUpdateOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#DeferComponentUpdate"); + } + + std::future DeferComponentUpdateOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return DeferComponentUpdateResult(GetOperationResult().get()); }); + } + + DeferComponentUpdateOperation::DeferComponentUpdateOperation( + ClientConnection &connection, + const DeferComponentUpdateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future DeferComponentUpdateOperation::Activate( + const DeferComponentUpdateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String DeferComponentUpdateOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToValidateConfigurationUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToValidateConfigurationUpdatesOperationContext:: + SubscribeToValidateConfigurationUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToValidateConfigurationUpdatesResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToValidateConfigurationUpdatesOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ValidateConfigurationUpdateEvents::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest"); + } + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetInitialResponseModelName() const + noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse"); + } + + Aws::Crt::Optional SubscribeToValidateConfigurationUpdatesOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ValidateConfigurationUpdateEvents"); + } + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToValidateConfigurationUpdates"); + } + + std::future SubscribeToValidateConfigurationUpdatesOperation:: + GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); + }); + } + + SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToValidateConfigurationUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToValidateConfigurationUpdatesOperation::Activate( + const SubscribeToValidateConfigurationUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToValidateConfigurationUpdatesOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetConfigurationOperationContext::GetConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetConfigurationOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return GetConfigurationResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetConfigurationOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetConfigurationOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetConfigurationRequest"); + } + + Aws::Crt::String GetConfigurationOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetConfigurationResponse"); + } + + Aws::Crt::Optional GetConfigurationOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetConfigurationOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetConfiguration"); + } + + std::future GetConfigurationOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return GetConfigurationResult(GetOperationResult().get()); }); + } + + GetConfigurationOperation::GetConfigurationOperation( + ClientConnection &connection, + const GetConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetConfigurationOperation::Activate( + const GetConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetConfigurationOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void SubscribeToTopicStreamHandler::OnStreamEvent(Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToTopicStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToTopicOperationContext::SubscribeToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToTopicResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToTopicOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscriptionResponseMessage::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToTopicOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToTopicRequest"); + } + + Aws::Crt::String SubscribeToTopicOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToTopicResponse"); + } + + Aws::Crt::Optional SubscribeToTopicOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::String("aws.greengrass#SubscriptionResponseMessage"); + } + + Aws::Crt::String SubscribeToTopicOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToTopic"); + } + + std::future SubscribeToTopicOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + } + + SubscribeToTopicOperation::SubscribeToTopicOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToTopicOperation::Activate( + const SubscribeToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToTopicOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetComponentDetailsOperationContext::GetComponentDetailsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return GetComponentDetailsResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetComponentDetailsOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetComponentDetailsOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetComponentDetailsRequest"); + } + + Aws::Crt::String GetComponentDetailsOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetComponentDetailsResponse"); + } + + Aws::Crt::Optional GetComponentDetailsOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetComponentDetailsOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetComponentDetails"); + } + + std::future GetComponentDetailsOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return GetComponentDetailsResult(GetOperationResult().get()); }); + } + + GetComponentDetailsOperation::GetComponentDetailsOperation( + ClientConnection &connection, + const GetComponentDetailsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetComponentDetailsOperation::Activate( + const GetComponentDetailsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetComponentDetailsOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetClientDeviceAuthTokenOperationContext::GetClientDeviceAuthTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return GetClientDeviceAuthTokenResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetClientDeviceAuthTokenOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenRequest"); + } + + Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthTokenResponse"); + } + + Aws::Crt::Optional GetClientDeviceAuthTokenOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetClientDeviceAuthTokenOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetClientDeviceAuthToken"); + } + + std::future GetClientDeviceAuthTokenOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return GetClientDeviceAuthTokenResult(GetOperationResult().get()); }); + } + + GetClientDeviceAuthTokenOperation::GetClientDeviceAuthTokenOperation( + ClientConnection &connection, + const GetClientDeviceAuthTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetClientDeviceAuthTokenOperation::Activate( + const GetClientDeviceAuthTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetClientDeviceAuthTokenOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + PublishToTopicOperationContext::PublishToTopicOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource PublishToTopicOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return PublishToTopicResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource PublishToTopicOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String PublishToTopicOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToTopicRequest"); + } + + Aws::Crt::String PublishToTopicOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToTopicResponse"); + } + + Aws::Crt::Optional PublishToTopicOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String PublishToTopicOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PublishToTopic"); + } + + std::future PublishToTopicOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return PublishToTopicResult(GetOperationResult().get()); }); + } + + PublishToTopicOperation::PublishToTopicOperation( + ClientConnection &connection, + const PublishToTopicOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future PublishToTopicOperation::Activate( + const PublishToTopicRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String PublishToTopicOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void SubscribeToCertificateUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToCertificateUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#UnauthorizedError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#InvalidArgumentsError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToCertificateUpdatesOperationContext::SubscribeToCertificateUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToCertificateUpdatesResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToCertificateUpdatesOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return CertificateUpdateEvent::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdatesRequest"); + } + + Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdatesResponse"); + } + + Aws::Crt::Optional SubscribeToCertificateUpdatesOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CertificateUpdateEvent"); + } + + Aws::Crt::String SubscribeToCertificateUpdatesOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToCertificateUpdates"); + } + + std::future SubscribeToCertificateUpdatesOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { + return SubscribeToCertificateUpdatesResult(GetOperationResult().get()); + }); + } + + SubscribeToCertificateUpdatesOperation::SubscribeToCertificateUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToCertificateUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToCertificateUpdatesOperation::Activate( + const SubscribeToCertificateUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToCertificateUpdatesOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + VerifyClientDeviceIdentityOperationContext::VerifyClientDeviceIdentityOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return VerifyClientDeviceIdentityResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource VerifyClientDeviceIdentityOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityRequest"); + } + + Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentityResponse"); + } + + Aws::Crt::Optional VerifyClientDeviceIdentityOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String VerifyClientDeviceIdentityOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#VerifyClientDeviceIdentity"); + } + + std::future VerifyClientDeviceIdentityOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return VerifyClientDeviceIdentityResult(GetOperationResult().get()); }); + } + + VerifyClientDeviceIdentityOperation::VerifyClientDeviceIdentityOperation( + ClientConnection &connection, + const VerifyClientDeviceIdentityOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future VerifyClientDeviceIdentityOperation::Activate( + const VerifyClientDeviceIdentityRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String VerifyClientDeviceIdentityOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + AuthorizeClientDeviceActionOperationContext::AuthorizeClientDeviceActionOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return AuthorizeClientDeviceActionResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource AuthorizeClientDeviceActionOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionRequest"); + } + + Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceActionResponse"); + } + + Aws::Crt::Optional AuthorizeClientDeviceActionOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String AuthorizeClientDeviceActionOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#AuthorizeClientDeviceAction"); + } + + std::future AuthorizeClientDeviceActionOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return AuthorizeClientDeviceActionResult(GetOperationResult().get()); }); + } + + AuthorizeClientDeviceActionOperation::AuthorizeClientDeviceActionOperation( + ClientConnection &connection, + const AuthorizeClientDeviceActionOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future AuthorizeClientDeviceActionOperation::Activate( + const AuthorizeClientDeviceActionRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String AuthorizeClientDeviceActionOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + ListComponentsOperationContext::ListComponentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource ListComponentsOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return ListComponentsResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource ListComponentsOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String ListComponentsOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListComponentsRequest"); + } + + Aws::Crt::String ListComponentsOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListComponentsResponse"); + } + + Aws::Crt::Optional ListComponentsOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String ListComponentsOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListComponents"); + } + + std::future ListComponentsOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return ListComponentsResult(GetOperationResult().get()); }); + } + + ListComponentsOperation::ListComponentsOperation( + ClientConnection &connection, + const ListComponentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future ListComponentsOperation::Activate( + const ListComponentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String ListComponentsOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + CreateDebugPasswordOperationContext::CreateDebugPasswordOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return CreateDebugPasswordResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource CreateDebugPasswordOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String CreateDebugPasswordOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateDebugPasswordRequest"); + } + + Aws::Crt::String CreateDebugPasswordOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateDebugPasswordResponse"); + } + + Aws::Crt::Optional CreateDebugPasswordOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String CreateDebugPasswordOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateDebugPassword"); + } + + std::future CreateDebugPasswordOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return CreateDebugPasswordResult(GetOperationResult().get()); }); + } + + CreateDebugPasswordOperation::CreateDebugPasswordOperation( + ClientConnection &connection, + const CreateDebugPasswordOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future CreateDebugPasswordOperation::Activate( + const CreateDebugPasswordRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String CreateDebugPasswordOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetThingShadowOperationContext::GetThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetThingShadowOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return GetThingShadowResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetThingShadowOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetThingShadowOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetThingShadowRequest"); + } + + Aws::Crt::String GetThingShadowOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetThingShadowResponse"); + } + + Aws::Crt::Optional GetThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetThingShadowOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetThingShadow"); + } + + std::future GetThingShadowOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return GetThingShadowResult(GetOperationResult().get()); }); + } + + GetThingShadowOperation::GetThingShadowOperation( + ClientConnection &connection, + const GetThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetThingShadowOperation::Activate( + const GetThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetThingShadowOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + SendConfigurationValidityReportOperationContext::SendConfigurationValidityReportOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SendConfigurationValidityReportResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SendConfigurationValidityReportOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String SendConfigurationValidityReportOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReportRequest"); + } + + Aws::Crt::String SendConfigurationValidityReportOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReportResponse"); + } + + Aws::Crt::Optional SendConfigurationValidityReportOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String SendConfigurationValidityReportOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SendConfigurationValidityReport"); + } + + std::future SendConfigurationValidityReportOperation:: + GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { + return SendConfigurationValidityReportResult(GetOperationResult().get()); + }); + } + + SendConfigurationValidityReportOperation::SendConfigurationValidityReportOperation( + ClientConnection &connection, + const SendConfigurationValidityReportOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future SendConfigurationValidityReportOperation::Activate( + const SendConfigurationValidityReportRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SendConfigurationValidityReportOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + UpdateThingShadowOperationContext::UpdateThingShadowOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return UpdateThingShadowResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource UpdateThingShadowOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String UpdateThingShadowOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateThingShadowRequest"); + } + + Aws::Crt::String UpdateThingShadowOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateThingShadowResponse"); + } + + Aws::Crt::Optional UpdateThingShadowOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String UpdateThingShadowOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateThingShadow"); + } + + std::future UpdateThingShadowOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return UpdateThingShadowResult(GetOperationResult().get()); }); + } + + UpdateThingShadowOperation::UpdateThingShadowOperation( + ClientConnection &connection, + const UpdateThingShadowOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future UpdateThingShadowOperation::Activate( + const UpdateThingShadowRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String UpdateThingShadowOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + UpdateConfigurationOperationContext::UpdateConfigurationOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return UpdateConfigurationResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource UpdateConfigurationOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String UpdateConfigurationOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateConfigurationRequest"); + } + + Aws::Crt::String UpdateConfigurationOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateConfigurationResponse"); + } + + Aws::Crt::Optional UpdateConfigurationOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String UpdateConfigurationOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateConfiguration"); + } + + std::future UpdateConfigurationOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return UpdateConfigurationResult(GetOperationResult().get()); }); + } + + UpdateConfigurationOperation::UpdateConfigurationOperation( + ClientConnection &connection, + const UpdateConfigurationOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future UpdateConfigurationOperation::Activate( + const UpdateConfigurationRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String UpdateConfigurationOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + ValidateAuthorizationTokenOperationContext::ValidateAuthorizationTokenOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ValidateAuthorizationTokenResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource ValidateAuthorizationTokenOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenRequest"); + } + + Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationTokenResponse"); + } + + Aws::Crt::Optional ValidateAuthorizationTokenOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String ValidateAuthorizationTokenOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ValidateAuthorizationToken"); + } + + std::future ValidateAuthorizationTokenOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return ValidateAuthorizationTokenResult(GetOperationResult().get()); }); + } + + ValidateAuthorizationTokenOperation::ValidateAuthorizationTokenOperation( + ClientConnection &connection, + const ValidateAuthorizationTokenOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future ValidateAuthorizationTokenOperation::Activate( + const ValidateAuthorizationTokenRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String ValidateAuthorizationTokenOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + RestartComponentOperationContext::RestartComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource RestartComponentOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return RestartComponentResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource RestartComponentOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String RestartComponentOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#RestartComponentRequest"); + } + + Aws::Crt::String RestartComponentOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#RestartComponentResponse"); + } + + Aws::Crt::Optional RestartComponentOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String RestartComponentOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#RestartComponent"); + } + + std::future RestartComponentOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return RestartComponentResult(GetOperationResult().get()); }); + } + + RestartComponentOperation::RestartComponentOperation( + ClientConnection &connection, + const RestartComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future RestartComponentOperation::Activate( + const RestartComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String RestartComponentOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetLocalDeploymentStatusOperationContext::GetLocalDeploymentStatusOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return GetLocalDeploymentStatusResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetLocalDeploymentStatusOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusRequest"); + } + + Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatusResponse"); + } + + Aws::Crt::Optional GetLocalDeploymentStatusOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetLocalDeploymentStatusOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetLocalDeploymentStatus"); + } + + std::future GetLocalDeploymentStatusOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return GetLocalDeploymentStatusResult(GetOperationResult().get()); }); + } + + GetLocalDeploymentStatusOperation::GetLocalDeploymentStatusOperation( + ClientConnection &connection, + const GetLocalDeploymentStatusOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetLocalDeploymentStatusOperation::Activate( + const GetLocalDeploymentStatusRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetLocalDeploymentStatusOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GetSecretValueOperationContext::GetSecretValueOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource GetSecretValueOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return GetSecretValueResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource GetSecretValueOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String GetSecretValueOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetSecretValueRequest"); + } + + Aws::Crt::String GetSecretValueOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetSecretValueResponse"); + } + + Aws::Crt::Optional GetSecretValueOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String GetSecretValueOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#GetSecretValue"); + } + + std::future GetSecretValueOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return GetSecretValueResult(GetOperationResult().get()); }); + } + + GetSecretValueOperation::GetSecretValueOperation( + ClientConnection &connection, + const GetSecretValueOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future GetSecretValueOperation::Activate( + const GetSecretValueRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String GetSecretValueOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + UpdateStateOperationContext::UpdateStateOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource UpdateStateOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return UpdateStateResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource UpdateStateOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String UpdateStateOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateStateRequest"); + } + + Aws::Crt::String UpdateStateOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateStateResponse"); + } + + Aws::Crt::Optional UpdateStateOperationContext::GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String UpdateStateOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#UpdateState"); + } + + std::future UpdateStateOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return UpdateStateResult(GetOperationResult().get()); }); + } + + UpdateStateOperation::UpdateStateOperation( + ClientConnection &connection, + const UpdateStateOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future UpdateStateOperation::Activate( + const UpdateStateRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String UpdateStateOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + ListNamedShadowsForThingOperationContext::ListNamedShadowsForThingOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ListNamedShadowsForThingResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource ListNamedShadowsForThingOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String ListNamedShadowsForThingOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingRequest"); + } + + Aws::Crt::String ListNamedShadowsForThingOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThingResponse"); + } + + Aws::Crt::Optional ListNamedShadowsForThingOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String ListNamedShadowsForThingOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListNamedShadowsForThing"); + } + + std::future ListNamedShadowsForThingOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return ListNamedShadowsForThingResult(GetOperationResult().get()); }); + } + + ListNamedShadowsForThingOperation::ListNamedShadowsForThingOperation( + ClientConnection &connection, + const ListNamedShadowsForThingOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future ListNamedShadowsForThingOperation::Activate( + const ListNamedShadowsForThingRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String ListNamedShadowsForThingOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + void SubscribeToComponentUpdatesStreamHandler::OnStreamEvent( + Aws::Crt::ScopedResource response) + { + OnStreamEvent(static_cast(response.get())); + } + + bool SubscribeToComponentUpdatesStreamHandler::OnStreamError( + Aws::Crt::ScopedResource operationError, + RpcError rpcError) + { + bool streamShouldTerminate = false; + if (rpcError.baseStatus != EVENT_STREAM_RPC_SUCCESS) + { + streamShouldTerminate = OnStreamError(rpcError); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ServiceError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && + operationError->GetModelName() == Aws::Crt::String("aws.greengrass#ResourceNotFoundError") && + !streamShouldTerminate) + { + streamShouldTerminate = OnStreamError(static_cast(operationError.get())); + } + if (operationError != nullptr && !streamShouldTerminate) + streamShouldTerminate = OnStreamError(operationError.get()); + return streamShouldTerminate; + } + + SubscribeToComponentUpdatesOperationContext::SubscribeToComponentUpdatesOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return SubscribeToComponentUpdatesResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource SubscribeToComponentUpdatesOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ComponentUpdatePolicyEvents::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesRequest"); + } + + Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdatesResponse"); + } + + Aws::Crt::Optional SubscribeToComponentUpdatesOperationContext:: + GetStreamingResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ComponentUpdatePolicyEvents"); + } + + Aws::Crt::String SubscribeToComponentUpdatesOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#SubscribeToComponentUpdates"); + } + + std::future SubscribeToComponentUpdatesOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return SubscribeToComponentUpdatesResult(GetOperationResult().get()); }); + } + + SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + std::shared_ptr streamHandler, + const SubscribeToComponentUpdatesOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, streamHandler, operationContext, allocator) + { + } + + std::future SubscribeToComponentUpdatesOperation::Activate( + const SubscribeToComponentUpdatesRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String SubscribeToComponentUpdatesOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + ListLocalDeploymentsOperationContext::ListLocalDeploymentsOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return ListLocalDeploymentsResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource ListLocalDeploymentsOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String ListLocalDeploymentsOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsRequest"); + } + + Aws::Crt::String ListLocalDeploymentsOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListLocalDeploymentsResponse"); + } + + Aws::Crt::Optional ListLocalDeploymentsOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String ListLocalDeploymentsOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#ListLocalDeployments"); + } + + std::future ListLocalDeploymentsOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return ListLocalDeploymentsResult(GetOperationResult().get()); }); + } + + ListLocalDeploymentsOperation::ListLocalDeploymentsOperation( + ClientConnection &connection, + const ListLocalDeploymentsOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future ListLocalDeploymentsOperation::Activate( + const ListLocalDeploymentsRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String ListLocalDeploymentsOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + StopComponentOperationContext::StopComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource StopComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return StopComponentResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource StopComponentOperationContext::AllocateStreamingResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String StopComponentOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#StopComponentRequest"); + } + + Aws::Crt::String StopComponentOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#StopComponentResponse"); + } + + Aws::Crt::Optional StopComponentOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String StopComponentOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#StopComponent"); + } + + std::future StopComponentOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return StopComponentResult(GetOperationResult().get()); }); + } + + StopComponentOperation::StopComponentOperation( + ClientConnection &connection, + const StopComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future StopComponentOperation::Activate( + const StopComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String StopComponentOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + PauseComponentOperationContext::PauseComponentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource PauseComponentOperationContext::AllocateInitialResponseFromPayload( + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + return PauseComponentResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource PauseComponentOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String PauseComponentOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PauseComponentRequest"); + } + + Aws::Crt::String PauseComponentOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PauseComponentResponse"); + } + + Aws::Crt::Optional PauseComponentOperationContext::GetStreamingResponseModelName() const + noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String PauseComponentOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#PauseComponent"); + } + + std::future PauseComponentOperation::GetResult() noexcept + { + return std::async(m_asyncLaunchMode, [this]() { return PauseComponentResult(GetOperationResult().get()); }); + } + + PauseComponentOperation::PauseComponentOperation( + ClientConnection &connection, + const PauseComponentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future PauseComponentOperation::Activate( + const PauseComponentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String PauseComponentOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + CreateLocalDeploymentOperationContext::CreateLocalDeploymentOperationContext( + const GreengrassCoreIpcServiceModel &serviceModel) noexcept + : OperationModelContext(serviceModel) + { + } + + Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: + AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + return CreateLocalDeploymentResponse::s_allocateFromPayload(stringView, allocator); + } + + Aws::Crt::ScopedResource CreateLocalDeploymentOperationContext:: + AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const + noexcept + { + (void)stringView; + (void)allocator; + return nullptr; + } + + Aws::Crt::String CreateLocalDeploymentOperationContext::GetRequestModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentRequest"); + } + + Aws::Crt::String CreateLocalDeploymentOperationContext::GetInitialResponseModelName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateLocalDeploymentResponse"); + } + + Aws::Crt::Optional CreateLocalDeploymentOperationContext::GetStreamingResponseModelName() + const noexcept + { + return Aws::Crt::Optional(); + } + + Aws::Crt::String CreateLocalDeploymentOperationContext::GetOperationName() const noexcept + { + return Aws::Crt::String("aws.greengrass#CreateLocalDeployment"); + } + + std::future CreateLocalDeploymentOperation::GetResult() noexcept + { + return std::async( + m_asyncLaunchMode, [this]() { return CreateLocalDeploymentResult(GetOperationResult().get()); }); + } + + CreateLocalDeploymentOperation::CreateLocalDeploymentOperation( + ClientConnection &connection, + const CreateLocalDeploymentOperationContext &operationContext, + Aws::Crt::Allocator *allocator) noexcept + : ClientOperation(connection, nullptr, operationContext, allocator) + { + } + + std::future CreateLocalDeploymentOperation::Activate( + const CreateLocalDeploymentRequest &request, + OnMessageFlushCallback onMessageFlushCallback) noexcept + { + return ClientOperation::Activate(static_cast(&request), onMessageFlushCallback); + } + + Aws::Crt::String CreateLocalDeploymentOperation::GetModelName() const noexcept + { + return m_operationModelContext.GetOperationName(); + } + + GreengrassCoreIpcServiceModel::GreengrassCoreIpcServiceModel() noexcept + : m_subscribeToIoTCoreOperationContext(*this), m_resumeComponentOperationContext(*this), + m_publishToIoTCoreOperationContext(*this), m_subscribeToConfigurationUpdateOperationContext(*this), + m_deleteThingShadowOperationContext(*this), m_putComponentMetricOperationContext(*this), + m_deferComponentUpdateOperationContext(*this), + m_subscribeToValidateConfigurationUpdatesOperationContext(*this), + m_getConfigurationOperationContext(*this), m_subscribeToTopicOperationContext(*this), + m_getComponentDetailsOperationContext(*this), m_getClientDeviceAuthTokenOperationContext(*this), + m_publishToTopicOperationContext(*this), m_subscribeToCertificateUpdatesOperationContext(*this), + m_verifyClientDeviceIdentityOperationContext(*this), m_authorizeClientDeviceActionOperationContext(*this), + m_listComponentsOperationContext(*this), m_createDebugPasswordOperationContext(*this), + m_getThingShadowOperationContext(*this), m_sendConfigurationValidityReportOperationContext(*this), + m_updateThingShadowOperationContext(*this), m_updateConfigurationOperationContext(*this), + m_validateAuthorizationTokenOperationContext(*this), m_restartComponentOperationContext(*this), + m_getLocalDeploymentStatusOperationContext(*this), m_getSecretValueOperationContext(*this), + m_updateStateOperationContext(*this), m_listNamedShadowsForThingOperationContext(*this), + m_subscribeToComponentUpdatesOperationContext(*this), m_listLocalDeploymentsOperationContext(*this), + m_stopComponentOperationContext(*this), m_pauseComponentOperationContext(*this), + m_createLocalDeploymentOperationContext(*this) + { + } + + Aws::Crt::ScopedResource GreengrassCoreIpcServiceModel::AllocateOperationErrorFromPayload( + const Aws::Crt::String &errorModelName, + Aws::Crt::StringView stringView, + Aws::Crt::Allocator *allocator) const noexcept + { + auto it = m_modelNameToErrorResponse.find(errorModelName); + if (it == m_modelNameToErrorResponse.end()) + { + return nullptr; + } + else + { + return it->second(stringView, allocator); + } + } + + void GreengrassCoreIpcServiceModel::AssignModelNameToErrorResponse( + Aws::Crt::String modelName, + ErrorResponseFactory factory) noexcept + { + m_modelNameToErrorResponse[modelName] = factory; + } + } // namespace Greengrass } // namespace Aws From 0716b885346a6a4eb75d94334b177f1cbd420a09 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 14 Feb 2023 18:29:29 -0800 Subject: [PATCH 7/8] fix clang-format and crt version' --- crt/aws-crt-cpp | 2 +- eventstream_rpc/source/EventStreamClient.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crt/aws-crt-cpp b/crt/aws-crt-cpp index 8ee94e268..f81587db3 160000 --- a/crt/aws-crt-cpp +++ b/crt/aws-crt-cpp @@ -1 +1 @@ -Subproject commit 8ee94e26804070e2279dc7451c5ac87d695dba13 +Subproject commit f81587db32a2f13764b0378fb069161f6742e376 diff --git a/eventstream_rpc/source/EventStreamClient.cpp b/eventstream_rpc/source/EventStreamClient.cpp index d338dd61c..d3c567853 100644 --- a/eventstream_rpc/source/EventStreamClient.cpp +++ b/eventstream_rpc/source/EventStreamClient.cpp @@ -1515,10 +1515,7 @@ namespace Aws } } - void ClientOperation::WithLaunchMode(std::launch mode) noexcept - { - m_asyncLaunchMode = mode; - } + void ClientOperation::WithLaunchMode(std::launch mode) noexcept { m_asyncLaunchMode = mode; } std::future ClientOperation::Close(OnMessageFlushCallback onMessageFlushCallback) noexcept { From 11f3a89cf73eb03a70ef2980d40096b609c1e00c Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 14 Feb 2023 18:52:08 -0800 Subject: [PATCH 8/8] add generated file header --- eventstream_rpc/tests/EchoTestRpcClient.cpp | 7 +++++++ eventstream_rpc/tests/EchoTestRpcModel.cpp | 7 +++++++ greengrass_ipc/source/GreengrassCoreIpcClient.cpp | 7 +++++++ greengrass_ipc/source/GreengrassCoreIpcModel.cpp | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index f49f52b36..508e13fcb 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -1,3 +1,10 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* This file is generated. */ + #include #include #include diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index d6b463468..a1322ed7e 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1,3 +1,10 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* This file is generated. */ + #include #include diff --git a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp index 01bcd3300..f72bdb677 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -5,6 +5,13 @@ * This file is generated. */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* This file is generated. */ + #include #include #include diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index a3f68537b..0a7098518 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -5,6 +5,13 @@ * This file is generated. */ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* This file is generated. */ + #include #include