/** * 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 WellArchitected { namespace Model { Lens::Lens() : m_lensArnHasBeenSet(false), m_lensVersionHasBeenSet(false), m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_ownerHasBeenSet(false), m_shareInvitationIdHasBeenSet(false), m_tagsHasBeenSet(false) { } Lens::Lens(JsonView jsonValue) : m_lensArnHasBeenSet(false), m_lensVersionHasBeenSet(false), m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_ownerHasBeenSet(false), m_shareInvitationIdHasBeenSet(false), m_tagsHasBeenSet(false) { *this = jsonValue; } Lens& Lens::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("LensArn")) { m_lensArn = jsonValue.GetString("LensArn"); m_lensArnHasBeenSet = true; } if(jsonValue.ValueExists("LensVersion")) { m_lensVersion = jsonValue.GetString("LensVersion"); m_lensVersionHasBeenSet = true; } 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("Owner")) { m_owner = jsonValue.GetString("Owner"); m_ownerHasBeenSet = true; } if(jsonValue.ValueExists("ShareInvitationId")) { m_shareInvitationId = jsonValue.GetString("ShareInvitationId"); m_shareInvitationIdHasBeenSet = true; } if(jsonValue.ValueExists("Tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } m_tagsHasBeenSet = true; } return *this; } JsonValue Lens::Jsonize() const { JsonValue payload; if(m_lensArnHasBeenSet) { payload.WithString("LensArn", m_lensArn); } if(m_lensVersionHasBeenSet) { payload.WithString("LensVersion", m_lensVersion); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_ownerHasBeenSet) { payload.WithString("Owner", m_owner); } if(m_shareInvitationIdHasBeenSet) { payload.WithString("ShareInvitationId", m_shareInvitationId); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("Tags", std::move(tagsJsonMap)); } return payload; } } // namespace Model } // namespace WellArchitected } // namespace Aws