/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::OAM::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateLinkResult::UpdateLinkResult() { } UpdateLinkResult::UpdateLinkResult(const Aws::AmazonWebServiceResult& result) { *this = result; } UpdateLinkResult& UpdateLinkResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); } if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); } if(jsonValue.ValueExists("Label")) { m_label = jsonValue.GetString("Label"); } if(jsonValue.ValueExists("LabelTemplate")) { m_labelTemplate = jsonValue.GetString("LabelTemplate"); } 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()); } } if(jsonValue.ValueExists("SinkArn")) { m_sinkArn = jsonValue.GetString("SinkArn"); } if(jsonValue.ValueExists("Tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }