/** * 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; DetectCustomLabelsResult::DetectCustomLabelsResult() { } DetectCustomLabelsResult::DetectCustomLabelsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DetectCustomLabelsResult& DetectCustomLabelsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("CustomLabels")) { Aws::Utils::Array customLabelsJsonList = jsonValue.GetArray("CustomLabels"); for(unsigned customLabelsIndex = 0; customLabelsIndex < customLabelsJsonList.GetLength(); ++customLabelsIndex) { m_customLabels.push_back(customLabelsJsonList[customLabelsIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }