/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // THIS CODE IS AUTOGENERATED, DO NOT MODIFY ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// #include "CloudGemMessageOfTheDay_precompiled.h" #include "AWS/ServiceAPI/CloudGemMessageOfTheDayClientComponent.h" namespace CloudGemMessageOfTheDay { namespace ServiceAPI { const char* LmbrAWS_CodeGen_MessageList_UUID= "{b81c0212-dc96-42a9-9db6-f5d20b62fbb2}"; const char* LmbrAWS_CodeGen_PutAdminMessagesReturnType_UUID= "{a7262f91-f469-451d-bc8c-596658e57129}"; const char* LmbrAWS_CodeGen_Component_UUID= "{ec8874a1-c329-11e6-accd-80a589a02a3d}"; const char* LmbrAWS_CodeGen_ResponseHandler_UUID= "{f3b0893b-fdad-431c-be9f-d665cefcc8c2}"; const char* LmbrAWS_CodeGen_NotificationBus1_UUID= "{b21dd18d-8e92-4df0-a300-0745378a4ce1}"; const char* LmbrAWS_CodeGen_RequestBus1_UUID= "{8c17e0c6-9849-470f-9db5-200c9ff8364c}"; const char* LmbrAWS_CodeGen_DeleteAdminMessagesReturnType_UUID= "{ad7519ce-82db-40f5-a854-54d4c3ef1ae0}"; const char* LmbrAWS_CodeGen_DetailedMessageList_UUID= "{a44b97c4-fdcf-45e1-93d6-1f1a3969f59b}"; const char* LmbrAWS_CodeGen_ServiceStatus_UUID= "{b330091d-106c-4809-8cb0-2712dce6dceb}"; const char* LmbrAWS_CodeGen_DetailedMessageData_UUID= "{5676e347-f734-47fc-89e5-c38df825f6db}"; const char* LmbrAWS_CodeGen_MessageData_UUID= "{f756e20b-5b23-4425-8065-75b5850f0252}"; void Configure() { // Insert any necessary CloudGemFramework configuration here } // redefs bool WriteJson(CloudGemFramework::JsonWriter& writer, const int& item) { return writer.Int(item); } bool WriteJson(CloudGemFramework::JsonWriter& writer, const AZStd::string& item) { return writer.String(item); } bool WriteJson(CloudGemFramework::JsonWriter& writer, const double& item) { return writer.Double(item); } bool WriteJson(CloudGemFramework::JsonWriter& writer, const MessageData& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.Key("priority"); ok = ok && WriteJson(writer, item.priority); ok = ok && writer.Key("message"); ok = ok && WriteJson(writer, item.message); ok = ok && writer.Key("endTime"); ok = ok && WriteJson(writer, item.endTime); ok = ok && writer.Key("startTime"); ok = ok && WriteJson(writer, item.startTime); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const PutAdminMessagesReturnType& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const DeleteAdminMessagesReturnType& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const DetailedMessageData& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.Key("priority"); ok = ok && WriteJson(writer, item.priority); ok = ok && writer.Key("message"); ok = ok && WriteJson(writer, item.message); ok = ok && writer.Key("endTime"); ok = ok && WriteJson(writer, item.endTime); ok = ok && writer.Key("UniqueMsgID"); ok = ok && WriteJson(writer, item.UniqueMsgID); ok = ok && writer.Key("startTime"); ok = ok && WriteJson(writer, item.startTime); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const DetailedMessageListPropertyList& list) { bool ok = true; ok = ok && writer.StartArray(); for (auto item : list) { ok = ok && WriteJson(writer, item); } ok = ok && writer.EndArray(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const DetailedMessageList& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.Key("list"); ok = ok && WriteJson(writer, item.list); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const ServiceStatus& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.Key("status"); ok = ok && WriteJson(writer, item.status); ok = ok && writer.EndObject(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const MessageListPropertyList& list) { bool ok = true; ok = ok && writer.StartArray(); for (auto item : list) { ok = ok && WriteJson(writer, item); } ok = ok && writer.EndArray(); return ok; } bool WriteJson(CloudGemFramework::JsonWriter& writer, const MessageList& item) { bool ok = true; ok = ok && writer.StartObject(); ok = ok && writer.Key("list"); ok = ok && WriteJson(writer, item.list); ok = ok && writer.EndObject(); return ok; } // Generated Function Parameters bool PutAdminMessagesRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.SetPathParameter("{""msg_id""}", msg_id); ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool PutAdminMessagesRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; ok = ok && CloudGemMessageOfTheDay::ServiceAPI::WriteJson(writer, msg); return ok; } bool DeleteAdminMessagesRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.SetPathParameter("{""msg_id""}", msg_id); ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool DeleteAdminMessagesRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; return ok; } bool PostAdminMessagesRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool PostAdminMessagesRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; ok = ok && CloudGemMessageOfTheDay::ServiceAPI::WriteJson(writer, msg); return ok; } bool GetAdminMessagesRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.AddQueryParameter("index", index); ok = ok && request.AddQueryParameter("count", count); ok = ok && request.AddQueryParameter("filter", filter); ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool GetAdminMessagesRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; return ok; } bool get_service_statusRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool get_service_statusRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; return ok; } bool GetPlayerMessagesRequest::Parameters::BuildRequest(CloudGemFramework::RequestBuilder& request) { bool ok = true; ok = ok && request.AddQueryParameter("time", time); ok = ok && request.AddQueryParameter("lang", lang); ok = ok && request.WriteJsonBodyParameter(*this); return ok; } bool GetPlayerMessagesRequest::Parameters::WriteJson(CloudGemFramework::JsonWriter& writer) const { bool ok = true; return ok; } // CloudGemMessageOfTheDayNotificationBus void CloudGemMessageOfTheDayNotifications::OnPutAdminMessagesRequestSuccess(const PutAdminMessagesReturnType response) { } void CloudGemMessageOfTheDayNotifications::OnPutAdminMessagesRequestError(const CloudGemFramework::Error error) { } void CloudGemMessageOfTheDayNotifications::OnDeleteAdminMessagesRequestSuccess(const DeleteAdminMessagesReturnType response) { } void CloudGemMessageOfTheDayNotifications::OnDeleteAdminMessagesRequestError(const CloudGemFramework::Error error) { } void CloudGemMessageOfTheDayNotifications::OnPostAdminMessagesRequestSuccess(const DetailedMessageData response) { } void CloudGemMessageOfTheDayNotifications::OnPostAdminMessagesRequestError(const CloudGemFramework::Error error) { } void CloudGemMessageOfTheDayNotifications::OnGetAdminMessagesRequestSuccess(const DetailedMessageList response) { } void CloudGemMessageOfTheDayNotifications::OnGetAdminMessagesRequestError(const CloudGemFramework::Error error) { } void CloudGemMessageOfTheDayNotifications::Onget_service_statusRequestSuccess(const ServiceStatus response) { } void CloudGemMessageOfTheDayNotifications::Onget_service_statusRequestError(const CloudGemFramework::Error error) { } void CloudGemMessageOfTheDayNotifications::OnGetPlayerMessagesRequestSuccess(const MessageList response) { } void CloudGemMessageOfTheDayNotifications::OnGetPlayerMessagesRequestError(const CloudGemFramework::Error error) { } // BehaviorContext CloudGemMessageOfTheDayNotificationBus handler implementation void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnPutAdminMessagesRequestSuccess(const PutAdminMessagesReturnType response) { Call(FN_OnPutAdminMessagesRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnPutAdminMessagesRequestError(const CloudGemFramework::Error error) { Call(FN_OnPutAdminMessagesRequestError, error); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnDeleteAdminMessagesRequestSuccess(const DeleteAdminMessagesReturnType response) { Call(FN_OnDeleteAdminMessagesRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnDeleteAdminMessagesRequestError(const CloudGemFramework::Error error) { Call(FN_OnDeleteAdminMessagesRequestError, error); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnPostAdminMessagesRequestSuccess(const DetailedMessageData response) { Call(FN_OnPostAdminMessagesRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnPostAdminMessagesRequestError(const CloudGemFramework::Error error) { Call(FN_OnPostAdminMessagesRequestError, error); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnGetAdminMessagesRequestSuccess(const DetailedMessageList response) { Call(FN_OnGetAdminMessagesRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnGetAdminMessagesRequestError(const CloudGemFramework::Error error) { Call(FN_OnGetAdminMessagesRequestError, error); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::Onget_service_statusRequestSuccess(const ServiceStatus response) { Call(FN_Onget_service_statusRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::Onget_service_statusRequestError(const CloudGemFramework::Error error) { Call(FN_Onget_service_statusRequestError, error); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnGetPlayerMessagesRequestSuccess(const MessageList response) { Call(FN_OnGetPlayerMessagesRequestSuccess, response); } void BehaviorCloudGemMessageOfTheDayNotificationBusHandler::OnGetPlayerMessagesRequestError(const CloudGemFramework::Error error) { Call(FN_OnGetPlayerMessagesRequestError, error); } // CloudGemMessageOfTheDayRequestBus void CloudGemMessageOfTheDayRequests::PutAdminMessages(const AZStd::string& msg_id, const MessageData& msg, CloudGemMessageOfTheDayResponseHandler* responseHandler) { } void CloudGemMessageOfTheDayRequests::DeleteAdminMessages(const AZStd::string& msg_id, CloudGemMessageOfTheDayResponseHandler* responseHandler) { } void CloudGemMessageOfTheDayRequests::PostAdminMessages(const MessageData& msg, CloudGemMessageOfTheDayResponseHandler* responseHandler) { } void CloudGemMessageOfTheDayRequests::GetAdminMessages(const int& index, const int& count, const AZStd::string& filter, CloudGemMessageOfTheDayResponseHandler* responseHandler) { } void CloudGemMessageOfTheDayRequests::get_service_status(CloudGemMessageOfTheDayResponseHandler* responseHandler) { } void CloudGemMessageOfTheDayRequests::GetPlayerMessages(const AZStd::string& time, const AZStd::string& lang, CloudGemMessageOfTheDayResponseHandler* responseHandler) { } // CloudGemMessageOfTheDayResponseHandler void CloudGemMessageOfTheDayResponseHandler::HandlePutAdminMessagesSuccess(PutAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnPutAdminMessagesRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::HandlePutAdminMessagesError(PutAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnPutAdminMessagesRequestError, job->error); } void CloudGemMessageOfTheDayResponseHandler::HandleDeleteAdminMessagesSuccess(DeleteAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnDeleteAdminMessagesRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::HandleDeleteAdminMessagesError(DeleteAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnDeleteAdminMessagesRequestError, job->error); } void CloudGemMessageOfTheDayResponseHandler::HandlePostAdminMessagesSuccess(PostAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnPostAdminMessagesRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::HandlePostAdminMessagesError(PostAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnPostAdminMessagesRequestError, job->error); } void CloudGemMessageOfTheDayResponseHandler::HandleGetAdminMessagesSuccess(GetAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnGetAdminMessagesRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::HandleGetAdminMessagesError(GetAdminMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnGetAdminMessagesRequestError, job->error); } void CloudGemMessageOfTheDayResponseHandler::Handleget_service_statusSuccess(get_service_statusRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, Onget_service_statusRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::Handleget_service_statusError(get_service_statusRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, Onget_service_statusRequestError, job->error); } void CloudGemMessageOfTheDayResponseHandler::HandleGetPlayerMessagesSuccess(GetPlayerMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnGetPlayerMessagesRequestSuccess, job->result); } void CloudGemMessageOfTheDayResponseHandler::HandleGetPlayerMessagesError(GetPlayerMessagesRequestJob* job, AZ::EntityId entityId) { EBUS_EVENT_ID(entityId, CloudGemMessageOfTheDayNotificationBus, OnGetPlayerMessagesRequestError, job->error); } // CloudGemMessageOfTheDayClientComponent void CloudGemMessageOfTheDayClientComponent::Init() { m_defaultResponseHandler = AZStd::make_shared(); CloudGemMessageOfTheDay::ServiceAPI::Configure(); } void CloudGemMessageOfTheDayClientComponent::Activate() { CloudGemMessageOfTheDayRequestBus::Handler::BusConnect(m_entity->GetId()); } void CloudGemMessageOfTheDayClientComponent::Deactivate() { CloudGemMessageOfTheDayRequestBus::Handler::BusDisconnect(); } void CloudGemMessageOfTheDayClientComponent::PutAdminMessages(const AZStd::string& msg_id, const MessageData& msg, CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job PutAdminMessagesRequestJob* requestJob = PutAdminMessagesRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](PutAdminMessagesRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->HandlePutAdminMessagesSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](PutAdminMessagesRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->HandlePutAdminMessagesError(failedJob, entityId); } } ); requestJob->parameters.msg = msg; requestJob->parameters.msg_id = msg_id; requestJob->Start(); } void CloudGemMessageOfTheDayClientComponent::DeleteAdminMessages(const AZStd::string& msg_id, CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job DeleteAdminMessagesRequestJob* requestJob = DeleteAdminMessagesRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](DeleteAdminMessagesRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->HandleDeleteAdminMessagesSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](DeleteAdminMessagesRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->HandleDeleteAdminMessagesError(failedJob, entityId); } } ); requestJob->parameters.msg_id = msg_id; requestJob->Start(); } void CloudGemMessageOfTheDayClientComponent::PostAdminMessages(const MessageData& msg, CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job PostAdminMessagesRequestJob* requestJob = PostAdminMessagesRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](PostAdminMessagesRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->HandlePostAdminMessagesSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](PostAdminMessagesRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->HandlePostAdminMessagesError(failedJob, entityId); } } ); requestJob->parameters.msg = msg; requestJob->Start(); } void CloudGemMessageOfTheDayClientComponent::GetAdminMessages(const int& index, const int& count, const AZStd::string& filter, CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job GetAdminMessagesRequestJob* requestJob = GetAdminMessagesRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](GetAdminMessagesRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->HandleGetAdminMessagesSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](GetAdminMessagesRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->HandleGetAdminMessagesError(failedJob, entityId); } } ); requestJob->parameters.index = index; requestJob->parameters.count = count; requestJob->parameters.filter = filter; requestJob->Start(); } void CloudGemMessageOfTheDayClientComponent::get_service_status(CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job get_service_statusRequestJob* requestJob = get_service_statusRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](get_service_statusRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->Handleget_service_statusSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](get_service_statusRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->Handleget_service_statusError(failedJob, entityId); } } ); requestJob->Start(); } void CloudGemMessageOfTheDayClientComponent::GetPlayerMessages(const AZStd::string& time, const AZStd::string& lang, CloudGemMessageOfTheDayResponseHandler* responseHandler) { // Cache our entityId in case the entity goes away AZ::EntityId entityId; if (m_entity) { entityId = m_entity->GetId(); } // Cache our default response handler in case this component goes away AZStd::shared_ptr < CloudGemMessageOfTheDayResponseHandler > defaultResponseHandler = m_defaultResponseHandler; // Create job GetPlayerMessagesRequestJob* requestJob = GetPlayerMessagesRequestJob::Create( [responseHandler, defaultResponseHandler, entityId](GetPlayerMessagesRequestJob* successJob) { // handle success CloudGemMessageOfTheDayResponseHandler* successHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (successHandler) { successHandler->HandleGetPlayerMessagesSuccess(successJob, entityId); } }, [responseHandler, defaultResponseHandler, entityId](GetPlayerMessagesRequestJob* failedJob) { // handle error CloudGemMessageOfTheDayResponseHandler* failureHandler = responseHandler ? responseHandler : defaultResponseHandler.get(); if (failureHandler) { failureHandler->HandleGetPlayerMessagesError(failedJob, entityId); } } ); requestJob->parameters.time = time; requestJob->parameters.lang = lang; requestJob->Start(); } bool MessageData::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { if (strcmp(key, "priority") == 0) return reader.Accept(priority); if (strcmp(key, "message") == 0) return reader.Accept(message); if (strcmp(key, "endTime") == 0) return reader.Accept(endTime); if (strcmp(key, "startTime") == 0) return reader.Accept(startTime); return reader.Ignore(); } void MessageData::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_MessageData") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ->Property("priority", BehaviorValueProperty(&MessageData::priority)) ->Property("message", BehaviorValueProperty(&MessageData::message)) ->Property("endTime", BehaviorValueProperty(&MessageData::endTime)) ->Property("startTime", BehaviorValueProperty(&MessageData::startTime)) ; } } bool PutAdminMessagesReturnType::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { return reader.Ignore(); } void PutAdminMessagesReturnType::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_PutAdminMessagesReturnType") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ; } } bool DeleteAdminMessagesReturnType::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { return reader.Ignore(); } void DeleteAdminMessagesReturnType::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_DeleteAdminMessagesReturnType") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ; } } bool DetailedMessageData::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { if (strcmp(key, "priority") == 0) return reader.Accept(priority); if (strcmp(key, "message") == 0) return reader.Accept(message); if (strcmp(key, "endTime") == 0) return reader.Accept(endTime); if (strcmp(key, "UniqueMsgID") == 0) return reader.Accept(UniqueMsgID); if (strcmp(key, "startTime") == 0) return reader.Accept(startTime); return reader.Ignore(); } void DetailedMessageData::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_DetailedMessageData") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ->Property("priority", BehaviorValueProperty(&DetailedMessageData::priority)) ->Property("message", BehaviorValueProperty(&DetailedMessageData::message)) ->Property("endTime", BehaviorValueProperty(&DetailedMessageData::endTime)) ->Property("UniqueMsgID", BehaviorValueProperty(&DetailedMessageData::UniqueMsgID)) ->Property("startTime", BehaviorValueProperty(&DetailedMessageData::startTime)) ; } } bool DetailedMessageList::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { if (strcmp(key, "list") == 0) return reader.Accept(list); return reader.Ignore(); } void DetailedMessageList::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_DetailedMessageList") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ->Property("list", BehaviorValueProperty(&DetailedMessageList::list)) ; } } bool ServiceStatus::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { if (strcmp(key, "status") == 0) return reader.Accept(status); return reader.Ignore(); } void ServiceStatus::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_ServiceStatus") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ->Property("status", BehaviorValueProperty(&ServiceStatus::status)) ; } } bool MessageList::OnJsonKey(const char* key, CloudGemFramework::JsonReader& reader) { if (strcmp(key, "list") == 0) return reader.Accept(list); return reader.Ignore(); } void MessageList::Reflect(AZ::ReflectContext* reflection) { AZ::SerializeContext* serializeContext = azrtti_cast(reflection); if (serializeContext) { serializeContext->Class() ->Version(1); } AZ::BehaviorContext* behaviorContext = azrtti_cast(reflection); if (behaviorContext) { behaviorContext->Class("CloudGemMessageOfTheDay_MessageList") ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value) ->Property("list", BehaviorValueProperty(&MessageList::list)) ; } } } }