/** * 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::CodeBuild::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; BatchGetReportsResult::BatchGetReportsResult() { } BatchGetReportsResult::BatchGetReportsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } BatchGetReportsResult& BatchGetReportsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("reports")) { Aws::Utils::Array reportsJsonList = jsonValue.GetArray("reports"); for(unsigned reportsIndex = 0; reportsIndex < reportsJsonList.GetLength(); ++reportsIndex) { m_reports.push_back(reportsJsonList[reportsIndex].AsObject()); } } if(jsonValue.ValueExists("reportsNotFound")) { Aws::Utils::Array reportsNotFoundJsonList = jsonValue.GetArray("reportsNotFound"); for(unsigned reportsNotFoundIndex = 0; reportsNotFoundIndex < reportsNotFoundJsonList.GetLength(); ++reportsNotFoundIndex) { m_reportsNotFound.push_back(reportsNotFoundJsonList[reportsNotFoundIndex].AsString()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }