/** * 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 IoTSiteWise { namespace Model { AssetModelCompositeModel::AssetModelCompositeModel() : m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_typeHasBeenSet(false), m_propertiesHasBeenSet(false), m_idHasBeenSet(false) { } AssetModelCompositeModel::AssetModelCompositeModel(JsonView jsonValue) : m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_typeHasBeenSet(false), m_propertiesHasBeenSet(false), m_idHasBeenSet(false) { *this = jsonValue; } AssetModelCompositeModel& AssetModelCompositeModel::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("type")) { m_type = jsonValue.GetString("type"); m_typeHasBeenSet = true; } if(jsonValue.ValueExists("properties")) { Aws::Utils::Array propertiesJsonList = jsonValue.GetArray("properties"); for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex) { m_properties.push_back(propertiesJsonList[propertiesIndex].AsObject()); } m_propertiesHasBeenSet = true; } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } return *this; } JsonValue AssetModelCompositeModel::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_typeHasBeenSet) { payload.WithString("type", m_type); } if(m_propertiesHasBeenSet) { Aws::Utils::Array propertiesJsonList(m_properties.size()); for(unsigned propertiesIndex = 0; propertiesIndex < propertiesJsonList.GetLength(); ++propertiesIndex) { propertiesJsonList[propertiesIndex].AsObject(m_properties[propertiesIndex].Jsonize()); } payload.WithArray("properties", std::move(propertiesJsonList)); } if(m_idHasBeenSet) { payload.WithString("id", m_id); } return payload; } } // namespace Model } // namespace IoTSiteWise } // namespace Aws