This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-pinpoint/source/model/EventsBatch.cpp

83 lines
1.5 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/pinpoint/model/EventsBatch.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
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<Aws::String, JsonView> 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