/** * 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::ECR::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; BatchGetImageResult::BatchGetImageResult() { } BatchGetImageResult::BatchGetImageResult(const Aws::AmazonWebServiceResult& result) { *this = result; } BatchGetImageResult& BatchGetImageResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("images")) { Aws::Utils::Array imagesJsonList = jsonValue.GetArray("images"); for(unsigned imagesIndex = 0; imagesIndex < imagesJsonList.GetLength(); ++imagesIndex) { m_images.push_back(imagesJsonList[imagesIndex].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; }