/** * 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::APIGateway::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetResourceResult::GetResourceResult() { } GetResourceResult::GetResourceResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetResourceResult& GetResourceResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); } if(jsonValue.ValueExists("parentId")) { m_parentId = jsonValue.GetString("parentId"); } if(jsonValue.ValueExists("pathPart")) { m_pathPart = jsonValue.GetString("pathPart"); } if(jsonValue.ValueExists("path")) { m_path = jsonValue.GetString("path"); } if(jsonValue.ValueExists("resourceMethods")) { Aws::Map resourceMethodsJsonMap = jsonValue.GetObject("resourceMethods").GetAllObjects(); for(auto& resourceMethodsItem : resourceMethodsJsonMap) { m_resourceMethods[resourceMethodsItem.first] = resourceMethodsItem.second.AsObject(); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }