/** * 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 IoTEvents { namespace Model { OnExitLifecycle::OnExitLifecycle() : m_eventsHasBeenSet(false) { } OnExitLifecycle::OnExitLifecycle(JsonView jsonValue) : m_eventsHasBeenSet(false) { *this = jsonValue; } OnExitLifecycle& OnExitLifecycle::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("events")) { Aws::Utils::Array eventsJsonList = jsonValue.GetArray("events"); for(unsigned eventsIndex = 0; eventsIndex < eventsJsonList.GetLength(); ++eventsIndex) { m_events.push_back(eventsJsonList[eventsIndex].AsObject()); } m_eventsHasBeenSet = true; } return *this; } JsonValue OnExitLifecycle::Jsonize() const { JsonValue payload; if(m_eventsHasBeenSet) { Aws::Utils::Array eventsJsonList(m_events.size()); for(unsigned eventsIndex = 0; eventsIndex < eventsJsonList.GetLength(); ++eventsIndex) { eventsJsonList[eventsIndex].AsObject(m_events[eventsIndex].Jsonize()); } payload.WithArray("events", std::move(eventsJsonList)); } return payload; } } // namespace Model } // namespace IoTEvents } // namespace Aws