/** * 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 ServiceDiscovery { namespace Model { NamespaceSummary::NamespaceSummary() : m_idHasBeenSet(false), m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_type(NamespaceType::NOT_SET), m_typeHasBeenSet(false), m_descriptionHasBeenSet(false), m_serviceCount(0), m_serviceCountHasBeenSet(false), m_propertiesHasBeenSet(false), m_createDateHasBeenSet(false) { } NamespaceSummary::NamespaceSummary(JsonView jsonValue) : m_idHasBeenSet(false), m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_type(NamespaceType::NOT_SET), m_typeHasBeenSet(false), m_descriptionHasBeenSet(false), m_serviceCount(0), m_serviceCountHasBeenSet(false), m_propertiesHasBeenSet(false), m_createDateHasBeenSet(false) { *this = jsonValue; } NamespaceSummary& NamespaceSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Type")) { m_type = NamespaceTypeMapper::GetNamespaceTypeForName(jsonValue.GetString("Type")); m_typeHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("ServiceCount")) { m_serviceCount = jsonValue.GetInteger("ServiceCount"); m_serviceCountHasBeenSet = true; } if(jsonValue.ValueExists("Properties")) { m_properties = jsonValue.GetObject("Properties"); m_propertiesHasBeenSet = true; } if(jsonValue.ValueExists("CreateDate")) { m_createDate = jsonValue.GetDouble("CreateDate"); m_createDateHasBeenSet = true; } return *this; } JsonValue NamespaceSummary::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_typeHasBeenSet) { payload.WithString("Type", NamespaceTypeMapper::GetNameForNamespaceType(m_type)); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_serviceCountHasBeenSet) { payload.WithInteger("ServiceCount", m_serviceCount); } if(m_propertiesHasBeenSet) { payload.WithObject("Properties", m_properties.Jsonize()); } if(m_createDateHasBeenSet) { payload.WithDouble("CreateDate", m_createDate.SecondsWithMSPrecision()); } return payload; } } // namespace Model } // namespace ServiceDiscovery } // namespace Aws