From e80089c5231cd2dbc86c89982974bf4384a7091a Mon Sep 17 00:00:00 2001 From: Banthiya Date: Mon, 19 Jul 2021 14:47:37 -0700 Subject: [PATCH 01/51] feat: add gg apis for resource management --- eventstream_rpc/tests/EchoTestRpcClient.cpp | 106 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 2780 ++-- .../tests/include/awstest/EchoTestRpcClient.h | 80 +- .../tests/include/awstest/EchoTestRpcModel.h | 2023 +-- .../aws/greengrass/GreengrassCoreIpcClient.h | 134 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 9647 ++++++----- .../source/GreengrassCoreIpcClient.cpp | 445 +- .../source/GreengrassCoreIpcModel.cpp | 13717 ++++++++-------- 8 files changed, 15047 insertions(+), 13885 deletions(-) diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index ab257baf5..e99af52a6 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -1,61 +1,63 @@ #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_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(); } +EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } - GetAllProductsOperation EchoTestRpcClient::NewGetAllProducts() noexcept - { - return GetAllProductsOperation( - m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); - } - CauseServiceErrorOperation EchoTestRpcClient::NewCauseServiceError() noexcept - { - return CauseServiceErrorOperation( - m_connection, m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, m_allocator); - } - CauseStreamServiceToErrorOperation EchoTestRpcClient::NewCauseStreamServiceToError( - CauseStreamServiceToErrorStreamHandler &streamHandler) noexcept - { - return CauseStreamServiceToErrorOperation( - m_connection, - &streamHandler, - m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, - m_allocator); - } - EchoStreamMessagesOperation EchoTestRpcClient::NewEchoStreamMessages( - EchoStreamMessagesStreamHandler &streamHandler) noexcept - { - return EchoStreamMessagesOperation( - m_connection, &streamHandler, m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, m_allocator); - } - EchoMessageOperation EchoTestRpcClient::NewEchoMessage() noexcept - { - return EchoMessageOperation(m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); - } - GetAllCustomersOperation EchoTestRpcClient::NewGetAllCustomers() noexcept - { - return GetAllCustomersOperation( - m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); - } +GetAllProductsOperation EchoTestRpcClient::NewGetAllProducts() noexcept { + return GetAllProductsOperation( + m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, + m_allocator); +} +CauseServiceErrorOperation EchoTestRpcClient::NewCauseServiceError() noexcept { + return CauseServiceErrorOperation( + m_connection, + m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, + m_allocator); +} +CauseStreamServiceToErrorOperation +EchoTestRpcClient::NewCauseStreamServiceToError( + CauseStreamServiceToErrorStreamHandler &streamHandler) noexcept { + return CauseStreamServiceToErrorOperation( + m_connection, &streamHandler, + m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, + m_allocator); +} +EchoStreamMessagesOperation EchoTestRpcClient::NewEchoStreamMessages( + EchoStreamMessagesStreamHandler &streamHandler) noexcept { + return EchoStreamMessagesOperation( + m_connection, &streamHandler, + m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, + m_allocator); +} +EchoMessageOperation EchoTestRpcClient::NewEchoMessage() noexcept { + return EchoMessageOperation( + m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, + m_allocator); +} +GetAllCustomersOperation EchoTestRpcClient::NewGetAllCustomers() noexcept { + return GetAllCustomersOperation( + m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, + m_allocator); +} } // namespace Awstest diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index b951ad0db..e9f71005d 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1,1415 +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() noexcept - { - 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(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( + 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(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 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( - 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() noexcept - { - return std::async( - std::launch::deferred, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); - } - - CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( - ClientConnection &connection, - CauseStreamServiceToErrorStreamHandler *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( - std::launch::deferred, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); - } - - EchoStreamMessagesOperation::EchoStreamMessagesOperation( - ClientConnection &connection, - EchoStreamMessagesStreamHandler *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(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() noexcept - { - 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(std::launch::deferred, [this]() { + return CauseStreamServiceToErrorResult(GetOperationResult().get()); + }); +} + +CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( + ClientConnection &connection, + CauseStreamServiceToErrorStreamHandler *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(std::launch::deferred, [this]() { + return EchoStreamMessagesResult(GetOperationResult().get()); + }); +} + +EchoStreamMessagesOperation::EchoStreamMessagesOperation( + ClientConnection &connection, + EchoStreamMessagesStreamHandler *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(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() noexcept { + 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; +} } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index 4bfa0006c..f8164857c 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -10,46 +10,46 @@ 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; - GetAllProductsOperation NewGetAllProducts() noexcept; - CauseServiceErrorOperation NewCauseServiceError() noexcept; - CauseStreamServiceToErrorOperation NewCauseStreamServiceToError( - CauseStreamServiceToErrorStreamHandler &) noexcept; - EchoStreamMessagesOperation NewEchoStreamMessages(EchoStreamMessagesStreamHandler &) noexcept; - EchoMessageOperation NewEchoMessage() noexcept; - GetAllCustomersOperation NewGetAllCustomers() noexcept; - ~EchoTestRpcClient() 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; + GetAllProductsOperation NewGetAllProducts() noexcept; + CauseServiceErrorOperation NewCauseServiceError() noexcept; + CauseStreamServiceToErrorOperation NewCauseStreamServiceToError( + CauseStreamServiceToErrorStreamHandler &) noexcept; + EchoStreamMessagesOperation + NewEchoStreamMessages(EchoStreamMessagesStreamHandler &) noexcept; + EchoMessageOperation NewEchoMessage() noexcept; + GetAllCustomersOperation NewGetAllCustomers() noexcept; + ~EchoTestRpcClient() noexcept; - private: - EchoTestRpcServiceModel m_echoTestRpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - }; +private: + EchoTestRpcServiceModel m_echoTestRpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; +}; } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index 40a5cf370..9fbd8a235 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -13,962 +13,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() 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, - CauseStreamServiceToErrorStreamHandler *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, - EchoStreamMessagesStreamHandler *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, + CauseStreamServiceToErrorStreamHandler *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, + EchoStreamMessagesStreamHandler *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 13b7272d6..2a1eb3781 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -10,71 +10,75 @@ 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; - SubscribeToIoTCoreOperation NewSubscribeToIoTCore(SubscribeToIoTCoreStreamHandler &) noexcept; - PublishToIoTCoreOperation NewPublishToIoTCore() noexcept; - SubscribeToConfigurationUpdateOperation NewSubscribeToConfigurationUpdate( - SubscribeToConfigurationUpdateStreamHandler &) noexcept; - DeleteThingShadowOperation NewDeleteThingShadow() noexcept; - DeferComponentUpdateOperation NewDeferComponentUpdate() noexcept; - SubscribeToValidateConfigurationUpdatesOperation NewSubscribeToValidateConfigurationUpdates( - SubscribeToValidateConfigurationUpdatesStreamHandler &) noexcept; - GetConfigurationOperation NewGetConfiguration() noexcept; - SubscribeToTopicOperation NewSubscribeToTopic(SubscribeToTopicStreamHandler &) noexcept; - GetComponentDetailsOperation NewGetComponentDetails() noexcept; - PublishToTopicOperation NewPublishToTopic() noexcept; - ListComponentsOperation NewListComponents() noexcept; - CreateDebugPasswordOperation NewCreateDebugPassword() noexcept; - GetThingShadowOperation NewGetThingShadow() noexcept; - SendConfigurationValidityReportOperation NewSendConfigurationValidityReport() noexcept; - UpdateThingShadowOperation NewUpdateThingShadow() noexcept; - UpdateConfigurationOperation NewUpdateConfiguration() noexcept; - ValidateAuthorizationTokenOperation NewValidateAuthorizationToken() noexcept; - RestartComponentOperation NewRestartComponent() noexcept; - GetLocalDeploymentStatusOperation NewGetLocalDeploymentStatus() noexcept; - GetSecretValueOperation NewGetSecretValue() noexcept; - UpdateStateOperation NewUpdateState() noexcept; - ListNamedShadowsForThingOperation NewListNamedShadowsForThing() noexcept; - SubscribeToComponentUpdatesOperation NewSubscribeToComponentUpdates( - SubscribeToComponentUpdatesStreamHandler &) noexcept; - ListLocalDeploymentsOperation NewListLocalDeployments() noexcept; - StopComponentOperation NewStopComponent() noexcept; - CreateLocalDeploymentOperation NewCreateLocalDeployment() noexcept; - ~GreengrassCoreIpcClient() 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; + SubscribeToIoTCoreOperation + NewSubscribeToIoTCore(SubscribeToIoTCoreStreamHandler &) noexcept; + ResumeComponentOperation NewResumeComponent() noexcept; + PublishToIoTCoreOperation NewPublishToIoTCore() noexcept; + SubscribeToConfigurationUpdateOperation NewSubscribeToConfigurationUpdate( + SubscribeToConfigurationUpdateStreamHandler &) noexcept; + DeleteThingShadowOperation NewDeleteThingShadow() noexcept; + DeferComponentUpdateOperation NewDeferComponentUpdate() noexcept; + SubscribeToValidateConfigurationUpdatesOperation + NewSubscribeToValidateConfigurationUpdates( + SubscribeToValidateConfigurationUpdatesStreamHandler &) noexcept; + GetConfigurationOperation NewGetConfiguration() noexcept; + SubscribeToTopicOperation + NewSubscribeToTopic(SubscribeToTopicStreamHandler &) noexcept; + GetComponentDetailsOperation NewGetComponentDetails() noexcept; + PublishToTopicOperation NewPublishToTopic() noexcept; + ListComponentsOperation NewListComponents() noexcept; + CreateDebugPasswordOperation NewCreateDebugPassword() noexcept; + GetThingShadowOperation NewGetThingShadow() noexcept; + SendConfigurationValidityReportOperation + NewSendConfigurationValidityReport() noexcept; + UpdateThingShadowOperation NewUpdateThingShadow() noexcept; + UpdateConfigurationOperation NewUpdateConfiguration() noexcept; + ValidateAuthorizationTokenOperation NewValidateAuthorizationToken() noexcept; + RestartComponentOperation NewRestartComponent() noexcept; + GetLocalDeploymentStatusOperation NewGetLocalDeploymentStatus() noexcept; + GetSecretValueOperation NewGetSecretValue() noexcept; + UpdateStateOperation NewUpdateState() noexcept; + ListNamedShadowsForThingOperation NewListNamedShadowsForThing() noexcept; + SubscribeToComponentUpdatesOperation NewSubscribeToComponentUpdates( + SubscribeToComponentUpdatesStreamHandler &) noexcept; + ListLocalDeploymentsOperation NewListLocalDeployments() noexcept; + StopComponentOperation NewStopComponent() noexcept; + PauseComponentOperation NewPauseComponent() noexcept; + CreateLocalDeploymentOperation NewCreateLocalDeployment() noexcept; + ~GreengrassCoreIpcClient() noexcept; - private: - GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; - }; - } // namespace Greengrass +private: + GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; +}; +} // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index fd07d52e0..ed9661aa4 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -13,4374 +13,5281 @@ using namespace Aws::Eventstreamrpc; -namespace Aws -{ - namespace Greengrass - { - class GreengrassCoreIpcClient; - class GreengrassCoreIpcServiceModel; - 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; - }; - - enum ConfigurationValidityStatus - { - CONFIGURATION_VALIDITY_STATUS_ACCEPTED, - CONFIGURATION_VALIDITY_STATUS_REJECTED - }; - - 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; } - 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; - }; - - 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; } - 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; - }; - - 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 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 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; - }; - - 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; - }; - - 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 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 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; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } - 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 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; - }; - - 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 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 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 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 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 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 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 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 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 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 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, - SubscribeToIoTCoreStreamHandler *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 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, - SubscribeToConfigurationUpdateStreamHandler *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 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, - SubscribeToValidateConfigurationUpdatesStreamHandler *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, - SubscribeToTopicStreamHandler *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 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 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, - SubscribeToComponentUpdatesStreamHandler *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 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; - PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext; - SubscribeToConfigurationUpdateOperationContext m_subscribeToConfigurationUpdateOperationContext; - DeleteThingShadowOperationContext m_deleteThingShadowOperationContext; - DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; - SubscribeToValidateConfigurationUpdatesOperationContext - m_subscribeToValidateConfigurationUpdatesOperationContext; - GetConfigurationOperationContext m_getConfigurationOperationContext; - SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; - GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; - PublishToTopicOperationContext m_publishToTopicOperationContext; - 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; - CreateLocalDeploymentOperationContext m_createLocalDeploymentOperationContext; - Aws::Crt::Map m_modelNameToErrorResponse; - }; - } // namespace Greengrass +namespace Aws { +namespace Greengrass { +class GreengrassCoreIpcClient; +class GreengrassCoreIpcServiceModel; +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; +}; + +enum ConfigurationValidityStatus { + CONFIGURATION_VALIDITY_STATUS_ACCEPTED, + CONFIGURATION_VALIDITY_STATUS_REJECTED +}; + +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; + } + 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; +}; + +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; + } + 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; +}; + +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 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 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_systemResourceLimits; +}; + +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; +}; + +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 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 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; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { + m_topicName = topicName; + } + 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 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; +}; + +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 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 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 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 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 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 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 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 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, + SubscribeToIoTCoreStreamHandler *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, + SubscribeToConfigurationUpdateStreamHandler *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 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, + SubscribeToValidateConfigurationUpdatesStreamHandler *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, + SubscribeToTopicStreamHandler *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 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 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, + SubscribeToComponentUpdatesStreamHandler *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; + DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; + SubscribeToValidateConfigurationUpdatesOperationContext + m_subscribeToValidateConfigurationUpdatesOperationContext; + GetConfigurationOperationContext m_getConfigurationOperationContext; + SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; + GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; + PublishToTopicOperationContext m_publishToTopicOperationContext; + 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 a8ad37227..0f8bb0439 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -1,207 +1,256 @@ #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#ResourceNotFoundError"), ResourceNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), InvalidArgumentsError::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#ServiceError"), ServiceError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#UnauthorizedError"), UnauthorizedError::s_allocateFromPayload); - } +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#ResourceNotFoundError"), + ResourceNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), + InvalidArgumentsError::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#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); - } +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::Close() noexcept { m_connection.Close(); } - GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } +GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } - SubscribeToIoTCoreOperation GreengrassCoreIpcClient::NewSubscribeToIoTCore( - SubscribeToIoTCoreStreamHandler &streamHandler) noexcept - { - return SubscribeToIoTCoreOperation( - m_connection, - &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, - m_allocator); - } - PublishToIoTCoreOperation GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept - { - return PublishToIoTCoreOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, m_allocator); - } - SubscribeToConfigurationUpdateOperation GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( - SubscribeToConfigurationUpdateStreamHandler &streamHandler) noexcept - { - return SubscribeToConfigurationUpdateOperation( - m_connection, - &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToConfigurationUpdateOperationContext, - m_allocator); - } - DeleteThingShadowOperation GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept - { - return DeleteThingShadowOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, m_allocator); - } - DeferComponentUpdateOperation GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept - { - return DeferComponentUpdateOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, m_allocator); - } - SubscribeToValidateConfigurationUpdatesOperation GreengrassCoreIpcClient:: - NewSubscribeToValidateConfigurationUpdates( - SubscribeToValidateConfigurationUpdatesStreamHandler &streamHandler) noexcept - { - return SubscribeToValidateConfigurationUpdatesOperation( - m_connection, - &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToValidateConfigurationUpdatesOperationContext, - m_allocator); - } - GetConfigurationOperation GreengrassCoreIpcClient::NewGetConfiguration() noexcept - { - return GetConfigurationOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, m_allocator); - } - SubscribeToTopicOperation GreengrassCoreIpcClient::NewSubscribeToTopic( - SubscribeToTopicStreamHandler &streamHandler) noexcept - { - return SubscribeToTopicOperation( - m_connection, - &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, - m_allocator); - } - GetComponentDetailsOperation GreengrassCoreIpcClient::NewGetComponentDetails() noexcept - { - return GetComponentDetailsOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, m_allocator); - } - PublishToTopicOperation GreengrassCoreIpcClient::NewPublishToTopic() noexcept - { - return PublishToTopicOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, m_allocator); - } - ListComponentsOperation GreengrassCoreIpcClient::NewListComponents() noexcept - { - return ListComponentsOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, m_allocator); - } - CreateDebugPasswordOperation GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept - { - return CreateDebugPasswordOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, m_allocator); - } - GetThingShadowOperation GreengrassCoreIpcClient::NewGetThingShadow() noexcept - { - return GetThingShadowOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, m_allocator); - } - SendConfigurationValidityReportOperation GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept - { - return SendConfigurationValidityReportOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_sendConfigurationValidityReportOperationContext, - m_allocator); - } - UpdateThingShadowOperation GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept - { - return UpdateThingShadowOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, m_allocator); - } - UpdateConfigurationOperation GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept - { - return UpdateConfigurationOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, m_allocator); - } - ValidateAuthorizationTokenOperation GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept - { - return ValidateAuthorizationTokenOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_validateAuthorizationTokenOperationContext, - m_allocator); - } - RestartComponentOperation GreengrassCoreIpcClient::NewRestartComponent() noexcept - { - return RestartComponentOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, m_allocator); - } - GetLocalDeploymentStatusOperation GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept - { - return GetLocalDeploymentStatusOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_getLocalDeploymentStatusOperationContext, m_allocator); - } - GetSecretValueOperation GreengrassCoreIpcClient::NewGetSecretValue() noexcept - { - return GetSecretValueOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, m_allocator); - } - UpdateStateOperation GreengrassCoreIpcClient::NewUpdateState() noexcept - { - return UpdateStateOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, m_allocator); - } - ListNamedShadowsForThingOperation GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept - { - return ListNamedShadowsForThingOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_listNamedShadowsForThingOperationContext, m_allocator); - } - SubscribeToComponentUpdatesOperation GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( - SubscribeToComponentUpdatesStreamHandler &streamHandler) noexcept - { - return SubscribeToComponentUpdatesOperation( - m_connection, - &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToComponentUpdatesOperationContext, - m_allocator); - } - ListLocalDeploymentsOperation GreengrassCoreIpcClient::NewListLocalDeployments() noexcept - { - return ListLocalDeploymentsOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, m_allocator); - } - StopComponentOperation GreengrassCoreIpcClient::NewStopComponent() noexcept - { - return StopComponentOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, m_allocator); - } - CreateLocalDeploymentOperation GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept - { - return CreateLocalDeploymentOperation( - m_connection, m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, m_allocator); - } +SubscribeToIoTCoreOperation GreengrassCoreIpcClient::NewSubscribeToIoTCore( + SubscribeToIoTCoreStreamHandler &streamHandler) noexcept { + return SubscribeToIoTCoreOperation( + m_connection, &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, + m_allocator); +} +ResumeComponentOperation +GreengrassCoreIpcClient::NewResumeComponent() noexcept { + return ResumeComponentOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, + m_allocator); +} +PublishToIoTCoreOperation +GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept { + return PublishToIoTCoreOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, + m_allocator); +} +SubscribeToConfigurationUpdateOperation +GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( + SubscribeToConfigurationUpdateStreamHandler &streamHandler) noexcept { + return SubscribeToConfigurationUpdateOperation( + m_connection, &streamHandler, + m_greengrassCoreIpcServiceModel + .m_subscribeToConfigurationUpdateOperationContext, + m_allocator); +} +DeleteThingShadowOperation +GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept { + return DeleteThingShadowOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, + m_allocator); +} +DeferComponentUpdateOperation +GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept { + return DeferComponentUpdateOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, + m_allocator); +} +SubscribeToValidateConfigurationUpdatesOperation +GreengrassCoreIpcClient::NewSubscribeToValidateConfigurationUpdates( + SubscribeToValidateConfigurationUpdatesStreamHandler + &streamHandler) noexcept { + return SubscribeToValidateConfigurationUpdatesOperation( + m_connection, &streamHandler, + m_greengrassCoreIpcServiceModel + .m_subscribeToValidateConfigurationUpdatesOperationContext, + m_allocator); +} +GetConfigurationOperation +GreengrassCoreIpcClient::NewGetConfiguration() noexcept { + return GetConfigurationOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, + m_allocator); +} +SubscribeToTopicOperation GreengrassCoreIpcClient::NewSubscribeToTopic( + SubscribeToTopicStreamHandler &streamHandler) noexcept { + return SubscribeToTopicOperation( + m_connection, &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, + m_allocator); +} +GetComponentDetailsOperation +GreengrassCoreIpcClient::NewGetComponentDetails() noexcept { + return GetComponentDetailsOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, + m_allocator); +} +PublishToTopicOperation GreengrassCoreIpcClient::NewPublishToTopic() noexcept { + return PublishToTopicOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, + m_allocator); +} +ListComponentsOperation GreengrassCoreIpcClient::NewListComponents() noexcept { + return ListComponentsOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, + m_allocator); +} +CreateDebugPasswordOperation +GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept { + return CreateDebugPasswordOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, + m_allocator); +} +GetThingShadowOperation GreengrassCoreIpcClient::NewGetThingShadow() noexcept { + return GetThingShadowOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, + m_allocator); +} +SendConfigurationValidityReportOperation +GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept { + return SendConfigurationValidityReportOperation( + m_connection, + m_greengrassCoreIpcServiceModel + .m_sendConfigurationValidityReportOperationContext, + m_allocator); +} +UpdateThingShadowOperation +GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept { + return UpdateThingShadowOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, + m_allocator); +} +UpdateConfigurationOperation +GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept { + return UpdateConfigurationOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, + m_allocator); +} +ValidateAuthorizationTokenOperation +GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept { + return ValidateAuthorizationTokenOperation( + m_connection, + m_greengrassCoreIpcServiceModel + .m_validateAuthorizationTokenOperationContext, + m_allocator); +} +RestartComponentOperation +GreengrassCoreIpcClient::NewRestartComponent() noexcept { + return RestartComponentOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, + m_allocator); +} +GetLocalDeploymentStatusOperation +GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept { + return GetLocalDeploymentStatusOperation( + m_connection, + m_greengrassCoreIpcServiceModel + .m_getLocalDeploymentStatusOperationContext, + m_allocator); +} +GetSecretValueOperation GreengrassCoreIpcClient::NewGetSecretValue() noexcept { + return GetSecretValueOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, + m_allocator); +} +UpdateStateOperation GreengrassCoreIpcClient::NewUpdateState() noexcept { + return UpdateStateOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, + m_allocator); +} +ListNamedShadowsForThingOperation +GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept { + return ListNamedShadowsForThingOperation( + m_connection, + m_greengrassCoreIpcServiceModel + .m_listNamedShadowsForThingOperationContext, + m_allocator); +} +SubscribeToComponentUpdatesOperation +GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( + SubscribeToComponentUpdatesStreamHandler &streamHandler) noexcept { + return SubscribeToComponentUpdatesOperation( + m_connection, &streamHandler, + m_greengrassCoreIpcServiceModel + .m_subscribeToComponentUpdatesOperationContext, + m_allocator); +} +ListLocalDeploymentsOperation +GreengrassCoreIpcClient::NewListLocalDeployments() noexcept { + return ListLocalDeploymentsOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, + m_allocator); +} +StopComponentOperation GreengrassCoreIpcClient::NewStopComponent() noexcept { + return StopComponentOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, + m_allocator); +} +PauseComponentOperation GreengrassCoreIpcClient::NewPauseComponent() noexcept { + return PauseComponentOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, + m_allocator); +} +CreateLocalDeploymentOperation +GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept { + return CreateLocalDeploymentOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, + m_allocator); +} - } // namespace Greengrass +} // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index b456ae5d1..fcdb57dec 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -1,6796 +1,6929 @@ #include #include -namespace Aws -{ - namespace Greengrass - { - 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 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())); - } - } - } - - 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"))); - } - } - } - - 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()); - } - } - - 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()); - } - } - - 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 RunWithInfo::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept - { - if (m_posixUser.has_value()) - { - payloadObject.WithString("posixUser", m_posixUser.value()); - } - } - - 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")); - } - } - - 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 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 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 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()); - } - } - - 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")); - } - } - - 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 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 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 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 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 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 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 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 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 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 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( - std::launch::deferred, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); - } - - SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( - ClientConnection &connection, - SubscribeToIoTCoreStreamHandler *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(); - } - - 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( - 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() noexcept - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); - } - - SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - SubscribeToConfigurationUpdateStreamHandler *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( - 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(); - } - - 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( - 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() noexcept - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); - }); - } - - SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - SubscribeToValidateConfigurationUpdatesStreamHandler *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( - 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() noexcept - { - return std::async( - std::launch::deferred, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); - } - - SubscribeToTopicOperation::SubscribeToTopicOperation( - ClientConnection &connection, - SubscribeToTopicStreamHandler *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( - 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(); - } - - 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( - 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(); - } - - 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( - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - 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() noexcept - { - return std::async(std::launch::deferred, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); - } - - SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - SubscribeToComponentUpdatesStreamHandler *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( - 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() noexcept - { - 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(); - } - - 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( - 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_publishToIoTCoreOperationContext(*this), - m_subscribeToConfigurationUpdateOperationContext(*this), m_deleteThingShadowOperationContext(*this), - m_deferComponentUpdateOperationContext(*this), - m_subscribeToValidateConfigurationUpdatesOperationContext(*this), - m_getConfigurationOperationContext(*this), m_subscribeToTopicOperationContext(*this), - m_getComponentDetailsOperationContext(*this), m_publishToTopicOperationContext(*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_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 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 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())); + } + } +} + +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"))); + } + } +} + +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()); + } +} + +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()); + } +} + +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 RunWithInfo::SerializeToJsonObject( + Aws::Crt::JsonObject &payloadObject) const noexcept { + if (m_posixUser.has_value()) { + payloadObject.WithString("posixUser", m_posixUser.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("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 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 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 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()); + } +} + +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")); + } +} + +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 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 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 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 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 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 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 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 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(std::launch::deferred, [this]() { + return SubscribeToIoTCoreResult(GetOperationResult().get()); + }); +} + +SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( + ClientConnection &connection, + SubscribeToIoTCoreStreamHandler *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(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() noexcept { + 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() noexcept { + return std::async(std::launch::deferred, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); +} + +SubscribeToConfigurationUpdateOperation:: + SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + SubscribeToConfigurationUpdateStreamHandler *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(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(); +} + +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(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() noexcept { + return std::async(std::launch::deferred, [this]() { + return SubscribeToValidateConfigurationUpdatesResult( + GetOperationResult().get()); + }); +} + +SubscribeToValidateConfigurationUpdatesOperation:: + SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + SubscribeToValidateConfigurationUpdatesStreamHandler *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(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() noexcept { + return std::async(std::launch::deferred, [this]() { + return SubscribeToTopicResult(GetOperationResult().get()); + }); +} + +SubscribeToTopicOperation::SubscribeToTopicOperation( + ClientConnection &connection, SubscribeToTopicStreamHandler *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(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(); +} + +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(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(); +} + +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(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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + 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() noexcept { + return std::async(std::launch::deferred, [this]() { + return SubscribeToComponentUpdatesResult(GetOperationResult().get()); + }); +} + +SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + SubscribeToComponentUpdatesStreamHandler *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(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() noexcept { + 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() noexcept { + 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() noexcept { + 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_deferComponentUpdateOperationContext(*this), + m_subscribeToValidateConfigurationUpdatesOperationContext(*this), + m_getConfigurationOperationContext(*this), + m_subscribeToTopicOperationContext(*this), + m_getComponentDetailsOperationContext(*this), + m_publishToTopicOperationContext(*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 e3458b3f9ea77c500e16125a38f11776d29ac02c Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:12:42 -0700 Subject: [PATCH 02/51] try to enable private CI --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++----------------- builder.json | 2 +- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf8c320b..93a43f7e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,10 @@ env: BUILDER_VERSION: v0.8.12 BUILDER_SOURCE: releases BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net - PACKAGE_NAME: aws-iot-device-sdk-cpp-v2 + PACKAGE_NAME: STAGING-aws-iot-device-sdk-cpp-v2 LINUX_BASE_IMAGE: ubuntu-16-x64 RUN: ${{ github.run_id }}-${{ github.run_number }} + ACCESS_TOKEN: ${{secrets.BOT_PAT}} jobs: linux-compat: @@ -23,13 +24,18 @@ jobs: - manylinux2014-x64 - manylinux2014-x86 steps: + - name: Checkout Sources + uses: actions/checkout@v2.3.1 + with: + token: ${{ env.ACCESS_TOKEN }} + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ matrix.image }}:${{ env.BUILDER_VERSION }} docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} + docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} al2: runs-on: ubuntu-latest @@ -73,13 +79,13 @@ jobs: byo-crypto: runs-on: ubuntu-latest steps: - # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - - name: Build ${{ env.PACKAGE_NAME }} - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin - export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }} - docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON skip_samples=1 + # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages + - name: Build ${{ env.PACKAGE_NAME }} + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin + export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }} + docker pull $DOCKER_IMAGE + docker run --env GITHUB_REF $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON skip_samples=1 windows-vs16: runs-on: windows-latest @@ -122,12 +128,12 @@ jobs: check-submodules: runs-on: ubuntu-latest steps: - - name: Checkout Source - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - name: Check Submodules - # note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work - # https://github.com/actions/runner/issues/480 - uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main + - name: Checkout Source + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - name: Check Submodules + # note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work + # https://github.com/actions/runner/issues/480 + uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main diff --git a/builder.json b/builder.json index 35cc28439..f607a0bce 100644 --- a/builder.json +++ b/builder.json @@ -1,5 +1,5 @@ { - "name": "aws-iot-device-sdk-cpp-v2", + "name": "STAGING-aws-iot-device-sdk-cpp-v2", "!cmake_args": [ "-DPERFORM_HEADER_CHECK=OFF", "-DS2N_NO_PQ_ASM=ON" From f867eb4e4687de55b975d5d7e6673fe455d189ec Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:18:23 -0700 Subject: [PATCH 03/51] we don't need checkout --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93a43f7e3..fa0e995fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,6 @@ env: PACKAGE_NAME: STAGING-aws-iot-device-sdk-cpp-v2 LINUX_BASE_IMAGE: ubuntu-16-x64 RUN: ${{ github.run_id }}-${{ github.run_number }} - ACCESS_TOKEN: ${{secrets.BOT_PAT}} jobs: linux-compat: @@ -24,11 +23,6 @@ jobs: - manylinux2014-x64 - manylinux2014-x86 steps: - - name: Checkout Sources - uses: actions/checkout@v2.3.1 - with: - token: ${{ env.ACCESS_TOKEN }} - submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | From e0b29d68344db49a3530c49d3c5fb673c1bf3cbd Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:20:31 -0700 Subject: [PATCH 04/51] mount all the docker related --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa0e995fe..24e5a05f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-al2-x64:${{ env.BUILDER_VERSION }} docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --spec=downstream + docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --spec=downstream clang-compat: runs-on: ubuntu-latest @@ -54,7 +54,7 @@ jobs: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }} docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --compiler=clang-${{ matrix.version }} --config Debug + docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --compiler=clang-${{ matrix.version }} --config Debug gcc-compat: runs-on: ubuntu-latest @@ -68,7 +68,7 @@ jobs: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }} docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --compiler=gcc-${{ matrix.version }} + docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --compiler=gcc-${{ matrix.version }} byo-crypto: runs-on: ubuntu-latest @@ -79,7 +79,7 @@ jobs: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }} docker pull $DOCKER_IMAGE - docker run --env GITHUB_REF $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON skip_samples=1 + docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON skip_samples=1 windows-vs16: runs-on: windows-latest From b8d434d431081a9f179168ce35e26905ae26d0c9 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:24:18 -0700 Subject: [PATCH 05/51] try not use token to get submodules --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24e5a05f1..1bac319be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,10 @@ jobs: - manylinux2014-x64 - manylinux2014-x86 steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | From 7f658a4fde80907760246cebae289376c42ee789 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:26:20 -0700 Subject: [PATCH 06/51] need to checkout resource for all ci --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bac319be..3817782bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,10 @@ jobs: al2: runs-on: ubuntu-latest steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | @@ -52,6 +56,10 @@ jobs: matrix: version: [3, 6, 8, 9] steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | @@ -66,6 +74,10 @@ jobs: matrix: version: [4.8, 5, 6, 7, 8] steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | @@ -77,6 +89,10 @@ jobs: byo-crypto: runs-on: ubuntu-latest steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages - name: Build ${{ env.PACKAGE_NAME }} run: | @@ -88,6 +104,10 @@ jobs: windows-vs16: runs-on: windows-latest steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | md D:\a\work @@ -101,6 +121,10 @@ jobs: matrix: arch: [x86, x64] steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" - uses: ilammy/msvc-dev-cmd@v1 with: toolset: 14.0 @@ -117,6 +141,10 @@ jobs: osx: runs-on: macos-latest steps: + - name: Checkout Sources + uses: actions/checkout@v2 + with: + submodules: "recursive" - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder')" From f8d91493de8ac9e1dea0fb7ad214759dd16f40ae Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:35:31 -0700 Subject: [PATCH 07/51] maybe instead of recursive? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3817782bc..62bbed7e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: - name: Checkout Sources uses: actions/checkout@v2 with: - submodules: "recursive" + submodules: true - uses: ilammy/msvc-dev-cmd@v1 with: toolset: 14.0 From 3ce5743ef75f29f9b6814691890c0bbd0dd11972 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:52:33 -0700 Subject: [PATCH 08/51] shorten it a bit --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index dd84d4a0f..4f92da19b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "aws-common-runtime/aws-crt-cpp"] +[submodule "crt/aws-crt-cpp"] path = crt/aws-crt-cpp url = https://github.com/awslabs/aws-crt-cpp.git [submodule "crt/aws-c-iot"] From da9158ac95cc03ff3b4a3b0113bad6d0b3fd3780 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 15:56:21 -0700 Subject: [PATCH 09/51] not sure --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62bbed7e6..3817782bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: - name: Checkout Sources uses: actions/checkout@v2 with: - submodules: true + submodules: "recursive" - uses: ilammy/msvc-dev-cmd@v1 with: toolset: 14.0 From 2b4beddf2a9dee851acfe020a2a72bbdb5fdedfb Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 19 Jul 2021 16:02:15 -0700 Subject: [PATCH 10/51] Don't need the other flod --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3817782bc..3bc06b104 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,8 +110,6 @@ jobs: submodules: "recursive" - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | - md D:\a\work - cd D:\a\work python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder.pyz')" python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream @@ -133,8 +131,6 @@ jobs: spectre: true - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | - md D:\a\work - cd D:\a\work python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream From 0a6a343dff456521d97706ff815e5e631bd6fbd2 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Tue, 20 Jul 2021 12:26:10 -0700 Subject: [PATCH 11/51] format to check newer projects, format fixes, aws-c-iot version bump --- crt/aws-c-iot | 2 +- eventstream_rpc/tests/EchoTestRpcClient.cpp | 106 +- eventstream_rpc/tests/EchoTestRpcModel.cpp | 2780 +-- .../tests/include/awstest/EchoTestRpcClient.h | 82 +- .../tests/include/awstest/EchoTestRpcModel.h | 2058 ++- format-check.sh | 2 +- .../aws/greengrass/GreengrassCoreIpcClient.h | 138 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 10071 ++++++----- .../source/GreengrassCoreIpcClient.cpp | 455 +- .../source/GreengrassCoreIpcModel.cpp | 14098 ++++++++-------- 10 files changed, 14743 insertions(+), 15049 deletions(-) diff --git a/crt/aws-c-iot b/crt/aws-c-iot index f2057934f..9ce6e5b0e 160000 --- a/crt/aws-c-iot +++ b/crt/aws-c-iot @@ -1 +1 @@ -Subproject commit f2057934f5ea9072c47d42babe77e8d241982c90 +Subproject commit 9ce6e5b0ed6b259cb188abd2bad010b34e36da67 diff --git a/eventstream_rpc/tests/EchoTestRpcClient.cpp b/eventstream_rpc/tests/EchoTestRpcClient.cpp index e99af52a6..ab257baf5 100644 --- a/eventstream_rpc/tests/EchoTestRpcClient.cpp +++ b/eventstream_rpc/tests/EchoTestRpcClient.cpp @@ -1,63 +1,61 @@ #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_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(); } + EchoTestRpcClient::~EchoTestRpcClient() noexcept { Close(); } -GetAllProductsOperation EchoTestRpcClient::NewGetAllProducts() noexcept { - return GetAllProductsOperation( - m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, - m_allocator); -} -CauseServiceErrorOperation EchoTestRpcClient::NewCauseServiceError() noexcept { - return CauseServiceErrorOperation( - m_connection, - m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, - m_allocator); -} -CauseStreamServiceToErrorOperation -EchoTestRpcClient::NewCauseStreamServiceToError( - CauseStreamServiceToErrorStreamHandler &streamHandler) noexcept { - return CauseStreamServiceToErrorOperation( - m_connection, &streamHandler, - m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, - m_allocator); -} -EchoStreamMessagesOperation EchoTestRpcClient::NewEchoStreamMessages( - EchoStreamMessagesStreamHandler &streamHandler) noexcept { - return EchoStreamMessagesOperation( - m_connection, &streamHandler, - m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, - m_allocator); -} -EchoMessageOperation EchoTestRpcClient::NewEchoMessage() noexcept { - return EchoMessageOperation( - m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, - m_allocator); -} -GetAllCustomersOperation EchoTestRpcClient::NewGetAllCustomers() noexcept { - return GetAllCustomersOperation( - m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, - m_allocator); -} + GetAllProductsOperation EchoTestRpcClient::NewGetAllProducts() noexcept + { + return GetAllProductsOperation( + m_connection, m_echoTestRpcServiceModel.m_getAllProductsOperationContext, m_allocator); + } + CauseServiceErrorOperation EchoTestRpcClient::NewCauseServiceError() noexcept + { + return CauseServiceErrorOperation( + m_connection, m_echoTestRpcServiceModel.m_causeServiceErrorOperationContext, m_allocator); + } + CauseStreamServiceToErrorOperation EchoTestRpcClient::NewCauseStreamServiceToError( + CauseStreamServiceToErrorStreamHandler &streamHandler) noexcept + { + return CauseStreamServiceToErrorOperation( + m_connection, + &streamHandler, + m_echoTestRpcServiceModel.m_causeStreamServiceToErrorOperationContext, + m_allocator); + } + EchoStreamMessagesOperation EchoTestRpcClient::NewEchoStreamMessages( + EchoStreamMessagesStreamHandler &streamHandler) noexcept + { + return EchoStreamMessagesOperation( + m_connection, &streamHandler, m_echoTestRpcServiceModel.m_echoStreamMessagesOperationContext, m_allocator); + } + EchoMessageOperation EchoTestRpcClient::NewEchoMessage() noexcept + { + return EchoMessageOperation(m_connection, m_echoTestRpcServiceModel.m_echoMessageOperationContext, m_allocator); + } + GetAllCustomersOperation EchoTestRpcClient::NewGetAllCustomers() noexcept + { + return GetAllCustomersOperation( + m_connection, m_echoTestRpcServiceModel.m_getAllCustomersOperationContext, m_allocator); + } } // namespace Awstest diff --git a/eventstream_rpc/tests/EchoTestRpcModel.cpp b/eventstream_rpc/tests/EchoTestRpcModel.cpp index e9f71005d..b951ad0db 100644 --- a/eventstream_rpc/tests/EchoTestRpcModel.cpp +++ b/eventstream_rpc/tests/EchoTestRpcModel.cpp @@ -1,1375 +1,1415 @@ #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(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( - 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(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( +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(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( 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(std::launch::deferred, [this]() { - return CauseStreamServiceToErrorResult(GetOperationResult().get()); - }); -} - -CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( - ClientConnection &connection, - CauseStreamServiceToErrorStreamHandler *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(std::launch::deferred, [this]() { - return EchoStreamMessagesResult(GetOperationResult().get()); - }); -} - -EchoStreamMessagesOperation::EchoStreamMessagesOperation( - ClientConnection &connection, - EchoStreamMessagesStreamHandler *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(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() noexcept { - 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 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( + 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() noexcept + { + return std::async( + std::launch::deferred, [this]() { return CauseStreamServiceToErrorResult(GetOperationResult().get()); }); + } + + CauseStreamServiceToErrorOperation::CauseStreamServiceToErrorOperation( + ClientConnection &connection, + CauseStreamServiceToErrorStreamHandler *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( + std::launch::deferred, [this]() { return EchoStreamMessagesResult(GetOperationResult().get()); }); + } + + EchoStreamMessagesOperation::EchoStreamMessagesOperation( + ClientConnection &connection, + EchoStreamMessagesStreamHandler *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(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() noexcept + { + 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; + } } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index f8164857c..a213fba54 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -10,46 +10,48 @@ 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; - GetAllProductsOperation NewGetAllProducts() noexcept; - CauseServiceErrorOperation NewCauseServiceError() noexcept; - CauseStreamServiceToErrorOperation NewCauseStreamServiceToError( - CauseStreamServiceToErrorStreamHandler &) noexcept; - EchoStreamMessagesOperation - NewEchoStreamMessages(EchoStreamMessagesStreamHandler &) noexcept; - EchoMessageOperation NewEchoMessage() noexcept; - GetAllCustomersOperation NewGetAllCustomers() noexcept; - ~EchoTestRpcClient() 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; + GetAllProductsOperation NewGetAllProducts() noexcept; + CauseServiceErrorOperation NewCauseServiceError() noexcept; + CauseStreamServiceToErrorOperation NewCauseStreamServiceToError( + CauseStreamServiceToErrorStreamHandler &) noexcept; + EchoStreamMessagesOperation NewEchoStreamMessages(EchoStreamMessagesStreamHandler &) noexcept; + EchoMessageOperation NewEchoMessage() noexcept; + GetAllCustomersOperation NewGetAllCustomers() noexcept; + ~EchoTestRpcClient() noexcept; -private: - EchoTestRpcServiceModel m_echoTestRpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; -}; + private: + EchoTestRpcServiceModel m_echoTestRpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + }; } // namespace Awstest diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index 9fbd8a235..91e3212da 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -13,1069 +13,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, - CauseStreamServiceToErrorStreamHandler *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, - EchoStreamMessagesStreamHandler *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, + CauseStreamServiceToErrorStreamHandler *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, + EchoStreamMessagesStreamHandler *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/format-check.sh b/format-check.sh index b7c800af8..6ce634678 100755 --- a/format-check.sh +++ b/format-check.sh @@ -10,7 +10,7 @@ if NOT type $CLANG_FORMAT 2> /dev/null ; then fi FAIL=0 -SOURCE_FILES=`find devicedefender discovery iotdevicecommon jobs shadow samples -type f \( -name '*.h' -o -name '*.cpp' \)` +SOURCE_FILES=`find devicedefender discovery eventstream_rpc greengrass_ipc identity iotdevicecommon jobs shadow samples -type f \( -name '*.h' -o -name '*.cpp' \)` for i in $SOURCE_FILES do $CLANG_FORMAT -output-replacements-xml $i | grep -c " /dev/null diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h index 2a1eb3781..e1f19103d 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -10,75 +10,75 @@ 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; - SubscribeToIoTCoreOperation - NewSubscribeToIoTCore(SubscribeToIoTCoreStreamHandler &) noexcept; - ResumeComponentOperation NewResumeComponent() noexcept; - PublishToIoTCoreOperation NewPublishToIoTCore() noexcept; - SubscribeToConfigurationUpdateOperation NewSubscribeToConfigurationUpdate( - SubscribeToConfigurationUpdateStreamHandler &) noexcept; - DeleteThingShadowOperation NewDeleteThingShadow() noexcept; - DeferComponentUpdateOperation NewDeferComponentUpdate() noexcept; - SubscribeToValidateConfigurationUpdatesOperation - NewSubscribeToValidateConfigurationUpdates( - SubscribeToValidateConfigurationUpdatesStreamHandler &) noexcept; - GetConfigurationOperation NewGetConfiguration() noexcept; - SubscribeToTopicOperation - NewSubscribeToTopic(SubscribeToTopicStreamHandler &) noexcept; - GetComponentDetailsOperation NewGetComponentDetails() noexcept; - PublishToTopicOperation NewPublishToTopic() noexcept; - ListComponentsOperation NewListComponents() noexcept; - CreateDebugPasswordOperation NewCreateDebugPassword() noexcept; - GetThingShadowOperation NewGetThingShadow() noexcept; - SendConfigurationValidityReportOperation - NewSendConfigurationValidityReport() noexcept; - UpdateThingShadowOperation NewUpdateThingShadow() noexcept; - UpdateConfigurationOperation NewUpdateConfiguration() noexcept; - ValidateAuthorizationTokenOperation NewValidateAuthorizationToken() noexcept; - RestartComponentOperation NewRestartComponent() noexcept; - GetLocalDeploymentStatusOperation NewGetLocalDeploymentStatus() noexcept; - GetSecretValueOperation NewGetSecretValue() noexcept; - UpdateStateOperation NewUpdateState() noexcept; - ListNamedShadowsForThingOperation NewListNamedShadowsForThing() noexcept; - SubscribeToComponentUpdatesOperation NewSubscribeToComponentUpdates( - SubscribeToComponentUpdatesStreamHandler &) noexcept; - ListLocalDeploymentsOperation NewListLocalDeployments() noexcept; - StopComponentOperation NewStopComponent() noexcept; - PauseComponentOperation NewPauseComponent() noexcept; - CreateLocalDeploymentOperation NewCreateLocalDeployment() noexcept; - ~GreengrassCoreIpcClient() 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; + SubscribeToIoTCoreOperation NewSubscribeToIoTCore(SubscribeToIoTCoreStreamHandler &) noexcept; + ResumeComponentOperation NewResumeComponent() noexcept; + PublishToIoTCoreOperation NewPublishToIoTCore() noexcept; + SubscribeToConfigurationUpdateOperation NewSubscribeToConfigurationUpdate( + SubscribeToConfigurationUpdateStreamHandler &) noexcept; + DeleteThingShadowOperation NewDeleteThingShadow() noexcept; + DeferComponentUpdateOperation NewDeferComponentUpdate() noexcept; + SubscribeToValidateConfigurationUpdatesOperation NewSubscribeToValidateConfigurationUpdates( + SubscribeToValidateConfigurationUpdatesStreamHandler &) noexcept; + GetConfigurationOperation NewGetConfiguration() noexcept; + SubscribeToTopicOperation NewSubscribeToTopic(SubscribeToTopicStreamHandler &) noexcept; + GetComponentDetailsOperation NewGetComponentDetails() noexcept; + PublishToTopicOperation NewPublishToTopic() noexcept; + ListComponentsOperation NewListComponents() noexcept; + CreateDebugPasswordOperation NewCreateDebugPassword() noexcept; + GetThingShadowOperation NewGetThingShadow() noexcept; + SendConfigurationValidityReportOperation NewSendConfigurationValidityReport() noexcept; + UpdateThingShadowOperation NewUpdateThingShadow() noexcept; + UpdateConfigurationOperation NewUpdateConfiguration() noexcept; + ValidateAuthorizationTokenOperation NewValidateAuthorizationToken() noexcept; + RestartComponentOperation NewRestartComponent() noexcept; + GetLocalDeploymentStatusOperation NewGetLocalDeploymentStatus() noexcept; + GetSecretValueOperation NewGetSecretValue() noexcept; + UpdateStateOperation NewUpdateState() noexcept; + ListNamedShadowsForThingOperation NewListNamedShadowsForThing() noexcept; + SubscribeToComponentUpdatesOperation NewSubscribeToComponentUpdates( + SubscribeToComponentUpdatesStreamHandler &) noexcept; + ListLocalDeploymentsOperation NewListLocalDeployments() noexcept; + StopComponentOperation NewStopComponent() noexcept; + PauseComponentOperation NewPauseComponent() noexcept; + CreateLocalDeploymentOperation NewCreateLocalDeployment() noexcept; + ~GreengrassCoreIpcClient() noexcept; -private: - GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; - ClientConnection m_connection; - Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; - Aws::Crt::Allocator *m_allocator; - MessageAmendment m_connectAmendment; -}; -} // namespace Greengrass + private: + GreengrassCoreIpcServiceModel m_greengrassCoreIpcServiceModel; + ClientConnection m_connection; + Aws::Crt::Io::ClientBootstrap &m_clientBootstrap; + Aws::Crt::Allocator *m_allocator; + MessageAmendment m_connectAmendment; + }; + } // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index ed9661aa4..d1f96e3b0 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -13,5281 +13,4798 @@ using namespace Aws::Eventstreamrpc; -namespace Aws { -namespace Greengrass { -class GreengrassCoreIpcClient; -class GreengrassCoreIpcServiceModel; -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; -}; - -enum ConfigurationValidityStatus { - CONFIGURATION_VALIDITY_STATUS_ACCEPTED, - CONFIGURATION_VALIDITY_STATUS_REJECTED -}; - -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; - } - 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; -}; - -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; - } - 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; -}; - -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 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 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_systemResourceLimits; -}; - -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; -}; - -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 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 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; - void SetTopicName(const Aws::Crt::String &topicName) noexcept { - m_topicName = topicName; - } - 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 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; -}; - -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 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 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 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 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 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 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 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 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, - SubscribeToIoTCoreStreamHandler *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, - SubscribeToConfigurationUpdateStreamHandler *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 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, - SubscribeToValidateConfigurationUpdatesStreamHandler *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, - SubscribeToTopicStreamHandler *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 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 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, - SubscribeToComponentUpdatesStreamHandler *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; - DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; - SubscribeToValidateConfigurationUpdatesOperationContext - m_subscribeToValidateConfigurationUpdatesOperationContext; - GetConfigurationOperationContext m_getConfigurationOperationContext; - SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; - GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; - PublishToTopicOperationContext m_publishToTopicOperationContext; - 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; + 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; + }; + + enum ConfigurationValidityStatus + { + CONFIGURATION_VALIDITY_STATUS_ACCEPTED, + CONFIGURATION_VALIDITY_STATUS_REJECTED + }; + + 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; } + 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; + }; + + 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; } + 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; + }; + + 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 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 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_systemResourceLimits; + }; + + 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; + }; + + 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 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 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; + void SetTopicName(const Aws::Crt::String &topicName) noexcept { m_topicName = topicName; } + 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 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; + }; + + 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 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 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 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 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 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 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 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 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, + SubscribeToIoTCoreStreamHandler *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, + SubscribeToConfigurationUpdateStreamHandler *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 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, + SubscribeToValidateConfigurationUpdatesStreamHandler *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, + SubscribeToTopicStreamHandler *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 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 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, + SubscribeToComponentUpdatesStreamHandler *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; + DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext; + SubscribeToValidateConfigurationUpdatesOperationContext + m_subscribeToValidateConfigurationUpdatesOperationContext; + GetConfigurationOperationContext m_getConfigurationOperationContext; + SubscribeToTopicOperationContext m_subscribeToTopicOperationContext; + GetComponentDetailsOperationContext m_getComponentDetailsOperationContext; + PublishToTopicOperationContext m_publishToTopicOperationContext; + 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 0f8bb0439..7f4a6efc1 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcClient.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcClient.cpp @@ -1,256 +1,217 @@ #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#ResourceNotFoundError"), - ResourceNotFoundError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), - InvalidArgumentsError::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#ServiceError"), - ServiceError::s_allocateFromPayload); - m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( - Aws::Crt::String("aws.greengrass#UnauthorizedError"), - UnauthorizedError::s_allocateFromPayload); -} +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#ResourceNotFoundError"), ResourceNotFoundError::s_allocateFromPayload); + m_greengrassCoreIpcServiceModel.AssignModelNameToErrorResponse( + Aws::Crt::String("aws.greengrass#InvalidArgumentsError"), InvalidArgumentsError::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#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); -} + 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::Close() noexcept { m_connection.Close(); } -GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } + GreengrassCoreIpcClient::~GreengrassCoreIpcClient() noexcept { Close(); } -SubscribeToIoTCoreOperation GreengrassCoreIpcClient::NewSubscribeToIoTCore( - SubscribeToIoTCoreStreamHandler &streamHandler) noexcept { - return SubscribeToIoTCoreOperation( - m_connection, &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, - m_allocator); -} -ResumeComponentOperation -GreengrassCoreIpcClient::NewResumeComponent() noexcept { - return ResumeComponentOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, - m_allocator); -} -PublishToIoTCoreOperation -GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept { - return PublishToIoTCoreOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, - m_allocator); -} -SubscribeToConfigurationUpdateOperation -GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( - SubscribeToConfigurationUpdateStreamHandler &streamHandler) noexcept { - return SubscribeToConfigurationUpdateOperation( - m_connection, &streamHandler, - m_greengrassCoreIpcServiceModel - .m_subscribeToConfigurationUpdateOperationContext, - m_allocator); -} -DeleteThingShadowOperation -GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept { - return DeleteThingShadowOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, - m_allocator); -} -DeferComponentUpdateOperation -GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept { - return DeferComponentUpdateOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, - m_allocator); -} -SubscribeToValidateConfigurationUpdatesOperation -GreengrassCoreIpcClient::NewSubscribeToValidateConfigurationUpdates( - SubscribeToValidateConfigurationUpdatesStreamHandler - &streamHandler) noexcept { - return SubscribeToValidateConfigurationUpdatesOperation( - m_connection, &streamHandler, - m_greengrassCoreIpcServiceModel - .m_subscribeToValidateConfigurationUpdatesOperationContext, - m_allocator); -} -GetConfigurationOperation -GreengrassCoreIpcClient::NewGetConfiguration() noexcept { - return GetConfigurationOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, - m_allocator); -} -SubscribeToTopicOperation GreengrassCoreIpcClient::NewSubscribeToTopic( - SubscribeToTopicStreamHandler &streamHandler) noexcept { - return SubscribeToTopicOperation( - m_connection, &streamHandler, - m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, - m_allocator); -} -GetComponentDetailsOperation -GreengrassCoreIpcClient::NewGetComponentDetails() noexcept { - return GetComponentDetailsOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, - m_allocator); -} -PublishToTopicOperation GreengrassCoreIpcClient::NewPublishToTopic() noexcept { - return PublishToTopicOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, - m_allocator); -} -ListComponentsOperation GreengrassCoreIpcClient::NewListComponents() noexcept { - return ListComponentsOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, - m_allocator); -} -CreateDebugPasswordOperation -GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept { - return CreateDebugPasswordOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, - m_allocator); -} -GetThingShadowOperation GreengrassCoreIpcClient::NewGetThingShadow() noexcept { - return GetThingShadowOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, - m_allocator); -} -SendConfigurationValidityReportOperation -GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept { - return SendConfigurationValidityReportOperation( - m_connection, - m_greengrassCoreIpcServiceModel - .m_sendConfigurationValidityReportOperationContext, - m_allocator); -} -UpdateThingShadowOperation -GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept { - return UpdateThingShadowOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, - m_allocator); -} -UpdateConfigurationOperation -GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept { - return UpdateConfigurationOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, - m_allocator); -} -ValidateAuthorizationTokenOperation -GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept { - return ValidateAuthorizationTokenOperation( - m_connection, - m_greengrassCoreIpcServiceModel - .m_validateAuthorizationTokenOperationContext, - m_allocator); -} -RestartComponentOperation -GreengrassCoreIpcClient::NewRestartComponent() noexcept { - return RestartComponentOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, - m_allocator); -} -GetLocalDeploymentStatusOperation -GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept { - return GetLocalDeploymentStatusOperation( - m_connection, - m_greengrassCoreIpcServiceModel - .m_getLocalDeploymentStatusOperationContext, - m_allocator); -} -GetSecretValueOperation GreengrassCoreIpcClient::NewGetSecretValue() noexcept { - return GetSecretValueOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, - m_allocator); -} -UpdateStateOperation GreengrassCoreIpcClient::NewUpdateState() noexcept { - return UpdateStateOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, - m_allocator); -} -ListNamedShadowsForThingOperation -GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept { - return ListNamedShadowsForThingOperation( - m_connection, - m_greengrassCoreIpcServiceModel - .m_listNamedShadowsForThingOperationContext, - m_allocator); -} -SubscribeToComponentUpdatesOperation -GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( - SubscribeToComponentUpdatesStreamHandler &streamHandler) noexcept { - return SubscribeToComponentUpdatesOperation( - m_connection, &streamHandler, - m_greengrassCoreIpcServiceModel - .m_subscribeToComponentUpdatesOperationContext, - m_allocator); -} -ListLocalDeploymentsOperation -GreengrassCoreIpcClient::NewListLocalDeployments() noexcept { - return ListLocalDeploymentsOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, - m_allocator); -} -StopComponentOperation GreengrassCoreIpcClient::NewStopComponent() noexcept { - return StopComponentOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, - m_allocator); -} -PauseComponentOperation GreengrassCoreIpcClient::NewPauseComponent() noexcept { - return PauseComponentOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, - m_allocator); -} -CreateLocalDeploymentOperation -GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept { - return CreateLocalDeploymentOperation( - m_connection, - m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, - m_allocator); -} + SubscribeToIoTCoreOperation GreengrassCoreIpcClient::NewSubscribeToIoTCore( + SubscribeToIoTCoreStreamHandler &streamHandler) noexcept + { + return SubscribeToIoTCoreOperation( + m_connection, + &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToIoTCoreOperationContext, + m_allocator); + } + ResumeComponentOperation GreengrassCoreIpcClient::NewResumeComponent() noexcept + { + return ResumeComponentOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_resumeComponentOperationContext, m_allocator); + } + PublishToIoTCoreOperation GreengrassCoreIpcClient::NewPublishToIoTCore() noexcept + { + return PublishToIoTCoreOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_publishToIoTCoreOperationContext, m_allocator); + } + SubscribeToConfigurationUpdateOperation GreengrassCoreIpcClient::NewSubscribeToConfigurationUpdate( + SubscribeToConfigurationUpdateStreamHandler &streamHandler) noexcept + { + return SubscribeToConfigurationUpdateOperation( + m_connection, + &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToConfigurationUpdateOperationContext, + m_allocator); + } + DeleteThingShadowOperation GreengrassCoreIpcClient::NewDeleteThingShadow() noexcept + { + return DeleteThingShadowOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_deleteThingShadowOperationContext, m_allocator); + } + DeferComponentUpdateOperation GreengrassCoreIpcClient::NewDeferComponentUpdate() noexcept + { + return DeferComponentUpdateOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_deferComponentUpdateOperationContext, m_allocator); + } + SubscribeToValidateConfigurationUpdatesOperation GreengrassCoreIpcClient:: + NewSubscribeToValidateConfigurationUpdates( + SubscribeToValidateConfigurationUpdatesStreamHandler &streamHandler) noexcept + { + return SubscribeToValidateConfigurationUpdatesOperation( + m_connection, + &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToValidateConfigurationUpdatesOperationContext, + m_allocator); + } + GetConfigurationOperation GreengrassCoreIpcClient::NewGetConfiguration() noexcept + { + return GetConfigurationOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_getConfigurationOperationContext, m_allocator); + } + SubscribeToTopicOperation GreengrassCoreIpcClient::NewSubscribeToTopic( + SubscribeToTopicStreamHandler &streamHandler) noexcept + { + return SubscribeToTopicOperation( + m_connection, + &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToTopicOperationContext, + m_allocator); + } + GetComponentDetailsOperation GreengrassCoreIpcClient::NewGetComponentDetails() noexcept + { + return GetComponentDetailsOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_getComponentDetailsOperationContext, m_allocator); + } + PublishToTopicOperation GreengrassCoreIpcClient::NewPublishToTopic() noexcept + { + return PublishToTopicOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_publishToTopicOperationContext, m_allocator); + } + ListComponentsOperation GreengrassCoreIpcClient::NewListComponents() noexcept + { + return ListComponentsOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_listComponentsOperationContext, m_allocator); + } + CreateDebugPasswordOperation GreengrassCoreIpcClient::NewCreateDebugPassword() noexcept + { + return CreateDebugPasswordOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_createDebugPasswordOperationContext, m_allocator); + } + GetThingShadowOperation GreengrassCoreIpcClient::NewGetThingShadow() noexcept + { + return GetThingShadowOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_getThingShadowOperationContext, m_allocator); + } + SendConfigurationValidityReportOperation GreengrassCoreIpcClient::NewSendConfigurationValidityReport() noexcept + { + return SendConfigurationValidityReportOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_sendConfigurationValidityReportOperationContext, + m_allocator); + } + UpdateThingShadowOperation GreengrassCoreIpcClient::NewUpdateThingShadow() noexcept + { + return UpdateThingShadowOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_updateThingShadowOperationContext, m_allocator); + } + UpdateConfigurationOperation GreengrassCoreIpcClient::NewUpdateConfiguration() noexcept + { + return UpdateConfigurationOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_updateConfigurationOperationContext, m_allocator); + } + ValidateAuthorizationTokenOperation GreengrassCoreIpcClient::NewValidateAuthorizationToken() noexcept + { + return ValidateAuthorizationTokenOperation( + m_connection, + m_greengrassCoreIpcServiceModel.m_validateAuthorizationTokenOperationContext, + m_allocator); + } + RestartComponentOperation GreengrassCoreIpcClient::NewRestartComponent() noexcept + { + return RestartComponentOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_restartComponentOperationContext, m_allocator); + } + GetLocalDeploymentStatusOperation GreengrassCoreIpcClient::NewGetLocalDeploymentStatus() noexcept + { + return GetLocalDeploymentStatusOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_getLocalDeploymentStatusOperationContext, m_allocator); + } + GetSecretValueOperation GreengrassCoreIpcClient::NewGetSecretValue() noexcept + { + return GetSecretValueOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_getSecretValueOperationContext, m_allocator); + } + UpdateStateOperation GreengrassCoreIpcClient::NewUpdateState() noexcept + { + return UpdateStateOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_updateStateOperationContext, m_allocator); + } + ListNamedShadowsForThingOperation GreengrassCoreIpcClient::NewListNamedShadowsForThing() noexcept + { + return ListNamedShadowsForThingOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_listNamedShadowsForThingOperationContext, m_allocator); + } + SubscribeToComponentUpdatesOperation GreengrassCoreIpcClient::NewSubscribeToComponentUpdates( + SubscribeToComponentUpdatesStreamHandler &streamHandler) noexcept + { + return SubscribeToComponentUpdatesOperation( + m_connection, + &streamHandler, + m_greengrassCoreIpcServiceModel.m_subscribeToComponentUpdatesOperationContext, + m_allocator); + } + ListLocalDeploymentsOperation GreengrassCoreIpcClient::NewListLocalDeployments() noexcept + { + return ListLocalDeploymentsOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_listLocalDeploymentsOperationContext, m_allocator); + } + StopComponentOperation GreengrassCoreIpcClient::NewStopComponent() noexcept + { + return StopComponentOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_stopComponentOperationContext, m_allocator); + } + PauseComponentOperation GreengrassCoreIpcClient::NewPauseComponent() noexcept + { + return PauseComponentOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_pauseComponentOperationContext, m_allocator); + } + CreateLocalDeploymentOperation GreengrassCoreIpcClient::NewCreateLocalDeployment() noexcept + { + return CreateLocalDeploymentOperation( + m_connection, m_greengrassCoreIpcServiceModel.m_createLocalDeploymentOperationContext, m_allocator); + } -} // namespace Greengrass + } // namespace Greengrass } // namespace Aws diff --git a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp index fcdb57dec..0e4114d12 100644 --- a/greengrass_ipc/source/GreengrassCoreIpcModel.cpp +++ b/greengrass_ipc/source/GreengrassCoreIpcModel.cpp @@ -1,6929 +1,7177 @@ #include #include -namespace Aws { -namespace Greengrass { -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 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())); - } - } -} - -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"))); - } - } -} - -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()); - } -} - -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()); - } -} - -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 RunWithInfo::SerializeToJsonObject( - Aws::Crt::JsonObject &payloadObject) const noexcept { - if (m_posixUser.has_value()) { - payloadObject.WithString("posixUser", m_posixUser.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("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 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 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 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()); - } -} - -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")); - } -} - -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 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 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 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 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 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 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 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 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(std::launch::deferred, [this]() { - return SubscribeToIoTCoreResult(GetOperationResult().get()); - }); -} - -SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( - ClientConnection &connection, - SubscribeToIoTCoreStreamHandler *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(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() noexcept { - 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() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); - }); -} - -SubscribeToConfigurationUpdateOperation:: - SubscribeToConfigurationUpdateOperation( - ClientConnection &connection, - SubscribeToConfigurationUpdateStreamHandler *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(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(); -} - -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(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() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToValidateConfigurationUpdatesResult( - GetOperationResult().get()); - }); -} - -SubscribeToValidateConfigurationUpdatesOperation:: - SubscribeToValidateConfigurationUpdatesOperation( - ClientConnection &connection, - SubscribeToValidateConfigurationUpdatesStreamHandler *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(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() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToTopicResult(GetOperationResult().get()); - }); -} - -SubscribeToTopicOperation::SubscribeToTopicOperation( - ClientConnection &connection, SubscribeToTopicStreamHandler *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(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(); -} - -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(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(); -} - -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(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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - 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() noexcept { - return std::async(std::launch::deferred, [this]() { - return SubscribeToComponentUpdatesResult(GetOperationResult().get()); - }); -} - -SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( - ClientConnection &connection, - SubscribeToComponentUpdatesStreamHandler *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(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() noexcept { - 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() noexcept { - 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() noexcept { - 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_deferComponentUpdateOperationContext(*this), - m_subscribeToValidateConfigurationUpdatesOperationContext(*this), - m_getConfigurationOperationContext(*this), - m_subscribeToTopicOperationContext(*this), - m_getComponentDetailsOperationContext(*this), - m_publishToTopicOperationContext(*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 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 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())); + } + } + } + + 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"))); + } + } + } + + 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()); + } + } + + 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()); + } + } + + 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 RunWithInfo::SerializeToJsonObject(Aws::Crt::JsonObject &payloadObject) const noexcept + { + if (m_posixUser.has_value()) + { + payloadObject.WithString("posixUser", m_posixUser.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("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 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 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 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()); + } + } + + 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")); + } + } + + 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 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 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 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 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 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 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 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 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( + std::launch::deferred, [this]() { return SubscribeToIoTCoreResult(GetOperationResult().get()); }); + } + + SubscribeToIoTCoreOperation::SubscribeToIoTCoreOperation( + ClientConnection &connection, + SubscribeToIoTCoreStreamHandler *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( + 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() noexcept + { + 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() noexcept + { + return std::async(std::launch::deferred, [this]() { + return SubscribeToConfigurationUpdateResult(GetOperationResult().get()); + }); + } + + SubscribeToConfigurationUpdateOperation::SubscribeToConfigurationUpdateOperation( + ClientConnection &connection, + SubscribeToConfigurationUpdateStreamHandler *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( + 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(); + } + + 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( + 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() noexcept + { + return std::async(std::launch::deferred, [this]() { + return SubscribeToValidateConfigurationUpdatesResult(GetOperationResult().get()); + }); + } + + SubscribeToValidateConfigurationUpdatesOperation::SubscribeToValidateConfigurationUpdatesOperation( + ClientConnection &connection, + SubscribeToValidateConfigurationUpdatesStreamHandler *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( + 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() noexcept + { + return std::async( + std::launch::deferred, [this]() { return SubscribeToTopicResult(GetOperationResult().get()); }); + } + + SubscribeToTopicOperation::SubscribeToTopicOperation( + ClientConnection &connection, + SubscribeToTopicStreamHandler *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( + 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(); + } + + 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( + 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(); + } + + 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( + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + return std::async(std::launch::deferred, [this]() { + return SubscribeToComponentUpdatesResult(GetOperationResult().get()); + }); + } + + SubscribeToComponentUpdatesOperation::SubscribeToComponentUpdatesOperation( + ClientConnection &connection, + SubscribeToComponentUpdatesStreamHandler *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( + 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() noexcept + { + 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() noexcept + { + 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() noexcept + { + 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_deferComponentUpdateOperationContext(*this), + m_subscribeToValidateConfigurationUpdatesOperationContext(*this), + m_getConfigurationOperationContext(*this), m_subscribeToTopicOperationContext(*this), + m_getComponentDetailsOperationContext(*this), m_publishToTopicOperationContext(*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 bfec3e3a449b43047b383433492eb59bd99e4170 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Thu, 18 Aug 2022 17:42:37 -0700 Subject: [PATCH 12/51] mqtt5 pub-sub sample --- samples/mqtt/mqtt5_sample/CMakeLists.txt | 25 ++++ samples/mqtt/mqtt5_sample/main.cpp | 162 +++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 samples/mqtt/mqtt5_sample/CMakeLists.txt create mode 100644 samples/mqtt/mqtt5_sample/main.cpp diff --git a/samples/mqtt/mqtt5_sample/CMakeLists.txt b/samples/mqtt/mqtt5_sample/CMakeLists.txt new file mode 100644 index 000000000..6b3eeea05 --- /dev/null +++ b/samples/mqtt/mqtt5_sample/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.1) +# note: cxx-17 requires cmake 3.8, cxx-20 requires cmake 3.12 +project(mqtt5-pubsub CXX) + +file(GLOB SRC_FILES + "*.cpp" + "../../utils/CommandLineUtils.cpp" + "../../utils/CommandLineUtils.h" +) + +add_executable(${PROJECT_NAME} ${SRC_FILES}) + +set_target_properties(${PROJECT_NAME} PROPERTIES + CXX_STANDARD 14) + +#set warnings +if (MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /wd4068) +else () + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror) +endif () + +find_package(aws-crt-cpp REQUIRED) + +target_link_libraries(${PROJECT_NAME} AWS::aws-crt-cpp) diff --git a/samples/mqtt/mqtt5_sample/main.cpp b/samples/mqtt/mqtt5_sample/main.cpp new file mode 100644 index 000000000..b6f7bbba9 --- /dev/null +++ b/samples/mqtt/mqtt5_sample/main.cpp @@ -0,0 +1,162 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +#include +#include +#include + +#include "../../utils/CommandLineUtils.h" + +using namespace Aws::Crt; + +int main(int argc, char *argv[]) +{ + + /************************ Setup the Lib ****************************/ + /* + * Do the global initialization for the API. + */ + ApiHandle apiHandle; + uint32_t messageCount = 10; + String testTopic = "test/topic1"; + + std::mutex receiveMutex; + std::condition_variable receiveSignal; + uint32_t receivedCount = 0; + + /*********************** Parse Arguments ***************************/ + Utils::CommandLineUtils cmdUtils = Utils::CommandLineUtils(); + cmdUtils.RegisterProgramName("basic-connect"); + cmdUtils.AddCommonMQTTCommands(); + cmdUtils.RegisterCommand("key", "", "Path to your key in PEM format."); + cmdUtils.RegisterCommand("cert", "", "Path to your client certificate in PEM format."); + cmdUtils.AddCommonProxyCommands(); + cmdUtils.RegisterCommand("client_id", "", "Client id to use (optional, default='test-*')"); + cmdUtils.AddLoggingCommands(); + const char **const_argv = (const char **)argv; + cmdUtils.SendArguments(const_argv, const_argv + argc); + cmdUtils.StartLoggingBasedOnCommand(&apiHandle); + + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder builder( + cmdUtils.GetCommand("endpoint"), cmdUtils.GetCommand("cert").c_str(), cmdUtils.GetCommand("key").c_str()); + + // Setup connection options + std::shared_ptr connectOptions = std::make_shared(); + // Get the client ID to send with the connection + String clientId = cmdUtils.GetCommandOrDefault("client_id", String("test-") + Aws::Crt::UUID().ToString()); + connectOptions->withClientId(clientId); + builder.withConnectOptions(connectOptions); + + std::promise connectionPromise; + std::promise stoppedPromise; + std::promise disconnectPromise; + + // Setup lifecycle callbacks + builder.onConnectionSuccess = [&connectionPromise]( + Mqtt5::Mqtt5Client &, + std::shared_ptr, + std::shared_ptr settings) { + fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.", settings->getClientId().c_str()); + connectionPromise.set_value(true); + }; + + builder.onConnectionFailure = + [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.", aws_error_debug_str(error_code)); + connectionPromise.set_value(false); + }; + + builder.onStopped = [&stoppedPromise](Aws::Crt::Mqtt5::Mqtt5Client &) { + fprintf(stdout, "Mqtt5 Client stopped."); + stoppedPromise.set_value(); + }; + + builder.onAttemptingConnect = [](Aws::Crt::Mqtt5::Mqtt5Client &) { + fprintf(stdout, "Mqtt5 Client attempting connection..."); + }; + + builder.onDisconnection = [&disconnectPromise]( + Aws::Crt::Mqtt5::Mqtt5Client &, + int errorCode, + std::shared_ptr packet_disconnect) { + if (errorCode == 0) + { + fprintf(stdout, "Mqtt5 Client disconnected."); + } + else + { + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.", aws_error_debug_str(errorCode)); + } + disconnectPromise.set_value(); + }; + + ; + + builder.onPublishReceived = [&receiveMutex, &receivedCount, &receiveSignal]( + Mqtt5::Mqtt5Client & /*client*/, std::shared_ptr publish) { + if (publish == nullptr) + return; + + std::lock_guard lock(receiveMutex); + ++receivedCount; + fprintf(stdout, "Publish received on topic %s\n", publish->getTopic().c_str()); + fprintf(stdout, "Message: "); + fwrite(publish->getPayload().ptr, 1, publish->getPayload().len, stdout); + fprintf(stdout, "\n"); + + for (Mqtt5::UserProperty prop : publish->getUserProperties()) + { + fprintf(stdout, "\twith UserProperty:(%s,%s)", prop.getName().c_str(), prop.getValue().c_str()); + } + receiveSignal.notify_all(); + }; + + // Create Mqtt5Client + std::shared_ptr client = builder.Build(); + + if (client == nullptr) + { + fprintf(stdout, "Client creation failed."); + return -1; + } + + if (client->Start()) + { + if (connectionPromise.get_future().get() == false) + { + return -1; + } + + Mqtt5::Subscription sub1("test/topic1", Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + sub1.withNoLocal(false); + Mqtt5::SubscribePacket subPacket; + subPacket.withSubscription(std::move(sub1)); + std::shared_ptr suback = client->Subscribe(subPacket).get_future().get(); + if (suback != nullptr) + { + fprintf(stdout, "Subscription Success."); + + uint32_t publishedCount = 0; + while (publishedCount < messageCount) + { + String message = String("Mqtt5 Publish Message: ") + std::to_string(publishedCount).c_str(); + ByteCursor payload = ByteCursorFromString(message); + + Mqtt5::PublishPacket publish(testTopic, payload, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + client->Publish(publish).get_future().wait(); + ++publishedCount; + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + + std::unique_lock receivedLock(receiveMutex); + receiveSignal.wait(receivedLock, [&] { return receivedCount >= messageCount; }); + } + + client->Stop(); + } + + return 0; +} From fb1f03c21de5d3aa2e3e4b97e2129dc4ba855303 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 19 Aug 2022 17:08:56 -0700 Subject: [PATCH 13/51] Move mqtt5 sample to its own folder. Improve error messages. --- .../mqtt5_pubsub}/CMakeLists.txt | 2 +- .../mqtt5_pubsub}/main.cpp | 38 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) rename samples/{mqtt/mqtt5_sample => mqtt5/mqtt5_pubsub}/CMakeLists.txt (96%) rename samples/{mqtt/mqtt5_sample => mqtt5/mqtt5_pubsub}/main.cpp (81%) diff --git a/samples/mqtt/mqtt5_sample/CMakeLists.txt b/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt similarity index 96% rename from samples/mqtt/mqtt5_sample/CMakeLists.txt rename to samples/mqtt5/mqtt5_pubsub/CMakeLists.txt index 6b3eeea05..b2d6ddafa 100644 --- a/samples/mqtt/mqtt5_sample/CMakeLists.txt +++ b/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1) # note: cxx-17 requires cmake 3.8, cxx-20 requires cmake 3.12 -project(mqtt5-pubsub CXX) +project(mqtt5_pubsub CXX) file(GLOB SRC_FILES "*.cpp" diff --git a/samples/mqtt/mqtt5_sample/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp similarity index 81% rename from samples/mqtt/mqtt5_sample/main.cpp rename to samples/mqtt5/mqtt5_pubsub/main.cpp index b6f7bbba9..1f2a5d75b 100644 --- a/samples/mqtt/mqtt5_sample/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) /*********************** Parse Arguments ***************************/ Utils::CommandLineUtils cmdUtils = Utils::CommandLineUtils(); - cmdUtils.RegisterProgramName("basic-connect"); + cmdUtils.RegisterProgramName("mqtt5_pubsub"); cmdUtils.AddCommonMQTTCommands(); cmdUtils.RegisterCommand("key", "", "Path to your key in PEM format."); cmdUtils.RegisterCommand("cert", "", "Path to your client certificate in PEM format."); @@ -58,23 +58,23 @@ int main(int argc, char *argv[]) Mqtt5::Mqtt5Client &, std::shared_ptr, std::shared_ptr settings) { - fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.", settings->getClientId().c_str()); + fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); connectionPromise.set_value(true); }; builder.onConnectionFailure = [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.", aws_error_debug_str(error_code)); + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); connectionPromise.set_value(false); }; builder.onStopped = [&stoppedPromise](Aws::Crt::Mqtt5::Mqtt5Client &) { - fprintf(stdout, "Mqtt5 Client stopped."); + fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); }; builder.onAttemptingConnect = [](Aws::Crt::Mqtt5::Mqtt5Client &) { - fprintf(stdout, "Mqtt5 Client attempting connection..."); + fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }; builder.onDisconnection = [&disconnectPromise]( @@ -83,11 +83,11 @@ int main(int argc, char *argv[]) std::shared_ptr packet_disconnect) { if (errorCode == 0) { - fprintf(stdout, "Mqtt5 Client disconnected."); + fprintf(stdout, "Mqtt5 Client disconnected.\n"); } else { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.", aws_error_debug_str(errorCode)); + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(errorCode)); } disconnectPromise.set_value(); }; @@ -101,14 +101,13 @@ int main(int argc, char *argv[]) std::lock_guard lock(receiveMutex); ++receivedCount; - fprintf(stdout, "Publish received on topic %s\n", publish->getTopic().c_str()); - fprintf(stdout, "Message: "); + fprintf(stdout, "Publish received on topic %s:", publish->getTopic().c_str()); fwrite(publish->getPayload().ptr, 1, publish->getPayload().len, stdout); fprintf(stdout, "\n"); for (Mqtt5::UserProperty prop : publish->getUserProperties()) { - fprintf(stdout, "\twith UserProperty:(%s,%s)", prop.getName().c_str(), prop.getValue().c_str()); + fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); } receiveSignal.notify_all(); }; @@ -118,7 +117,7 @@ int main(int argc, char *argv[]) if (client == nullptr) { - fprintf(stdout, "Client creation failed."); + fprintf(stdout, "Client creation failed.\n"); return -1; } @@ -129,7 +128,7 @@ int main(int argc, char *argv[]) return -1; } - Mqtt5::Subscription sub1("test/topic1", Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + Mqtt5::Subscription sub1(testTopic, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); sub1.withNoLocal(false); Mqtt5::SubscribePacket subPacket; subPacket.withSubscription(std::move(sub1)); @@ -154,8 +153,21 @@ int main(int argc, char *argv[]) std::unique_lock receivedLock(receiveMutex); receiveSignal.wait(receivedLock, [&] { return receivedCount >= messageCount; }); } + else + { + fprintf(stdout, "Subscription Failed.\n"); + for (int errorCode : suback->getReasonCodes()) + { + fprintf(stdout, "Mqtt5 Client subscription failed with error: %s.\n", aws_error_debug_str(errorCode)); + } + } - client->Stop(); + if (!client->Stop()) + { + fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); + return -1; + } + disconnectPromise.get_future().wait(); } return 0; From 80cbe020f4d231f50f7ab787b80080583a819696 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 19 Aug 2022 17:14:39 -0700 Subject: [PATCH 14/51] Improve log message --- samples/mqtt5/mqtt5_pubsub/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 1f2a5d75b..cb8b2733e 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) std::shared_ptr suback = client->Subscribe(subPacket).get_future().get(); if (suback != nullptr) { - fprintf(stdout, "Subscription Success."); + fprintf(stdout, "Subscription Success.\n"); uint32_t publishedCount = 0; while (publishedCount < messageCount) From 625e0ffdcf10ed0e8a15bc27a907f4d0ca8788ce Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 23 Aug 2022 11:12:11 -0700 Subject: [PATCH 15/51] update client api changes --- samples/mqtt5/mqtt5_pubsub/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index cb8b2733e..1c0e01698 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) sub1.withNoLocal(false); Mqtt5::SubscribePacket subPacket; subPacket.withSubscription(std::move(sub1)); - std::shared_ptr suback = client->Subscribe(subPacket).get_future().get(); + std::shared_ptr suback = client->Subscribe(subPacket); if (suback != nullptr) { fprintf(stdout, "Subscription Success.\n"); @@ -144,8 +144,8 @@ int main(int argc, char *argv[]) ByteCursor payload = ByteCursorFromString(message); Mqtt5::PublishPacket publish(testTopic, payload, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); - client->Publish(publish).get_future().wait(); - ++publishedCount; + if(client->Publish(publish) != nullptr) + ++publishedCount; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } From 4833ba5224e9b1700e39be7d76cbe136bf4a3b9e Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Thu, 1 Sep 2022 10:08:10 -0700 Subject: [PATCH 16/51] update samples with latest api changes --- samples/mqtt5/mqtt5_pubsub/main.cpp | 141 ++++++++++++++++------------ 1 file changed, 82 insertions(+), 59 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 1c0e01698..7283986b2 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -39,48 +39,56 @@ int main(int argc, char *argv[]) cmdUtils.StartLoggingBasedOnCommand(&apiHandle); // Create a Client using Mqtt5ClientBuilder - Aws::Iot::Mqtt5ClientBuilder builder( + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath( cmdUtils.GetCommand("endpoint"), cmdUtils.GetCommand("cert").c_str(), cmdUtils.GetCommand("key").c_str()); + Aws::Iot::Mqtt5CustomAuthConfig authconfig; + authconfig.WithAuthrizaerName("SdkTestingAuthorizerNoSigning2") + .WithUsername("Derp") + .WithPassword(ByteCursorFromCString("test")); + // Setup connection options std::shared_ptr connectOptions = std::make_shared(); // Get the client ID to send with the connection String clientId = cmdUtils.GetCommandOrDefault("client_id", String("test-") + Aws::Crt::UUID().ToString()); connectOptions->withClientId(clientId); - builder.withConnectOptions(connectOptions); + builder->withConnectOptions(connectOptions); + builder->WithCustomAuthorizer(authconfig); std::promise connectionPromise; std::promise stoppedPromise; std::promise disconnectPromise; + std::promise subscribeSuccess; + // Setup lifecycle callbacks - builder.onConnectionSuccess = [&connectionPromise]( - Mqtt5::Mqtt5Client &, - std::shared_ptr, - std::shared_ptr settings) { + builder->withClientConnectionSuccessCallback([&connectionPromise]( + std::shared_ptr, + std::shared_ptr, + std::shared_ptr settings) { fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); connectionPromise.set_value(true); - }; + }); - builder.onConnectionFailure = - [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { + builder->withClientConnectionFailureCallback( + [&connectionPromise]( + std::shared_ptr, int error_code, std::shared_ptr) { fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); connectionPromise.set_value(false); - }; + }); - builder.onStopped = [&stoppedPromise](Aws::Crt::Mqtt5::Mqtt5Client &) { + builder->withClientStoppedCallback([&stoppedPromise](std::shared_ptr) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); - }; + }); - builder.onAttemptingConnect = [](Aws::Crt::Mqtt5::Mqtt5Client &) { - fprintf(stdout, "Mqtt5 Client attempting connection...\n"); - }; + builder->withClientAttemptingConnectCallback( + [](std::shared_ptr) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); - builder.onDisconnection = [&disconnectPromise]( - Aws::Crt::Mqtt5::Mqtt5Client &, - int errorCode, - std::shared_ptr packet_disconnect) { + builder->withClientDisconnectionCallback([&disconnectPromise]( + std::shared_ptr, + int errorCode, + std::shared_ptr packet_disconnect) { if (errorCode == 0) { fprintf(stdout, "Mqtt5 Client disconnected.\n"); @@ -90,30 +98,29 @@ int main(int argc, char *argv[]) fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(errorCode)); } disconnectPromise.set_value(); - }; + }); - ; + builder->withPublishReceivedCallback( + [&receiveMutex, &receivedCount, &receiveSignal]( + std::shared_ptr /*client*/, std::shared_ptr publish) { + if (publish == nullptr) + return; - builder.onPublishReceived = [&receiveMutex, &receivedCount, &receiveSignal]( - Mqtt5::Mqtt5Client & /*client*/, std::shared_ptr publish) { - if (publish == nullptr) - return; + std::lock_guard lock(receiveMutex); + ++receivedCount; + fprintf(stdout, "Publish received on topic %s:", publish->getTopic().c_str()); + fwrite(publish->getPayload().ptr, 1, publish->getPayload().len, stdout); + fprintf(stdout, "\n"); - std::lock_guard lock(receiveMutex); - ++receivedCount; - fprintf(stdout, "Publish received on topic %s:", publish->getTopic().c_str()); - fwrite(publish->getPayload().ptr, 1, publish->getPayload().len, stdout); - fprintf(stdout, "\n"); - - for (Mqtt5::UserProperty prop : publish->getUserProperties()) - { - fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); - } - receiveSignal.notify_all(); - }; + for (Mqtt5::UserProperty prop : publish->getUserProperties()) + { + fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); + } + receiveSignal.notify_all(); + }); // Create Mqtt5Client - std::shared_ptr client = builder.Build(); + std::shared_ptr client = builder->Build(); if (client == nullptr) { @@ -130,36 +137,52 @@ int main(int argc, char *argv[]) Mqtt5::Subscription sub1(testTopic, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); sub1.withNoLocal(false); - Mqtt5::SubscribePacket subPacket; - subPacket.withSubscription(std::move(sub1)); - std::shared_ptr suback = client->Subscribe(subPacket); - if (suback != nullptr) + std::shared_ptr subPacket = std::make_shared(); + subPacket->withSubscription(std::move(sub1)); + if (client->Subscribe( + subPacket, + [&subscribeSuccess]( + std::shared_ptr, int error_code, std::shared_ptr) { + if (error_code == 0) + { + subscribeSuccess.set_value(true); + } + else + { + subscribeSuccess.set_value(false); + } + })) { - fprintf(stdout, "Subscription Success.\n"); - - uint32_t publishedCount = 0; - while (publishedCount < messageCount) + if (subscribeSuccess.get_future().get() == true) { - String message = String("Mqtt5 Publish Message: ") + std::to_string(publishedCount).c_str(); - ByteCursor payload = ByteCursorFromString(message); - Mqtt5::PublishPacket publish(testTopic, payload, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); - if(client->Publish(publish) != nullptr) - ++publishedCount; + fprintf(stdout, "Subscription Success.\n"); - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - } + uint32_t publishedCount = 0; + while (publishedCount < messageCount) + { + String message = String("Mqtt5 Publish Message: ") + std::to_string(publishedCount).c_str(); + ByteCursor payload = ByteCursorFromString(message); + + std::shared_ptr publish = std::make_shared( + testTopic, payload, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + if (client->Publish(publish)) + ++publishedCount; - std::unique_lock receivedLock(receiveMutex); - receiveSignal.wait(receivedLock, [&] { return receivedCount >= messageCount; }); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + } + + std::unique_lock receivedLock(receiveMutex); + receiveSignal.wait(receivedLock, [&] { return receivedCount >= messageCount; }); + } + else + { + fprintf(stdout, "Subscription Failed.\n"); + } } else { fprintf(stdout, "Subscription Failed.\n"); - for (int errorCode : suback->getReasonCodes()) - { - fprintf(stdout, "Mqtt5 Client subscription failed with error: %s.\n", aws_error_debug_str(errorCode)); - } } if (!client->Stop()) From 1a35d6723cf61ab01cecc3f085163c53d1dfa741 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Thu, 1 Sep 2022 16:55:42 -0700 Subject: [PATCH 17/51] update sample to the latest sdk changes --- samples/mqtt5/mqtt5_pubsub/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 7283986b2..98ababe4e 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "../../utils/CommandLineUtils.h" @@ -63,7 +64,7 @@ int main(int argc, char *argv[]) // Setup lifecycle callbacks builder->withClientConnectionSuccessCallback([&connectionPromise]( - std::shared_ptr, + Mqtt5::Mqtt5Client&, std::shared_ptr, std::shared_ptr settings) { fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); @@ -71,22 +72,24 @@ int main(int argc, char *argv[]) }); builder->withClientConnectionFailureCallback( - [&connectionPromise]( - std::shared_ptr, int error_code, std::shared_ptr) { + [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) + { fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); connectionPromise.set_value(false); }); - builder->withClientStoppedCallback([&stoppedPromise](std::shared_ptr) { + builder->withClientStoppedCallback( + [&stoppedPromise](Mqtt5::Mqtt5Client &) + { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); }); - builder->withClientAttemptingConnectCallback( - [](std::shared_ptr) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client&) + { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); builder->withClientDisconnectionCallback([&disconnectPromise]( - std::shared_ptr, + Mqtt5::Mqtt5Client &, int errorCode, std::shared_ptr packet_disconnect) { if (errorCode == 0) From 7ca93e092822a8cecbef3dc778248a967dc9a559 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Fri, 2 Sep 2022 08:45:23 -0700 Subject: [PATCH 18/51] remove customer auth --- samples/mqtt5/mqtt5_pubsub/main.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 98ababe4e..600a164e6 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -43,23 +43,16 @@ int main(int argc, char *argv[]) Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath( cmdUtils.GetCommand("endpoint"), cmdUtils.GetCommand("cert").c_str(), cmdUtils.GetCommand("key").c_str()); - Aws::Iot::Mqtt5CustomAuthConfig authconfig; - authconfig.WithAuthrizaerName("SdkTestingAuthorizerNoSigning2") - .WithUsername("Derp") - .WithPassword(ByteCursorFromCString("test")); - // Setup connection options std::shared_ptr connectOptions = std::make_shared(); // Get the client ID to send with the connection String clientId = cmdUtils.GetCommandOrDefault("client_id", String("test-") + Aws::Crt::UUID().ToString()); connectOptions->withClientId(clientId); builder->withConnectOptions(connectOptions); - builder->WithCustomAuthorizer(authconfig); std::promise connectionPromise; std::promise stoppedPromise; std::promise disconnectPromise; - std::promise subscribeSuccess; // Setup lifecycle callbacks From 131590b5dc4b6334c7992be7c137812ef0ecbd9b Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 12:24:23 -0700 Subject: [PATCH 19/51] add mqtt5 readme --- README_MQTT5.md | 239 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 README_MQTT5.md diff --git a/README_MQTT5.md b/README_MQTT5.md new file mode 100644 index 000000000..5b81766bf --- /dev/null +++ b/README_MQTT5.md @@ -0,0 +1,239 @@ +# MQTT5 +The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to + +## Initialize the Client + +To access the AWS IoT service, you can create a `Mqtt5Client` usng `Mqtt5ClientBuilder` in which you initialize the client depends on the connection type (MQTT5 or MQTT5 over WebSocket) and authentication type you choose. The `Mqtt5ClientBuilder` will setup the client options and create a `Mqtt5Client` for you. + +* Initialize the Client with MTLS: +For MQTT5 client, the AWS IoT service requires TLS mutual authentication. +The following examples showed how to create a client with a valid client certificate (X.509) and key. You can use the [AWS IoT console][aws-iot-console] or the AWS command line tools to generate certificates and keys. + +``` +// use value returned by describe-endpoint --endpoint-type "iot:Data-ATS" +Crt::String clientEndpoint = "-ats.iot..amazonaws.com"; +// X.509 based certificate file +const char* certificateFilePath = ""; +// PKCS#1 or PKCS#8 PEM encoded private key file +const char* privateKeyFilePath = ""; + +// Create a Client using Mqtt5ClientBuilder +Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath( + clientEndpoint, certificateFilePath, privateKeyFilePath); + +/* You can setup other client options and callbacks before call builder->Build(). Once the the client get created, you could no longer update the client options or connection options. + +// Build Mqtt5Client +std::shared_ptr client = builder->Build(); + +if (client == nullptr) +{ + fprintf(stdout, "Client creation failed.\n"); + return -1; +} + +``` + + +* Initialize the Client with MQTT Over WebSocket: + +``` +// use value returned by describe-endpoint --endpoint-type "iot:Data-ATS" +Crt::String clientEndpoint = "-ats.iot..amazonaws.com"; +// X.509 based certificate file +const char* certificateFilePath = ""; +// PKCS#1 or PKCS#8 PEM encoded private key file +const char* privateKeyFilePath = ""; +// The signing region. e.x.: 'us-east-1' +const char* signing_region = ''; + +// Create websocket configuration +Aws::Crt::Auth::CredentialsProviderChainDefaultConfig defaultConfig; +std::shared_ptr provider = Aws::Crt::Auth::CredentialsProvider::CreateCredentialsProviderChainDefault(defaultConfig); +if (!provider) +{ + fprintf(stderr, "Failure to create credentials provider!\n"); + exit(-1); +} +Aws::Iot::WebsocketConfig websocketConfig(signing_region, provider); + +// Create a Client using Mqtt5ClientBuilder +Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWebsocket( + clientEndpoint, websocketConfig); + +/* You can setup other client options and callbacks before call builder->Build(). Once the the client get created, you could no longer update the client options or connection options. + +// Build Mqtt5Client +std::shared_ptr client = builder->Build(); + +if (client == nullptr) +{ + fprintf(stdout, "Client creation failed.\n"); + return -1; +} +``` + +## Start & Stop Client connection Session +After build the Mqtt5Client, you can start/stop a MQTT5 connection session as you needed. Mqtt5Client was designed with a async manner. We use callbacks to track life cycle status of the Mqtt5Client. + +``` +// Create Mqtt5ClientBulder + +std::promise connectionPromise; +std::promise stoppedPromise; + +// Setup lifecycle callbacks +builder->withClientConnectionSuccessCallback([&connectionPromise]( + Mqtt5::Mqtt5Client&, + std::shared_ptr, + std::shared_ptr settings) { + fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); + connectionPromise.set_value(true); +}); + +builder->withClientConnectionFailureCallback( + [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) + { + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); + connectionPromise.set_value(false); + }); + +builder->withClientStoppedCallback( + [&stoppedPromise](Mqtt5::Mqtt5Client &) + { + fprintf(stdout, "Mqtt5 Client stopped.\n"); + stoppedPromise.set_value(); +}); + +// Build Mqtt5Client +std::shared_ptr client = builder->Build(); + +if (client == nullptr) +{ + fprintf(stdout, "Client creation failed.\n"); + return -1; +} + +if (!client->Start()) +{ + fprintf("Failed start Mqtt5 client"); + return -1; +} + +// Waiting for ConnAck from the server +if (connectionPromise.get_future().get() == false) +{ + fprintf("Connection failed."); +} + +if (!client->Stop()) +{ + fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); + return -1; +} +// Wait for client shutdown +disconnectPromise.get_future().wait(); + +``` + + +## Publish and Subscribe + +After the Mqtt5Client setup and started, you can publish messages and subscribe +to topics. + +* To publish a message: + +``` + +Crt::String testTopic = "my/own/topic"; +Crt::String message_string = "any payload"; + +ByteCursor payload = ByteCursorFromString(message_string); + +// Create PublishPacket. +std::shared_ptr publish = std::make_shared(testTopic, payload, QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + +// Setup publish completion callback. The callback will get triggered when the pulbish completes and publish result returned from the server +OnPublishCompletionHandler callback = [](std::shared_ptr client, int, std::shared_ptr result){ + if(!result->wasSuccessful()) + { + fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); + } + else + { + fprintf(stdout, "Publish Succeed."); + } +}; + +if(!client->Publish(publish, std::move(callback))) +{ + fprintf(stdout, "Publish Operation Failed.\n"); + return -1; +} + +``` + +* To subscribe to a topic: + +``` + +// Create multiple subscription data. With the Mqtt5 API, we can subscribe multiple topics at once. +Subscription data1(); +data1.withNoLocal(false).withTopicFilter("test/topic/test1"); +Subscription data2(); +data2.withTopicFilter("test/topic/test2"); +Subscription data3(); +data3.withTopicFilter("test/topic/test3"); + +Vector subscriptionList; +subscriptionList.push_back(data1); +subscriptionList.push_back(data2); +subscriptionList.push_back(data3); + +// Creaet a SubscribePacket with the subscription list. You can also use packet->withSubscription(subscription) to push_back a single subscription data. +std::shared_ptr packet = std::make_shared(); +packet->withSubscriptions(subscriptionList); + +bool subSuccess = mqtt5Client->Subscribe( + packet, + [](std::shared_ptr, int, std::shared_ptr suback) + { + for (auto code : suback->getReasonCodes()) + { + std::cout << "Get suback with codes: " << code << std::endl; + if (code > Mqtt5::SubAckReasonCode::AWS_MQTT5_SARC_GRANTED_QOS_2) + { + std::cout << "Subscription Succeed." << std::endl; + } + else + { + std::cout << "Subscription Failed." << std::endl; + } + } + }); + +if (!subSuccess) +{ + std::cout << "[ERROR]Subscription Failed." << std::endl; + if (mqtt5Client->Stop()) + { + stoppedPromise.get_future().get(); + } + else + { + std::cout << "[ERROR]Failed to stop the client " << std::endl; + } + return -1; +} + +``` + + +*Note*: all operations (publish, subscribe, unsubscribe) will not timeout unless +you define a timeout when performing the operation. If no timeout is defined, then +a value of 0 is used, meaning the operation will never timeout and, in rare cases, +wait forever for the server to respond and block the calling thread indefinitely. +It is recommended to set a timeout for QoS1 operations if your application expects +responses within a fixed duration or if there is the possibility the server you are +communicating with may not respond. From 7a1d5563a237e5594a177c0f3a9246ebfbc50571 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 12:28:41 -0700 Subject: [PATCH 20/51] remove timeout explanation --- README_MQTT5.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README_MQTT5.md b/README_MQTT5.md index 5b81766bf..e70ebf62f 100644 --- a/README_MQTT5.md +++ b/README_MQTT5.md @@ -1,5 +1,5 @@ # MQTT5 -The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to +The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to < link to MQTT5 samples > ## Initialize the Client @@ -228,12 +228,3 @@ if (!subSuccess) } ``` - - -*Note*: all operations (publish, subscribe, unsubscribe) will not timeout unless -you define a timeout when performing the operation. If no timeout is defined, then -a value of 0 is used, meaning the operation will never timeout and, in rare cases, -wait forever for the server to respond and block the calling thread indefinitely. -It is recommended to set a timeout for QoS1 operations if your application expects -responses within a fixed duration or if there is the possibility the server you are -communicating with may not respond. From 8067e0b30877c45841744e1f1816d69e836aa1fc Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:02:44 -0700 Subject: [PATCH 21/51] add unsubescribe sample code --- README_MQTT5.md | 73 +++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/README_MQTT5.md b/README_MQTT5.md index e70ebf62f..f259c2056 100644 --- a/README_MQTT5.md +++ b/README_MQTT5.md @@ -1,5 +1,5 @@ # MQTT5 -The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to < link to MQTT5 samples > +The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to < MQTT5 sample link > and < API Documentation link > ## Initialize the Client @@ -64,9 +64,9 @@ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5Cl /* You can setup other client options and callbacks before call builder->Build(). Once the the client get created, you could no longer update the client options or connection options. // Build Mqtt5Client -std::shared_ptr client = builder->Build(); +std::shared_ptr mqtt5Client = builder->Build(); -if (client == nullptr) +if (mqtt5Client == nullptr) { fprintf(stdout, "Client creation failed.\n"); return -1; @@ -108,13 +108,13 @@ builder->withClientStoppedCallback( // Build Mqtt5Client std::shared_ptr client = builder->Build(); -if (client == nullptr) +if (mqtt5Client == nullptr) { fprintf(stdout, "Client creation failed.\n"); return -1; } -if (!client->Start()) +if (!mqtt5Client->Start()) { fprintf("Failed start Mqtt5 client"); return -1; @@ -126,7 +126,7 @@ if (connectionPromise.get_future().get() == false) fprintf("Connection failed."); } -if (!client->Stop()) +if (!mqtt5Client->Stop()) { fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); return -1; @@ -139,8 +139,7 @@ disconnectPromise.get_future().wait(); ## Publish and Subscribe -After the Mqtt5Client setup and started, you can publish messages and subscribe -to topics. +After the Mqtt5Client get setup and started, you can perform publish, subscribe and unsubscribe oprations. * To publish a message: @@ -166,7 +165,7 @@ OnPublishCompletionHandler callback = [](std::shared_ptr client, in } }; -if(!client->Publish(publish, std::move(callback))) +if(!mqtt5Client->Publish(publish, std::move(callback))) { fprintf(stdout, "Publish Operation Failed.\n"); return -1; @@ -174,7 +173,7 @@ if(!client->Publish(publish, std::move(callback))) ``` -* To subscribe to a topic: +* To subscribe to topics: ``` @@ -197,34 +196,42 @@ packet->withSubscriptions(subscriptionList); bool subSuccess = mqtt5Client->Subscribe( packet, - [](std::shared_ptr, int, std::shared_ptr suback) - { + [](std::shared_ptr, int, std::shared_ptr suback){ for (auto code : suback->getReasonCodes()) { - std::cout << "Get suback with codes: " << code << std::endl; - if (code > Mqtt5::SubAckReasonCode::AWS_MQTT5_SARC_GRANTED_QOS_2) - { - std::cout << "Subscription Succeed." << std::endl; - } - else - { - std::cout << "Subscription Failed." << std::endl; - } + fprintf(stdout, "Get suback from server with code: %d \n", code ); } }); -if (!subSuccess) -{ - std::cout << "[ERROR]Subscription Failed." << std::endl; - if (mqtt5Client->Stop()) - { - stoppedPromise.get_future().get(); - } - else - { - std::cout << "[ERROR]Failed to stop the client " << std::endl; - } - return -1; +if (!subSuccess){ + fprintf(stdout, "Failed to perform subscribe operation on client." ); +} + +``` + +* To unsubscribe to topics: + + Similar to subscribe operation, you can unsubscribe from multiple topics. + +``` +String topic1 = "test/topic/test1"; +String topic2 = "test/topic/test2"; +Vector topics; +topics.push_back(topic1); +topics.push_back(topic2); +std::shared_ptr unsub = std::make_shared(); +unsub->withTopicFilters(topics); +bool unsubSuccess = mqtt5Client->Unsubscribe( + packet, + [](std::shared_ptr, int, std::shared_ptr unsuback){ + for (auto code : unsuback->getReasonCodes()) + { + fprintf(stdout, "Get unsuback from server with code: %d \n", code ); + } + }); + +if (!unsubSuccess){ + fprintf(stdout, "Failed to perform subscribe operation on client." ); } ``` From 8e1a4ed67b477fb494adfbc9f90b312b29843a48 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:20:08 -0700 Subject: [PATCH 22/51] add puback completion callback --- samples/mqtt5/mqtt5_pubsub/main.cpp | 55 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 600a164e6..2ff887f10 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -81,20 +81,13 @@ int main(int argc, char *argv[]) builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client&) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); - builder->withClientDisconnectionCallback([&disconnectPromise]( - Mqtt5::Mqtt5Client &, - int errorCode, - std::shared_ptr packet_disconnect) { - if (errorCode == 0) + builder->withClientDisconnectionCallback( + [&disconnectPromise]( + Mqtt5::Mqtt5Client &, int errorCode, std::shared_ptr packet_disconnect) { - fprintf(stdout, "Mqtt5 Client disconnected.\n"); - } - else - { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(errorCode)); - } - disconnectPromise.set_value(); - }); + fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(errorCode)); + disconnectPromise.set_value(); + }); builder->withPublishReceivedCallback( [&receiveMutex, &receivedCount, &receiveSignal]( @@ -138,22 +131,32 @@ int main(int argc, char *argv[]) if (client->Subscribe( subPacket, [&subscribeSuccess]( - std::shared_ptr, int error_code, std::shared_ptr) { - if (error_code == 0) - { - subscribeSuccess.set_value(true); - } - else - { - subscribeSuccess.set_value(false); - } - })) + std::shared_ptr, int error_code, std::shared_ptr) + { subscribeSuccess.set_value(error_code == 0); })) { + // Waiting for subscription completed. if (subscribeSuccess.get_future().get() == true) { fprintf(stdout, "Subscription Success.\n"); + // Setup publish completion callback. The callback will get triggered when the pulbish completes (when + // the client received the PubAck from the server). + Aws::Crt::Mqtt5::OnPublishCompletionHandler callback = + [](std::shared_ptr client, + int, + std::shared_ptr result) + { + if (!result->wasSuccessful()) + { + fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); + } + else + { + fprintf(stdout, "Publish Succeed."); + }; + }; + uint32_t publishedCount = 0; while (publishedCount < messageCount) { @@ -162,7 +165,7 @@ int main(int argc, char *argv[]) std::shared_ptr publish = std::make_shared( testTopic, payload, Mqtt5::QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); - if (client->Publish(publish)) + if (client->Publish(publish, std::move(callback))) ++publishedCount; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); @@ -173,12 +176,12 @@ int main(int argc, char *argv[]) } else { - fprintf(stdout, "Subscription Failed.\n"); + fprintf(stdout, "Subscription failed. Please check the SubAck packet for details.\n"); } } else { - fprintf(stdout, "Subscription Failed.\n"); + fprintf(stdout, "Subscribe operation failed on client.\n"); } if (!client->Stop()) From 09aa2fd2e7146afc6132997fe769e58c0aded871 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:23:14 -0700 Subject: [PATCH 23/51] automated clang-format fix --- .github/workflows/lint.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7371147b1..fa605c4b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,3 +20,11 @@ jobs: with: # List of extensions to check extensions: cpp,h + inplace: True + - uses: EndBug/add-and-commit@v4 + with: + author_name: xiazhvera + author_email: zhvxia@amazon.com + message: 'Committing clang-format changes' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7d1bad31f2c8c968494ed24a5782793014f75c38 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:34:31 -0700 Subject: [PATCH 24/51] update format --- samples/mqtt5/mqtt5_pubsub/main.cpp | 42 +++++++++++++---------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 2ff887f10..f1b5b02b9 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -4,8 +4,8 @@ */ #include #include -#include #include +#include #include "../../utils/CommandLineUtils.h" @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) // Setup lifecycle callbacks builder->withClientConnectionSuccessCallback([&connectionPromise]( - Mqtt5::Mqtt5Client&, + Mqtt5::Mqtt5Client &, std::shared_ptr, std::shared_ptr settings) { fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); @@ -65,26 +65,22 @@ int main(int argc, char *argv[]) }); builder->withClientConnectionFailureCallback( - [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) - { + [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); connectionPromise.set_value(false); }); - builder->withClientStoppedCallback( - [&stoppedPromise](Mqtt5::Mqtt5Client &) - { + builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); }); - builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client&) - { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + builder->withClientAttemptingConnectCallback( + [](Mqtt5::Mqtt5Client&) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); builder->withClientDisconnectionCallback( [&disconnectPromise]( - Mqtt5::Mqtt5Client &, int errorCode, std::shared_ptr packet_disconnect) - { + Mqtt5::Mqtt5Client &, int errorCode, std::shared_ptr packet_disconnect) { fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(errorCode)); disconnectPromise.set_value(); }); @@ -131,8 +127,9 @@ int main(int argc, char *argv[]) if (client->Subscribe( subPacket, [&subscribeSuccess]( - std::shared_ptr, int error_code, std::shared_ptr) - { subscribeSuccess.set_value(error_code == 0); })) + std::shared_ptr, int error_code, std::shared_ptr) { + subscribeSuccess.set_value(error_code == 0); + })) { // Waiting for subscription completed. if (subscribeSuccess.get_future().get() == true) @@ -145,17 +142,16 @@ int main(int argc, char *argv[]) Aws::Crt::Mqtt5::OnPublishCompletionHandler callback = [](std::shared_ptr client, int, - std::shared_ptr result) - { - if (!result->wasSuccessful()) - { - fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); - } - else - { - fprintf(stdout, "Publish Succeed."); + std::shared_ptr result) { + if (!result->wasSuccessful()) + { + fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); + } + else + { + fprintf(stdout, "Publish Succeed."); + }; }; - }; uint32_t publishedCount = 0; while (publishedCount < messageCount) From 84afab882aca46d9de0be494311f1ba3b950b558 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:34:34 -0700 Subject: [PATCH 25/51] Revert "automated clang-format fix" This reverts commit 09aa2fd2e7146afc6132997fe769e58c0aded871. --- .github/workflows/lint.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fa605c4b2..7371147b1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,11 +20,3 @@ jobs: with: # List of extensions to check extensions: cpp,h - inplace: True - - uses: EndBug/add-and-commit@v4 - with: - author_name: xiazhvera - author_email: zhvxia@amazon.com - message: 'Committing clang-format changes' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e24d156b8800139e56f2ea370881d6f85b565053 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:37:02 -0700 Subject: [PATCH 26/51] update format --- samples/mqtt5/mqtt5_pubsub/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index f1b5b02b9..df4195c96 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) }); builder->withClientAttemptingConnectCallback( - [](Mqtt5::Mqtt5Client&) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + [](Mqtt5::Mqtt5Client &) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); builder->withClientDisconnectionCallback( [&disconnectPromise]( From d83decbe9ab696ab00bb308a39b92291f15e1e56 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 15:52:39 -0700 Subject: [PATCH 27/51] add mqtt5 sample to CI --- .builder/actions/build_samples.py | 1 + .github/workflows/ci.yml | 47 ++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.builder/actions/build_samples.py b/.builder/actions/build_samples.py index ec7d6942b..5de4307d9 100644 --- a/.builder/actions/build_samples.py +++ b/.builder/actions/build_samples.py @@ -25,6 +25,7 @@ def run(self, env): 'samples/mqtt/windows_cert_connect', 'samples/mqtt/x509_credentials_provider_connect', 'samples/mqtt/custom_authorizer_connect', + 'samples/mqtt5/mqtt5_pubsub', "samples/pub_sub/basic_pub_sub", "samples/pub_sub/cycle_pub_sub", 'samples/secure_tunneling/secure_tunnel', diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d99d46e0..948c83fd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} - + linux-compiler-compat: runs-on: ubuntu-latest @@ -171,14 +171,18 @@ jobs: with: role-to-assume: ${{ env.CI_PUBSUB_ROLE }} aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample + - name: run MQTT3 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '.\aws-iot-device-sdk-cpp-v2\build\samples\pub_sub\basic_pub_sub\RelWithDebInfo\basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}\mqtt\windows_cert_connect\RelWithDebInfo\windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -186,7 +190,7 @@ jobs: aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run DeviceAdvisor run: | - cd ${{ env.CI_FOLDER }}\aws-iot-device-sdk-cpp-v2 + cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py windows-vs14: @@ -215,11 +219,15 @@ jobs: - name: run PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '.\aws-iot-device-sdk-cpp-v2\build\samples\pub_sub\basic_pub_sub\RelWithDebInfo\basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}\mqtt\windows_cert_connect\RelWithDebInfo\windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -227,7 +235,7 @@ jobs: aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run DeviceAdvisor run: | - cd ${{ env.CI_FOLDER }}\aws-iot-device-sdk-cpp-v2 + cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py windows-no-cpu-extensions: @@ -252,11 +260,15 @@ jobs: - name: run PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '.\aws-iot-device-sdk-cpp-v2\build\samples\pub_sub\basic_pub_sub\RelWithDebInfo\basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}\mqtt\windows_cert_connect\RelWithDebInfo\windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -264,7 +276,7 @@ jobs: aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run DeviceAdvisor run: | - cd ${{ env.CI_FOLDER }}\aws-iot-device-sdk-cpp-v2 + cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py windows-app-verifier: @@ -290,7 +302,7 @@ jobs: run: | cd ${{ env.CI_FOLDER }} echo "Starting to run AppVerifier with cycle pub-sub sample" - python ${{ env.CI_UTILS_FOLDER }}\appverifier_launch_sample.py --sample_file "${{ env.CI_SAMPLES_FOLDER }}\pub_sub\cycle_pub_sub\RelWithDebInfo\cycle-pub-sub.exe" --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/CyclePubSub/cert' --sample_secret_private_key 'ci/CyclePubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/appverifier_launch_sample.py --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/cycle_pub_sub/RelWithDebInfo/cycle-pub-sub.exe" --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/CyclePubSub/cert' --sample_secret_private_key 'ci/CyclePubSub/key' osx: runs-on: macos-latest @@ -316,7 +328,10 @@ jobs: aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run PubSub sample run: | - python3 ./aws-iot-device-sdk-cpp-v2/utils/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample + run: | + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -350,6 +365,9 @@ jobs: - name: run PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample + run: | + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -405,6 +423,9 @@ jobs: - name: run Basic Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: run MQTT5 PubSub sample + run: | + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' From d0f9927cb542eb318147214c52d5ad471546c4b1 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 3 Nov 2022 16:18:50 -0700 Subject: [PATCH 28/51] change mqtt5 pubsub sample name to make it consistent to other samples --- .github/workflows/ci.yml | 12 ++++++------ samples/mqtt5/mqtt5_pubsub/main.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 948c83fd7..d1e288f5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,7 +178,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -223,7 +223,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -264,7 +264,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -331,7 +331,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -367,7 +367,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -425,7 +425,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index df4195c96..c15e37fdd 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) /*********************** Parse Arguments ***************************/ Utils::CommandLineUtils cmdUtils = Utils::CommandLineUtils(); - cmdUtils.RegisterProgramName("mqtt5_pubsub"); + cmdUtils.RegisterProgramName("mqtt5-pubsub"); cmdUtils.AddCommonMQTTCommands(); cmdUtils.RegisterCommand("key", "", "Path to your key in PEM format."); cmdUtils.RegisterCommand("cert", "", "Path to your client certificate in PEM format."); From bcb5eb966554c01a59545bfcf530ae453158ceef Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 7 Nov 2022 17:27:23 -0800 Subject: [PATCH 29/51] add MQTT5 readme --- MQTT5.md | 612 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 612 insertions(+) create mode 100644 MQTT5.md diff --git a/MQTT5.md b/MQTT5.md new file mode 100644 index 000000000..3d58db4f2 --- /dev/null +++ b/MQTT5.md @@ -0,0 +1,612 @@ +# MQTT 5 + + +## Developer Preview Disclaimer + +MQTT5 support is currently in **developer preview**. We encourage feedback at all times, but feedback during the preview window is especially valuable in shaping the final product. During the preview period we may make backwards-incompatible changes to the public API, but in general, this is something we will try our best to avoid. + + +The MQTT5 client cannot yet be used with the AWS IoT MQTT services (Shadow, Jobs, Identity). This is a shortcoming that we hope to address in the near future. + +## Introduction + +This user guide is designed to act as a reference and guide for how to use MQTT5 with the CPP SDK, covering what MQTT5 is and some essential knowledge required to effectively use of MQTT5 within the CPP SDK. + +This guide also includes code snippets for how to make a MQTT5 client with proper configuration, how to connect to AWS IoT Core, how to perform operations and interact with AWS IoT Core through MQTT5, and some best practices for MQTT5. + +The goal of this guide is to provide a basic understanding of MQTT5 and how to leverage the CPP SDK to use MQTT5 for your IoT application. + +If you are completely new to MQTT, it is highly recommended to read through the section to learn more about what MQTT is and what the terms used throughout this document mean. If you are experienced with MQTT, feel free to skip ahead to the section to jump right into the implementation specifics with code snippets showing how to use MQTT5 within the CPP SDK. + + +## Concepts + +### What is MQTT + +MQTT is a message protocol often used for IoT devices thanks to its smaller bandwidth cost, its defined spec, and relatively low complexity compared to something like HTTP. MQTT5 is the latest version of MQTT protocol with additional features, like user properties, and developer enhancements, like better error logging, that make developing a MQTT application easier and more powerful. + +*Please note that this document does not include the whole MQTT protocol* and only covers the basic essential MQTT concepts to aid in the understanding and usage of the CPP SDK API. In the Further Reading section there are links to documentation that covers the MQTT protocol in more detail. + +### MQTT Knowledge Essentials + +MQTT is a message protocol, but what does that mean? Simply put, MQTT is a way for a device on one network to send information to a device on another networking using an agreed upon set of rules and protocols. This information is sent through what is called *Packets*, which is data formatted in a specific way so the receiver knows how to parse it and extract the data contained within. The data within a packet is often referred to as the *payload*. + +The concepts section will cover the most important aspects of MQTT relative to its usage in the CPP SDK in the sections below. The first thing that needs to be covered are the two main types of devices on the internet with MQTT: + +**Servers** and **Clients**: + +* **Server** (interchangeably referred to as *Brokers*): where MQTT packets are sent and processed. A single server can process many packets and have many different MQTT clients (see below) at once. A server may both send and receive packets from one or more clients. + * Servers can perform many different operations with packets depending on the data within, the Quality of Service level (also known as “QoS”), and the topic the packets are being sent to. The server will process incoming packets to determine whether to forward the packet to subscribers (clients who have subscribed to the topic in the packet) and/or responding to the client that sent the packet with an acknowledgement packet. + * AWS IoT Core is a service that provides a MQTT5 server, which devices can connect to and send packets to and from. AWS IoT Core also has services that, when packets are sent to, will invoke certain operations and other services. +* **Client**: what sends and receives packets from the server. A client connects by sending a Connect Packet with information on who the client is, as well as often including authorization data. Upon connecting successfully, an MQTT client can subscribe and unsubscribe from topics, send and receive Publish Packets to topics and from topics it is subscribed to, as well as disconnect and reconnect. + +In general, you will be working on writing code that makes a MQTT5 client and sends data to the server when certain operations happen, to report data from the device, to respond to data sent from the server or another client whose topic the client is subscribed to (more on subscriptions below), or otherwise react based on the packets being sent and received. Because of this, this document will be focusing the majority of the information on the client side of things, rather than the server. + +(*Implementer note*: Link “subscriptions below” to the correct section in the Markdown when adding to GitHub.) + + +**Terminology and Relationship** + +The connection process for MQTT is different than connection process for a *Client/Server* paradigm. The process to connect in MQTT requires both a *Connection* and a *Session*, in addition to a *Client*. This can be confusing as they have similar functionalities. Below are the rough definitions for each concept: + +* **Client**: Manages the Connection and the Session. A client contains all the information needed to connect to a MQTT server, as well as the interface to use for performing operations. + * Operations are described further below in the operations section. + * (**Implementer note**: Link “operations section” to the section in the Markdown when adding to GitHub.) +* **Connection**: Directly handles packets and communicating with the MQTT server via sockets. The connection is where the MQTT operations are directly performed at. The connection also handles keeping the client connected by responding to PING requests from the server, as well as tracking operations and their timeouts. + * The MQTT client creates a connection. Connections cannot exist without a client. +* **Session**: The period of time where a client is connected to a MQTT server and is able to perform operations. A session ends when the MQTT client is disconnected, shutdown, or otherwise destroyed. + * Sessions exist only when there is a client and connection, and the connection is actively connected to a MQTT server. + +In the CPP SDK, the terminology isn’t quite as important as some MQTT implementations because *in MQTT5 a client can only have a single Connection and Session.* However, it is important to know the terms and what each part means when MQTT5 is discussed. All of your code will interact solely with the MQTT5 client, so if you are unsure, just remember the MQTT5 client is what your code interacts with. + +* Note that in MQTT 3.1.1, often referred to simply as “MQTT” in the CPP SDK code, there are some fundamental differences compared to MQTT5. A few of these differences are listed below: + * In the MQTT 3.1.1 client, the MQTT connection is where your code interacts to perform MQTT operations. In MQTT5, the code instead performs all operations through the MQTT5 client. + * In the MQTT 3.1.1 client, you can have multiple MQTT connections (and by extension, sessions) per MQTT 3.1.1 client. In MQTT5, each MQTT5 client has only a single connection and session. In MQTT5 you can use multiple clients each with their own connection. + * In the MQTT 3.1.1 client, when you subscribe to a topic it adds it to a topic tree so when a publish packet comes in, per-topic callbacks will be invoked. In MQTT5, there is not a topic tree, and instead all subscriptions will invoke the same callback when a publish packet comes in. + + +Additionally, there is some further terms that are important to define in relation to making a connection with MQTT: + +* **Endpoint**: The server address or URL of the MQTT server to connect to. +* **Port**: The network port to use for sending packets to and from the device to the server. In CPP SDK, this can often be left alone as the SDK will automatically set the port based on the connection type. + +**What is a Topic** + +In MQTT, one of the important functionalities of the MQTT server is to handle sending packets to the proper *topics*. A topic is a string that tells the server where to send a packet when it receives one, so it can properly process or forward the packet on to other clients who are listening for packets on that topic. Topics can be specific or can use wildcards via the asterisk character (*). + +With wildcards, this means a client can make a subscription to a topic of “test/hello-*” for example, and then that client will receive all packets sent to “test” that start with “hello-”. For example, a packet sent to “test/hello-world” and a packet sent to “test/hello-/world” would both be received by a client subscribed to “test/hello-*”. + +It should be noted that not every packet has a topic, like connection and disconnect packets do not include and a topic. + +It should also be noted that topics are extremely important for both the MQTT client and server. The MQTT client needs to know of topics to know where to send data to when performing operations, while the MQTT server needs to process topics to make sure each MQTT client connected gets the proper data as soon as new data is sent to the MQTT server. + + +**What is Quality Of Service (QOS)** + +Another important term in MQTT is *Quality Of Service*, or *QOS*. QOS dictates how reliable the MQTT packet is and what steps will be taken when it seems data may not be received by the MQTT server. This is important if a client is sending information in a packet that has important data and it is critical to know whether it has to be received by the server or not. There are three levels of QOS and each increasing level means more mechanisms to ensure the server has received the packet. + +* **QOS 0**: This level is often referred to as “*at most once*” and means that the MQTT packet will be sent once and that is it, there will be no additional processing to determine if the packet was received. +* **QOS 1**: This level is often referred to as “*at least once*” and means that the MQTT packet will be sent and then the sender (client or server) will wait for an acknowledgement (ACK) to come back. If an ACK is not received within a certain time frame, then the packet will be resent. + * Packets that have been sent but an ACK not yet received are referred to as “in-flight” packets. + * QOS 1 does not guarantee that the packet will not be sent more than once, as it will continue to resend the packet at a set interval until an ACK is received. +* **QOS 2**: This level is often referred to as “*exactly once*” and means that the MQTT packet will be sent exactly once and no more. This is done through a series of ACKs on both the sender and receiver’s side to confirm that the packet was sent, arrived at the server, and was successfully processed. + * **Note**: **QOS 2 is not supported in the CPP SDK at this time.** + +The higher the QOS level, the more complicated and slower the complete operation will be due to the extra packets. Packets with higher QOS take longer to be fully processed and require more bandwidth than those with a lower QOS. In general, clients should send packets with the minimum QOS that required for the data being sent for faster speeds and less bandwidth. + + +**Allowed Operations** + +MQTT clients and servers send packets through *operations*. A MQTT client can perform many different operations, each with a different functionality and *associated* *packet*: + +* **Start**: Sends a packet requesting a connection to a server. A connect packet contains information that tells the server who the client is, what settings to use for sending MQTT packets, and what the options the client supports. This packet often also contains authentication information that verifies the client is authorized to connect. This packet performs a handshake with the server that allows the client to perform all other operations describe herein. + * A connect packet can also include something called a **Will**. A will is a publish sent to a topic when the client disconnects and/or the server feels the client has become disconnected due to not responding to PING requests within the agreed upon time. + * The client is the only one that can send a connect packet. However, the server will send an acknowledgement packet, often referred to as the ConnAck packet, with information on whether the connection was successful or not. If successful, the ConnAck packet will also include Negotiated-Settings, which detail the settings the server supports and the client can use to communication. + * **Note**: In the MQTT 3.1.1 client, the Start operation is called **Connect**. Also note that Negotiated-Settings are only sent in MQTT5. +* **Publish**: Sends a packet containing whatever data the client wishes to send to a given topic. A publish can be made with different QOS levels, can be set to be retained (persist on the server). + * Publish packets can have payloads containing string or binary data. +* **Subscribe**: Sends a packet telling the server that the client wants to get any publish packets sent to a specific topic. A subscribe can be made with different QOS levels and can be configured to get retained messages. + * **Note**: Publish packets can be received that are sent from both the client and the server, as well as other clients who are also connected to the server. +* **Unsubscribe**: Sends a packet telling the server that the client no longer wants to get publish packet on a specific topic anymore. +* **Stop**: Sends a packet telling the server to disconnect the client from the server. The disconnect packet can contain a reason for the disconnect and some additional options, like whether to send a will. + * **Note**: In the MQTT 3.1.1 client SDK, the Stop operation is called *Disconnect*. + + +Operations on QOS1 or higher will cause the server to send an acknowledgement packet, often referred to as an ACK packet, when the client performs an operation. For example, if a client performs a publish operation, the client will send a publish packet to the MQTT server and the server will send back a PubAck packet when the publish has been received. These ACK packets often contain information on whether the operation was successful, and if it was unsuccessful, information on why. + +It should also be noted that in MQTT5 most operations and their packets can also include *user properties*. User properties are new to MQTT5 and are key-value pairs that can be set in the packet when a client performs an operation. User properties can be helpful for passing along additional information or context to other MQTT5 clients. + + +### Further Reading: + +Hopefully that has helped give an overview of MQTT and what it is within the CPP SDK. If you are curious to learn more about MQTT, how it works, and what it can do, please see the following links for more information: + +* MQTT 5 standard: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html +* MQTT 3.1.1 standard: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html + + + + +## Using MQTT5 in the SDK + + +### What's Different? (relative to the MQTT311 implementation) + +SDK MQTT5 support comes from a separate client implementation. In doing so, we took the opportunity to incorporate feedback about the 311 client that we could not apply without making breaking changes. If you're used to the 311 client's API contract, there are a number of differences. + + +**Major changes** + +* The MQTT5 client does not treat initial connection failures differently. With the 311 implementation, a failure during initial connect would halt reconnects completely. + +* The set of client lifecycle events is expanded and contains more detailed information whenever possible. All protocol data is exposed to the user. + +* MQTT operations are completed with the full associated ACK packet when possible. + +* New behavioral configuration options: + + * IoT Core specific validation - will validate and fail operations that break IoT Core specific restrictions + + * IoT Core specific flow control - will apply flow control to honor IoT Core specific per-connection limits and quotas + + * Flexible queue control - provides a number of options to control what happens to incomplete operations on a disconnection event + +* A new API has been added to query the internal state of the client's operation queue. This API allows the user to make more informed flow control decisions before submitting operatons to the client. + +* Data can no longer back up on the socket. At most one frame of data is ever pending-write on the socket. + +* The MQTT5 client has a single message-received callback. Per-subscription callbacks are not supported. + + + + +**Minor changes** + +* Public API terminology has changed. You *start* or *stop* the MQTT5 client. This removes the semantic confusion with connect/disconnect as client-level controls vs. internal recurrent networking events. + +* With the 311 implementation, there were two separate objects, a client and a connection. With MQTT5, there is only the client. + + + + +**Not Supported** + +Not all parts of the MQTT5 spec are supported by the implementation. We currently do not support: + +* AUTH packets and the authentication fields in the CONNECT packet + +* QoS 2 + + + + +## Client lifecycle management + +Once created, an MQTT5 client's configuration is immutable. Invoking start() on the client will put it into an active state where it recurrently establishes a connection to the configured remote endpoint. Reconnecting continues until you invoke stop(). + + + + +``` + + // Create Mqtt5Client Builder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath(...); + + + /* setup lifecycle event callbacks */ + std::promise connectionPromise; + std::promise stoppedPromise; + + builder->withClientConnectionSuccessCallback([&connectionPromise]( + Mqtt5::Mqtt5Client&, + std::shared_ptr, + std::shared_ptr settings) { + fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); + connectionPromise.set_value(true); + }); + + builder->withClientConnectionFailureCallback( + [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); + connectionPromise.set_value(false); + }); + + builder->withClientStoppedCallback( + [&stoppedPromise](Mqtt5::Mqtt5Client &) { + fprintf(stdout, "Mqtt5 Client stopped.\n"); + stoppedPromise.set_value(); + }); + + builder->withPublishReceivedCallback( + [](std::shared_ptr, std::shared_ptr publish) { + fprintf(stdout, "Message received on Topic: %s.\n", publish->getTopic()); + }); + + // Build Mqtt5Client + std::shared_ptr client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + + // Start mqtt5 connection session + if (!mqtt5Client->Start()) + { + fprintf("Failed start Mqtt5 client"); + return -1; + } + +``` + + + + +Invoking stop() breaks the current connection (if any) and moves the client into an idle state. When waiting for finished with an MQTT5 client, + + + +``` + if (!client->Stop()) + { + fprintf(stdout, "Failed to stop the mqtt connection session. Exiting..\n"); + return -1; + } + stoppedPromise.get_future().wait(); + +``` + + +The MQTT5 client emits a set of events related to state and network status changes. + +### AttemptingConnect + +Emitted when the client begins to make a connection attempt. + + + +### ConnectionSuccess + +Emitted when a connection attempt succeeds based on receipt of an affirmative CONNACK packet from the MQTT broker. A ConnectionSuccess event includes the MQTT broker's CONNACK packet, as well as a structure -- the NegotiatedSettings -- which contains the final values for all variable MQTT session settings (based on protocol defaults, client wishes, and server response). + + + +### ConnectionFailure + +Emitted when a connection attempt fails at any point between DNS resolution and CONNACK receipt. In addition to an error code, additional data may be present in the event based on the context. For example, if the remote endpoint sent a CONNACK with a failing reason code, the CONNACK packet will be included in the event data. + + + +### Disconnect + +Emitted when the client's network connection is shut down, either by a local action, event, or a remote close or reset. Only emitted after a ConnectionSuccess event: a network connection that is shut down during the connecting process manifests as a ConnectionFailure event. +A Disconnect event will always include an error code. If the Disconnect event is due to the receipt of a server-sent DISCONNECT packet, the packet will be included with the event data. + + + +### Stopped + +Emitted once the client has shutdown any associated network connection and entered an idle state where it will no longer attempt to reconnect. Only emitted after an invocation of stop() on the client. A stopped client may always be started again. + + + + + +## Connecting To AWS IoT Core + +We strongly recommend using the Mqtt5ClientBuilder class to configure MQTT5 clients when connecting to AWS IoT Core. The builder simplifies configuration for all authentication methods supported by AWS IoT Core. + +This section shows samples for all of the authentication possibilities. + + +### Direct MQTT with X509-based mutual TLS + +For X509 based mutual TLS, you can create a client where the certificate and private key are configured by path: + +``` + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath( + , , ); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr client = builder->Build(); + + if (client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + + // start use the mqtt5 client + +``` + + + +#### MQTT over Websockets with Sigv4 authentication + +Sigv4-based authentication requires a credentials provider capable of sourcing valid AWS credentials. Sourced credentials will sign the websocket upgrade request made by the client while connecting. The default credentials provider chain supported by the SDK is capable of resolving credentials in a variety of environments according to a chain of priorities: + + +```Environment -> Profile (local file system) -> STS Web Identity -> IMDS (ec2) or ECS``` + + + +If the default credentials provider chain and AWS region are specified, you do not need to specify any additional configuration, Alternatively, if you're connecting to a special region for which standard pattern matching does not work, or if you need a specific credentials provider, you can specify advanced websocket configuration options. + + +``` + // Create websocket configuration + Aws::Crt::Auth::CredentialsProviderChainDefaultConfig defaultConfig; + std::shared_ptr provider = Aws::Crt::Auth::CredentialsProvider::CreateCredentialsProviderChainDefault(defaultConfig); + if (!provider) + { + fprintf(stderr, "Failure to create credentials provider!\n"); + exit(-1); + } + Aws::Iot::WebsocketConfig websocketConfig(, provider); + + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWebsocket( + , websocketConfig); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr mqtt5Client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + + +``` + + +#### Direct MQTT with Custom Authentication + +AWS IoT Core Custom Authentication allows you to use a lambda to gate access to IoT Core resources. For this authentication method,you must supply an additional configuration structure containing fields relevant to AWS IoT Core Custom Authentication. + + + +If your custom authenticator does not use signing, you don't specify anything related to the token signature: + +``` + // Setup custom authorization config + Mqtt5CustomAuthConfig customAuth; + customAuth.WithAuthrizaerName(); + customAuth.WithUsername(); + customAuth.WithPassword(); + + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithCustomCustomAuthorizer( + , customAuth); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr mqtt5Client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + +``` + + +If your custom authorizer uses signing, you must specify the three signed token properties as well. The token signature must be the URI-encoding of the base64 encoding of the digital signature of the token value via the private key associated with the public key that was registered with the custom authorizer. It is your responsibility to URI-encode the token signature. + +``` + // Setup custom authorization config + Mqtt5CustomAuthConfig customAuth; + customAuth.WithAuthrizaerName(); + customAuth.WithUsername(); + customAuth.WithPassword(); + customAuth.WithTokenSignature() + + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithCustomCustomAuthorizer( + , customAuth); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr mqtt5Client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + +``` + +In both cases, the builder will construct a final CONNECT packet username field value for you based on the values configured. Do not add the token-signing fields to the value of the username that you assign within the custom authentication config structure. Similarly, do not add any custom authentication related values to the username in the CONNECT configuration optionally attached to the client configuration. The builder will do everything for you. + + + +#### HTTP Proxy + +No matter what your connection transport or authentication method is, you may connect through an HTTP proxy by applying proxy configuration to the builder: + +``` + + // Create a Client using Mqtt5ClientBuilder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithXXXXX( ... ); + + Http::HttpClientConnectionProxyOptions proxyOptions; + proxyOptions.HostName = ; + proxyOptions.Port = ; + builder->withHttpProxyOptions(proxyOptions); + + /* You can setup other client options and lifecycle event callbacks before call builder->Build(). + ** Once the the client get built, you could no longer update the client options or connection options + ** on the created client. + */ + + // Build Mqtt5Client + std::shared_ptr mqtt5Client = builder->Build(); + + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + +``` + +SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example). + +## Client Operations + +There are four basic MQTT operations you can perform with the MQTT5 client. + + + +### Subscribe + +The Subscribe operation takes a description of the SUBSCRIBE packet you wish to send and return false if the operation goes wrong. The operation takes in a subscribe completion callback which returns ponding SubAckPacket returned by the broker. + + +``` + + // Create multiple subscription data. With the Mqtt5 API, we can subscribe multiple topics at once. + Subscription data1(); + data1.withNoLocal(false).withTopicFilter("test/topic/test1"); + Subscription data2(); + data2.withTopicFilter("test/topic/test2"); + Subscription data3(); + data3.withTopicFilter("test/topic/test3"); + + Vector subscriptionList; + subscriptionList.push_back(data1); + subscriptionList.push_back(data2); + subscriptionList.push_back(data3); + + // Creaet a SubscribePacket with the subscription list. You can also use packet->withSubscription(subscription) to push_back a single subscription data. + std::shared_ptr packet = std::make_shared(); + packet->withSubscriptions(subscriptionList); + + bool subSuccess = mqtt5Client->Subscribe( + packet, + [](std::shared_ptr, int, std::shared_ptr suback){ + for (auto code : suback->getReasonCodes()) + { + fprintf(stdout, "Get suback from server with code: %d \n", code ); + } + }); + + if (!subSuccess){ + fprintf(stdout, "Failed to perform subscribe operation on client." ); + } + + + +``` + + +### Unsubscribe + +The Unsubscribe operation takes a description of the UNSUBSCRIBE packet you wish to send and return false if the operation goes wrong. The operation takes in a subscribe completion callback which returns ponding UnSubAckPacket returned by the broker. + + + +``` + + String topic1 = "test/topic/test1"; + String topic2 = "test/topic/test2"; + Vector topics; + topics.push_back(topic1); + topics.push_back(topic2); + std::shared_ptr unsub = std::make_shared(); + unsub->withTopicFilters(topics); + bool unsubSuccess = mqtt5Client->Unsubscribe( + packet, + [](std::shared_ptr, int, std::shared_ptr unsuback){ + for (auto code : unsuback->getReasonCodes()) + { + fprintf(stdout, "Get unsuback from server with code: %d \n", code ); + } + }); + + if (!unsubSuccess){ + fprintf(stdout, "Failed to perform unsubscribe operation on client." ); + } + + +``` + + +### Publish + +The Publish operation takes a description of the PUBLISH packet you wish to send and return false if the operation goes wrong. +The publish completion callback will return a PublishResult, which is a polymorphic value, as soon as the packet has been written to the socket. +If the PUBLISH was a QoS 0 publish, then the completion callback returns nullptr for PublishResult. +If the PUBLISH was a QoS 1 publish, then the completion callback returns a PubAckPacket. + + +``` + + Crt::String testTopic = "my/own/topic"; + Crt::String message_string = "any payload"; + + ByteCursor payload = ByteCursorFromString(message_string); + + // Create PublishPacket. + std::shared_ptr publish = std::make_shared(testTopic, payload, QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); + + // Setup publish completion callback. The callback will get triggered when the pulbish completes and publish result returned from the server + OnPublishCompletionHandler callback = [](std::shared_ptr client, int, std::shared_ptr result){ + if(!result->wasSuccessful()) + { + fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); + } + else + { + fprintf(stdout, "Publish Succeed."); + } + }; + + if(!mqtt5Client->Publish(publish, std::move(callback))) + { + fprintf(stdout, "Publish Operation Failed.\n"); + return -1; + } + +``` + + + +##### Disconnect + +The stop() API supports a DISCONNECT packet as an optional parameter. If supplied, the DISCONNECT packet will be sent to the server prior to closing the socket. You may listen for the 'stopped' event on the client for the result. + + +``` +if (!mqtt5Client->Stop()) +{ + fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); + return -1; +} +// Waiting for closing the client + +``` From 6186f3712afa5acce94a35dae31e65bf2210a215 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 7 Nov 2022 17:28:28 -0800 Subject: [PATCH 30/51] delete old version --- README_MQTT5.md | 237 ------------------------------------------------ 1 file changed, 237 deletions(-) delete mode 100644 README_MQTT5.md diff --git a/README_MQTT5.md b/README_MQTT5.md deleted file mode 100644 index f259c2056..000000000 --- a/README_MQTT5.md +++ /dev/null @@ -1,237 +0,0 @@ -# MQTT5 -The following sections provide some basic examples of using the SDK to access the AWS IoT service over MQTT5. For more details please refer to < MQTT5 sample link > and < API Documentation link > - -## Initialize the Client - -To access the AWS IoT service, you can create a `Mqtt5Client` usng `Mqtt5ClientBuilder` in which you initialize the client depends on the connection type (MQTT5 or MQTT5 over WebSocket) and authentication type you choose. The `Mqtt5ClientBuilder` will setup the client options and create a `Mqtt5Client` for you. - -* Initialize the Client with MTLS: -For MQTT5 client, the AWS IoT service requires TLS mutual authentication. -The following examples showed how to create a client with a valid client certificate (X.509) and key. You can use the [AWS IoT console][aws-iot-console] or the AWS command line tools to generate certificates and keys. - -``` -// use value returned by describe-endpoint --endpoint-type "iot:Data-ATS" -Crt::String clientEndpoint = "-ats.iot..amazonaws.com"; -// X.509 based certificate file -const char* certificateFilePath = ""; -// PKCS#1 or PKCS#8 PEM encoded private key file -const char* privateKeyFilePath = ""; - -// Create a Client using Mqtt5ClientBuilder -Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath( - clientEndpoint, certificateFilePath, privateKeyFilePath); - -/* You can setup other client options and callbacks before call builder->Build(). Once the the client get created, you could no longer update the client options or connection options. - -// Build Mqtt5Client -std::shared_ptr client = builder->Build(); - -if (client == nullptr) -{ - fprintf(stdout, "Client creation failed.\n"); - return -1; -} - -``` - - -* Initialize the Client with MQTT Over WebSocket: - -``` -// use value returned by describe-endpoint --endpoint-type "iot:Data-ATS" -Crt::String clientEndpoint = "-ats.iot..amazonaws.com"; -// X.509 based certificate file -const char* certificateFilePath = ""; -// PKCS#1 or PKCS#8 PEM encoded private key file -const char* privateKeyFilePath = ""; -// The signing region. e.x.: 'us-east-1' -const char* signing_region = ''; - -// Create websocket configuration -Aws::Crt::Auth::CredentialsProviderChainDefaultConfig defaultConfig; -std::shared_ptr provider = Aws::Crt::Auth::CredentialsProvider::CreateCredentialsProviderChainDefault(defaultConfig); -if (!provider) -{ - fprintf(stderr, "Failure to create credentials provider!\n"); - exit(-1); -} -Aws::Iot::WebsocketConfig websocketConfig(signing_region, provider); - -// Create a Client using Mqtt5ClientBuilder -Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWebsocket( - clientEndpoint, websocketConfig); - -/* You can setup other client options and callbacks before call builder->Build(). Once the the client get created, you could no longer update the client options or connection options. - -// Build Mqtt5Client -std::shared_ptr mqtt5Client = builder->Build(); - -if (mqtt5Client == nullptr) -{ - fprintf(stdout, "Client creation failed.\n"); - return -1; -} -``` - -## Start & Stop Client connection Session -After build the Mqtt5Client, you can start/stop a MQTT5 connection session as you needed. Mqtt5Client was designed with a async manner. We use callbacks to track life cycle status of the Mqtt5Client. - -``` -// Create Mqtt5ClientBulder - -std::promise connectionPromise; -std::promise stoppedPromise; - -// Setup lifecycle callbacks -builder->withClientConnectionSuccessCallback([&connectionPromise]( - Mqtt5::Mqtt5Client&, - std::shared_ptr, - std::shared_ptr settings) { - fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); - connectionPromise.set_value(true); -}); - -builder->withClientConnectionFailureCallback( - [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) - { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); - connectionPromise.set_value(false); - }); - -builder->withClientStoppedCallback( - [&stoppedPromise](Mqtt5::Mqtt5Client &) - { - fprintf(stdout, "Mqtt5 Client stopped.\n"); - stoppedPromise.set_value(); -}); - -// Build Mqtt5Client -std::shared_ptr client = builder->Build(); - -if (mqtt5Client == nullptr) -{ - fprintf(stdout, "Client creation failed.\n"); - return -1; -} - -if (!mqtt5Client->Start()) -{ - fprintf("Failed start Mqtt5 client"); - return -1; -} - -// Waiting for ConnAck from the server -if (connectionPromise.get_future().get() == false) -{ - fprintf("Connection failed."); -} - -if (!mqtt5Client->Stop()) -{ - fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); - return -1; -} -// Wait for client shutdown -disconnectPromise.get_future().wait(); - -``` - - -## Publish and Subscribe - -After the Mqtt5Client get setup and started, you can perform publish, subscribe and unsubscribe oprations. - -* To publish a message: - -``` - -Crt::String testTopic = "my/own/topic"; -Crt::String message_string = "any payload"; - -ByteCursor payload = ByteCursorFromString(message_string); - -// Create PublishPacket. -std::shared_ptr publish = std::make_shared(testTopic, payload, QOS::AWS_MQTT5_QOS_AT_LEAST_ONCE); - -// Setup publish completion callback. The callback will get triggered when the pulbish completes and publish result returned from the server -OnPublishCompletionHandler callback = [](std::shared_ptr client, int, std::shared_ptr result){ - if(!result->wasSuccessful()) - { - fprintf(stdout, "Publish failed with error_code: %d", result->getErrorCode()); - } - else - { - fprintf(stdout, "Publish Succeed."); - } -}; - -if(!mqtt5Client->Publish(publish, std::move(callback))) -{ - fprintf(stdout, "Publish Operation Failed.\n"); - return -1; -} - -``` - -* To subscribe to topics: - -``` - -// Create multiple subscription data. With the Mqtt5 API, we can subscribe multiple topics at once. -Subscription data1(); -data1.withNoLocal(false).withTopicFilter("test/topic/test1"); -Subscription data2(); -data2.withTopicFilter("test/topic/test2"); -Subscription data3(); -data3.withTopicFilter("test/topic/test3"); - -Vector subscriptionList; -subscriptionList.push_back(data1); -subscriptionList.push_back(data2); -subscriptionList.push_back(data3); - -// Creaet a SubscribePacket with the subscription list. You can also use packet->withSubscription(subscription) to push_back a single subscription data. -std::shared_ptr packet = std::make_shared(); -packet->withSubscriptions(subscriptionList); - -bool subSuccess = mqtt5Client->Subscribe( - packet, - [](std::shared_ptr, int, std::shared_ptr suback){ - for (auto code : suback->getReasonCodes()) - { - fprintf(stdout, "Get suback from server with code: %d \n", code ); - } - }); - -if (!subSuccess){ - fprintf(stdout, "Failed to perform subscribe operation on client." ); -} - -``` - -* To unsubscribe to topics: - - Similar to subscribe operation, you can unsubscribe from multiple topics. - -``` -String topic1 = "test/topic/test1"; -String topic2 = "test/topic/test2"; -Vector topics; -topics.push_back(topic1); -topics.push_back(topic2); -std::shared_ptr unsub = std::make_shared(); -unsub->withTopicFilters(topics); -bool unsubSuccess = mqtt5Client->Unsubscribe( - packet, - [](std::shared_ptr, int, std::shared_ptr unsuback){ - for (auto code : unsuback->getReasonCodes()) - { - fprintf(stdout, "Get unsuback from server with code: %d \n", code ); - } - }); - -if (!unsubSuccess){ - fprintf(stdout, "Failed to perform subscribe operation on client." ); -} - -``` From 99dc493f04e22111ce134420972f54a0a00ab714 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 7 Nov 2022 17:29:10 -0800 Subject: [PATCH 31/51] fix wrong close promise --- samples/mqtt5/mqtt5_pubsub/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index c15e37fdd..8938b0b8d 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); return -1; } - disconnectPromise.get_future().wait(); + stoppedPromise.get_future().wait(); } return 0; From b10772a57f92154ce809355bb606420897c15200 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 09:53:49 -0800 Subject: [PATCH 32/51] update mqtt3 sample name --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a4e9a90c..f3f6127ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,7 +217,7 @@ jobs: with: role-to-assume: ${{ env.CI_PUBSUB_ROLE }} aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample + - name: run MQTT3 PubSub sample run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' @@ -258,7 +258,7 @@ jobs: with: role-to-assume: ${{ env.CI_PUBSUB_ROLE }} aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample + - name: run MQTT3 PubSub sample run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' @@ -327,9 +327,10 @@ jobs: with: role-to-assume: ${{ env.CI_PUBSUB_ROLE }} aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample + - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ./aws-iot-device-sdk-cpp-v2/utils/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' @@ -363,7 +364,7 @@ jobs: with: role-to-assume: ${{ env.CI_PUBSUB_ROLE }} aws-region: ${{ env.AWS_DEFAULT_REGION }} - - name: run PubSub sample + - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample @@ -430,7 +431,7 @@ jobs: - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' - - name: run PubSub sample + - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run PKCS11 Connect sample From a02a021b620ff2d5c590ad0426ee924336b1b53e Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 10:15:52 -0800 Subject: [PATCH 33/51] remove staging changes and fix format --- .github/workflows/ci.yml | 4 - builder.json | 2 +- .../tests/include/awstest/EchoTestRpcClient.h | 10 +- .../tests/include/awstest/EchoTestRpcModel.h | 99 ++--- .../aws/greengrass/GreengrassCoreIpcClient.h | 9 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 351 ++++++------------ 6 files changed, 158 insertions(+), 317 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3f6127ae..f4e44377a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,10 +154,6 @@ jobs: permissions: id-token: write # This is required for requesting the JWT steps: - - name: Checkout Sources - uses: actions/checkout@v2 - with: - submodules: "recursive" - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | md ${{ env.CI_FOLDER }} diff --git a/builder.json b/builder.json index 5f8924437..2a014ee07 100644 --- a/builder.json +++ b/builder.json @@ -1,5 +1,5 @@ { - "name": "STAGING-aws-iot-device-sdk-cpp-v2", + "name": "aws-iot-device-sdk-cpp-v2", "!cmake_args": [ "-DPERFORM_HEADER_CHECK=OFF", "-DS2N_NO_PQ_ASM=ON" diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h index d1e54db99..e89f2c0ba 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h @@ -28,12 +28,10 @@ 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 45e15eb27..8e836f8cd 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -63,8 +63,7 @@ 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; @@ -159,8 +158,7 @@ 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; @@ -223,8 +221,7 @@ 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; @@ -254,8 +251,7 @@ 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; @@ -277,8 +273,7 @@ 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; @@ -301,8 +296,7 @@ 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; @@ -324,8 +318,7 @@ 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; @@ -348,8 +341,7 @@ 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; @@ -373,8 +365,7 @@ 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; @@ -396,8 +387,7 @@ 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; @@ -444,8 +434,7 @@ 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; @@ -490,8 +479,7 @@ 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; @@ -549,10 +537,8 @@ 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, @@ -614,10 +600,8 @@ 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 equest is flushed. + * @return An `RpcError` that can be used to check whether the stream was activated. */ std::future Activate( const CauseServiceErrorRequest &request, @@ -637,10 +621,8 @@ 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) { @@ -659,8 +641,7 @@ 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) @@ -675,8 +656,7 @@ 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. */ @@ -732,12 +712,9 @@ 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, @@ -757,10 +734,8 @@ 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) { @@ -769,8 +744,7 @@ 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) @@ -785,8 +759,7 @@ 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. */ @@ -841,10 +814,8 @@ 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, @@ -906,10 +877,8 @@ 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, @@ -971,10 +940,8 @@ 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 ce29e7444..f269cbdcf 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -30,12 +30,9 @@ 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 8a3fb8e02..edb75b81c 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -100,8 +100,7 @@ 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; @@ -128,8 +127,7 @@ 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; @@ -156,8 +154,7 @@ 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; @@ -182,8 +179,7 @@ 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; @@ -319,8 +315,7 @@ 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; @@ -349,8 +344,7 @@ 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; @@ -441,8 +435,7 @@ 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; @@ -536,8 +529,7 @@ 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; @@ -596,8 +588,7 @@ 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` a can be used as a key in maps. */ bool operator<(const SubscriptionResponseMessage &) const noexcept; static const char *MODEL_NAME; @@ -648,8 +639,7 @@ 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; @@ -692,8 +682,7 @@ 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; @@ -752,8 +741,7 @@ 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` a can be used as a key in maps. */ bool operator<(const ComponentUpdatePolicyEvents &) const noexcept; static const char *MODEL_NAME; @@ -854,8 +842,7 @@ 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` a can be used as a key in maps. */ bool operator<(const ConfigurationValidityReport &) const noexcept; static const char *MODEL_NAME; @@ -918,8 +905,7 @@ 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; @@ -986,8 +972,7 @@ 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; @@ -1019,8 +1004,7 @@ 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; @@ -1054,8 +1038,7 @@ 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; @@ -1226,8 +1209,7 @@ 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; @@ -1251,8 +1233,7 @@ 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; @@ -1280,8 +1261,7 @@ 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; @@ -1354,8 +1334,7 @@ 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; @@ -1379,8 +1358,7 @@ 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; @@ -1402,8 +1380,7 @@ 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` a can be used as a key in maps. */ bool operator<(const UpdateConfigurationResponse &) const noexcept; static const char *MODEL_NAME; @@ -1430,8 +1407,7 @@ 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` a can be used as a key in maps. */ bool operator<(const UpdateConfigurationRequest &) const noexcept; static const char *MODEL_NAME; @@ -1459,8 +1435,7 @@ namespace Aws 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. */ + * `SubscribeToValidateConfigurationUpdatesResponse` can be used as a key in maps. */ bool operator<(const SubscribeToValidateConfigurationUpdatesResponse &) const noexcept; static const char *MODEL_NAME; @@ -1485,8 +1460,7 @@ namespace Aws 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. */ + * `SubscribeToValidateConfigurationUpdatesRequest` can be used as a key in maps. */ bool operator<(const SubscribeToValidateConfigurationUpdatesRequest &) const noexcept; static const char *MODEL_NAME; @@ -1511,8 +1485,7 @@ 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; @@ -1562,8 +1535,7 @@ 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` a can be used as a key in maps. */ bool operator<(const SubscribeToIoTCoreResponse &) const noexcept; static const char *MODEL_NAME; @@ -1588,8 +1560,7 @@ 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; @@ -1614,8 +1585,7 @@ 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; @@ -1642,8 +1612,7 @@ 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; @@ -1815,8 +1784,7 @@ 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; @@ -1847,8 +1815,7 @@ 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; @@ -1944,8 +1911,7 @@ 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; @@ -2088,8 +2054,7 @@ 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; @@ -2192,8 +2157,7 @@ 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; @@ -2223,8 +2187,7 @@ 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; @@ -2256,8 +2219,7 @@ 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` a can be used as a key in maps. */ bool operator<(const ListLocalDeploymentsResponse &) const noexcept; static const char *MODEL_NAME; @@ -2279,8 +2241,7 @@ 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` a can be used as a key in maps. */ bool operator<(const ListLocalDeploymentsRequest &) const noexcept; static const char *MODEL_NAME; @@ -2474,8 +2435,7 @@ 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; @@ -2499,8 +2459,7 @@ 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; @@ -2526,8 +2485,7 @@ 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; @@ -2583,8 +2541,7 @@ 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` a can be used as a key in maps. */ bool operator<(const GetComponentDetailsResponse &) const noexcept; static const char *MODEL_NAME; @@ -2608,8 +2565,7 @@ 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` a can be used as a key in maps. */ bool operator<(const GetComponentDetailsRequest &) const noexcept; static const char *MODEL_NAME; @@ -2708,8 +2664,7 @@ 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; @@ -2735,8 +2690,7 @@ 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; @@ -2790,8 +2744,7 @@ 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` a can be used as a key in maps. */ bool operator<(const DeferComponentUpdateResponse &) const noexcept; static const char *MODEL_NAME; @@ -2818,8 +2771,7 @@ 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` a can be used as a key in maps. */ bool operator<(const DeferComponentUpdateRequest &) const noexcept; static const char *MODEL_NAME; @@ -2870,8 +2822,7 @@ 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; @@ -2895,8 +2846,7 @@ 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; @@ -2970,8 +2920,7 @@ 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` a can be used as a key in maps. */ bool operator<(const CreateLocalDeploymentRequest &) const noexcept; static const char *MODEL_NAME; @@ -3018,8 +2967,7 @@ 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` a can be used as a key in maps. */ bool operator<(const CreateDebugPasswordResponse &) const noexcept; static const char *MODEL_NAME; @@ -3045,8 +2993,7 @@ 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` a can be used as a key in maps. */ bool operator<(const CreateDebugPasswordRequest &) const noexcept; static const char *MODEL_NAME; @@ -3248,8 +3195,7 @@ 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) @@ -3320,10 +3266,8 @@ 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, @@ -3448,10 +3392,8 @@ 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, @@ -3504,8 +3446,7 @@ 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) @@ -3578,12 +3519,9 @@ 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, @@ -3645,10 +3583,8 @@ 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, @@ -3775,10 +3711,8 @@ 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, @@ -3820,8 +3754,7 @@ 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) @@ -3895,14 +3828,10 @@ 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, @@ -3964,10 +3893,8 @@ 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, @@ -4031,8 +3958,7 @@ 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) @@ -4103,10 +4029,8 @@ 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, @@ -4168,10 +4092,8 @@ 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, @@ -4299,10 +4221,8 @@ 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, @@ -4630,10 +4550,8 @@ 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, @@ -4695,10 +4613,8 @@ 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, @@ -4760,10 +4676,8 @@ 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, @@ -4826,14 +4740,10 @@ 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, @@ -4895,10 +4805,8 @@ 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, @@ -4960,10 +4868,8 @@ 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, @@ -5027,12 +4933,9 @@ 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, @@ -5094,10 +4997,8 @@ 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, @@ -5162,10 +5063,8 @@ 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, @@ -5227,10 +5126,8 @@ 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, @@ -5292,10 +5189,8 @@ 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, @@ -5360,10 +5255,8 @@ 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, @@ -5416,8 +5309,7 @@ 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) @@ -5490,12 +5382,9 @@ 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, @@ -5559,10 +5448,8 @@ 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, @@ -5624,10 +5511,8 @@ 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, @@ -5754,10 +5639,8 @@ 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, From 1b05aebaad0fa6ea09060d5a1346a4834b1f53d7 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 10:23:54 -0800 Subject: [PATCH 34/51] fix clang format --- .../tests/include/awstest/EchoTestRpcModel.h | 10 +- .../aws/greengrass/GreengrassCoreIpcClient.h | 3 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 167 +++++++----------- 3 files changed, 70 insertions(+), 110 deletions(-) diff --git a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h index 8e836f8cd..cdcd51f51 100644 --- a/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h +++ b/eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h @@ -251,7 +251,7 @@ 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; @@ -408,8 +408,7 @@ 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; @@ -457,8 +456,7 @@ 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; @@ -600,7 +598,7 @@ 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 equest is flushed. + * @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( diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h index f269cbdcf..564548fd8 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h @@ -30,7 +30,8 @@ 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 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. */ diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index edb75b81c..f160dfb80 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -205,8 +205,7 @@ 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; @@ -588,7 +587,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscriptionResponseMessage *) noexcept; - /* This needs to be defined so that `SubscriptionResponseMessage` a 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; @@ -741,7 +740,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ComponentUpdatePolicyEvents *) noexcept; - /* This needs to be defined so that `ComponentUpdatePolicyEvents` a 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; @@ -842,7 +841,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ConfigurationValidityReport *) noexcept; - /* This needs to be defined so that `ConfigurationValidityReport` a 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; @@ -1184,8 +1183,7 @@ 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; @@ -1380,7 +1378,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateConfigurationResponse *) noexcept; - /* This needs to be defined so that `UpdateConfigurationResponse` a 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; @@ -1407,7 +1405,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(UpdateConfigurationRequest *) noexcept; - /* This needs to be defined so that `UpdateConfigurationRequest` a 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; @@ -1434,8 +1432,8 @@ 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; @@ -1459,8 +1457,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 maps. */ + /* 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; @@ -1511,8 +1509,7 @@ 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; @@ -1535,7 +1532,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(SubscribeToIoTCoreResponse *) noexcept; - /* This needs to be defined so that `SubscribeToIoTCoreResponse` a 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; @@ -1635,8 +1632,7 @@ 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; @@ -1657,8 +1653,7 @@ 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; @@ -1733,8 +1728,7 @@ 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; @@ -1759,8 +1753,7 @@ 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; @@ -1784,7 +1777,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; @@ -1815,7 +1809,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; @@ -1884,8 +1879,7 @@ 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; @@ -1936,8 +1930,7 @@ 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; @@ -2004,8 +1997,7 @@ 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; @@ -2030,8 +2022,7 @@ 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; @@ -2081,8 +2072,7 @@ 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; @@ -2219,7 +2209,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListLocalDeploymentsResponse *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsResponse` a 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; @@ -2241,7 +2231,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(ListLocalDeploymentsRequest *) noexcept; - /* This needs to be defined so that `ListLocalDeploymentsRequest` a 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; @@ -2267,8 +2257,7 @@ 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; @@ -2290,8 +2279,7 @@ 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; @@ -2314,8 +2302,7 @@ 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; @@ -2341,8 +2328,7 @@ 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; @@ -2376,8 +2362,7 @@ 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; @@ -2408,8 +2393,7 @@ 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; @@ -2512,8 +2496,7 @@ 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; @@ -2541,7 +2524,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetComponentDetailsResponse *) noexcept; - /* This needs to be defined so that `GetComponentDetailsResponse` a 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; @@ -2565,7 +2548,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(GetComponentDetailsRequest *) noexcept; - /* This needs to be defined so that `GetComponentDetailsRequest` a 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; @@ -2719,8 +2702,7 @@ 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; @@ -2744,7 +2726,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeferComponentUpdateResponse *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateResponse` a 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; @@ -2771,7 +2753,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(DeferComponentUpdateRequest *) noexcept; - /* This needs to be defined so that `DeferComponentUpdateRequest` a 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; @@ -2797,8 +2779,7 @@ 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; @@ -2920,7 +2901,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateLocalDeploymentRequest *) noexcept; - /* This needs to be defined so that `CreateLocalDeploymentRequest` a 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; @@ -2967,7 +2948,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateDebugPasswordResponse *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordResponse` a 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; @@ -2993,7 +2974,7 @@ namespace Aws Aws::Crt::StringView, Aws::Crt::Allocator *) noexcept; static void s_customDeleter(CreateDebugPasswordRequest *) noexcept; - /* This needs to be defined so that `CreateDebugPasswordRequest` a 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; @@ -3162,10 +3143,8 @@ 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) { @@ -3184,8 +3163,7 @@ 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) @@ -3210,8 +3188,7 @@ 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. */ @@ -3413,10 +3390,8 @@ 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) { @@ -3435,8 +3410,7 @@ 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) @@ -3461,8 +3435,7 @@ 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. */ @@ -3732,10 +3705,8 @@ 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) { @@ -3769,8 +3740,7 @@ 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. */ @@ -3914,10 +3884,8 @@ 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) { @@ -3926,8 +3894,7 @@ 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) @@ -3947,8 +3914,7 @@ 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) @@ -3973,8 +3939,7 @@ 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. */ @@ -5276,10 +5241,8 @@ 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) { @@ -5298,8 +5261,7 @@ 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) @@ -5324,8 +5286,7 @@ 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. */ From 1202873479164937b1ae0ff213fe1279a6444ed7 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 10:27:09 -0800 Subject: [PATCH 35/51] set crt header to mqtt5 to have ci running --- crt/aws-crt-cpp | 2 +- .../aws/greengrass/GreengrassCoreIpcModel.h | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/crt/aws-crt-cpp b/crt/aws-crt-cpp index 365f03437..c57371cbf 160000 --- a/crt/aws-crt-cpp +++ b/crt/aws-crt-cpp @@ -1 +1 @@ -Subproject commit 365f0343712e2123592885b2c9e738df7c3de6ae +Subproject commit c57371cbf5a754a0f5d12a1037be183a61181ff1 diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index f160dfb80..45db75d6a 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -1158,8 +1158,7 @@ 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; @@ -1283,8 +1282,7 @@ 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; @@ -1307,8 +1305,7 @@ 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; @@ -1432,8 +1429,7 @@ 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; @@ -1582,7 +1578,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; @@ -1778,7 +1775,7 @@ namespace Aws 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; @@ -1810,7 +1807,7 @@ namespace Aws 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; From adad7f68e00e8f1f9e2ccd0cdfd2b4ac9e94edac Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 11:17:59 -0800 Subject: [PATCH 36/51] update documentation --- README.md | 1 + documents/FAQ.md | 9 +- MQTT5.md => documents/MQTT5.md | 285 ++++++++---------- documents/MQTT_CONCEPT.md | 115 +++++++ .../aws/greengrass/GreengrassCoreIpcModel.h | 3 +- 5 files changed, 251 insertions(+), 162 deletions(-) rename MQTT5.md => documents/MQTT5.md (55%) create mode 100644 documents/MQTT_CONCEPT.md diff --git a/README.md b/README.md index 75cd49c94..18ea278e6 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ __Jump To:__ * [Getting Help](#Getting-Help) * [FAQ](./documents/FAQ.md) * [Giving Feedback and Contributions](#Giving-Feedback-and-Contributions) +* [MQTT5 Introduction](./documents/MQTT5.md) ## Installation diff --git a/documents/FAQ.md b/documents/FAQ.md index b808cfdfc..09d13edee 100644 --- a/documents/FAQ.md +++ b/documents/FAQ.md @@ -73,7 +73,7 @@ Please note that on Mac, once a private key is used with a certificate, that cer static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided. ``` -### How do debug in VSCode? +### How do debug in VSCode? Here is an example launch.json file to run the pubsub sample ``` json @@ -111,13 +111,16 @@ Here is an example launch.json file to run the pubsub sample * Device certificate * Intermediate device certificate that is used to generate the key below * When using samples it can look like this: `--cert abcde12345-certificate.pem.crt` - * Key files + * Key files * You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you * When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key` ### I still have more questions about the this sdk? * [Here](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) are the AWS IoT Core docs for more details about IoT Core -* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass +* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass * [Discussion](https://github.com/aws/aws-iot-device-sdk-cpp-v2/discussions) questions are also a great way to ask other questions about this sdk. * [Open an issue](https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues) if you find a bug or have a feature request +* [Breif MQTT CONCEPT](./MQTT_CONCEPT.md) +* [MQTT5 Introduction](./MQTT5.md) + diff --git a/MQTT5.md b/documents/MQTT5.md similarity index 55% rename from MQTT5.md rename to documents/MQTT5.md index 3d58db4f2..30a13a10a 100644 --- a/MQTT5.md +++ b/documents/MQTT5.md @@ -1,5 +1,28 @@ # MQTT 5 +## Table of Contents +* [Developer Preview Disclaimer](#developer-preview-disclaimer) +* [Introduction](#introduction) +* [What's Different? (relative to the MQTT311 implementation)](#what-s-different---relative-to-the-mqtt311-implementation-) + + [Major changes](#major-changes) + + [Minor changes](#minor-changes) + + [Not Supported](#not-supported) +* [[Getting Started with MQTT5]](#-getting-started-with-mqtt5-) + + [How to Create Mqtt5 Client](#how-to-create-mqtt5-client) + + [How to Start and Stop](#how-to-start-and-stop) + - [**Start**](#--start--) + - [**Stop**](#--stop--) + + [Client lifecycle management](#client-lifecycle-management) + + [Connecting To AWS IoT Core](#connecting-to-aws-iot-core) + - [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls) + - [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication) + - [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication) + - [HTTP Proxy](#http-proxy) + + [Client Operations](#client-operations) + - [Subscribe](#subscribe) + - [Unsubscribe](#unsubscribe) + - [Publish](#publish) +* [MQTT5 Best Practices](#mqtt5-best-practices) ## Developer Preview Disclaimer @@ -16,176 +39,130 @@ This guide also includes code snippets for how to make a MQTT5 client with prope The goal of this guide is to provide a basic understanding of MQTT5 and how to leverage the CPP SDK to use MQTT5 for your IoT application. -If you are completely new to MQTT, it is highly recommended to read through the section to learn more about what MQTT is and what the terms used throughout this document mean. If you are experienced with MQTT, feel free to skip ahead to the section to jump right into the implementation specifics with code snippets showing how to use MQTT5 within the CPP SDK. +If you are completely new to MQTT, it is highly recommended to read through the [concepts](./MQTT_CONCEPT.md) documentation to learn more about what MQTT is and what the terms used throughout this document mean. -## Concepts - -### What is MQTT - -MQTT is a message protocol often used for IoT devices thanks to its smaller bandwidth cost, its defined spec, and relatively low complexity compared to something like HTTP. MQTT5 is the latest version of MQTT protocol with additional features, like user properties, and developer enhancements, like better error logging, that make developing a MQTT application easier and more powerful. - -*Please note that this document does not include the whole MQTT protocol* and only covers the basic essential MQTT concepts to aid in the understanding and usage of the CPP SDK API. In the Further Reading section there are links to documentation that covers the MQTT protocol in more detail. - -### MQTT Knowledge Essentials - -MQTT is a message protocol, but what does that mean? Simply put, MQTT is a way for a device on one network to send information to a device on another networking using an agreed upon set of rules and protocols. This information is sent through what is called *Packets*, which is data formatted in a specific way so the receiver knows how to parse it and extract the data contained within. The data within a packet is often referred to as the *payload*. - -The concepts section will cover the most important aspects of MQTT relative to its usage in the CPP SDK in the sections below. The first thing that needs to be covered are the two main types of devices on the internet with MQTT: - -**Servers** and **Clients**: - -* **Server** (interchangeably referred to as *Brokers*): where MQTT packets are sent and processed. A single server can process many packets and have many different MQTT clients (see below) at once. A server may both send and receive packets from one or more clients. - * Servers can perform many different operations with packets depending on the data within, the Quality of Service level (also known as “QoS”), and the topic the packets are being sent to. The server will process incoming packets to determine whether to forward the packet to subscribers (clients who have subscribed to the topic in the packet) and/or responding to the client that sent the packet with an acknowledgement packet. - * AWS IoT Core is a service that provides a MQTT5 server, which devices can connect to and send packets to and from. AWS IoT Core also has services that, when packets are sent to, will invoke certain operations and other services. -* **Client**: what sends and receives packets from the server. A client connects by sending a Connect Packet with information on who the client is, as well as often including authorization data. Upon connecting successfully, an MQTT client can subscribe and unsubscribe from topics, send and receive Publish Packets to topics and from topics it is subscribed to, as well as disconnect and reconnect. - -In general, you will be working on writing code that makes a MQTT5 client and sends data to the server when certain operations happen, to report data from the device, to respond to data sent from the server or another client whose topic the client is subscribed to (more on subscriptions below), or otherwise react based on the packets being sent and received. Because of this, this document will be focusing the majority of the information on the client side of things, rather than the server. - -(*Implementer note*: Link “subscriptions below” to the correct section in the Markdown when adding to GitHub.) - - -**Terminology and Relationship** - -The connection process for MQTT is different than connection process for a *Client/Server* paradigm. The process to connect in MQTT requires both a *Connection* and a *Session*, in addition to a *Client*. This can be confusing as they have similar functionalities. Below are the rough definitions for each concept: - -* **Client**: Manages the Connection and the Session. A client contains all the information needed to connect to a MQTT server, as well as the interface to use for performing operations. - * Operations are described further below in the operations section. - * (**Implementer note**: Link “operations section” to the section in the Markdown when adding to GitHub.) -* **Connection**: Directly handles packets and communicating with the MQTT server via sockets. The connection is where the MQTT operations are directly performed at. The connection also handles keeping the client connected by responding to PING requests from the server, as well as tracking operations and their timeouts. - * The MQTT client creates a connection. Connections cannot exist without a client. -* **Session**: The period of time where a client is connected to a MQTT server and is able to perform operations. A session ends when the MQTT client is disconnected, shutdown, or otherwise destroyed. - * Sessions exist only when there is a client and connection, and the connection is actively connected to a MQTT server. - -In the CPP SDK, the terminology isn’t quite as important as some MQTT implementations because *in MQTT5 a client can only have a single Connection and Session.* However, it is important to know the terms and what each part means when MQTT5 is discussed. All of your code will interact solely with the MQTT5 client, so if you are unsure, just remember the MQTT5 client is what your code interacts with. - -* Note that in MQTT 3.1.1, often referred to simply as “MQTT” in the CPP SDK code, there are some fundamental differences compared to MQTT5. A few of these differences are listed below: - * In the MQTT 3.1.1 client, the MQTT connection is where your code interacts to perform MQTT operations. In MQTT5, the code instead performs all operations through the MQTT5 client. - * In the MQTT 3.1.1 client, you can have multiple MQTT connections (and by extension, sessions) per MQTT 3.1.1 client. In MQTT5, each MQTT5 client has only a single connection and session. In MQTT5 you can use multiple clients each with their own connection. - * In the MQTT 3.1.1 client, when you subscribe to a topic it adds it to a topic tree so when a publish packet comes in, per-topic callbacks will be invoked. In MQTT5, there is not a topic tree, and instead all subscriptions will invoke the same callback when a publish packet comes in. - - -Additionally, there is some further terms that are important to define in relation to making a connection with MQTT: - -* **Endpoint**: The server address or URL of the MQTT server to connect to. -* **Port**: The network port to use for sending packets to and from the device to the server. In CPP SDK, this can often be left alone as the SDK will automatically set the port based on the connection type. - -**What is a Topic** - -In MQTT, one of the important functionalities of the MQTT server is to handle sending packets to the proper *topics*. A topic is a string that tells the server where to send a packet when it receives one, so it can properly process or forward the packet on to other clients who are listening for packets on that topic. Topics can be specific or can use wildcards via the asterisk character (*). - -With wildcards, this means a client can make a subscription to a topic of “test/hello-*” for example, and then that client will receive all packets sent to “test” that start with “hello-”. For example, a packet sent to “test/hello-world” and a packet sent to “test/hello-/world” would both be received by a client subscribed to “test/hello-*”. - -It should be noted that not every packet has a topic, like connection and disconnect packets do not include and a topic. - -It should also be noted that topics are extremely important for both the MQTT client and server. The MQTT client needs to know of topics to know where to send data to when performing operations, while the MQTT server needs to process topics to make sure each MQTT client connected gets the proper data as soon as new data is sent to the MQTT server. - - -**What is Quality Of Service (QOS)** - -Another important term in MQTT is *Quality Of Service*, or *QOS*. QOS dictates how reliable the MQTT packet is and what steps will be taken when it seems data may not be received by the MQTT server. This is important if a client is sending information in a packet that has important data and it is critical to know whether it has to be received by the server or not. There are three levels of QOS and each increasing level means more mechanisms to ensure the server has received the packet. - -* **QOS 0**: This level is often referred to as “*at most once*” and means that the MQTT packet will be sent once and that is it, there will be no additional processing to determine if the packet was received. -* **QOS 1**: This level is often referred to as “*at least once*” and means that the MQTT packet will be sent and then the sender (client or server) will wait for an acknowledgement (ACK) to come back. If an ACK is not received within a certain time frame, then the packet will be resent. - * Packets that have been sent but an ACK not yet received are referred to as “in-flight” packets. - * QOS 1 does not guarantee that the packet will not be sent more than once, as it will continue to resend the packet at a set interval until an ACK is received. -* **QOS 2**: This level is often referred to as “*exactly once*” and means that the MQTT packet will be sent exactly once and no more. This is done through a series of ACKs on both the sender and receiver’s side to confirm that the packet was sent, arrived at the server, and was successfully processed. - * **Note**: **QOS 2 is not supported in the CPP SDK at this time.** - -The higher the QOS level, the more complicated and slower the complete operation will be due to the extra packets. Packets with higher QOS take longer to be fully processed and require more bandwidth than those with a lower QOS. In general, clients should send packets with the minimum QOS that required for the data being sent for faster speeds and less bandwidth. +## What's Different? (relative to the MQTT311 implementation) +SDK MQTT5 support comes from a separate client implementation. In doing so, we took the opportunity to incorporate feedback about the 311 client that we could not apply without making breaking changes. If you're used to the 311 client's API contract, there are a number of differences. -**Allowed Operations** -MQTT clients and servers send packets through *operations*. A MQTT client can perform many different operations, each with a different functionality and *associated* *packet*: +### Major changes -* **Start**: Sends a packet requesting a connection to a server. A connect packet contains information that tells the server who the client is, what settings to use for sending MQTT packets, and what the options the client supports. This packet often also contains authentication information that verifies the client is authorized to connect. This packet performs a handshake with the server that allows the client to perform all other operations describe herein. - * A connect packet can also include something called a **Will**. A will is a publish sent to a topic when the client disconnects and/or the server feels the client has become disconnected due to not responding to PING requests within the agreed upon time. - * The client is the only one that can send a connect packet. However, the server will send an acknowledgement packet, often referred to as the ConnAck packet, with information on whether the connection was successful or not. If successful, the ConnAck packet will also include Negotiated-Settings, which detail the settings the server supports and the client can use to communication. - * **Note**: In the MQTT 3.1.1 client, the Start operation is called **Connect**. Also note that Negotiated-Settings are only sent in MQTT5. -* **Publish**: Sends a packet containing whatever data the client wishes to send to a given topic. A publish can be made with different QOS levels, can be set to be retained (persist on the server). - * Publish packets can have payloads containing string or binary data. -* **Subscribe**: Sends a packet telling the server that the client wants to get any publish packets sent to a specific topic. A subscribe can be made with different QOS levels and can be configured to get retained messages. - * **Note**: Publish packets can be received that are sent from both the client and the server, as well as other clients who are also connected to the server. -* **Unsubscribe**: Sends a packet telling the server that the client no longer wants to get publish packet on a specific topic anymore. -* **Stop**: Sends a packet telling the server to disconnect the client from the server. The disconnect packet can contain a reason for the disconnect and some additional options, like whether to send a will. - * **Note**: In the MQTT 3.1.1 client SDK, the Stop operation is called *Disconnect*. +* The MQTT5 client does not treat initial connection failures differently. With the 311 implementation, a failure during initial connect would halt reconnects completely. +* The set of client lifecycle events is expanded and contains more detailed information whenever possible. All protocol data is exposed to the user. -Operations on QOS1 or higher will cause the server to send an acknowledgement packet, often referred to as an ACK packet, when the client performs an operation. For example, if a client performs a publish operation, the client will send a publish packet to the MQTT server and the server will send back a PubAck packet when the publish has been received. These ACK packets often contain information on whether the operation was successful, and if it was unsuccessful, information on why. +* MQTT operations are completed with the full associated ACK packet when possible. -It should also be noted that in MQTT5 most operations and their packets can also include *user properties*. User properties are new to MQTT5 and are key-value pairs that can be set in the packet when a client performs an operation. User properties can be helpful for passing along additional information or context to other MQTT5 clients. +* New behavioral configuration options: + * IoT Core specific validation - will validate and fail operations that break IoT Core specific restrictions -### Further Reading: + * IoT Core specific flow control - will apply flow control to honor IoT Core specific per-connection limits and quotas -Hopefully that has helped give an overview of MQTT and what it is within the CPP SDK. If you are curious to learn more about MQTT, how it works, and what it can do, please see the following links for more information: + * Flexible queue control - provides a number of options to control what happens to incomplete operations on a disconnection event -* MQTT 5 standard: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html -* MQTT 3.1.1 standard: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html +* A new API has been added to query the internal state of the client's operation queue. This API allows the user to make more informed flow control decisions before submitting operatons to the client. +* Data can no longer back up on the socket. At most one frame of data is ever pending-write on the socket. +* The MQTT5 client has a single message-received callback. Per-subscription callbacks are not supported. -## Using MQTT5 in the SDK +### Minor changes -### What's Different? (relative to the MQTT311 implementation) +* Public API terminology has changed. You *start* or *stop* the MQTT5 client. This removes the semantic confusion with connect/disconnect as client-level controls vs. internal recurrent networking events. -SDK MQTT5 support comes from a separate client implementation. In doing so, we took the opportunity to incorporate feedback about the 311 client that we could not apply without making breaking changes. If you're used to the 311 client's API contract, there are a number of differences. +* With the 311 implementation, there were two separate objects, a client and a connection. With MQTT5, there is only the client. -**Major changes** -* The MQTT5 client does not treat initial connection failures differently. With the 311 implementation, a failure during initial connect would halt reconnects completely. -* The set of client lifecycle events is expanded and contains more detailed information whenever possible. All protocol data is exposed to the user. +### Not Supported -* MQTT operations are completed with the full associated ACK packet when possible. +Not all parts of the MQTT5 spec are supported by the implementation. We currently do not support: -* New behavioral configuration options: +* AUTH packets and the authentication fields in the CONNECT packet - * IoT Core specific validation - will validate and fail operations that break IoT Core specific restrictions +* QoS 2 - * IoT Core specific flow control - will apply flow control to honor IoT Core specific per-connection limits and quotas - * Flexible queue control - provides a number of options to control what happens to incomplete operations on a disconnection event -* A new API has been added to query the internal state of the client's operation queue. This API allows the user to make more informed flow control decisions before submitting operatons to the client. +## [Getting Started with MQTT5] -* Data can no longer back up on the socket. At most one frame of data is ever pending-write on the socket. -* The MQTT5 client has a single message-received callback. Per-subscription callbacks are not supported. +### How to Create Mqtt5 Client +Once a MQTT5 client builder has been created, it is ready to make a [MQTT5 client](https://awslabs.github.io/aws-crt-java/software/amazon/awssdk/crt/mqtt5/Mqtt5Client.html). Something important to note is that once a MQTT5 client is built and finalized, the client configuration is immutable. Further modifications to the MQTT5 client builder will not change the settings of already created the MQTT5 clients. Before building a MQTT5 client from a MQTT5 client builder, make sure to have everything fully setup. +``` + // Create Mqtt5Client Builder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath(...); + // Build Mqtt5Client + std::shared_ptr client = builder->Build(); -**Minor changes** + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } -* Public API terminology has changed. You *start* or *stop* the MQTT5 client. This removes the semantic confusion with connect/disconnect as client-level controls vs. internal recurrent networking events. + // Start mqtt5 connection session + if (!mqtt5Client->Start()) + { + fprintf("Failed start Mqtt5 client"); + return -1; + } -* With the 311 implementation, there were two separate objects, a client and a connection. With MQTT5, there is only the client. +``` +### How to Start and Stop +#### **Start** +Invoking start() on the client will put it into an active state where it recurrently establishes a connection to the configured remote endpoint. Reconnecting continues until you invoke stop(). -**Not Supported** -Not all parts of the MQTT5 spec are supported by the implementation. We currently do not support: +``` -* AUTH packets and the authentication fields in the CONNECT packet + // Create Mqtt5Client Builder + Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath(...); -* QoS 2 + // Build Mqtt5Client + std::shared_ptr client = builder->Build(); + if (mqtt5Client == nullptr) + { + fprintf(stdout, "Client creation failed.\n"); + return -1; + } + // Start mqtt5 connection session + if (!mqtt5Client->Start()) + { + fprintf("Failed start Mqtt5 client"); + return -1; + } +``` -## Client lifecycle management +#### **Stop** -Once created, an MQTT5 client's configuration is immutable. Invoking start() on the client will put it into an active state where it recurrently establishes a connection to the configured remote endpoint. Reconnecting continues until you invoke stop(). +The Stop() API supports a DISCONNECT packet as an optional parameter. If supplied, the DISCONNECT packet will be sent to the server prior to closing the socket. You may listen for the 'Stopped' lifecycle event on the client for the result. Invoking stop() breaks the current connection (if any) and moves the client into an idle state. When waiting for finished with an MQTT5 client, +``` + if (!client->Stop()) + { + fprintf(stdout, "Failed to stop the mqtt connection session. Exiting..\n"); + } +``` +### Client lifecycle management +The MQTT5 client emits a set of events related to state and network status changes. The lifecycle events callback should be set in Mqtt5ClientBuilder before the client builds. ``` @@ -238,54 +215,54 @@ Once created, an MQTT5 client's configuration is immutable. Invoking start() on return -1; } -``` - - - - -Invoking stop() breaks the current connection (if any) and moves the client into an idle state. When waiting for finished with an MQTT5 client, - - + if(connectionPromise.get_future().get() == true) + { + // Client started successfully + } + else + { + // Client Start failed. + } -``` - if (!client->Stop()) + if (client->Stop()) + { + // Waiting for client stopped callback + stoppedPromise.get_future().get(); + } + else { fprintf(stdout, "Failed to stop the mqtt connection session. Exiting..\n"); - return -1; + return -1' } - stoppedPromise.get_future().wait(); ``` - -The MQTT5 client emits a set of events related to state and network status changes. - -### AttemptingConnect +**AttemptingConnect** Emitted when the client begins to make a connection attempt. -### ConnectionSuccess +**ConnectionSuccess** Emitted when a connection attempt succeeds based on receipt of an affirmative CONNACK packet from the MQTT broker. A ConnectionSuccess event includes the MQTT broker's CONNACK packet, as well as a structure -- the NegotiatedSettings -- which contains the final values for all variable MQTT session settings (based on protocol defaults, client wishes, and server response). -### ConnectionFailure +**ConnectionFailure** Emitted when a connection attempt fails at any point between DNS resolution and CONNACK receipt. In addition to an error code, additional data may be present in the event based on the context. For example, if the remote endpoint sent a CONNACK with a failing reason code, the CONNACK packet will be included in the event data. -### Disconnect +**Disconnect** Emitted when the client's network connection is shut down, either by a local action, event, or a remote close or reset. Only emitted after a ConnectionSuccess event: a network connection that is shut down during the connecting process manifests as a ConnectionFailure event. A Disconnect event will always include an error code. If the Disconnect event is due to the receipt of a server-sent DISCONNECT packet, the packet will be included with the event data. -### Stopped +**Stopped** Emitted once the client has shutdown any associated network connection and entered an idle state where it will no longer attempt to reconnect. Only emitted after an invocation of stop() on the client. A stopped client may always be started again. @@ -293,14 +270,14 @@ Emitted once the client has shutdown any associated network connection and enter -## Connecting To AWS IoT Core +### Connecting To AWS IoT Core We strongly recommend using the Mqtt5ClientBuilder class to configure MQTT5 clients when connecting to AWS IoT Core. The builder simplifies configuration for all authentication methods supported by AWS IoT Core. This section shows samples for all of the authentication possibilities. -### Direct MQTT with X509-based mutual TLS +#### Direct MQTT with X509-based mutual TLS For X509 based mutual TLS, you can create a client where the certificate and private key are configured by path: @@ -476,13 +453,12 @@ No matter what your connection transport or authentication method is, you may co SDK Proxy support also includes support for basic authentication and TLS-to-proxy. SDK proxy support does not include any additional proxy authentication methods (kerberos, NTLM, etc...) nor does it include non-HTTP proxies (SOCKS5, for example). -## Client Operations - -There are four basic MQTT operations you can perform with the MQTT5 client. +### Client Operations +There are three basic MQTT operations you can perform with the MQTT5 client. -### Subscribe +#### Subscribe The Subscribe operation takes a description of the SUBSCRIBE packet you wish to send and return false if the operation goes wrong. The operation takes in a subscribe completion callback which returns ponding SubAckPacket returned by the broker. @@ -524,7 +500,7 @@ The Subscribe operation takes a description of the SUBSCRIBE packet you wish to ``` -### Unsubscribe +#### Unsubscribe The Unsubscribe operation takes a description of the UNSUBSCRIBE packet you wish to send and return false if the operation goes wrong. The operation takes in a subscribe completion callback which returns ponding UnSubAckPacket returned by the broker. @@ -556,7 +532,7 @@ The Unsubscribe operation takes a description of the UNSUBSCRIBE packet you wish ``` -### Publish +#### Publish The Publish operation takes a description of the PUBLISH packet you wish to send and return false if the operation goes wrong. The publish completion callback will return a PublishResult, which is a polymorphic value, as soon as the packet has been written to the socket. @@ -595,18 +571,11 @@ If the PUBLISH was a QoS 1 publish, then the completion callback returns a PubAc ``` +## MQTT5 Best Practices -##### Disconnect - -The stop() API supports a DISCONNECT packet as an optional parameter. If supplied, the DISCONNECT packet will be sent to the server prior to closing the socket. You may listen for the 'stopped' event on the client for the result. - +Below are some best practices for the MQTT5 client that are recommended to follow for the best development experience: -``` -if (!mqtt5Client->Stop()) -{ - fprintf(stdout, "Failed to disconnect from the mqtt connection. Exiting..\n"); - return -1; -} -// Waiting for closing the client - -``` +* When creating MQTT5 clients, make sure to use ClientIDs that are unique! If you connect two MQTT5 clients with the same ClientID, they will Disconnect each other! If you do not configure a ClientID, the MQTT5 server will automatically assign one. +* Use the minimum QoS you can get away with for the lowest latency and bandwidth costs. For example, if you are sending data consistently multiple times per second and do not have to have a guarantee the server got each and every publish, using QoS 0 may be ideal compared to QoS 1. Of course, this heavily depends on your use case but generally it is recommended to use the lowest QoS possible. +* If you are getting unexpected disconnects when trying to connect to AWS IoT Core, make sure to check your IoT Core Thing’s policy and permissions to make sure your device is has the permissions it needs to connect! +* For **Publish**, **Subscribe**, and **Unsubscribe**, you can check the reason codes in the CompletionCallbacks to see if the operation actually succeeded. diff --git a/documents/MQTT_CONCEPT.md b/documents/MQTT_CONCEPT.md new file mode 100644 index 000000000..35ee5ee4e --- /dev/null +++ b/documents/MQTT_CONCEPT.md @@ -0,0 +1,115 @@ +# MQTT Concepts + +## Table of Contents +* [What is MQTT](#what-is-mqtt) +* [MQTT Knowledge Essentials](#mqtt-knowledge-essentials) + + [Servers and Clients](#--servers---and---clients---) + + [Terminology and Relationship](#--terminology-and-relationship--) + + [What is a Topic](#--what-is-a-topic--) + + [What is Quality Of Service (QOS)](#--what-is-quality-of-service--qos---) + + [Allowed Operations](#--allowed-operations--) +* [Further Reading](#further-reading-) + + +## What is MQTT + +MQTT is a message protocol often used for IoT devices thanks to its smaller bandwidth cost, its defined spec, and relatively low complexity compared to something like HTTP. MQTT5 is the latest version of MQTT protocol with additional features, like user properties, and developer enhancements, like better error logging, that make developing a MQTT application easier and more powerful. + +*Please note that this document does not include the whole MQTT protocol* and only covers the basic essential MQTT concepts to aid in the understanding and usage of the CPP SDK API. In the Further Reading section there are links to documentation that covers the MQTT protocol in more detail. + +## MQTT Knowledge Essentials + +MQTT is a message protocol, but what does that mean? Simply put, MQTT is a way for a device on one network to send information to a device on another networking using an agreed upon set of rules and protocols. This information is sent through what is called *Packets*, which is data formatted in a specific way so the receiver knows how to parse it and extract the data contained within. The data within a packet is often referred to as the *payload*. + +The concepts section will cover the most important aspects of MQTT relative to its usage in the CPP SDK in the sections below. The first thing that needs to be covered are the two main types of devices on the internet with MQTT: + +### **Servers** and **Clients**: + +* **Server** (interchangeably referred to as *Brokers*): where MQTT packets are sent and processed. A single server can process many packets and have many different MQTT clients (see below) at once. A server may both send and receive packets from one or more clients. + * Servers can perform many different operations with packets depending on the data within, the Quality of Service level (also known as “QoS”), and the topic the packets are being sent to. The server will process incoming packets to determine whether to forward the packet to subscribers (clients who have subscribed to the topic in the packet) and/or responding to the client that sent the packet with an acknowledgement packet. + * AWS IoT Core is a service that provides a MQTT5 server, which devices can connect to and send packets to and from. AWS IoT Core also has services that, when packets are sent to, will invoke certain operations and other services. +* **Client**: what sends and receives packets from the server. A client connects by sending a Connect Packet with information on who the client is, as well as often including authorization data. Upon connecting successfully, an MQTT client can subscribe and unsubscribe from topics, send and receive Publish Packets to topics and from topics it is subscribed to, as well as disconnect and reconnect. + +In general, you will be working on writing code that makes a MQTT5 client and sends data to the server when certain operations happen, to report data from the device, to respond to data sent from the server or another client whose topic the client is subscribed to (more on subscriptions below), or otherwise react based on the packets being sent and received. Because of this, this document will be focusing the majority of the information on the client side of things, rather than the server. + +(*Implementer note*: Link “subscriptions below” to the correct section in the Markdown when adding to GitHub.) + + +### **Terminology and Relationship** + +The connection process for MQTT is different than connection process for a *Client/Server* paradigm. The process to connect in MQTT requires both a *Connection* and a *Session*, in addition to a *Client*. This can be confusing as they have similar functionalities. Below are the rough definitions for each concept: + +* **Client**: Manages the Connection and the Session. A client contains all the information needed to connect to a MQTT server, as well as the interface to use for performing operations. + * Operations are described further below in the operations section. + * (**Implementer note**: Link “operations section” to the section in the Markdown when adding to GitHub.) +* **Connection**: Directly handles packets and communicating with the MQTT server via sockets. The connection is where the MQTT operations are directly performed at. The connection also handles keeping the client connected by responding to PING requests from the server, as well as tracking operations and their timeouts. + * The MQTT client creates a connection. Connections cannot exist without a client. +* **Session**: The period of time where a client is connected to a MQTT server and is able to perform operations. A session ends when the MQTT client is disconnected, shutdown, or otherwise destroyed. + * Sessions exist only when there is a client and connection, and the connection is actively connected to a MQTT server. + +In the CPP SDK, the terminology isn’t quite as important as some MQTT implementations because *in MQTT5 a client can only have a single Connection and Session.* However, it is important to know the terms and what each part means when MQTT5 is discussed. All of your code will interact solely with the MQTT5 client, so if you are unsure, just remember the MQTT5 client is what your code interacts with. + +* Note that in MQTT 3.1.1, often referred to simply as “MQTT” in the CPP SDK code, there are some fundamental differences compared to MQTT5. A few of these differences are listed below: + * In the MQTT 3.1.1 client, the MQTT connection is where your code interacts to perform MQTT operations. In MQTT5, the code instead performs all operations through the MQTT5 client. + * In the MQTT 3.1.1 client, you can have multiple MQTT connections (and by extension, sessions) per MQTT 3.1.1 client. In MQTT5, each MQTT5 client has only a single connection and session. In MQTT5 you can use multiple clients each with their own connection. + * In the MQTT 3.1.1 client, when you subscribe to a topic it adds it to a topic tree so when a publish packet comes in, per-topic callbacks will be invoked. In MQTT5, there is not a topic tree, and instead all subscriptions will invoke the same callback when a publish packet comes in. + + +Additionally, there is some further terms that are important to define in relation to making a connection with MQTT: + +* **Endpoint**: The server address or URL of the MQTT server to connect to. +* **Port**: The network port to use for sending packets to and from the device to the server. In CPP SDK, this can often be left alone as the SDK will automatically set the port based on the connection type. + +### **What is a Topic** + +In MQTT, one of the important functionalities of the MQTT server is to handle sending packets to the proper *topics*. A topic is a string that tells the server where to send a packet when it receives one, so it can properly process or forward the packet on to other clients who are listening for packets on that topic. Topics can be specific or can use wildcards via the asterisk character (*). + +With wildcards, this means a client can make a subscription to a topic of “test/hello-*” for example, and then that client will receive all packets sent to “test” that start with “hello-”. For example, a packet sent to “test/hello-world” and a packet sent to “test/hello-/world” would both be received by a client subscribed to “test/hello-*”. + +It should be noted that not every packet has a topic, like connection and disconnect packets do not include and a topic. + +It should also be noted that topics are extremely important for both the MQTT client and server. The MQTT client needs to know of topics to know where to send data to when performing operations, while the MQTT server needs to process topics to make sure each MQTT client connected gets the proper data as soon as new data is sent to the MQTT server. + + +### **What is Quality Of Service (QOS)** + +Another important term in MQTT is *Quality Of Service*, or *QOS*. QOS dictates how reliable the MQTT packet is and what steps will be taken when it seems data may not be received by the MQTT server. This is important if a client is sending information in a packet that has important data and it is critical to know whether it has to be received by the server or not. There are three levels of QOS and each increasing level means more mechanisms to ensure the server has received the packet. + +* **QOS 0**: This level is often referred to as “*at most once*” and means that the MQTT packet will be sent once and that is it, there will be no additional processing to determine if the packet was received. +* **QOS 1**: This level is often referred to as “*at least once*” and means that the MQTT packet will be sent and then the sender (client or server) will wait for an acknowledgement (ACK) to come back. If an ACK is not received within a certain time frame, then the packet will be resent. + * Packets that have been sent but an ACK not yet received are referred to as “in-flight” packets. + * QOS 1 does not guarantee that the packet will not be sent more than once, as it will continue to resend the packet at a set interval until an ACK is received. +* **QOS 2**: This level is often referred to as “*exactly once*” and means that the MQTT packet will be sent exactly once and no more. This is done through a series of ACKs on both the sender and receiver’s side to confirm that the packet was sent, arrived at the server, and was successfully processed. + * **Note**: **QOS 2 is not supported in the CPP SDK at this time.** + +The higher the QOS level, the more complicated and slower the complete operation will be due to the extra packets. Packets with higher QOS take longer to be fully processed and require more bandwidth than those with a lower QOS. In general, clients should send packets with the minimum QOS that required for the data being sent for faster speeds and less bandwidth. + + +### **Allowed Operations** + +MQTT clients and servers send packets through *operations*. A MQTT client can perform many different operations, each with a different functionality and *associated* *packet*: + +* **Start**: Sends a packet requesting a connection to a server. A connect packet contains information that tells the server who the client is, what settings to use for sending MQTT packets, and what the options the client supports. This packet often also contains authentication information that verifies the client is authorized to connect. This packet performs a handshake with the server that allows the client to perform all other operations describe herein. + * A connect packet can also include something called a **Will**. A will is a publish sent to a topic when the client disconnects and/or the server feels the client has become disconnected due to not responding to PING requests within the agreed upon time. + * The client is the only one that can send a connect packet. However, the server will send an acknowledgement packet, often referred to as the ConnAck packet, with information on whether the connection was successful or not. If successful, the ConnAck packet will also include Negotiated-Settings, which detail the settings the server supports and the client can use to communication. + * **Note**: In the MQTT 3.1.1 client, the Start operation is called **Connect**. Also note that Negotiated-Settings are only sent in MQTT5. +* **Publish**: Sends a packet containing whatever data the client wishes to send to a given topic. A publish can be made with different QOS levels, can be set to be retained (persist on the server). + * Publish packets can have payloads containing string or binary data. +* **Subscribe**: Sends a packet telling the server that the client wants to get any publish packets sent to a specific topic. A subscribe can be made with different QOS levels and can be configured to get retained messages. + * **Note**: Publish packets can be received that are sent from both the client and the server, as well as other clients who are also connected to the server. +* **Unsubscribe**: Sends a packet telling the server that the client no longer wants to get publish packet on a specific topic anymore. +* **Stop**: Sends a packet telling the server to disconnect the client from the server. The disconnect packet can contain a reason for the disconnect and some additional options, like whether to send a will. + * **Note**: In the MQTT 3.1.1 client SDK, the Stop operation is called *Disconnect*. + + +Operations on QOS1 or higher will cause the server to send an acknowledgement packet, often referred to as an ACK packet, when the client performs an operation. For example, if a client performs a publish operation, the client will send a publish packet to the MQTT server and the server will send back a PubAck packet when the publish has been received. These ACK packets often contain information on whether the operation was successful, and if it was unsuccessful, information on why. + +It should also be noted that in MQTT5 most operations and their packets can also include *user properties*. User properties are new to MQTT5 and are key-value pairs that can be set in the packet when a client performs an operation. User properties can be helpful for passing along additional information or context to other MQTT5 clients. + + +## Further Reading: + +Hopefully that has helped give an overview of MQTT and what it is within the CPP SDK. If you are curious to learn more about MQTT, how it works, and what it can do, please see the following links for more information: + +* MQTT 5 standard: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html +* MQTT 3.1.1 standard: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html diff --git a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h index 45db75d6a..0b0559c21 100644 --- a/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h +++ b/greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcModel.h @@ -1429,7 +1429,8 @@ 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; From cbd8cf6880deeef836543a6cbf077f7e727e98af Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 11:46:55 -0800 Subject: [PATCH 37/51] update the sample with updated callback api --- samples/mqtt5/mqtt5_pubsub/main.cpp | 35 +++++++++++++---------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 8938b0b8d..de0d6d02c 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -44,9 +44,9 @@ int main(int argc, char *argv[]) cmdUtils.GetCommand("endpoint"), cmdUtils.GetCommand("cert").c_str(), cmdUtils.GetCommand("key").c_str()); // Setup connection options - std::shared_ptr connectOptions = std::make_shared(); + std::shared_ptr connectOptions = std::make_shared(); // Get the client ID to send with the connection - String clientId = cmdUtils.GetCommandOrDefault("client_id", String("test-") + Aws::Crt::UUID().ToString()); + String clientId = cmdUtils.GetCommandOrDefault("client_id", String("test-") + UUID().ToString()); connectOptions->withClientId(clientId); builder->withConnectOptions(connectOptions); @@ -56,48 +56,45 @@ int main(int argc, char *argv[]) std::promise subscribeSuccess; // Setup lifecycle callbacks - builder->withClientConnectionSuccessCallback([&connectionPromise]( - Mqtt5::Mqtt5Client &, - std::shared_ptr, - std::shared_ptr settings) { - fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); + builder->withClientConnectionSuccessCallback([&connectionPromise](Mqtt5::Mqtt5Client &,const Mqtt5::OnConnectionSuccessEventData& eventData){ + fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", eventData.negotiatedSettings->getClientId().c_str()); connectionPromise.set_value(true); }); builder->withClientConnectionFailureCallback( - [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); + [&connectionPromise](Mqtt5::Mqtt5Client &,const Mqtt5::OnConnectionFailureEventData& eventData){ + fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(eventData.errorCode)); connectionPromise.set_value(false); }); - builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &) { + builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnStoppedEventData&) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); }); builder->withClientAttemptingConnectCallback( - [](Mqtt5::Mqtt5Client &) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + [](Mqtt5::Mqtt5Client &, const Mqtt5::OnAttemptingConnectEventData&) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); builder->withClientDisconnectionCallback( [&disconnectPromise]( - Mqtt5::Mqtt5Client &, int errorCode, std::shared_ptr packet_disconnect) { - fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(errorCode)); + Mqtt5::Mqtt5Client &, const Mqtt5::OnDisconnectionEventData& eventData){ + fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(eventData.errorCode)); disconnectPromise.set_value(); }); builder->withPublishReceivedCallback( [&receiveMutex, &receivedCount, &receiveSignal]( - std::shared_ptr /*client*/, std::shared_ptr publish) { - if (publish == nullptr) + Mqtt5::Mqtt5Client & client, const Mqtt5::PublishReceivedEventData & eventData) { + if (eventData.publishPacket == nullptr) return; std::lock_guard lock(receiveMutex); ++receivedCount; - fprintf(stdout, "Publish received on topic %s:", publish->getTopic().c_str()); - fwrite(publish->getPayload().ptr, 1, publish->getPayload().len, stdout); + fprintf(stdout, "Publish received on topic %s:", eventData.publishPacket->getTopic().c_str()); + fwrite(eventData.publishPacket->getPayload().ptr, 1, eventData.publishPacket->getPayload().len, stdout); fprintf(stdout, "\n"); - for (Mqtt5::UserProperty prop : publish->getUserProperties()) + for (Mqtt5::UserProperty prop : eventData.publishPacket->getUserProperties()) { fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); } @@ -149,7 +146,7 @@ int main(int argc, char *argv[]) } else { - fprintf(stdout, "Publish Succeed."); + fprintf(stdout, "Publish Succeed.\n"); }; }; From 5e6c26f60b5abc934e8213805c63a522cde311e9 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 11:51:19 -0800 Subject: [PATCH 38/51] fix format --- samples/mqtt5/mqtt5_pubsub/main.cpp | 33 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index de0d6d02c..07d23077f 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -56,35 +56,40 @@ int main(int argc, char *argv[]) std::promise subscribeSuccess; // Setup lifecycle callbacks - builder->withClientConnectionSuccessCallback([&connectionPromise](Mqtt5::Mqtt5Client &,const Mqtt5::OnConnectionSuccessEventData& eventData){ - fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", eventData.negotiatedSettings->getClientId().c_str()); - connectionPromise.set_value(true); - }); + builder->withClientConnectionSuccessCallback( + [&connectionPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnConnectionSuccessEventData &eventData) { + fprintf( + stdout, + "Mqtt5 Client connection succeed, clientid: %s.\n", + eventData.negotiatedSettings->getClientId().c_str()); + connectionPromise.set_value(true); + }); builder->withClientConnectionFailureCallback( - [&connectionPromise](Mqtt5::Mqtt5Client &,const Mqtt5::OnConnectionFailureEventData& eventData){ - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(eventData.errorCode)); + [&connectionPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnConnectionFailureEventData &eventData) { + fprintf( + stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(eventData.errorCode)); connectionPromise.set_value(false); - }); + }); - builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnStoppedEventData&) { + builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnStoppedEventData &) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); - }); + }); - builder->withClientAttemptingConnectCallback( - [](Mqtt5::Mqtt5Client &, const Mqtt5::OnAttemptingConnectEventData&) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client &, const Mqtt5::OnAttemptingConnectEventData &) { + fprintf(stdout, "Mqtt5 Client attempting connection...\n"); + }); builder->withClientDisconnectionCallback( - [&disconnectPromise]( - Mqtt5::Mqtt5Client &, const Mqtt5::OnDisconnectionEventData& eventData){ + [&disconnectPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnDisconnectionEventData &eventData) { fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(eventData.errorCode)); disconnectPromise.set_value(); }); builder->withPublishReceivedCallback( [&receiveMutex, &receivedCount, &receiveSignal]( - Mqtt5::Mqtt5Client & client, const Mqtt5::PublishReceivedEventData & eventData) { + Mqtt5::Mqtt5Client &client, const Mqtt5::PublishReceivedEventData &eventData) { if (eventData.publishPacket == nullptr) return; From 741e1919757b7c3b47998cc1dd81499441b5dc02 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 11:54:46 -0800 Subject: [PATCH 39/51] update format and lifecycle events in readme --- documents/MQTT5.md | 34 +++++++++++++++++------------ samples/mqtt5/mqtt5_pubsub/main.cpp | 4 ++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/documents/MQTT5.md b/documents/MQTT5.md index 30a13a10a..b031ff7fb 100644 --- a/documents/MQTT5.md +++ b/documents/MQTT5.md @@ -174,31 +174,37 @@ The MQTT5 client emits a set of events related to state and network status chang std::promise connectionPromise; std::promise stoppedPromise; - builder->withClientConnectionSuccessCallback([&connectionPromise]( - Mqtt5::Mqtt5Client&, - std::shared_ptr, - std::shared_ptr settings) { - fprintf(stdout, "Mqtt5 Client connection succeed, clientid: %s.\n", settings->getClientId().c_str()); - connectionPromise.set_value(true); - }); + // Setup lifecycle callbacks + builder->withClientConnectionSuccessCallback( + [&connectionPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnConnectionSuccessEventData &eventData) { + fprintf( + stdout, + "Mqtt5 Client connection succeed, clientid: %s.\n", + eventData.negotiatedSettings->getClientId().c_str()); + connectionPromise.set_value(true); + }); builder->withClientConnectionFailureCallback( - [&connectionPromise](Mqtt5::Mqtt5Client &, int error_code, std::shared_ptr) { - fprintf(stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(error_code)); + [&connectionPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnConnectionFailureEventData &eventData) { + fprintf( + stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(eventData.errorCode)); connectionPromise.set_value(false); }); - builder->withClientStoppedCallback( - [&stoppedPromise](Mqtt5::Mqtt5Client &) { + builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnStoppedEventData &) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); }); - builder->withPublishReceivedCallback( - [](std::shared_ptr, std::shared_ptr publish) { - fprintf(stdout, "Message received on Topic: %s.\n", publish->getTopic()); + builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client &, const Mqtt5::OnAttemptingConnectEventData &) { + fprintf(stdout, "Mqtt5 Client attempting connection...\n"); }); + builder->withClientDisconnectionCallback( + [](Mqtt5::Mqtt5Client &, const Mqtt5::OnDisconnectionEventData &eventData) { + fprintf(stdout, "Mqtt5 Client disconnection with reason: %s.\n", aws_error_debug_str(eventData.errorCode)); + }); + // Build Mqtt5Client std::shared_ptr client = builder->Build(); diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 07d23077f..1eab3468f 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -70,12 +70,12 @@ int main(int argc, char *argv[]) fprintf( stdout, "Mqtt5 Client connection failed with error: %s.\n", aws_error_debug_str(eventData.errorCode)); connectionPromise.set_value(false); - }); + }); builder->withClientStoppedCallback([&stoppedPromise](Mqtt5::Mqtt5Client &, const Mqtt5::OnStoppedEventData &) { fprintf(stdout, "Mqtt5 Client stopped.\n"); stoppedPromise.set_value(); - }); + }); builder->withClientAttemptingConnectCallback([](Mqtt5::Mqtt5Client &, const Mqtt5::OnAttemptingConnectEventData &) { fprintf(stdout, "Mqtt5 Client attempting connection...\n"); From 187a5883b0d876d51246688df368ddb2a1a78d00 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 12:02:48 -0800 Subject: [PATCH 40/51] update FAQ format --- documents/FAQ.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documents/FAQ.md b/documents/FAQ.md index 09d13edee..b29614206 100644 --- a/documents/FAQ.md +++ b/documents/FAQ.md @@ -73,7 +73,7 @@ Please note that on Mac, once a private key is used with a certificate, that cer static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided. ``` -### How do debug in VSCode? +### How do debug in VSCode? Here is an example launch.json file to run the pubsub sample ``` json @@ -111,14 +111,14 @@ Here is an example launch.json file to run the pubsub sample * Device certificate * Intermediate device certificate that is used to generate the key below * When using samples it can look like this: `--cert abcde12345-certificate.pem.crt` - * Key files + * Key files * You should have generated/downloaded private and public keys that will be used to verify that communications are coming from you * When using samples you only need the private key and it will look like this: `--key abcde12345-private.pem.key` ### I still have more questions about the this sdk? * [Here](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) are the AWS IoT Core docs for more details about IoT Core -* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass +* [Here](https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) are the AWS IoT Greengrass v2 docs for more details about greengrass * [Discussion](https://github.com/aws/aws-iot-device-sdk-cpp-v2/discussions) questions are also a great way to ask other questions about this sdk. * [Open an issue](https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues) if you find a bug or have a feature request * [Breif MQTT CONCEPT](./MQTT_CONCEPT.md) From 35eb08c67a8c571ad4c5096900e92765000443da Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 12:16:33 -0800 Subject: [PATCH 41/51] fix compile issue --- samples/mqtt5/mqtt5_pubsub/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 1eab3468f..8ec1c345e 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -89,7 +89,8 @@ int main(int argc, char *argv[]) builder->withPublishReceivedCallback( [&receiveMutex, &receivedCount, &receiveSignal]( - Mqtt5::Mqtt5Client &client, const Mqtt5::PublishReceivedEventData &eventData) { + Mqtt5::Mqtt5Client &, const Mqtt5::PublishReceivedEventData &eventData) + { if (eventData.publishPacket == nullptr) return; From 881c0769cbffc0c2f34fbb9eff28787bd7d826c2 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 12:22:33 -0800 Subject: [PATCH 42/51] fix format... --- samples/mqtt5/mqtt5_pubsub/main.cpp | 33 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 8ec1c345e..66ed735da 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -87,25 +87,24 @@ int main(int argc, char *argv[]) disconnectPromise.set_value(); }); - builder->withPublishReceivedCallback( - [&receiveMutex, &receivedCount, &receiveSignal]( - Mqtt5::Mqtt5Client &, const Mqtt5::PublishReceivedEventData &eventData) + builder->withPublishReceivedCallback([&receiveMutex, &receivedCount, &receiveSignal]( + Mqtt5::Mqtt5Client &, const Mqtt5::PublishReceivedEventData &eventData) { + if (eventData.publishPacket == nullptr) + return; + + std::lock_guard lock(receiveMutex); + ++receivedCount; + fprintf(stdout, "Publish received on topic %s:", eventData.publishPacket->getTopic().c_str()); + fwrite(eventData.publishPacket->getPayload().ptr, 1, eventData.publishPacket->getPayload().len, stdout); + fprintf(stdout, "\n"); + + for (Mqtt5::UserProperty prop : eventData.publishPacket->getUserProperties()) { - if (eventData.publishPacket == nullptr) - return; - - std::lock_guard lock(receiveMutex); - ++receivedCount; - fprintf(stdout, "Publish received on topic %s:", eventData.publishPacket->getTopic().c_str()); - fwrite(eventData.publishPacket->getPayload().ptr, 1, eventData.publishPacket->getPayload().len, stdout); - fprintf(stdout, "\n"); + fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); + } + receiveSignal.notify_all(); + }); - for (Mqtt5::UserProperty prop : eventData.publishPacket->getUserProperties()) - { - fprintf(stdout, "\twith UserProperty:(%s,%s)\n", prop.getName().c_str(), prop.getValue().c_str()); - } - receiveSignal.notify_all(); - }); // Create Mqtt5Client std::shared_ptr client = builder->Build(); From a19859b14b12cb1008cd3e2a0799d193e089c5cd Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 12:46:19 -0800 Subject: [PATCH 43/51] update ci and mqtt5 sample --- .github/workflows/ci.yml | 12 ++++++------ samples/mqtt5/mqtt5_pubsub/main.cpp | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e44377a..b258eec28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,7 +175,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -220,7 +220,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -261,7 +261,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -329,7 +329,7 @@ jobs: python3 ./aws-iot-device-sdk-cpp-v2/utils/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -365,7 +365,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -423,7 +423,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5-pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index 66ed735da..aec15c439 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include "../../utils/CommandLineUtils.h" using namespace Aws::Crt; From 6bb839a44ded89186ded4aefa6f994ab8bb2f98b Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 13:28:36 -0800 Subject: [PATCH 44/51] fix ci test sample name --- .github/workflows/ci.yml | 13 ++++++------- samples/mqtt5/mqtt5_pubsub/main.cpp | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b258eec28..3076b96ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,7 +175,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -220,7 +220,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -261,7 +261,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -326,10 +326,9 @@ jobs: - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - python3 ./aws-iot-device-sdk-cpp-v2/utils/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -365,7 +364,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -423,7 +422,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5-pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index aec15c439..cd644e94f 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -107,7 +107,6 @@ int main(int argc, char *argv[]) receiveSignal.notify_all(); }); - // Create Mqtt5Client std::shared_ptr client = builder->Build(); From 58f57b8b24426f815e1adeca7da3556be473b149 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 14:33:51 -0800 Subject: [PATCH 45/51] fix ci path --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3076b96ed..eebb0f83f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -306,10 +306,6 @@ jobs: permissions: id-token: write # This is required for requesting the JWT steps: - - name: Checkout Sources - uses: actions/checkout@v2 - with: - submodules: "recursive" - name: Build ${{ env.PACKAGE_NAME }} + consumers run: | python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder')" @@ -328,7 +324,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -364,7 +360,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -422,7 +418,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' From 28448837c03bf285864433eb76a932d88ed0b43e Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 15:16:13 -0800 Subject: [PATCH 46/51] clean up builder/fix ci secrets --- .github/workflows/ci.yml | 12 ++++++------ samples/mqtt5/mqtt5_pubsub/main.cpp | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eebb0f83f..6356f0b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,7 +175,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -220,7 +220,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -261,7 +261,7 @@ jobs: - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} @@ -324,7 +324,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -360,7 +360,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -418,7 +418,7 @@ jobs: python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: run MQTT5 PubSub sample run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' diff --git a/samples/mqtt5/mqtt5_pubsub/main.cpp b/samples/mqtt5/mqtt5_pubsub/main.cpp index cd644e94f..beceacd2b 100644 --- a/samples/mqtt5/mqtt5_pubsub/main.cpp +++ b/samples/mqtt5/mqtt5_pubsub/main.cpp @@ -110,6 +110,8 @@ int main(int argc, char *argv[]) // Create Mqtt5Client std::shared_ptr client = builder->Build(); + delete builder; + if (client == nullptr) { fprintf(stdout, "Client creation failed.\n"); From 5f2f96a9a77566c8a3c29fdbf4523aeb9f55be99 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 15:39:17 -0800 Subject: [PATCH 47/51] update ci mqtt5 credential --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6356f0b15..a2cf3c119 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ env: CI_DEVICE_ADVISOR: ${{ secrets.AWS_CI_DEVICE_ADVISOR_ROLE }} CI_DEVICE_DEFENDER: ${{ secrets.AWS_CI_DEVICE_DEFENDER_ROLE }} CI_SECURE_TUNNEL: ${{ secrets.AWS_CI_SECURE_TUNNEL_ROLE }} + CI_MQTT5_ROLE: ${{ secrets.AWS_CI_MQTT5_ROLE }} jobs: linux-compat: @@ -172,14 +173,19 @@ jobs: run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - - name: run MQTT5 PubSub sample - run: | - cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run MQTT5 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -217,14 +223,19 @@ jobs: run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - - name: run MQTT5 PubSub sample - run: | - cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run MQTT5 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -258,14 +269,19 @@ jobs: run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/RelWithDebInfo/basic-pub-sub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - - name: run MQTT5 PubSub sample - run: | - cd ${{ env.CI_FOLDER }} - python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Windows Certificate Connect sample run: | cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run MQTT5 PubSub sample + run: | + cd ${{ env.CI_FOLDER }} + python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/RelWithDebInfo/mqtt5_pubsub.exe' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Device Advisor) uses: aws-actions/configure-aws-credentials@v1 with: @@ -322,6 +338,11 @@ jobs: - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' @@ -358,6 +379,11 @@ jobs: - name: run MQTT3 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' @@ -416,9 +442,6 @@ jobs: - name: run Basic Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/basic_connect/basic-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - - name: run MQTT5 PubSub sample - run: | - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: run Websocket Connect sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/websocket_connect/websocket-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_arguments '--signing_region us-east-1' @@ -431,6 +454,14 @@ jobs: export SOFTHSM2_CONF=/tmp/softhsm2.conf echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/pkcs11_connect/pkcs11-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/keyp8' --sample_run_softhsm 'true' --sample_arguments '--pkcs11_lib /usr/lib/softhsm/libsofthsm2.so --pin 0000 --token_label my-token --key_label my-key' + - name: configure AWS credentials (MQTT5) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run MQTT5 PubSub sample + run: | + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' - name: configure AWS credentials (Custom Authorizer) uses: aws-actions/configure-aws-credentials@v1 with: From 7a39e2904e443ea3877c613da7f22832accccd9e Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 16:21:09 -0800 Subject: [PATCH 48/51] fix ci format --- .github/workflows/ci.yml | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2cf3c119..56ad33753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,10 +178,10 @@ jobs: cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} @@ -228,10 +228,10 @@ jobs: cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} @@ -274,10 +274,10 @@ jobs: cd ${{ env.CI_FOLDER }} python ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/windows_cert_connect/RelWithDebInfo/windows-cert-connect.exe" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' --sample_run_certutil true - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | cd ${{ env.CI_FOLDER }} @@ -339,10 +339,10 @@ jobs: run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' @@ -380,10 +380,10 @@ jobs: run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/basic_pub_sub/basic-pub-sub" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/key' - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' @@ -455,10 +455,10 @@ jobs: echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file "${{ env.CI_SAMPLES_FOLDER }}/mqtt/pkcs11_connect/pkcs11-connect" --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/PubSub/cert' --sample_secret_private_key 'ci/PubSub/keyp8' --sample_run_softhsm 'true' --sample_arguments '--pkcs11_lib /usr/lib/softhsm/libsofthsm2.so --pin 0000 --token_label my-token --key_label my-key' - name: configure AWS credentials (MQTT5) - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.CI_MQTT5_ROLE }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_MQTT5_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} - name: run MQTT5 PubSub sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --language CPP --sample_file '${{ env.CI_SAMPLES_FOLDER }}/mqtt5/mqtt5_pubsub/mqtt5_pubsub' --sample_region ${{ env.AWS_DEFAULT_REGION }} --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/mqtt5/us/mqtt5_thing/cert' --sample_secret_private_key 'ci/mqtt5/us/mqtt5_thing/key' From 07471ea69ee7a37f0968d2080a795be6b072d96e Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 18:02:42 -0800 Subject: [PATCH 49/51] try fix app verifier --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56ad33753..14752fd63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ env: DA_SHADOW_VALUE_SET: ON DA_SHADOW_VALUE_DEFAULT: OFF CI_FOLDER: "D:/a/work" - CI_UTILS_FOLDER: "./aws-iot-device-sdk-cpp-v2/utils" - CI_SAMPLES_FOLDER: "./aws-iot-device-sdk-cpp-v2/build/samples" + CI_UTILS_FOLDER: ".\aws-iot-device-sdk-cpp-v2\utils" + CI_SAMPLES_FOLDER: ".\aws-iot-device-sdk-cpp-v2/build\samples" CI_IOT_CONTAINERS: ${{ secrets.AWS_CI_IOT_CONTAINERS }} CI_PUBSUB_ROLE: ${{ secrets.AWS_CI_PUBSUB_ROLE }} CI_CYCLEPUBSUB_ROLE: ${{ secrets.AWS_CI_CYCLEPUBSUB_ROLE }} From 78a5750886ae7d698e22b93139f18e782169a452 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 18:12:32 -0800 Subject: [PATCH 50/51] fix app verify slash --- .github/workflows/ci.yml | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14752fd63..99d20d9a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ env: DA_SHADOW_VALUE_SET: ON DA_SHADOW_VALUE_DEFAULT: OFF CI_FOLDER: "D:/a/work" - CI_UTILS_FOLDER: ".\aws-iot-device-sdk-cpp-v2\utils" - CI_SAMPLES_FOLDER: ".\aws-iot-device-sdk-cpp-v2/build\samples" + CI_UTILS_FOLDER: "./aws-iot-device-sdk-cpp-v2/utils" + CI_SAMPLES_FOLDER: "./aws-iot-device-sdk-cpp-v2/build/samples" CI_IOT_CONTAINERS: ${{ secrets.AWS_CI_IOT_CONTAINERS }} CI_PUBSUB_ROLE: ${{ secrets.AWS_CI_PUBSUB_ROLE }} CI_CYCLEPUBSUB_ROLE: ${{ secrets.AWS_CI_CYCLEPUBSUB_ROLE }} @@ -62,8 +62,6 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} - - raspberry: runs-on: ubuntu-20.04 # latest strategy: @@ -86,8 +84,6 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} - - linux-compiler-compat: runs-on: ubuntu-latest strategy: @@ -117,7 +113,6 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} - byo-crypto: runs-on: ubuntu-latest permissions: @@ -133,7 +128,6 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON --variant=skip_sample - linux-no-cpu-extensions: runs-on: ubuntu-latest permissions: @@ -149,7 +143,6 @@ jobs: run: | aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF - windows: runs-on: windows-latest permissions: @@ -195,7 +188,6 @@ jobs: run: | cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py - windows-vs14: runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0) strategy: @@ -245,7 +237,6 @@ jobs: run: | cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py - windows-no-cpu-extensions: runs-on: windows-latest permissions: @@ -291,7 +282,6 @@ jobs: run: | cd ${{ env.CI_FOLDER }}/aws-iot-device-sdk-cpp-v2 python ./deviceadvisor/script/DATestRun.py - windows-app-verifier: runs-on: windows-2022 # latest permissions: @@ -315,8 +305,7 @@ jobs: run: | cd ${{ env.CI_FOLDER }} echo "Starting to run AppVerifier with cycle pub-sub sample" - python ${{ env.CI_UTILS_FOLDER }}/appverifier_launch_sample.py --sample_file "${{ env.CI_SAMPLES_FOLDER }}/pub_sub/cycle_pub_sub/RelWithDebInfo/cycle-pub-sub.exe" --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/CyclePubSub/cert' --sample_secret_private_key 'ci/CyclePubSub/key' - + python ${{ env.CI_UTILS_FOLDER }}/appverifier_launch_sample.py --sample_file "${{ env.CI_SAMPLES_FOLDER }}\pub_sub\cycle_pub_sub\RelWithDebInfo\cycle-pub-sub.exe" --sample_secret_endpoint 'ci/endpoint' --sample_secret_certificate 'ci/CyclePubSub/cert' --sample_secret_private_key 'ci/CyclePubSub/key' osx: runs-on: macos-latest permissions: @@ -355,7 +344,6 @@ jobs: run: | cd ./aws-iot-device-sdk-cpp-v2 python3 ./deviceadvisor/script/DATestRun.py - # Not strictly needed, but allows us to run Device Advisor and PubSub on Linux without needing to run all samples linux-github-actions: runs-on: ubuntu-latest @@ -405,7 +393,6 @@ jobs: run: | cd ./aws-iot-device-sdk-cpp-v2 python3 ./devicedefender/script/DDTestRun.py - # Runs the samples and ensures that everything is working linux-smoke-tests: runs-on: ubuntu-latest @@ -505,7 +492,6 @@ jobs: - name: run Secure Tunneling sample run: | python3 ${{ env.CI_UTILS_FOLDER }}/run_secure_tunnel_ci.py --sample_file "${{ env.CI_SAMPLES_FOLDER }}/secure_tunneling/secure_tunnel/secure-tunnel" --sample_region ${{ env.AWS_DEFAULT_REGION }} - # check that docs can still build check-docs: runs-on: ubuntu-20.04 # latest @@ -515,7 +501,6 @@ jobs: submodules: recursive - name: Check docs run: | - echo "Compiling and installing doxygen 1.8.20 from source" sudo apt-get install -y llvm-11 llvm-11-dev clang-11 libclang-11-dev git clone https://github.com/doxygen/doxygen.git -b Release_1_8_20 @@ -527,9 +512,7 @@ jobs: sudo make install cd ../.. echo "Finished compiling and installing Doxygen" - ./make-docs.py - check-submodules: runs-on: ubuntu-latest steps: From e1817bda8135057416d6ea608b31ccaec01328c8 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Thu, 1 Dec 2022 19:08:15 -0800 Subject: [PATCH 51/51] update aws-crt-cpp version --- crt/aws-crt-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crt/aws-crt-cpp b/crt/aws-crt-cpp index c57371cbf..3e5566293 160000 --- a/crt/aws-crt-cpp +++ b/crt/aws-crt-cpp @@ -1 +1 @@ -Subproject commit c57371cbf5a754a0f5d12a1037be183a61181ff1 +Subproject commit 3e5566293526aa0aecbd46c140e7641f9998d461