/** * 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 OAM { namespace Model { ListLinksItem::ListLinksItem() : m_arnHasBeenSet(false), m_idHasBeenSet(false), m_labelHasBeenSet(false), m_resourceTypesHasBeenSet(false), m_sinkArnHasBeenSet(false) { } ListLinksItem::ListLinksItem(JsonView jsonValue) : m_arnHasBeenSet(false), m_idHasBeenSet(false), m_labelHasBeenSet(false), m_resourceTypesHasBeenSet(false), m_sinkArnHasBeenSet(false) { *this = jsonValue; } ListLinksItem& ListLinksItem::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("Label")) { m_label = jsonValue.GetString("Label"); m_labelHasBeenSet = true; } if(jsonValue.ValueExists("ResourceTypes")) { Aws::Utils::Array resourceTypesJsonList = jsonValue.GetArray("ResourceTypes"); for(unsigned resourceTypesIndex = 0; resourceTypesIndex < resourceTypesJsonList.GetLength(); ++resourceTypesIndex) { m_resourceTypes.push_back(resourceTypesJsonList[resourceTypesIndex].AsString()); } m_resourceTypesHasBeenSet = true; } if(jsonValue.ValueExists("SinkArn")) { m_sinkArn = jsonValue.GetString("SinkArn"); m_sinkArnHasBeenSet = true; } return *this; } JsonValue ListLinksItem::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_labelHasBeenSet) { payload.WithString("Label", m_label); } if(m_resourceTypesHasBeenSet) { Aws::Utils::Array resourceTypesJsonList(m_resourceTypes.size()); for(unsigned resourceTypesIndex = 0; resourceTypesIndex < resourceTypesJsonList.GetLength(); ++resourceTypesIndex) { resourceTypesJsonList[resourceTypesIndex].AsString(m_resourceTypes[resourceTypesIndex]); } payload.WithArray("ResourceTypes", std::move(resourceTypesJsonList)); } if(m_sinkArnHasBeenSet) { payload.WithString("SinkArn", m_sinkArn); } return payload; } } // namespace Model } // namespace OAM } // namespace Aws