68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/codeguruprofiler/model/NotificationConfiguration.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace CodeGuruProfiler
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
NotificationConfiguration::NotificationConfiguration() :
|
|
m_channelsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
NotificationConfiguration::NotificationConfiguration(JsonView jsonValue) :
|
|
m_channelsHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
NotificationConfiguration& NotificationConfiguration::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("channels"))
|
|
{
|
|
Array<JsonView> channelsJsonList = jsonValue.GetArray("channels");
|
|
for(unsigned channelsIndex = 0; channelsIndex < channelsJsonList.GetLength(); ++channelsIndex)
|
|
{
|
|
m_channels.push_back(channelsJsonList[channelsIndex].AsObject());
|
|
}
|
|
m_channelsHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue NotificationConfiguration::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_channelsHasBeenSet)
|
|
{
|
|
Array<JsonValue> channelsJsonList(m_channels.size());
|
|
for(unsigned channelsIndex = 0; channelsIndex < channelsJsonList.GetLength(); ++channelsIndex)
|
|
{
|
|
channelsJsonList[channelsIndex].AsObject(m_channels[channelsIndex].Jsonize());
|
|
}
|
|
payload.WithArray("channels", std::move(channelsJsonList));
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace CodeGuruProfiler
|
|
} // namespace Aws
|