/** * 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::ECRPublic::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UploadLayerPartResult::UploadLayerPartResult() : m_lastByteReceived(0) { } UploadLayerPartResult::UploadLayerPartResult(const Aws::AmazonWebServiceResult& result) : m_lastByteReceived(0) { *this = result; } UploadLayerPartResult& UploadLayerPartResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("registryId")) { m_registryId = jsonValue.GetString("registryId"); } if(jsonValue.ValueExists("repositoryName")) { m_repositoryName = jsonValue.GetString("repositoryName"); } if(jsonValue.ValueExists("uploadId")) { m_uploadId = jsonValue.GetString("uploadId"); } if(jsonValue.ValueExists("lastByteReceived")) { m_lastByteReceived = jsonValue.GetInt64("lastByteReceived"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }