/** * 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::ResourceGroups::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ListGroupResourcesResult::ListGroupResourcesResult() { } ListGroupResourcesResult::ListGroupResourcesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } ListGroupResourcesResult& ListGroupResourcesResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Resources")) { Aws::Utils::Array resourcesJsonList = jsonValue.GetArray("Resources"); for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex) { m_resources.push_back(resourcesJsonList[resourcesIndex].AsObject()); } } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } if(jsonValue.ValueExists("QueryErrors")) { Aws::Utils::Array queryErrorsJsonList = jsonValue.GetArray("QueryErrors"); for(unsigned queryErrorsIndex = 0; queryErrorsIndex < queryErrorsJsonList.GetLength(); ++queryErrorsIndex) { m_queryErrors.push_back(queryErrorsJsonList[queryErrorsIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }