/** * 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; DetectFacesResult::DetectFacesResult() : m_orientationCorrection(OrientationCorrection::NOT_SET) { } DetectFacesResult::DetectFacesResult(const Aws::AmazonWebServiceResult& result) : m_orientationCorrection(OrientationCorrection::NOT_SET) { *this = result; } DetectFacesResult& DetectFacesResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("FaceDetails")) { Aws::Utils::Array faceDetailsJsonList = jsonValue.GetArray("FaceDetails"); for(unsigned faceDetailsIndex = 0; faceDetailsIndex < faceDetailsJsonList.GetLength(); ++faceDetailsIndex) { m_faceDetails.push_back(faceDetailsJsonList[faceDetailsIndex].AsObject()); } } if(jsonValue.ValueExists("OrientationCorrection")) { m_orientationCorrection = OrientationCorrectionMapper::GetOrientationCorrectionForName(jsonValue.GetString("OrientationCorrection")); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }