/** * 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 DevOpsGuru { namespace Model { RecommendationRelatedEvent::RecommendationRelatedEvent() : m_nameHasBeenSet(false), m_resourcesHasBeenSet(false) { } RecommendationRelatedEvent::RecommendationRelatedEvent(JsonView jsonValue) : m_nameHasBeenSet(false), m_resourcesHasBeenSet(false) { *this = jsonValue; } RecommendationRelatedEvent& RecommendationRelatedEvent::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Resources")) { Aws::Utils::Array resourcesJsonList = jsonValue.GetArray("Resources"); for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex) { m_resources.push_back(resourcesJsonList[resourcesIndex].AsObject()); } m_resourcesHasBeenSet = true; } return *this; } JsonValue RecommendationRelatedEvent::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_resourcesHasBeenSet) { Aws::Utils::Array resourcesJsonList(m_resources.size()); for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex) { resourcesJsonList[resourcesIndex].AsObject(m_resources[resourcesIndex].Jsonize()); } payload.WithArray("Resources", std::move(resourcesJsonList)); } return payload; } } // namespace Model } // namespace DevOpsGuru } // namespace Aws