/** * 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::OpsWorks::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeStacksResult::DescribeStacksResult() { } DescribeStacksResult::DescribeStacksResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DescribeStacksResult& DescribeStacksResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Stacks")) { Aws::Utils::Array stacksJsonList = jsonValue.GetArray("Stacks"); for(unsigned stacksIndex = 0; stacksIndex < stacksJsonList.GetLength(); ++stacksIndex) { m_stacks.push_back(stacksJsonList[stacksIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }