/** * 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 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")) { Aws::Utils::Array 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) { Aws::Utils::Array 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