/** * 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::ECS::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeClustersResult::DescribeClustersResult() { } DescribeClustersResult::DescribeClustersResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DescribeClustersResult& DescribeClustersResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("clusters")) { Aws::Utils::Array clustersJsonList = jsonValue.GetArray("clusters"); for(unsigned clustersIndex = 0; clustersIndex < clustersJsonList.GetLength(); ++clustersIndex) { m_clusters.push_back(clustersJsonList[clustersIndex].AsObject()); } } if(jsonValue.ValueExists("failures")) { Aws::Utils::Array failuresJsonList = jsonValue.GetArray("failures"); for(unsigned failuresIndex = 0; failuresIndex < failuresJsonList.GetLength(); ++failuresIndex) { m_failures.push_back(failuresJsonList[failuresIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }