/** * 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::Rekognition::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; IndexFacesResult::IndexFacesResult() : m_orientationCorrection(OrientationCorrection::NOT_SET) { } IndexFacesResult::IndexFacesResult(const Aws::AmazonWebServiceResult& result) : m_orientationCorrection(OrientationCorrection::NOT_SET) { *this = result; } IndexFacesResult& IndexFacesResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("FaceRecords")) { Aws::Utils::Array faceRecordsJsonList = jsonValue.GetArray("FaceRecords"); for(unsigned faceRecordsIndex = 0; faceRecordsIndex < faceRecordsJsonList.GetLength(); ++faceRecordsIndex) { m_faceRecords.push_back(faceRecordsJsonList[faceRecordsIndex].AsObject()); } } if(jsonValue.ValueExists("OrientationCorrection")) { m_orientationCorrection = OrientationCorrectionMapper::GetOrientationCorrectionForName(jsonValue.GetString("OrientationCorrection")); } if(jsonValue.ValueExists("FaceModelVersion")) { m_faceModelVersion = jsonValue.GetString("FaceModelVersion"); } if(jsonValue.ValueExists("UnindexedFaces")) { Aws::Utils::Array unindexedFacesJsonList = jsonValue.GetArray("UnindexedFaces"); for(unsigned unindexedFacesIndex = 0; unindexedFacesIndex < unindexedFacesJsonList.GetLength(); ++unindexedFacesIndex) { m_unindexedFaces.push_back(unindexedFacesJsonList[unindexedFacesIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }