/** * 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; BatchGetBuildsResult::BatchGetBuildsResult() { } BatchGetBuildsResult::BatchGetBuildsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } BatchGetBuildsResult& BatchGetBuildsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("builds")) { Aws::Utils::Array buildsJsonList = jsonValue.GetArray("builds"); for(unsigned buildsIndex = 0; buildsIndex < buildsJsonList.GetLength(); ++buildsIndex) { m_builds.push_back(buildsJsonList[buildsIndex].AsObject()); } } if(jsonValue.ValueExists("buildsNotFound")) { Aws::Utils::Array buildsNotFoundJsonList = jsonValue.GetArray("buildsNotFound"); for(unsigned buildsNotFoundIndex = 0; buildsNotFoundIndex < buildsNotFoundJsonList.GetLength(); ++buildsNotFoundIndex) { m_buildsNotFound.push_back(buildsNotFoundJsonList[buildsNotFoundIndex].AsString()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }