/** * 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 imagebuilder { namespace Model { ContainerRecipeSummary::ContainerRecipeSummary() : m_arnHasBeenSet(false), m_containerType(ContainerType::NOT_SET), m_containerTypeHasBeenSet(false), m_nameHasBeenSet(false), m_platform(Platform::NOT_SET), m_platformHasBeenSet(false), m_ownerHasBeenSet(false), m_parentImageHasBeenSet(false), m_dateCreatedHasBeenSet(false), m_tagsHasBeenSet(false) { } ContainerRecipeSummary::ContainerRecipeSummary(JsonView jsonValue) : m_arnHasBeenSet(false), m_containerType(ContainerType::NOT_SET), m_containerTypeHasBeenSet(false), m_nameHasBeenSet(false), m_platform(Platform::NOT_SET), m_platformHasBeenSet(false), m_ownerHasBeenSet(false), m_parentImageHasBeenSet(false), m_dateCreatedHasBeenSet(false), m_tagsHasBeenSet(false) { *this = jsonValue; } ContainerRecipeSummary& ContainerRecipeSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("containerType")) { m_containerType = ContainerTypeMapper::GetContainerTypeForName(jsonValue.GetString("containerType")); m_containerTypeHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("platform")) { m_platform = PlatformMapper::GetPlatformForName(jsonValue.GetString("platform")); m_platformHasBeenSet = true; } if(jsonValue.ValueExists("owner")) { m_owner = jsonValue.GetString("owner"); m_ownerHasBeenSet = true; } if(jsonValue.ValueExists("parentImage")) { m_parentImage = jsonValue.GetString("parentImage"); m_parentImageHasBeenSet = true; } if(jsonValue.ValueExists("dateCreated")) { m_dateCreated = jsonValue.GetString("dateCreated"); m_dateCreatedHasBeenSet = 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 ContainerRecipeSummary::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_containerTypeHasBeenSet) { payload.WithString("containerType", ContainerTypeMapper::GetNameForContainerType(m_containerType)); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_platformHasBeenSet) { payload.WithString("platform", PlatformMapper::GetNameForPlatform(m_platform)); } if(m_ownerHasBeenSet) { payload.WithString("owner", m_owner); } if(m_parentImageHasBeenSet) { payload.WithString("parentImage", m_parentImage); } if(m_dateCreatedHasBeenSet) { payload.WithString("dateCreated", m_dateCreated); } 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 imagebuilder } // namespace Aws