/** * 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 { Instance::Instance() : m_idHasBeenSet(false), m_creatorRequestIdHasBeenSet(false), m_attributesHasBeenSet(false) { } Instance::Instance(JsonView jsonValue) : m_idHasBeenSet(false), m_creatorRequestIdHasBeenSet(false), m_attributesHasBeenSet(false) { *this = jsonValue; } Instance& Instance::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("CreatorRequestId")) { m_creatorRequestId = jsonValue.GetString("CreatorRequestId"); m_creatorRequestIdHasBeenSet = true; } if(jsonValue.ValueExists("Attributes")) { Aws::Map attributesJsonMap = jsonValue.GetObject("Attributes").GetAllObjects(); for(auto& attributesItem : attributesJsonMap) { m_attributes[attributesItem.first] = attributesItem.second.AsString(); } m_attributesHasBeenSet = true; } return *this; } JsonValue Instance::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_creatorRequestIdHasBeenSet) { payload.WithString("CreatorRequestId", m_creatorRequestId); } if(m_attributesHasBeenSet) { JsonValue attributesJsonMap; for(auto& attributesItem : m_attributes) { attributesJsonMap.WithString(attributesItem.first, attributesItem.second); } payload.WithObject("Attributes", std::move(attributesJsonMap)); } return payload; } } // namespace Model } // namespace ServiceDiscovery } // namespace Aws