/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace LexRuntimeV2 { namespace Model { TextResponseEvent::TextResponseEvent() : m_messagesHasBeenSet(false), m_eventIdHasBeenSet(false) { } TextResponseEvent::TextResponseEvent(JsonView jsonValue) : m_messagesHasBeenSet(false), m_eventIdHasBeenSet(false) { *this = jsonValue; } TextResponseEvent& TextResponseEvent::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("messages")) { Aws::Utils::Array messagesJsonList = jsonValue.GetArray("messages"); for(unsigned messagesIndex = 0; messagesIndex < messagesJsonList.GetLength(); ++messagesIndex) { m_messages.push_back(messagesJsonList[messagesIndex].AsObject()); } m_messagesHasBeenSet = true; } if(jsonValue.ValueExists("eventId")) { m_eventId = jsonValue.GetString("eventId"); m_eventIdHasBeenSet = true; } return *this; } JsonValue TextResponseEvent::Jsonize() const { JsonValue payload; if(m_messagesHasBeenSet) { Aws::Utils::Array messagesJsonList(m_messages.size()); for(unsigned messagesIndex = 0; messagesIndex < messagesJsonList.GetLength(); ++messagesIndex) { messagesJsonList[messagesIndex].AsObject(m_messages[messagesIndex].Jsonize()); } payload.WithArray("messages", std::move(messagesJsonList)); } if(m_eventIdHasBeenSet) { payload.WithString("eventId", m_eventId); } return payload; } } // namespace Model } // namespace LexRuntimeV2 } // namespace Aws