/** * 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 AmplifyUIBuilder { namespace Model { ThemeValue::ThemeValue() : m_valueHasBeenSet(false), m_childrenHasBeenSet(false) { } ThemeValue::ThemeValue(JsonView jsonValue) : m_valueHasBeenSet(false), m_childrenHasBeenSet(false) { *this = jsonValue; } ThemeValue& ThemeValue::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("value")) { m_value = jsonValue.GetString("value"); m_valueHasBeenSet = true; } if(jsonValue.ValueExists("children")) { Aws::Utils::Array childrenJsonList = jsonValue.GetArray("children"); for(unsigned childrenIndex = 0; childrenIndex < childrenJsonList.GetLength(); ++childrenIndex) { m_children.push_back(childrenJsonList[childrenIndex].AsObject()); } m_childrenHasBeenSet = true; } return *this; } JsonValue ThemeValue::Jsonize() const { JsonValue payload; if(m_valueHasBeenSet) { payload.WithString("value", m_value); } if(m_childrenHasBeenSet) { Aws::Utils::Array childrenJsonList(m_children.size()); for(unsigned childrenIndex = 0; childrenIndex < childrenJsonList.GetLength(); ++childrenIndex) { childrenJsonList[childrenIndex].AsObject(m_children[childrenIndex].Jsonize()); } payload.WithArray("children", std::move(childrenJsonList)); } return payload; } } // namespace Model } // namespace AmplifyUIBuilder } // namespace Aws