/** * 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 Pinpoint { namespace Model { EventsBatch::EventsBatch() : m_endpointHasBeenSet(false), m_eventsHasBeenSet(false) { } EventsBatch::EventsBatch(JsonView jsonValue) : m_endpointHasBeenSet(false), m_eventsHasBeenSet(false) { *this = jsonValue; } EventsBatch& EventsBatch::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Endpoint")) { m_endpoint = jsonValue.GetObject("Endpoint"); m_endpointHasBeenSet = true; } if(jsonValue.ValueExists("Events")) { Aws::Map eventsJsonMap = jsonValue.GetObject("Events").GetAllObjects(); for(auto& eventsItem : eventsJsonMap) { m_events[eventsItem.first] = eventsItem.second.AsObject(); } m_eventsHasBeenSet = true; } return *this; } JsonValue EventsBatch::Jsonize() const { JsonValue payload; if(m_endpointHasBeenSet) { payload.WithObject("Endpoint", m_endpoint.Jsonize()); } if(m_eventsHasBeenSet) { JsonValue eventsJsonMap; for(auto& eventsItem : m_events) { eventsJsonMap.WithObject(eventsItem.first, eventsItem.second.Jsonize()); } payload.WithObject("Events", std::move(eventsJsonMap)); } return payload; } } // namespace Model } // namespace Pinpoint } // namespace Aws