/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::Comprehend::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ClassifyDocumentResult::ClassifyDocumentResult() { } ClassifyDocumentResult::ClassifyDocumentResult(const Aws::AmazonWebServiceResult& result) { *this = result; } ClassifyDocumentResult& ClassifyDocumentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Classes")) { Array classesJsonList = jsonValue.GetArray("Classes"); for(unsigned classesIndex = 0; classesIndex < classesJsonList.GetLength(); ++classesIndex) { m_classes.push_back(classesJsonList[classesIndex].AsObject()); } } if(jsonValue.ValueExists("Labels")) { Array labelsJsonList = jsonValue.GetArray("Labels"); for(unsigned labelsIndex = 0; labelsIndex < labelsJsonList.GetLength(); ++labelsIndex) { m_labels.push_back(labelsJsonList[labelsIndex].AsObject()); } } return *this; }