From 67f50165c91da6936035169c3d9e406ec41f8094 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 4 Aug 2020 16:27:21 +0800 Subject: [PATCH] Update RecognizeTable. --- CHANGELOG | 3 + VERSION | 2 +- ocr/CMakeLists.txt | 170 ++++ ocr/include/alibabacloud/ocr/OcrClient.h | 222 +++++ ocr/include/alibabacloud/ocr/OcrExport.h | 32 + .../ocr/model/GetAsyncJobResultRequest.h | 51 ++ .../ocr/model/GetAsyncJobResultResult.h | 59 ++ .../ocr/model/RecognizeAccountPageRequest.h | 51 ++ .../ocr/model/RecognizeAccountPageResult.h | 103 +++ .../ocr/model/RecognizeBankCardRequest.h | 51 ++ .../ocr/model/RecognizeBankCardResult.h | 57 ++ .../ocr/model/RecognizeBusinessCardRequest.h | 51 ++ .../ocr/model/RecognizeBusinessCardResult.h | 62 ++ .../model/RecognizeBusinessLicenseRequest.h | 51 ++ .../model/RecognizeBusinessLicenseResult.h | 96 ++ .../ocr/model/RecognizeCharacterRequest.h | 57 ++ .../ocr/model/RecognizeCharacterResult.h | 69 ++ .../ocr/model/RecognizeChinapassportRequest.h | 48 + .../ocr/model/RecognizeChinapassportResult.h | 76 ++ .../ocr/model/RecognizeDriverLicenseRequest.h | 54 ++ .../ocr/model/RecognizeDriverLicenseResult.h | 71 ++ .../model/RecognizeDrivingLicenseRequest.h | 54 ++ .../ocr/model/RecognizeDrivingLicenseResult.h | 82 ++ .../ocr/model/RecognizeIdentityCardRequest.h | 54 ++ .../ocr/model/RecognizeIdentityCardResult.h | 100 +++ .../ocr/model/RecognizeLicensePlateRequest.h | 51 ++ .../ocr/model/RecognizeLicensePlateResult.h | 70 ++ .../ocr/model/RecognizePassportMRZRequest.h | 48 + .../ocr/model/RecognizePassportMRZResult.h | 63 ++ .../ocr/model/RecognizeQrCodeRequest.h | 53 ++ .../ocr/model/RecognizeQrCodeResult.h | 68 ++ .../ocr/model/RecognizeStampRequest.h | 51 ++ .../ocr/model/RecognizeStampResult.h | 78 ++ .../ocr/model/RecognizeTableRequest.h | 66 ++ .../ocr/model/RecognizeTableResult.h | 76 ++ .../ocr/model/RecognizeTakeoutOrderRequest.h | 48 + .../ocr/model/RecognizeTakeoutOrderResult.h | 62 ++ .../ocr/model/RecognizeTaxiInvoiceRequest.h | 51 ++ .../ocr/model/RecognizeTaxiInvoiceResult.h | 89 ++ .../ocr/model/RecognizeTrainTicketRequest.h | 51 ++ .../ocr/model/RecognizeTrainTicketResult.h | 62 ++ .../ocr/model/RecognizeVATInvoiceRequest.h | 51 ++ .../ocr/model/RecognizeVATInvoiceResult.h | 100 +++ .../ocr/model/RecognizeVINCodeRequest.h | 51 ++ .../ocr/model/RecognizeVINCodeResult.h | 55 ++ .../model/RecognizeVerificationcodeRequest.h | 48 + .../model/RecognizeVerificationcodeResult.h | 55 ++ .../ocr/model/TrimDocumentRequest.h | 57 ++ .../ocr/model/TrimDocumentResult.h | 55 ++ ocr/src/OcrClient.cc | 845 ++++++++++++++++++ ocr/src/model/GetAsyncJobResultRequest.cc | 51 ++ ocr/src/model/GetAsyncJobResultResult.cc | 60 ++ ocr/src/model/RecognizeAccountPageRequest.cc | 51 ++ ocr/src/model/RecognizeAccountPageResult.cc | 133 +++ ocr/src/model/RecognizeBankCardRequest.cc | 51 ++ ocr/src/model/RecognizeBankCardResult.cc | 56 ++ ocr/src/model/RecognizeBusinessCardRequest.cc | 51 ++ ocr/src/model/RecognizeBusinessCardResult.cc | 73 ++ .../model/RecognizeBusinessLicenseRequest.cc | 51 ++ .../model/RecognizeBusinessLicenseResult.cc | 106 +++ ocr/src/model/RecognizeCharacterRequest.cc | 73 ++ ocr/src/model/RecognizeCharacterResult.cc | 71 ++ .../model/RecognizeChinapassportRequest.cc | 40 + ocr/src/model/RecognizeChinapassportResult.cc | 94 ++ .../model/RecognizeDriverLicenseRequest.cc | 62 ++ ocr/src/model/RecognizeDriverLicenseResult.cc | 70 ++ .../model/RecognizeDrivingLicenseRequest.cc | 62 ++ .../model/RecognizeDrivingLicenseResult.cc | 92 ++ ocr/src/model/RecognizeIdentityCardRequest.cc | 62 ++ ocr/src/model/RecognizeIdentityCardResult.cc | 103 +++ ocr/src/model/RecognizeLicensePlateRequest.cc | 51 ++ ocr/src/model/RecognizeLicensePlateResult.cc | 73 ++ ocr/src/model/RecognizePassportMRZRequest.cc | 40 + ocr/src/model/RecognizePassportMRZResult.cc | 67 ++ ocr/src/model/RecognizeQrCodeRequest.cc | 44 + ocr/src/model/RecognizeQrCodeResult.cc | 75 ++ ocr/src/model/RecognizeStampRequest.cc | 51 ++ ocr/src/model/RecognizeStampResult.cc | 80 ++ ocr/src/model/RecognizeTableRequest.cc | 106 +++ ocr/src/model/RecognizeTableResult.cc | 91 ++ ocr/src/model/RecognizeTakeoutOrderRequest.cc | 40 + ocr/src/model/RecognizeTakeoutOrderResult.cc | 65 ++ ocr/src/model/RecognizeTaxiInvoiceRequest.cc | 51 ++ ocr/src/model/RecognizeTaxiInvoiceResult.cc | 88 ++ ocr/src/model/RecognizeTrainTicketRequest.cc | 51 ++ ocr/src/model/RecognizeTrainTicketResult.cc | 66 ++ ocr/src/model/RecognizeVATInvoiceRequest.cc | 51 ++ ocr/src/model/RecognizeVATInvoiceResult.cc | 147 +++ ocr/src/model/RecognizeVINCodeRequest.cc | 51 ++ ocr/src/model/RecognizeVINCodeResult.cc | 52 ++ .../model/RecognizeVerificationcodeRequest.cc | 40 + .../model/RecognizeVerificationcodeResult.cc | 52 ++ ocr/src/model/TrimDocumentRequest.cc | 73 ++ ocr/src/model/TrimDocumentResult.cc | 52 ++ 94 files changed, 6998 insertions(+), 1 deletion(-) create mode 100644 ocr/CMakeLists.txt create mode 100644 ocr/include/alibabacloud/ocr/OcrClient.h create mode 100644 ocr/include/alibabacloud/ocr/OcrExport.h create mode 100644 ocr/include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBankCardRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeCharacterRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeCharacterResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeChinapassportResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizePassportMRZResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h create mode 100644 ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h create mode 100644 ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h create mode 100644 ocr/src/OcrClient.cc create mode 100644 ocr/src/model/GetAsyncJobResultRequest.cc create mode 100644 ocr/src/model/GetAsyncJobResultResult.cc create mode 100644 ocr/src/model/RecognizeAccountPageRequest.cc create mode 100644 ocr/src/model/RecognizeAccountPageResult.cc create mode 100644 ocr/src/model/RecognizeBankCardRequest.cc create mode 100644 ocr/src/model/RecognizeBankCardResult.cc create mode 100644 ocr/src/model/RecognizeBusinessCardRequest.cc create mode 100644 ocr/src/model/RecognizeBusinessCardResult.cc create mode 100644 ocr/src/model/RecognizeBusinessLicenseRequest.cc create mode 100644 ocr/src/model/RecognizeBusinessLicenseResult.cc create mode 100644 ocr/src/model/RecognizeCharacterRequest.cc create mode 100644 ocr/src/model/RecognizeCharacterResult.cc create mode 100644 ocr/src/model/RecognizeChinapassportRequest.cc create mode 100644 ocr/src/model/RecognizeChinapassportResult.cc create mode 100644 ocr/src/model/RecognizeDriverLicenseRequest.cc create mode 100644 ocr/src/model/RecognizeDriverLicenseResult.cc create mode 100644 ocr/src/model/RecognizeDrivingLicenseRequest.cc create mode 100644 ocr/src/model/RecognizeDrivingLicenseResult.cc create mode 100644 ocr/src/model/RecognizeIdentityCardRequest.cc create mode 100644 ocr/src/model/RecognizeIdentityCardResult.cc create mode 100644 ocr/src/model/RecognizeLicensePlateRequest.cc create mode 100644 ocr/src/model/RecognizeLicensePlateResult.cc create mode 100644 ocr/src/model/RecognizePassportMRZRequest.cc create mode 100644 ocr/src/model/RecognizePassportMRZResult.cc create mode 100644 ocr/src/model/RecognizeQrCodeRequest.cc create mode 100644 ocr/src/model/RecognizeQrCodeResult.cc create mode 100644 ocr/src/model/RecognizeStampRequest.cc create mode 100644 ocr/src/model/RecognizeStampResult.cc create mode 100644 ocr/src/model/RecognizeTableRequest.cc create mode 100644 ocr/src/model/RecognizeTableResult.cc create mode 100644 ocr/src/model/RecognizeTakeoutOrderRequest.cc create mode 100644 ocr/src/model/RecognizeTakeoutOrderResult.cc create mode 100644 ocr/src/model/RecognizeTaxiInvoiceRequest.cc create mode 100644 ocr/src/model/RecognizeTaxiInvoiceResult.cc create mode 100644 ocr/src/model/RecognizeTrainTicketRequest.cc create mode 100644 ocr/src/model/RecognizeTrainTicketResult.cc create mode 100644 ocr/src/model/RecognizeVATInvoiceRequest.cc create mode 100644 ocr/src/model/RecognizeVATInvoiceResult.cc create mode 100644 ocr/src/model/RecognizeVINCodeRequest.cc create mode 100644 ocr/src/model/RecognizeVINCodeResult.cc create mode 100644 ocr/src/model/RecognizeVerificationcodeRequest.cc create mode 100644 ocr/src/model/RecognizeVerificationcodeResult.cc create mode 100644 ocr/src/model/TrimDocumentRequest.cc create mode 100644 ocr/src/model/TrimDocumentResult.cc diff --git a/CHANGELOG b/CHANGELOG index e00cf65fb..abe2e57e6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-04 Version: 1.36.556 +- Update RecognizeTable. + 2020-08-04 Version: 1.36.555 - Add Image Url parameter for invoke motor algorithm. diff --git a/VERSION b/VERSION index d1cc257a5..6874df969 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.555 \ No newline at end of file +1.36.556 \ No newline at end of file diff --git a/ocr/CMakeLists.txt b/ocr/CMakeLists.txt new file mode 100644 index 000000000..92cb3c1a6 --- /dev/null +++ b/ocr/CMakeLists.txt @@ -0,0 +1,170 @@ +# +# Copyright 2009-2017 Alibaba Cloud All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(ocr_public_header + include/alibabacloud/ocr/OcrClient.h + include/alibabacloud/ocr/OcrExport.h ) + +set(ocr_public_header_model + include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h + include/alibabacloud/ocr/model/GetAsyncJobResultResult.h + include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h + include/alibabacloud/ocr/model/RecognizeAccountPageResult.h + include/alibabacloud/ocr/model/RecognizeBankCardRequest.h + include/alibabacloud/ocr/model/RecognizeBankCardResult.h + include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h + include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h + include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h + include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h + include/alibabacloud/ocr/model/RecognizeCharacterRequest.h + include/alibabacloud/ocr/model/RecognizeCharacterResult.h + include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h + include/alibabacloud/ocr/model/RecognizeChinapassportResult.h + include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h + include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h + include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h + include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h + include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h + include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h + include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h + include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h + include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h + include/alibabacloud/ocr/model/RecognizePassportMRZResult.h + include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h + include/alibabacloud/ocr/model/RecognizeQrCodeResult.h + include/alibabacloud/ocr/model/RecognizeStampRequest.h + include/alibabacloud/ocr/model/RecognizeStampResult.h + include/alibabacloud/ocr/model/RecognizeTableRequest.h + include/alibabacloud/ocr/model/RecognizeTableResult.h + include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h + include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h + include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h + include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h + include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h + include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h + include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h + include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h + include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h + include/alibabacloud/ocr/model/RecognizeVINCodeResult.h + include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h + include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h + include/alibabacloud/ocr/model/TrimDocumentRequest.h + include/alibabacloud/ocr/model/TrimDocumentResult.h ) + +set(ocr_src + src/OcrClient.cc + src/model/GetAsyncJobResultRequest.cc + src/model/GetAsyncJobResultResult.cc + src/model/RecognizeAccountPageRequest.cc + src/model/RecognizeAccountPageResult.cc + src/model/RecognizeBankCardRequest.cc + src/model/RecognizeBankCardResult.cc + src/model/RecognizeBusinessCardRequest.cc + src/model/RecognizeBusinessCardResult.cc + src/model/RecognizeBusinessLicenseRequest.cc + src/model/RecognizeBusinessLicenseResult.cc + src/model/RecognizeCharacterRequest.cc + src/model/RecognizeCharacterResult.cc + src/model/RecognizeChinapassportRequest.cc + src/model/RecognizeChinapassportResult.cc + src/model/RecognizeDriverLicenseRequest.cc + src/model/RecognizeDriverLicenseResult.cc + src/model/RecognizeDrivingLicenseRequest.cc + src/model/RecognizeDrivingLicenseResult.cc + src/model/RecognizeIdentityCardRequest.cc + src/model/RecognizeIdentityCardResult.cc + src/model/RecognizeLicensePlateRequest.cc + src/model/RecognizeLicensePlateResult.cc + src/model/RecognizePassportMRZRequest.cc + src/model/RecognizePassportMRZResult.cc + src/model/RecognizeQrCodeRequest.cc + src/model/RecognizeQrCodeResult.cc + src/model/RecognizeStampRequest.cc + src/model/RecognizeStampResult.cc + src/model/RecognizeTableRequest.cc + src/model/RecognizeTableResult.cc + src/model/RecognizeTakeoutOrderRequest.cc + src/model/RecognizeTakeoutOrderResult.cc + src/model/RecognizeTaxiInvoiceRequest.cc + src/model/RecognizeTaxiInvoiceResult.cc + src/model/RecognizeTrainTicketRequest.cc + src/model/RecognizeTrainTicketResult.cc + src/model/RecognizeVATInvoiceRequest.cc + src/model/RecognizeVATInvoiceResult.cc + src/model/RecognizeVINCodeRequest.cc + src/model/RecognizeVINCodeResult.cc + src/model/RecognizeVerificationcodeRequest.cc + src/model/RecognizeVerificationcodeResult.cc + src/model/TrimDocumentRequest.cc + src/model/TrimDocumentResult.cc ) + +add_library(ocr ${LIB_TYPE} + ${ocr_public_header} + ${ocr_public_header_model} + ${ocr_src}) + +set_target_properties(ocr + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ocr + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(ocr + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_OCR_LIBRARY) +endif() + +target_include_directories(ocr + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(ocr + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(ocr + jsoncpp) + target_include_directories(ocr + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(ocr + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(ocr + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(ocr + PRIVATE /usr/include/jsoncpp) + target_link_libraries(ocr + jsoncpp) +endif() + +install(FILES ${ocr_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr) +install(FILES ${ocr_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr/model) +install(TARGETS ocr + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/OcrClient.h b/ocr/include/alibabacloud/ocr/OcrClient.h new file mode 100644 index 000000000..4c439984f --- /dev/null +++ b/ocr/include/alibabacloud/ocr/OcrClient.h @@ -0,0 +1,222 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_OCRCLIENT_H_ +#define ALIBABACLOUD_OCR_OCRCLIENT_H_ + +#include +#include +#include +#include +#include "OcrExport.h" +#include "model/GetAsyncJobResultRequest.h" +#include "model/GetAsyncJobResultResult.h" +#include "model/RecognizeAccountPageRequest.h" +#include "model/RecognizeAccountPageResult.h" +#include "model/RecognizeBankCardRequest.h" +#include "model/RecognizeBankCardResult.h" +#include "model/RecognizeBusinessCardRequest.h" +#include "model/RecognizeBusinessCardResult.h" +#include "model/RecognizeBusinessLicenseRequest.h" +#include "model/RecognizeBusinessLicenseResult.h" +#include "model/RecognizeCharacterRequest.h" +#include "model/RecognizeCharacterResult.h" +#include "model/RecognizeChinapassportRequest.h" +#include "model/RecognizeChinapassportResult.h" +#include "model/RecognizeDriverLicenseRequest.h" +#include "model/RecognizeDriverLicenseResult.h" +#include "model/RecognizeDrivingLicenseRequest.h" +#include "model/RecognizeDrivingLicenseResult.h" +#include "model/RecognizeIdentityCardRequest.h" +#include "model/RecognizeIdentityCardResult.h" +#include "model/RecognizeLicensePlateRequest.h" +#include "model/RecognizeLicensePlateResult.h" +#include "model/RecognizePassportMRZRequest.h" +#include "model/RecognizePassportMRZResult.h" +#include "model/RecognizeQrCodeRequest.h" +#include "model/RecognizeQrCodeResult.h" +#include "model/RecognizeStampRequest.h" +#include "model/RecognizeStampResult.h" +#include "model/RecognizeTableRequest.h" +#include "model/RecognizeTableResult.h" +#include "model/RecognizeTakeoutOrderRequest.h" +#include "model/RecognizeTakeoutOrderResult.h" +#include "model/RecognizeTaxiInvoiceRequest.h" +#include "model/RecognizeTaxiInvoiceResult.h" +#include "model/RecognizeTrainTicketRequest.h" +#include "model/RecognizeTrainTicketResult.h" +#include "model/RecognizeVATInvoiceRequest.h" +#include "model/RecognizeVATInvoiceResult.h" +#include "model/RecognizeVINCodeRequest.h" +#include "model/RecognizeVINCodeResult.h" +#include "model/RecognizeVerificationcodeRequest.h" +#include "model/RecognizeVerificationcodeResult.h" +#include "model/TrimDocumentRequest.h" +#include "model/TrimDocumentResult.h" + + +namespace AlibabaCloud +{ + namespace Ocr + { + class ALIBABACLOUD_OCR_EXPORT OcrClient : public RpcServiceClient + { + public: + typedef Outcome GetAsyncJobResultOutcome; + typedef std::future GetAsyncJobResultOutcomeCallable; + typedef std::function&)> GetAsyncJobResultAsyncHandler; + typedef Outcome RecognizeAccountPageOutcome; + typedef std::future RecognizeAccountPageOutcomeCallable; + typedef std::function&)> RecognizeAccountPageAsyncHandler; + typedef Outcome RecognizeBankCardOutcome; + typedef std::future RecognizeBankCardOutcomeCallable; + typedef std::function&)> RecognizeBankCardAsyncHandler; + typedef Outcome RecognizeBusinessCardOutcome; + typedef std::future RecognizeBusinessCardOutcomeCallable; + typedef std::function&)> RecognizeBusinessCardAsyncHandler; + typedef Outcome RecognizeBusinessLicenseOutcome; + typedef std::future RecognizeBusinessLicenseOutcomeCallable; + typedef std::function&)> RecognizeBusinessLicenseAsyncHandler; + typedef Outcome RecognizeCharacterOutcome; + typedef std::future RecognizeCharacterOutcomeCallable; + typedef std::function&)> RecognizeCharacterAsyncHandler; + typedef Outcome RecognizeChinapassportOutcome; + typedef std::future RecognizeChinapassportOutcomeCallable; + typedef std::function&)> RecognizeChinapassportAsyncHandler; + typedef Outcome RecognizeDriverLicenseOutcome; + typedef std::future RecognizeDriverLicenseOutcomeCallable; + typedef std::function&)> RecognizeDriverLicenseAsyncHandler; + typedef Outcome RecognizeDrivingLicenseOutcome; + typedef std::future RecognizeDrivingLicenseOutcomeCallable; + typedef std::function&)> RecognizeDrivingLicenseAsyncHandler; + typedef Outcome RecognizeIdentityCardOutcome; + typedef std::future RecognizeIdentityCardOutcomeCallable; + typedef std::function&)> RecognizeIdentityCardAsyncHandler; + typedef Outcome RecognizeLicensePlateOutcome; + typedef std::future RecognizeLicensePlateOutcomeCallable; + typedef std::function&)> RecognizeLicensePlateAsyncHandler; + typedef Outcome RecognizePassportMRZOutcome; + typedef std::future RecognizePassportMRZOutcomeCallable; + typedef std::function&)> RecognizePassportMRZAsyncHandler; + typedef Outcome RecognizeQrCodeOutcome; + typedef std::future RecognizeQrCodeOutcomeCallable; + typedef std::function&)> RecognizeQrCodeAsyncHandler; + typedef Outcome RecognizeStampOutcome; + typedef std::future RecognizeStampOutcomeCallable; + typedef std::function&)> RecognizeStampAsyncHandler; + typedef Outcome RecognizeTableOutcome; + typedef std::future RecognizeTableOutcomeCallable; + typedef std::function&)> RecognizeTableAsyncHandler; + typedef Outcome RecognizeTakeoutOrderOutcome; + typedef std::future RecognizeTakeoutOrderOutcomeCallable; + typedef std::function&)> RecognizeTakeoutOrderAsyncHandler; + typedef Outcome RecognizeTaxiInvoiceOutcome; + typedef std::future RecognizeTaxiInvoiceOutcomeCallable; + typedef std::function&)> RecognizeTaxiInvoiceAsyncHandler; + typedef Outcome RecognizeTrainTicketOutcome; + typedef std::future RecognizeTrainTicketOutcomeCallable; + typedef std::function&)> RecognizeTrainTicketAsyncHandler; + typedef Outcome RecognizeVATInvoiceOutcome; + typedef std::future RecognizeVATInvoiceOutcomeCallable; + typedef std::function&)> RecognizeVATInvoiceAsyncHandler; + typedef Outcome RecognizeVINCodeOutcome; + typedef std::future RecognizeVINCodeOutcomeCallable; + typedef std::function&)> RecognizeVINCodeAsyncHandler; + typedef Outcome RecognizeVerificationcodeOutcome; + typedef std::future RecognizeVerificationcodeOutcomeCallable; + typedef std::function&)> RecognizeVerificationcodeAsyncHandler; + typedef Outcome TrimDocumentOutcome; + typedef std::future TrimDocumentOutcomeCallable; + typedef std::function&)> TrimDocumentAsyncHandler; + + OcrClient(const Credentials &credentials, const ClientConfiguration &configuration); + OcrClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + OcrClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~OcrClient(); + GetAsyncJobResultOutcome getAsyncJobResult(const Model::GetAsyncJobResultRequest &request)const; + void getAsyncJobResultAsync(const Model::GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetAsyncJobResultOutcomeCallable getAsyncJobResultCallable(const Model::GetAsyncJobResultRequest& request) const; + RecognizeAccountPageOutcome recognizeAccountPage(const Model::RecognizeAccountPageRequest &request)const; + void recognizeAccountPageAsync(const Model::RecognizeAccountPageRequest& request, const RecognizeAccountPageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeAccountPageOutcomeCallable recognizeAccountPageCallable(const Model::RecognizeAccountPageRequest& request) const; + RecognizeBankCardOutcome recognizeBankCard(const Model::RecognizeBankCardRequest &request)const; + void recognizeBankCardAsync(const Model::RecognizeBankCardRequest& request, const RecognizeBankCardAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeBankCardOutcomeCallable recognizeBankCardCallable(const Model::RecognizeBankCardRequest& request) const; + RecognizeBusinessCardOutcome recognizeBusinessCard(const Model::RecognizeBusinessCardRequest &request)const; + void recognizeBusinessCardAsync(const Model::RecognizeBusinessCardRequest& request, const RecognizeBusinessCardAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeBusinessCardOutcomeCallable recognizeBusinessCardCallable(const Model::RecognizeBusinessCardRequest& request) const; + RecognizeBusinessLicenseOutcome recognizeBusinessLicense(const Model::RecognizeBusinessLicenseRequest &request)const; + void recognizeBusinessLicenseAsync(const Model::RecognizeBusinessLicenseRequest& request, const RecognizeBusinessLicenseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeBusinessLicenseOutcomeCallable recognizeBusinessLicenseCallable(const Model::RecognizeBusinessLicenseRequest& request) const; + RecognizeCharacterOutcome recognizeCharacter(const Model::RecognizeCharacterRequest &request)const; + void recognizeCharacterAsync(const Model::RecognizeCharacterRequest& request, const RecognizeCharacterAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeCharacterOutcomeCallable recognizeCharacterCallable(const Model::RecognizeCharacterRequest& request) const; + RecognizeChinapassportOutcome recognizeChinapassport(const Model::RecognizeChinapassportRequest &request)const; + void recognizeChinapassportAsync(const Model::RecognizeChinapassportRequest& request, const RecognizeChinapassportAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeChinapassportOutcomeCallable recognizeChinapassportCallable(const Model::RecognizeChinapassportRequest& request) const; + RecognizeDriverLicenseOutcome recognizeDriverLicense(const Model::RecognizeDriverLicenseRequest &request)const; + void recognizeDriverLicenseAsync(const Model::RecognizeDriverLicenseRequest& request, const RecognizeDriverLicenseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeDriverLicenseOutcomeCallable recognizeDriverLicenseCallable(const Model::RecognizeDriverLicenseRequest& request) const; + RecognizeDrivingLicenseOutcome recognizeDrivingLicense(const Model::RecognizeDrivingLicenseRequest &request)const; + void recognizeDrivingLicenseAsync(const Model::RecognizeDrivingLicenseRequest& request, const RecognizeDrivingLicenseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeDrivingLicenseOutcomeCallable recognizeDrivingLicenseCallable(const Model::RecognizeDrivingLicenseRequest& request) const; + RecognizeIdentityCardOutcome recognizeIdentityCard(const Model::RecognizeIdentityCardRequest &request)const; + void recognizeIdentityCardAsync(const Model::RecognizeIdentityCardRequest& request, const RecognizeIdentityCardAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeIdentityCardOutcomeCallable recognizeIdentityCardCallable(const Model::RecognizeIdentityCardRequest& request) const; + RecognizeLicensePlateOutcome recognizeLicensePlate(const Model::RecognizeLicensePlateRequest &request)const; + void recognizeLicensePlateAsync(const Model::RecognizeLicensePlateRequest& request, const RecognizeLicensePlateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeLicensePlateOutcomeCallable recognizeLicensePlateCallable(const Model::RecognizeLicensePlateRequest& request) const; + RecognizePassportMRZOutcome recognizePassportMRZ(const Model::RecognizePassportMRZRequest &request)const; + void recognizePassportMRZAsync(const Model::RecognizePassportMRZRequest& request, const RecognizePassportMRZAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizePassportMRZOutcomeCallable recognizePassportMRZCallable(const Model::RecognizePassportMRZRequest& request) const; + RecognizeQrCodeOutcome recognizeQrCode(const Model::RecognizeQrCodeRequest &request)const; + void recognizeQrCodeAsync(const Model::RecognizeQrCodeRequest& request, const RecognizeQrCodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeQrCodeOutcomeCallable recognizeQrCodeCallable(const Model::RecognizeQrCodeRequest& request) const; + RecognizeStampOutcome recognizeStamp(const Model::RecognizeStampRequest &request)const; + void recognizeStampAsync(const Model::RecognizeStampRequest& request, const RecognizeStampAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeStampOutcomeCallable recognizeStampCallable(const Model::RecognizeStampRequest& request) const; + RecognizeTableOutcome recognizeTable(const Model::RecognizeTableRequest &request)const; + void recognizeTableAsync(const Model::RecognizeTableRequest& request, const RecognizeTableAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeTableOutcomeCallable recognizeTableCallable(const Model::RecognizeTableRequest& request) const; + RecognizeTakeoutOrderOutcome recognizeTakeoutOrder(const Model::RecognizeTakeoutOrderRequest &request)const; + void recognizeTakeoutOrderAsync(const Model::RecognizeTakeoutOrderRequest& request, const RecognizeTakeoutOrderAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeTakeoutOrderOutcomeCallable recognizeTakeoutOrderCallable(const Model::RecognizeTakeoutOrderRequest& request) const; + RecognizeTaxiInvoiceOutcome recognizeTaxiInvoice(const Model::RecognizeTaxiInvoiceRequest &request)const; + void recognizeTaxiInvoiceAsync(const Model::RecognizeTaxiInvoiceRequest& request, const RecognizeTaxiInvoiceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeTaxiInvoiceOutcomeCallable recognizeTaxiInvoiceCallable(const Model::RecognizeTaxiInvoiceRequest& request) const; + RecognizeTrainTicketOutcome recognizeTrainTicket(const Model::RecognizeTrainTicketRequest &request)const; + void recognizeTrainTicketAsync(const Model::RecognizeTrainTicketRequest& request, const RecognizeTrainTicketAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeTrainTicketOutcomeCallable recognizeTrainTicketCallable(const Model::RecognizeTrainTicketRequest& request) const; + RecognizeVATInvoiceOutcome recognizeVATInvoice(const Model::RecognizeVATInvoiceRequest &request)const; + void recognizeVATInvoiceAsync(const Model::RecognizeVATInvoiceRequest& request, const RecognizeVATInvoiceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeVATInvoiceOutcomeCallable recognizeVATInvoiceCallable(const Model::RecognizeVATInvoiceRequest& request) const; + RecognizeVINCodeOutcome recognizeVINCode(const Model::RecognizeVINCodeRequest &request)const; + void recognizeVINCodeAsync(const Model::RecognizeVINCodeRequest& request, const RecognizeVINCodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeVINCodeOutcomeCallable recognizeVINCodeCallable(const Model::RecognizeVINCodeRequest& request) const; + RecognizeVerificationcodeOutcome recognizeVerificationcode(const Model::RecognizeVerificationcodeRequest &request)const; + void recognizeVerificationcodeAsync(const Model::RecognizeVerificationcodeRequest& request, const RecognizeVerificationcodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeVerificationcodeOutcomeCallable recognizeVerificationcodeCallable(const Model::RecognizeVerificationcodeRequest& request) const; + TrimDocumentOutcome trimDocument(const Model::TrimDocumentRequest &request)const; + void trimDocumentAsync(const Model::TrimDocumentRequest& request, const TrimDocumentAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + TrimDocumentOutcomeCallable trimDocumentCallable(const Model::TrimDocumentRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_OCR_OCRCLIENT_H_ diff --git a/ocr/include/alibabacloud/ocr/OcrExport.h b/ocr/include/alibabacloud/ocr/OcrExport.h new file mode 100644 index 000000000..00e6bd25e --- /dev/null +++ b/ocr/include/alibabacloud/ocr/OcrExport.h @@ -0,0 +1,32 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_OCREXPORT_H_ +#define ALIBABACLOUD_OCR_OCREXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_OCR_LIBRARY) +# define ALIBABACLOUD_OCR_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_OCR_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_OCR_EXPORT +#endif + +#endif // !ALIBABACLOUD_OCR_OCREXPORT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h b/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h new file mode 100644 index 000000000..845f64794 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT GetAsyncJobResultRequest : public RpcServiceRequest + { + + public: + GetAsyncJobResultRequest(); + ~GetAsyncJobResultRequest(); + + bool getAsync()const; + void setAsync(bool async); + std::string getJobId()const; + void setJobId(const std::string& jobId); + + private: + bool async_; + std::string jobId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h b/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h new file mode 100644 index 000000000..4c0480ae4 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h @@ -0,0 +1,59 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT GetAsyncJobResultResult : public ServiceResult + { + public: + struct Data + { + std::string status; + std::string errorCode; + std::string errorMessage; + std::string jobId; + std::string result; + }; + + + GetAsyncJobResultResult(); + explicit GetAsyncJobResultResult(const std::string &payload); + ~GetAsyncJobResultResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h new file mode 100644 index 000000000..4070c1330 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeAccountPageRequest : public RpcServiceRequest + { + + public: + RecognizeAccountPageRequest(); + ~RecognizeAccountPageRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h new file mode 100644 index 000000000..b110ee2c1 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h @@ -0,0 +1,103 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeAccountPageResult : public ServiceResult + { + public: + struct Data + { + struct TitleArea + { + int left; + int top; + int height; + int width; + }; + struct InvalidStampArea + { + int left; + int top; + int height; + int width; + }; + struct UndertakeStampArea + { + int left; + int top; + int height; + int width; + }; + struct RegisterStampArea + { + int left; + int top; + int height; + int width; + }; + struct OtherStampArea + { + int left; + int top; + int height; + int width; + }; + std::string nativePlace; + std::vector otherStampAreas; + std::string birthPlace; + std::vector registerStampAreas; + std::string gender; + std::vector invalidStampAreas; + std::string nationality; + std::string name; + std::vector undertakeStampAreas; + std::string relation; + float angle; + TitleArea titleArea; + std::string birthDate; + std::string iDNumber; + }; + + + RecognizeAccountPageResult(); + explicit RecognizeAccountPageResult(const std::string &payload); + ~RecognizeAccountPageResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBankCardRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeBankCardRequest.h new file mode 100644 index 000000000..d76402a16 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBankCardRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBankCardRequest : public RpcServiceRequest + { + + public: + RecognizeBankCardRequest(); + ~RecognizeBankCardRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h new file mode 100644 index 000000000..b08cc538d --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBankCardResult : public ServiceResult + { + public: + struct Data + { + std::string bankName; + std::string cardNumber; + std::string validDate; + }; + + + RecognizeBankCardResult(); + explicit RecognizeBankCardResult(const std::string &payload); + ~RecognizeBankCardResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h new file mode 100644 index 000000000..4d2fd47e3 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessCardRequest : public RpcServiceRequest + { + + public: + RecognizeBusinessCardRequest(); + ~RecognizeBusinessCardRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h new file mode 100644 index 000000000..87bfaeba0 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessCardResult : public ServiceResult + { + public: + struct Data + { + std::vector addresses; + std::vector departments; + std::vector companies; + std::vector emails; + std::vector officePhoneNumbers; + std::vector cellPhoneNumbers; + std::vector titles; + std::string name; + }; + + + RecognizeBusinessCardResult(); + explicit RecognizeBusinessCardResult(const std::string &payload); + ~RecognizeBusinessCardResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h new file mode 100644 index 000000000..dcab73266 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessLicenseRequest : public RpcServiceRequest + { + + public: + RecognizeBusinessLicenseRequest(); + ~RecognizeBusinessLicenseRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h new file mode 100644 index 000000000..2efb4cb81 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h @@ -0,0 +1,96 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessLicenseResult : public ServiceResult + { + public: + struct Data + { + struct Emblem + { + int left; + int top; + int height; + int width; + }; + struct Title + { + int left; + int top; + int height; + int width; + }; + struct Stamp + { + int left; + int top; + int height; + int width; + }; + struct QRCode + { + int left; + int top; + int height; + int width; + }; + Stamp stamp; + std::string validPeriod; + std::string address; + Title title; + std::string capital; + std::string legalPerson; + std::string establishDate; + std::string name; + std::string registerNumber; + QRCode qRCode; + std::string type; + std::string angle; + Emblem emblem; + std::string business; + }; + + + RecognizeBusinessLicenseResult(); + explicit RecognizeBusinessLicenseResult(const std::string &payload); + ~RecognizeBusinessLicenseResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeCharacterRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeCharacterRequest.h new file mode 100644 index 000000000..61e1b8d4c --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeCharacterRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeCharacterRequest : public RpcServiceRequest + { + + public: + RecognizeCharacterRequest(); + ~RecognizeCharacterRequest(); + + int getImageType()const; + void setImageType(int imageType); + bool getOutputProbability()const; + void setOutputProbability(bool outputProbability); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + int getMinHeight()const; + void setMinHeight(int minHeight); + + private: + int imageType_; + bool outputProbability_; + std::string imageURL_; + int minHeight_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeCharacterResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeCharacterResult.h new file mode 100644 index 000000000..aa2a3290f --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeCharacterResult.h @@ -0,0 +1,69 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeCharacterResult : public ServiceResult + { + public: + struct Data + { + struct Result + { + struct TextRectangles + { + int left; + int angle; + int top; + int height; + int width; + }; + TextRectangles textRectangles; + float probability; + std::string text; + }; + std::vector results; + }; + + + RecognizeCharacterResult(); + explicit RecognizeCharacterResult(const std::string &payload); + ~RecognizeCharacterResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h new file mode 100644 index 000000000..f7bac70ad --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeChinapassportRequest : public RpcServiceRequest + { + + public: + RecognizeChinapassportRequest(); + ~RecognizeChinapassportRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportResult.h new file mode 100644 index 000000000..58b58f49b --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeChinapassportResult.h @@ -0,0 +1,76 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeChinapassportResult : public ServiceResult + { + public: + struct Data + { + std::string expiryDate; + std::string sourceCountry; + std::string birthPlace; + std::string issuePlaceRaw; + std::string nameChineseRaw; + std::string authority; + std::string sex; + std::string issueDate; + std::string birthDay; + std::string lineZero; + std::string issuePlace; + std::string expiryDay; + bool success; + std::string name; + std::string lineOne; + std::string nameChinese; + std::string type; + std::string personId; + std::string passportNo; + std::string birthPlaceRaw; + std::string country; + std::string birthDate; + }; + + + RecognizeChinapassportResult(); + explicit RecognizeChinapassportResult(const std::string &payload); + ~RecognizeChinapassportResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h new file mode 100644 index 000000000..f4e1e4962 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeDriverLicenseRequest : public RpcServiceRequest + { + + public: + RecognizeDriverLicenseRequest(); + ~RecognizeDriverLicenseRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getSide()const; + void setSide(const std::string& side); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string side_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h new file mode 100644 index 000000000..a734f0a6f --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h @@ -0,0 +1,71 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeDriverLicenseResult : public ServiceResult + { + public: + struct Data + { + struct FaceResult + { + std::string startDate; + std::string address; + std::string licenseNumber; + std::string vehicleType; + std::string issueDate; + std::string gender; + std::string endDate; + std::string name; + }; + struct BackResult + { + std::string archiveNumber; + }; + FaceResult faceResult; + BackResult backResult; + }; + + + RecognizeDriverLicenseResult(); + explicit RecognizeDriverLicenseResult(const std::string &payload); + ~RecognizeDriverLicenseResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h new file mode 100644 index 000000000..b8c8786df --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeDrivingLicenseRequest : public RpcServiceRequest + { + + public: + RecognizeDrivingLicenseRequest(); + ~RecognizeDrivingLicenseRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getSide()const; + void setSide(const std::string& side); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string side_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h new file mode 100644 index 000000000..39f11ee12 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h @@ -0,0 +1,82 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeDrivingLicenseResult : public ServiceResult + { + public: + struct Data + { + struct FaceResult + { + std::string plateNumber; + std::string owner; + std::string engineNumber; + std::string address; + std::string vehicleType; + std::string model; + std::string registerDate; + std::string issueDate; + std::string vin; + std::string useCharacter; + }; + struct BackResult + { + std::string approvedPassengerCapacity; + std::string grossMass; + std::string plateNumber; + std::string energyType; + std::string tractionMass; + std::string approvedLoad; + std::string inspectionRecord; + std::string unladenMass; + std::string fileNumber; + std::string overallDimension; + }; + FaceResult faceResult; + BackResult backResult; + }; + + + RecognizeDrivingLicenseResult(); + explicit RecognizeDrivingLicenseResult(const std::string &payload); + ~RecognizeDrivingLicenseResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h new file mode 100644 index 000000000..af4cc4609 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeIdentityCardRequest : public RpcServiceRequest + { + + public: + RecognizeIdentityCardRequest(); + ~RecognizeIdentityCardRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getSide()const; + void setSide(const std::string& side); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string side_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h new file mode 100644 index 000000000..607647fd1 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h @@ -0,0 +1,100 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeIdentityCardResult : public ServiceResult + { + public: + struct Data + { + struct FrontResult + { + struct FaceRectangle + { + struct Center + { + float x; + float y; + }; + struct Size + { + float height; + float width; + }; + Center center; + float angle; + Size size; + }; + struct CardArea + { + float x; + float y; + }; + struct FaceRectVertice + { + float x; + float y; + }; + std::string address; + FaceRectangle faceRectangle; + std::vector faceRectVertices; + std::vector cardAreas; + std::string gender; + std::string nationality; + std::string name; + std::string iDNumber; + std::string birthDate; + }; + struct BackResult + { + std::string startDate; + std::string issue; + std::string endDate; + }; + FrontResult frontResult; + BackResult backResult; + }; + + + RecognizeIdentityCardResult(); + explicit RecognizeIdentityCardResult(const std::string &payload); + ~RecognizeIdentityCardResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h new file mode 100644 index 000000000..d9e8dda54 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeLicensePlateRequest : public RpcServiceRequest + { + + public: + RecognizeLicensePlateRequest(); + ~RecognizeLicensePlateRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h new file mode 100644 index 000000000..950db1d03 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h @@ -0,0 +1,70 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeLicensePlateResult : public ServiceResult + { + public: + struct Data + { + struct Plate + { + struct Roi + { + int w; + int h; + int x; + int y; + }; + std::string plateNumber; + float confidence; + std::string plateType; + float plateTypeConfidence; + Roi roi; + }; + std::vector plates; + }; + + + RecognizeLicensePlateResult(); + explicit RecognizeLicensePlateResult(const std::string &payload); + ~RecognizeLicensePlateResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h new file mode 100644 index 000000000..d56de439d --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizePassportMRZRequest : public RpcServiceRequest + { + + public: + RecognizePassportMRZRequest(); + ~RecognizePassportMRZRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZResult.h b/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZResult.h new file mode 100644 index 000000000..dd5bba2fe --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizePassportMRZResult.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizePassportMRZResult : public ServiceResult + { + public: + struct Data + { + struct Region + { + std::string content; + float recognitionScore; + std::vector bandBoxes; + std::string name; + float detectionScore; + }; + std::vector regions; + }; + + + RecognizePassportMRZResult(); + explicit RecognizePassportMRZResult(const std::string &payload); + ~RecognizePassportMRZResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h new file mode 100644 index 000000000..a00cd4894 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h @@ -0,0 +1,53 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeQrCodeRequest : public RpcServiceRequest + { + public: + struct Tasks + { + std::string imageURL; + }; + + public: + RecognizeQrCodeRequest(); + ~RecognizeQrCodeRequest(); + + std::vector getTasks()const; + void setTasks(const std::vector& tasks); + + private: + std::vector tasks_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h new file mode 100644 index 000000000..4083164f5 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h @@ -0,0 +1,68 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeQrCodeResult : public ServiceResult + { + public: + struct Data + { + struct Element + { + struct Result + { + std::string suggestion; + float rate; + std::vector qrCodesData; + std::string label; + }; + std::string taskId; + std::vector results; + std::string imageURL; + }; + std::vector elements; + }; + + + RecognizeQrCodeResult(); + explicit RecognizeQrCodeResult(const std::string &payload); + ~RecognizeQrCodeResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h new file mode 100644 index 000000000..7b97c8f4b --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeStampRequest : public RpcServiceRequest + { + + public: + RecognizeStampRequest(); + ~RecognizeStampRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h new file mode 100644 index 000000000..92b381fb2 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h @@ -0,0 +1,78 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeStampResult : public ServiceResult + { + public: + struct Data + { + struct ResultsItem + { + struct Roi + { + int left; + int top; + int height; + int width; + }; + struct Text + { + float confidence; + std::string content; + }; + struct GeneralTextItem + { + float confidence; + std::string content; + }; + Text text; + Roi roi; + std::vector generalText; + }; + std::vector results; + }; + + + RecognizeStampResult(); + explicit RecognizeStampResult(const std::string &payload); + ~RecognizeStampResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h new file mode 100644 index 000000000..dec82d3c4 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h @@ -0,0 +1,66 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTableRequest : public RpcServiceRequest + { + + public: + RecognizeTableRequest(); + ~RecognizeTableRequest(); + + int getImageType()const; + void setImageType(int imageType); + bool getUseFinanceModel()const; + void setUseFinanceModel(bool useFinanceModel); + bool getSkipDetection()const; + void setSkipDetection(bool skipDetection); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + std::string getOutputFormat()const; + void setOutputFormat(const std::string& outputFormat); + bool getAssureDirection()const; + void setAssureDirection(bool assureDirection); + bool getHasLine()const; + void setHasLine(bool hasLine); + + private: + int imageType_; + bool useFinanceModel_; + bool skipDetection_; + std::string imageURL_; + std::string outputFormat_; + bool assureDirection_; + bool hasLine_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h new file mode 100644 index 000000000..ba48e6d73 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h @@ -0,0 +1,76 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTableResult : public ServiceResult + { + public: + struct Data + { + struct Table + { + struct TableRow + { + struct TableColumn + { + int endRow; + int endColumn; + std::vector texts; + int height; + int width; + int startRow; + int startColumn; + }; + std::vector tableColumns; + }; + std::vector head; + std::vector tail; + std::vector tableRows; + }; + std::string fileContent; + std::vector tables; + }; + + + RecognizeTableResult(); + explicit RecognizeTableResult(const std::string &payload); + ~RecognizeTableResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h new file mode 100644 index 000000000..cd01fb3fd --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTakeoutOrderRequest : public RpcServiceRequest + { + + public: + RecognizeTakeoutOrderRequest(); + ~RecognizeTakeoutOrderRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h new file mode 100644 index 000000000..ff238e201 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTakeoutOrderResult : public ServiceResult + { + public: + struct Data + { + struct Element + { + float score; + std::string value; + std::string name; + std::vector boxes; + }; + std::vector elements; + }; + + + RecognizeTakeoutOrderResult(); + explicit RecognizeTakeoutOrderResult(const std::string &payload); + ~RecognizeTakeoutOrderResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h new file mode 100644 index 000000000..e146be7e0 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTaxiInvoiceRequest : public RpcServiceRequest + { + + public: + RecognizeTaxiInvoiceRequest(); + ~RecognizeTaxiInvoiceRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h new file mode 100644 index 000000000..f797e071d --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h @@ -0,0 +1,89 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTaxiInvoiceResult : public ServiceResult + { + public: + struct Data + { + struct Invoice + { + struct InvoiceRoi + { + float w; + float h; + float x; + float y; + }; + struct Item + { + struct ItemRoi + { + struct Center + { + float x; + float y; + }; + struct Size + { + float w; + float h; + }; + Center center; + float angle; + Size size; + }; + ItemRoi itemRoi; + std::string text; + }; + int rotateType; + InvoiceRoi invoiceRoi; + std::vector items; + }; + std::vector invoices; + }; + + + RecognizeTaxiInvoiceResult(); + explicit RecognizeTaxiInvoiceResult(const std::string &payload); + ~RecognizeTaxiInvoiceResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h new file mode 100644 index 000000000..ac3bd7661 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTrainTicketRequest : public RpcServiceRequest + { + + public: + RecognizeTrainTicketRequest(); + ~RecognizeTrainTicketRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h new file mode 100644 index 000000000..b00c57226 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeTrainTicketResult : public ServiceResult + { + public: + struct Data + { + std::string destination; + std::string seat; + std::string number; + float price; + std::string level; + std::string date; + std::string name; + std::string departureStation; + }; + + + RecognizeTrainTicketResult(); + explicit RecognizeTrainTicketResult(const std::string &payload); + ~RecognizeTrainTicketResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h new file mode 100644 index 000000000..9c1c96e66 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVATInvoiceRequest : public RpcServiceRequest + { + + public: + RecognizeVATInvoiceRequest(); + ~RecognizeVATInvoiceRequest(); + + std::string getFileType()const; + void setFileType(const std::string& fileType); + std::string getFileURL()const; + void setFileURL(const std::string& fileURL); + + private: + std::string fileType_; + std::string fileURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h new file mode 100644 index 000000000..cf1cbcfa7 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h @@ -0,0 +1,100 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVATInvoiceResult : public ServiceResult + { + public: + struct Data + { + struct Content + { + std::string checker; + std::string payeeAddress; + std::string payeeName; + std::string payerAddress; + std::string antiFakeCode; + std::string payerBankName; + std::string invoiceNo; + std::string payerRegisterNo; + std::string payerName; + std::string withoutTaxAmount; + std::string invoiceAmount; + std::string taxAmount; + std::string payeeBankName; + std::string clerk; + std::string invoiceCode; + std::string payeeRegisterNo; + std::string invoiceDate; + std::string sumAmount; + std::string payee; + }; + struct Box + { + std::vector payerRegisterNoes; + std::vector payerAddresses; + std::vector invoiceAmounts; + std::vector invoiceDates; + std::vector payeeAddresses; + std::vector clerks; + std::vector withoutTaxAmounts; + std::vector checkers; + std::vector invoiceCodes; + std::vector taxAmounts; + std::vector sumAmounts; + std::vector payerNames; + std::vector invoiceFakeCodes; + std::vector payeeNames; + std::vector payeeBankNames; + std::vector payees; + std::vector invoiceNoes; + std::vector payerBankNames; + std::vector payeeRegisterNoes; + }; + Content content; + Box box; + }; + + + RecognizeVATInvoiceResult(); + explicit RecognizeVATInvoiceResult(const std::string &payload); + ~RecognizeVATInvoiceResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h new file mode 100644 index 000000000..95dc41b3a --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVINCodeRequest : public RpcServiceRequest + { + + public: + RecognizeVINCodeRequest(); + ~RecognizeVINCodeRequest(); + + int getImageType()const; + void setImageType(int imageType); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + int imageType_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h new file mode 100644 index 000000000..a35f696ef --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVINCodeResult : public ServiceResult + { + public: + struct Data + { + std::string vinCode; + }; + + + RecognizeVINCodeResult(); + explicit RecognizeVINCodeResult(const std::string &payload); + ~RecognizeVINCodeResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h b/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h new file mode 100644 index 000000000..91cb3a1a1 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVerificationcodeRequest : public RpcServiceRequest + { + + public: + RecognizeVerificationcodeRequest(); + ~RecognizeVerificationcodeRequest(); + + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h b/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h new file mode 100644 index 000000000..3a6206e10 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT RecognizeVerificationcodeResult : public ServiceResult + { + public: + struct Data + { + std::string content; + }; + + + RecognizeVerificationcodeResult(); + explicit RecognizeVerificationcodeResult(const std::string &payload); + ~RecognizeVerificationcodeResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h b/ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h new file mode 100644 index 000000000..a0848db63 --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_ +#define ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT TrimDocumentRequest : public RpcServiceRequest + { + + public: + TrimDocumentRequest(); + ~TrimDocumentRequest(); + + std::string getFileType()const; + void setFileType(const std::string& fileType); + bool getAsync()const; + void setAsync(bool async); + std::string getFileURL()const; + void setFileURL(const std::string& fileURL); + std::string getOutputType()const; + void setOutputType(const std::string& outputType); + + private: + std::string fileType_; + bool async_; + std::string fileURL_; + std::string outputType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_ \ No newline at end of file diff --git a/ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h b/ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h new file mode 100644 index 000000000..8f63f3f2e --- /dev/null +++ b/ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_ +#define ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ocr + { + namespace Model + { + class ALIBABACLOUD_OCR_EXPORT TrimDocumentResult : public ServiceResult + { + public: + struct Data + { + std::string content; + }; + + + TrimDocumentResult(); + explicit TrimDocumentResult(const std::string &payload); + ~TrimDocumentResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_ \ No newline at end of file diff --git a/ocr/src/OcrClient.cc b/ocr/src/OcrClient.cc new file mode 100644 index 000000000..0d0c1e264 --- /dev/null +++ b/ocr/src/OcrClient.cc @@ -0,0 +1,845 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +namespace +{ + const std::string SERVICE_NAME = "ocr"; +} + +OcrClient::OcrClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "ocr"); +} + +OcrClient::OcrClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "ocr"); +} + +OcrClient::OcrClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "ocr"); +} + +OcrClient::~OcrClient() +{} + +OcrClient::GetAsyncJobResultOutcome OcrClient::getAsyncJobResult(const GetAsyncJobResultRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetAsyncJobResultOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetAsyncJobResultOutcome(GetAsyncJobResultResult(outcome.result())); + else + return GetAsyncJobResultOutcome(outcome.error()); +} + +void OcrClient::getAsyncJobResultAsync(const GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getAsyncJobResult(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::GetAsyncJobResultOutcomeCallable OcrClient::getAsyncJobResultCallable(const GetAsyncJobResultRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getAsyncJobResult(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeAccountPageOutcome OcrClient::recognizeAccountPage(const RecognizeAccountPageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeAccountPageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeAccountPageOutcome(RecognizeAccountPageResult(outcome.result())); + else + return RecognizeAccountPageOutcome(outcome.error()); +} + +void OcrClient::recognizeAccountPageAsync(const RecognizeAccountPageRequest& request, const RecognizeAccountPageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeAccountPage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeAccountPageOutcomeCallable OcrClient::recognizeAccountPageCallable(const RecognizeAccountPageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeAccountPage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeBankCardOutcome OcrClient::recognizeBankCard(const RecognizeBankCardRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeBankCardOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeBankCardOutcome(RecognizeBankCardResult(outcome.result())); + else + return RecognizeBankCardOutcome(outcome.error()); +} + +void OcrClient::recognizeBankCardAsync(const RecognizeBankCardRequest& request, const RecognizeBankCardAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeBankCard(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeBankCardOutcomeCallable OcrClient::recognizeBankCardCallable(const RecognizeBankCardRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeBankCard(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeBusinessCardOutcome OcrClient::recognizeBusinessCard(const RecognizeBusinessCardRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeBusinessCardOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeBusinessCardOutcome(RecognizeBusinessCardResult(outcome.result())); + else + return RecognizeBusinessCardOutcome(outcome.error()); +} + +void OcrClient::recognizeBusinessCardAsync(const RecognizeBusinessCardRequest& request, const RecognizeBusinessCardAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeBusinessCard(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeBusinessCardOutcomeCallable OcrClient::recognizeBusinessCardCallable(const RecognizeBusinessCardRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeBusinessCard(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeBusinessLicenseOutcome OcrClient::recognizeBusinessLicense(const RecognizeBusinessLicenseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeBusinessLicenseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeBusinessLicenseOutcome(RecognizeBusinessLicenseResult(outcome.result())); + else + return RecognizeBusinessLicenseOutcome(outcome.error()); +} + +void OcrClient::recognizeBusinessLicenseAsync(const RecognizeBusinessLicenseRequest& request, const RecognizeBusinessLicenseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeBusinessLicense(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeBusinessLicenseOutcomeCallable OcrClient::recognizeBusinessLicenseCallable(const RecognizeBusinessLicenseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeBusinessLicense(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeCharacterOutcome OcrClient::recognizeCharacter(const RecognizeCharacterRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeCharacterOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeCharacterOutcome(RecognizeCharacterResult(outcome.result())); + else + return RecognizeCharacterOutcome(outcome.error()); +} + +void OcrClient::recognizeCharacterAsync(const RecognizeCharacterRequest& request, const RecognizeCharacterAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeCharacter(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeCharacterOutcomeCallable OcrClient::recognizeCharacterCallable(const RecognizeCharacterRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeCharacter(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeChinapassportOutcome OcrClient::recognizeChinapassport(const RecognizeChinapassportRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeChinapassportOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeChinapassportOutcome(RecognizeChinapassportResult(outcome.result())); + else + return RecognizeChinapassportOutcome(outcome.error()); +} + +void OcrClient::recognizeChinapassportAsync(const RecognizeChinapassportRequest& request, const RecognizeChinapassportAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeChinapassport(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeChinapassportOutcomeCallable OcrClient::recognizeChinapassportCallable(const RecognizeChinapassportRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeChinapassport(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeDriverLicenseOutcome OcrClient::recognizeDriverLicense(const RecognizeDriverLicenseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeDriverLicenseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeDriverLicenseOutcome(RecognizeDriverLicenseResult(outcome.result())); + else + return RecognizeDriverLicenseOutcome(outcome.error()); +} + +void OcrClient::recognizeDriverLicenseAsync(const RecognizeDriverLicenseRequest& request, const RecognizeDriverLicenseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeDriverLicense(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeDriverLicenseOutcomeCallable OcrClient::recognizeDriverLicenseCallable(const RecognizeDriverLicenseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeDriverLicense(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeDrivingLicenseOutcome OcrClient::recognizeDrivingLicense(const RecognizeDrivingLicenseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeDrivingLicenseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeDrivingLicenseOutcome(RecognizeDrivingLicenseResult(outcome.result())); + else + return RecognizeDrivingLicenseOutcome(outcome.error()); +} + +void OcrClient::recognizeDrivingLicenseAsync(const RecognizeDrivingLicenseRequest& request, const RecognizeDrivingLicenseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeDrivingLicense(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeDrivingLicenseOutcomeCallable OcrClient::recognizeDrivingLicenseCallable(const RecognizeDrivingLicenseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeDrivingLicense(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeIdentityCardOutcome OcrClient::recognizeIdentityCard(const RecognizeIdentityCardRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeIdentityCardOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeIdentityCardOutcome(RecognizeIdentityCardResult(outcome.result())); + else + return RecognizeIdentityCardOutcome(outcome.error()); +} + +void OcrClient::recognizeIdentityCardAsync(const RecognizeIdentityCardRequest& request, const RecognizeIdentityCardAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeIdentityCard(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeIdentityCardOutcomeCallable OcrClient::recognizeIdentityCardCallable(const RecognizeIdentityCardRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeIdentityCard(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeLicensePlateOutcome OcrClient::recognizeLicensePlate(const RecognizeLicensePlateRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeLicensePlateOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeLicensePlateOutcome(RecognizeLicensePlateResult(outcome.result())); + else + return RecognizeLicensePlateOutcome(outcome.error()); +} + +void OcrClient::recognizeLicensePlateAsync(const RecognizeLicensePlateRequest& request, const RecognizeLicensePlateAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeLicensePlate(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeLicensePlateOutcomeCallable OcrClient::recognizeLicensePlateCallable(const RecognizeLicensePlateRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeLicensePlate(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizePassportMRZOutcome OcrClient::recognizePassportMRZ(const RecognizePassportMRZRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizePassportMRZOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizePassportMRZOutcome(RecognizePassportMRZResult(outcome.result())); + else + return RecognizePassportMRZOutcome(outcome.error()); +} + +void OcrClient::recognizePassportMRZAsync(const RecognizePassportMRZRequest& request, const RecognizePassportMRZAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizePassportMRZ(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizePassportMRZOutcomeCallable OcrClient::recognizePassportMRZCallable(const RecognizePassportMRZRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizePassportMRZ(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeQrCodeOutcome OcrClient::recognizeQrCode(const RecognizeQrCodeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeQrCodeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeQrCodeOutcome(RecognizeQrCodeResult(outcome.result())); + else + return RecognizeQrCodeOutcome(outcome.error()); +} + +void OcrClient::recognizeQrCodeAsync(const RecognizeQrCodeRequest& request, const RecognizeQrCodeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeQrCode(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeQrCodeOutcomeCallable OcrClient::recognizeQrCodeCallable(const RecognizeQrCodeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeQrCode(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeStampOutcome OcrClient::recognizeStamp(const RecognizeStampRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeStampOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeStampOutcome(RecognizeStampResult(outcome.result())); + else + return RecognizeStampOutcome(outcome.error()); +} + +void OcrClient::recognizeStampAsync(const RecognizeStampRequest& request, const RecognizeStampAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeStamp(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeStampOutcomeCallable OcrClient::recognizeStampCallable(const RecognizeStampRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeStamp(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeTableOutcome OcrClient::recognizeTable(const RecognizeTableRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeTableOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeTableOutcome(RecognizeTableResult(outcome.result())); + else + return RecognizeTableOutcome(outcome.error()); +} + +void OcrClient::recognizeTableAsync(const RecognizeTableRequest& request, const RecognizeTableAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeTable(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeTableOutcomeCallable OcrClient::recognizeTableCallable(const RecognizeTableRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeTable(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeTakeoutOrderOutcome OcrClient::recognizeTakeoutOrder(const RecognizeTakeoutOrderRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeTakeoutOrderOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeTakeoutOrderOutcome(RecognizeTakeoutOrderResult(outcome.result())); + else + return RecognizeTakeoutOrderOutcome(outcome.error()); +} + +void OcrClient::recognizeTakeoutOrderAsync(const RecognizeTakeoutOrderRequest& request, const RecognizeTakeoutOrderAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeTakeoutOrder(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeTakeoutOrderOutcomeCallable OcrClient::recognizeTakeoutOrderCallable(const RecognizeTakeoutOrderRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeTakeoutOrder(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeTaxiInvoiceOutcome OcrClient::recognizeTaxiInvoice(const RecognizeTaxiInvoiceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeTaxiInvoiceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeTaxiInvoiceOutcome(RecognizeTaxiInvoiceResult(outcome.result())); + else + return RecognizeTaxiInvoiceOutcome(outcome.error()); +} + +void OcrClient::recognizeTaxiInvoiceAsync(const RecognizeTaxiInvoiceRequest& request, const RecognizeTaxiInvoiceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeTaxiInvoice(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeTaxiInvoiceOutcomeCallable OcrClient::recognizeTaxiInvoiceCallable(const RecognizeTaxiInvoiceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeTaxiInvoice(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeTrainTicketOutcome OcrClient::recognizeTrainTicket(const RecognizeTrainTicketRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeTrainTicketOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeTrainTicketOutcome(RecognizeTrainTicketResult(outcome.result())); + else + return RecognizeTrainTicketOutcome(outcome.error()); +} + +void OcrClient::recognizeTrainTicketAsync(const RecognizeTrainTicketRequest& request, const RecognizeTrainTicketAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeTrainTicket(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeTrainTicketOutcomeCallable OcrClient::recognizeTrainTicketCallable(const RecognizeTrainTicketRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeTrainTicket(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeVATInvoiceOutcome OcrClient::recognizeVATInvoice(const RecognizeVATInvoiceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeVATInvoiceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeVATInvoiceOutcome(RecognizeVATInvoiceResult(outcome.result())); + else + return RecognizeVATInvoiceOutcome(outcome.error()); +} + +void OcrClient::recognizeVATInvoiceAsync(const RecognizeVATInvoiceRequest& request, const RecognizeVATInvoiceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeVATInvoice(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeVATInvoiceOutcomeCallable OcrClient::recognizeVATInvoiceCallable(const RecognizeVATInvoiceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeVATInvoice(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeVINCodeOutcome OcrClient::recognizeVINCode(const RecognizeVINCodeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeVINCodeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeVINCodeOutcome(RecognizeVINCodeResult(outcome.result())); + else + return RecognizeVINCodeOutcome(outcome.error()); +} + +void OcrClient::recognizeVINCodeAsync(const RecognizeVINCodeRequest& request, const RecognizeVINCodeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeVINCode(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeVINCodeOutcomeCallable OcrClient::recognizeVINCodeCallable(const RecognizeVINCodeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeVINCode(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::RecognizeVerificationcodeOutcome OcrClient::recognizeVerificationcode(const RecognizeVerificationcodeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeVerificationcodeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeVerificationcodeOutcome(RecognizeVerificationcodeResult(outcome.result())); + else + return RecognizeVerificationcodeOutcome(outcome.error()); +} + +void OcrClient::recognizeVerificationcodeAsync(const RecognizeVerificationcodeRequest& request, const RecognizeVerificationcodeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeVerificationcode(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::RecognizeVerificationcodeOutcomeCallable OcrClient::recognizeVerificationcodeCallable(const RecognizeVerificationcodeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeVerificationcode(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OcrClient::TrimDocumentOutcome OcrClient::trimDocument(const TrimDocumentRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return TrimDocumentOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return TrimDocumentOutcome(TrimDocumentResult(outcome.result())); + else + return TrimDocumentOutcome(outcome.error()); +} + +void OcrClient::trimDocumentAsync(const TrimDocumentRequest& request, const TrimDocumentAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, trimDocument(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OcrClient::TrimDocumentOutcomeCallable OcrClient::trimDocumentCallable(const TrimDocumentRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->trimDocument(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/ocr/src/model/GetAsyncJobResultRequest.cc b/ocr/src/model/GetAsyncJobResultRequest.cc new file mode 100644 index 000000000..c9d8942e8 --- /dev/null +++ b/ocr/src/model/GetAsyncJobResultRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::GetAsyncJobResultRequest; + +GetAsyncJobResultRequest::GetAsyncJobResultRequest() : + RpcServiceRequest("ocr", "2019-12-30", "GetAsyncJobResult") +{ + setMethod(HttpRequest::Method::Post); +} + +GetAsyncJobResultRequest::~GetAsyncJobResultRequest() +{} + +bool GetAsyncJobResultRequest::getAsync()const +{ + return async_; +} + +void GetAsyncJobResultRequest::setAsync(bool async) +{ + async_ = async; + setBodyParameter("Async", async ? "true" : "false"); +} + +std::string GetAsyncJobResultRequest::getJobId()const +{ + return jobId_; +} + +void GetAsyncJobResultRequest::setJobId(const std::string& jobId) +{ + jobId_ = jobId; + setBodyParameter("JobId", jobId); +} + diff --git a/ocr/src/model/GetAsyncJobResultResult.cc b/ocr/src/model/GetAsyncJobResultResult.cc new file mode 100644 index 000000000..ce6dc36f8 --- /dev/null +++ b/ocr/src/model/GetAsyncJobResultResult.cc @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +GetAsyncJobResultResult::GetAsyncJobResultResult() : + ServiceResult() +{} + +GetAsyncJobResultResult::GetAsyncJobResultResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetAsyncJobResultResult::~GetAsyncJobResultResult() +{} + +void GetAsyncJobResultResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["ErrorCode"].isNull()) + data_.errorCode = dataNode["ErrorCode"].asString(); + if(!dataNode["ErrorMessage"].isNull()) + data_.errorMessage = dataNode["ErrorMessage"].asString(); + if(!dataNode["JobId"].isNull()) + data_.jobId = dataNode["JobId"].asString(); + if(!dataNode["Result"].isNull()) + data_.result = dataNode["Result"].asString(); + if(!dataNode["Status"].isNull()) + data_.status = dataNode["Status"].asString(); + +} + +GetAsyncJobResultResult::Data GetAsyncJobResultResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeAccountPageRequest.cc b/ocr/src/model/RecognizeAccountPageRequest.cc new file mode 100644 index 000000000..a90adb29a --- /dev/null +++ b/ocr/src/model/RecognizeAccountPageRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeAccountPageRequest; + +RecognizeAccountPageRequest::RecognizeAccountPageRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeAccountPage") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeAccountPageRequest::~RecognizeAccountPageRequest() +{} + +int RecognizeAccountPageRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeAccountPageRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeAccountPageRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeAccountPageRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeAccountPageResult.cc b/ocr/src/model/RecognizeAccountPageResult.cc new file mode 100644 index 000000000..2f0ca2f35 --- /dev/null +++ b/ocr/src/model/RecognizeAccountPageResult.cc @@ -0,0 +1,133 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeAccountPageResult::RecognizeAccountPageResult() : + ServiceResult() +{} + +RecognizeAccountPageResult::RecognizeAccountPageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeAccountPageResult::~RecognizeAccountPageResult() +{} + +void RecognizeAccountPageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Angle"].isNull()) + data_.angle = std::stof(dataNode["Angle"].asString()); + if(!dataNode["Name"].isNull()) + data_.name = dataNode["Name"].asString(); + if(!dataNode["Gender"].isNull()) + data_.gender = dataNode["Gender"].asString(); + if(!dataNode["Relation"].isNull()) + data_.relation = dataNode["Relation"].asString(); + if(!dataNode["BirthPlace"].isNull()) + data_.birthPlace = dataNode["BirthPlace"].asString(); + if(!dataNode["Nationality"].isNull()) + data_.nationality = dataNode["Nationality"].asString(); + if(!dataNode["NativePlace"].isNull()) + data_.nativePlace = dataNode["NativePlace"].asString(); + if(!dataNode["BirthDate"].isNull()) + data_.birthDate = dataNode["BirthDate"].asString(); + if(!dataNode["IDNumber"].isNull()) + data_.iDNumber = dataNode["IDNumber"].asString(); + auto allInvalidStampAreasNode = dataNode["InvalidStampAreas"]["InvalidStampArea"]; + for (auto dataNodeInvalidStampAreasInvalidStampArea : allInvalidStampAreasNode) + { + Data::InvalidStampArea invalidStampAreaObject; + if(!dataNodeInvalidStampAreasInvalidStampArea["Left"].isNull()) + invalidStampAreaObject.left = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Left"].asString()); + if(!dataNodeInvalidStampAreasInvalidStampArea["Top"].isNull()) + invalidStampAreaObject.top = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Top"].asString()); + if(!dataNodeInvalidStampAreasInvalidStampArea["Height"].isNull()) + invalidStampAreaObject.height = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Height"].asString()); + if(!dataNodeInvalidStampAreasInvalidStampArea["Width"].isNull()) + invalidStampAreaObject.width = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Width"].asString()); + data_.invalidStampAreas.push_back(invalidStampAreaObject); + } + auto allUndertakeStampAreasNode = dataNode["UndertakeStampAreas"]["UndertakeStampArea"]; + for (auto dataNodeUndertakeStampAreasUndertakeStampArea : allUndertakeStampAreasNode) + { + Data::UndertakeStampArea undertakeStampAreaObject; + if(!dataNodeUndertakeStampAreasUndertakeStampArea["Left"].isNull()) + undertakeStampAreaObject.left = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Left"].asString()); + if(!dataNodeUndertakeStampAreasUndertakeStampArea["Top"].isNull()) + undertakeStampAreaObject.top = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Top"].asString()); + if(!dataNodeUndertakeStampAreasUndertakeStampArea["Height"].isNull()) + undertakeStampAreaObject.height = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Height"].asString()); + if(!dataNodeUndertakeStampAreasUndertakeStampArea["Width"].isNull()) + undertakeStampAreaObject.width = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Width"].asString()); + data_.undertakeStampAreas.push_back(undertakeStampAreaObject); + } + auto allRegisterStampAreasNode = dataNode["RegisterStampAreas"]["RegisterStampArea"]; + for (auto dataNodeRegisterStampAreasRegisterStampArea : allRegisterStampAreasNode) + { + Data::RegisterStampArea registerStampAreaObject; + if(!dataNodeRegisterStampAreasRegisterStampArea["Left"].isNull()) + registerStampAreaObject.left = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Left"].asString()); + if(!dataNodeRegisterStampAreasRegisterStampArea["Top"].isNull()) + registerStampAreaObject.top = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Top"].asString()); + if(!dataNodeRegisterStampAreasRegisterStampArea["Height"].isNull()) + registerStampAreaObject.height = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Height"].asString()); + if(!dataNodeRegisterStampAreasRegisterStampArea["Width"].isNull()) + registerStampAreaObject.width = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Width"].asString()); + data_.registerStampAreas.push_back(registerStampAreaObject); + } + auto allOtherStampAreasNode = dataNode["OtherStampAreas"]["OtherStampArea"]; + for (auto dataNodeOtherStampAreasOtherStampArea : allOtherStampAreasNode) + { + Data::OtherStampArea otherStampAreaObject; + if(!dataNodeOtherStampAreasOtherStampArea["Left"].isNull()) + otherStampAreaObject.left = std::stoi(dataNodeOtherStampAreasOtherStampArea["Left"].asString()); + if(!dataNodeOtherStampAreasOtherStampArea["Top"].isNull()) + otherStampAreaObject.top = std::stoi(dataNodeOtherStampAreasOtherStampArea["Top"].asString()); + if(!dataNodeOtherStampAreasOtherStampArea["Height"].isNull()) + otherStampAreaObject.height = std::stoi(dataNodeOtherStampAreasOtherStampArea["Height"].asString()); + if(!dataNodeOtherStampAreasOtherStampArea["Width"].isNull()) + otherStampAreaObject.width = std::stoi(dataNodeOtherStampAreasOtherStampArea["Width"].asString()); + data_.otherStampAreas.push_back(otherStampAreaObject); + } + auto titleAreaNode = dataNode["TitleArea"]; + if(!titleAreaNode["Left"].isNull()) + data_.titleArea.left = std::stoi(titleAreaNode["Left"].asString()); + if(!titleAreaNode["Top"].isNull()) + data_.titleArea.top = std::stoi(titleAreaNode["Top"].asString()); + if(!titleAreaNode["Height"].isNull()) + data_.titleArea.height = std::stoi(titleAreaNode["Height"].asString()); + if(!titleAreaNode["Width"].isNull()) + data_.titleArea.width = std::stoi(titleAreaNode["Width"].asString()); + +} + +RecognizeAccountPageResult::Data RecognizeAccountPageResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeBankCardRequest.cc b/ocr/src/model/RecognizeBankCardRequest.cc new file mode 100644 index 000000000..8148317d4 --- /dev/null +++ b/ocr/src/model/RecognizeBankCardRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeBankCardRequest; + +RecognizeBankCardRequest::RecognizeBankCardRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeBankCard") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeBankCardRequest::~RecognizeBankCardRequest() +{} + +int RecognizeBankCardRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeBankCardRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeBankCardRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeBankCardRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeBankCardResult.cc b/ocr/src/model/RecognizeBankCardResult.cc new file mode 100644 index 000000000..0313d89ed --- /dev/null +++ b/ocr/src/model/RecognizeBankCardResult.cc @@ -0,0 +1,56 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeBankCardResult::RecognizeBankCardResult() : + ServiceResult() +{} + +RecognizeBankCardResult::RecognizeBankCardResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeBankCardResult::~RecognizeBankCardResult() +{} + +void RecognizeBankCardResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["BankName"].isNull()) + data_.bankName = dataNode["BankName"].asString(); + if(!dataNode["CardNumber"].isNull()) + data_.cardNumber = dataNode["CardNumber"].asString(); + if(!dataNode["ValidDate"].isNull()) + data_.validDate = dataNode["ValidDate"].asString(); + +} + +RecognizeBankCardResult::Data RecognizeBankCardResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeBusinessCardRequest.cc b/ocr/src/model/RecognizeBusinessCardRequest.cc new file mode 100644 index 000000000..6e03a3eef --- /dev/null +++ b/ocr/src/model/RecognizeBusinessCardRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeBusinessCardRequest; + +RecognizeBusinessCardRequest::RecognizeBusinessCardRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeBusinessCard") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeBusinessCardRequest::~RecognizeBusinessCardRequest() +{} + +int RecognizeBusinessCardRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeBusinessCardRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeBusinessCardRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeBusinessCardRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeBusinessCardResult.cc b/ocr/src/model/RecognizeBusinessCardResult.cc new file mode 100644 index 000000000..5092f4242 --- /dev/null +++ b/ocr/src/model/RecognizeBusinessCardResult.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeBusinessCardResult::RecognizeBusinessCardResult() : + ServiceResult() +{} + +RecognizeBusinessCardResult::RecognizeBusinessCardResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeBusinessCardResult::~RecognizeBusinessCardResult() +{} + +void RecognizeBusinessCardResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Name"].isNull()) + data_.name = dataNode["Name"].asString(); + auto allCompanies = dataNode["Companies"]["Company"]; + for (auto value : allCompanies) + data_.companies.push_back(value.asString()); + auto allDepartments = dataNode["Departments"]["Department"]; + for (auto value : allDepartments) + data_.departments.push_back(value.asString()); + auto allTitles = dataNode["Titles"]["Title"]; + for (auto value : allTitles) + data_.titles.push_back(value.asString()); + auto allCellPhoneNumbers = dataNode["CellPhoneNumbers"]["CellPhoneNumber"]; + for (auto value : allCellPhoneNumbers) + data_.cellPhoneNumbers.push_back(value.asString()); + auto allOfficePhoneNumbers = dataNode["OfficePhoneNumbers"]["OfficePhoneNumber"]; + for (auto value : allOfficePhoneNumbers) + data_.officePhoneNumbers.push_back(value.asString()); + auto allAddresses = dataNode["Addresses"]["Address"]; + for (auto value : allAddresses) + data_.addresses.push_back(value.asString()); + auto allEmails = dataNode["Emails"]["Email"]; + for (auto value : allEmails) + data_.emails.push_back(value.asString()); + +} + +RecognizeBusinessCardResult::Data RecognizeBusinessCardResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeBusinessLicenseRequest.cc b/ocr/src/model/RecognizeBusinessLicenseRequest.cc new file mode 100644 index 000000000..806002297 --- /dev/null +++ b/ocr/src/model/RecognizeBusinessLicenseRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeBusinessLicenseRequest; + +RecognizeBusinessLicenseRequest::RecognizeBusinessLicenseRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeBusinessLicense") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeBusinessLicenseRequest::~RecognizeBusinessLicenseRequest() +{} + +int RecognizeBusinessLicenseRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeBusinessLicenseRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeBusinessLicenseRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeBusinessLicenseRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeBusinessLicenseResult.cc b/ocr/src/model/RecognizeBusinessLicenseResult.cc new file mode 100644 index 000000000..786421dad --- /dev/null +++ b/ocr/src/model/RecognizeBusinessLicenseResult.cc @@ -0,0 +1,106 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeBusinessLicenseResult::RecognizeBusinessLicenseResult() : + ServiceResult() +{} + +RecognizeBusinessLicenseResult::RecognizeBusinessLicenseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeBusinessLicenseResult::~RecognizeBusinessLicenseResult() +{} + +void RecognizeBusinessLicenseResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Angle"].isNull()) + data_.angle = dataNode["Angle"].asString(); + if(!dataNode["RegisterNumber"].isNull()) + data_.registerNumber = dataNode["RegisterNumber"].asString(); + if(!dataNode["Name"].isNull()) + data_.name = dataNode["Name"].asString(); + if(!dataNode["Type"].isNull()) + data_.type = dataNode["Type"].asString(); + if(!dataNode["LegalPerson"].isNull()) + data_.legalPerson = dataNode["LegalPerson"].asString(); + if(!dataNode["EstablishDate"].isNull()) + data_.establishDate = dataNode["EstablishDate"].asString(); + if(!dataNode["ValidPeriod"].isNull()) + data_.validPeriod = dataNode["ValidPeriod"].asString(); + if(!dataNode["Address"].isNull()) + data_.address = dataNode["Address"].asString(); + if(!dataNode["Capital"].isNull()) + data_.capital = dataNode["Capital"].asString(); + if(!dataNode["Business"].isNull()) + data_.business = dataNode["Business"].asString(); + auto emblemNode = dataNode["Emblem"]; + if(!emblemNode["Top"].isNull()) + data_.emblem.top = std::stoi(emblemNode["Top"].asString()); + if(!emblemNode["Left"].isNull()) + data_.emblem.left = std::stoi(emblemNode["Left"].asString()); + if(!emblemNode["Height"].isNull()) + data_.emblem.height = std::stoi(emblemNode["Height"].asString()); + if(!emblemNode["Width"].isNull()) + data_.emblem.width = std::stoi(emblemNode["Width"].asString()); + auto titleNode = dataNode["Title"]; + if(!titleNode["Top"].isNull()) + data_.title.top = std::stoi(titleNode["Top"].asString()); + if(!titleNode["Left"].isNull()) + data_.title.left = std::stoi(titleNode["Left"].asString()); + if(!titleNode["Height"].isNull()) + data_.title.height = std::stoi(titleNode["Height"].asString()); + if(!titleNode["Width"].isNull()) + data_.title.width = std::stoi(titleNode["Width"].asString()); + auto stampNode = dataNode["Stamp"]; + if(!stampNode["Top"].isNull()) + data_.stamp.top = std::stoi(stampNode["Top"].asString()); + if(!stampNode["Left"].isNull()) + data_.stamp.left = std::stoi(stampNode["Left"].asString()); + if(!stampNode["Height"].isNull()) + data_.stamp.height = std::stoi(stampNode["Height"].asString()); + if(!stampNode["Width"].isNull()) + data_.stamp.width = std::stoi(stampNode["Width"].asString()); + auto qRCodeNode = dataNode["QRCode"]; + if(!qRCodeNode["Top"].isNull()) + data_.qRCode.top = std::stoi(qRCodeNode["Top"].asString()); + if(!qRCodeNode["Left"].isNull()) + data_.qRCode.left = std::stoi(qRCodeNode["Left"].asString()); + if(!qRCodeNode["Height"].isNull()) + data_.qRCode.height = std::stoi(qRCodeNode["Height"].asString()); + if(!qRCodeNode["Width"].isNull()) + data_.qRCode.width = std::stoi(qRCodeNode["Width"].asString()); + +} + +RecognizeBusinessLicenseResult::Data RecognizeBusinessLicenseResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeCharacterRequest.cc b/ocr/src/model/RecognizeCharacterRequest.cc new file mode 100644 index 000000000..eb687b404 --- /dev/null +++ b/ocr/src/model/RecognizeCharacterRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeCharacterRequest; + +RecognizeCharacterRequest::RecognizeCharacterRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeCharacter") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeCharacterRequest::~RecognizeCharacterRequest() +{} + +int RecognizeCharacterRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeCharacterRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +bool RecognizeCharacterRequest::getOutputProbability()const +{ + return outputProbability_; +} + +void RecognizeCharacterRequest::setOutputProbability(bool outputProbability) +{ + outputProbability_ = outputProbability; + setBodyParameter("OutputProbability", outputProbability ? "true" : "false"); +} + +std::string RecognizeCharacterRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeCharacterRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + +int RecognizeCharacterRequest::getMinHeight()const +{ + return minHeight_; +} + +void RecognizeCharacterRequest::setMinHeight(int minHeight) +{ + minHeight_ = minHeight; + setBodyParameter("MinHeight", std::to_string(minHeight)); +} + diff --git a/ocr/src/model/RecognizeCharacterResult.cc b/ocr/src/model/RecognizeCharacterResult.cc new file mode 100644 index 000000000..cbb2e0601 --- /dev/null +++ b/ocr/src/model/RecognizeCharacterResult.cc @@ -0,0 +1,71 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeCharacterResult::RecognizeCharacterResult() : + ServiceResult() +{} + +RecognizeCharacterResult::RecognizeCharacterResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeCharacterResult::~RecognizeCharacterResult() +{} + +void RecognizeCharacterResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allResultsNode = dataNode["Results"]["Result"]; + for (auto dataNodeResultsResult : allResultsNode) + { + Data::Result resultObject; + if(!dataNodeResultsResult["Probability"].isNull()) + resultObject.probability = std::stof(dataNodeResultsResult["Probability"].asString()); + if(!dataNodeResultsResult["Text"].isNull()) + resultObject.text = dataNodeResultsResult["Text"].asString(); + auto textRectanglesNode = value["TextRectangles"]; + if(!textRectanglesNode["Angle"].isNull()) + resultObject.textRectangles.angle = std::stoi(textRectanglesNode["Angle"].asString()); + if(!textRectanglesNode["Left"].isNull()) + resultObject.textRectangles.left = std::stoi(textRectanglesNode["Left"].asString()); + if(!textRectanglesNode["Top"].isNull()) + resultObject.textRectangles.top = std::stoi(textRectanglesNode["Top"].asString()); + if(!textRectanglesNode["Width"].isNull()) + resultObject.textRectangles.width = std::stoi(textRectanglesNode["Width"].asString()); + if(!textRectanglesNode["Height"].isNull()) + resultObject.textRectangles.height = std::stoi(textRectanglesNode["Height"].asString()); + data_.results.push_back(resultObject); + } + +} + +RecognizeCharacterResult::Data RecognizeCharacterResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeChinapassportRequest.cc b/ocr/src/model/RecognizeChinapassportRequest.cc new file mode 100644 index 000000000..d91ade6f3 --- /dev/null +++ b/ocr/src/model/RecognizeChinapassportRequest.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeChinapassportRequest; + +RecognizeChinapassportRequest::RecognizeChinapassportRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeChinapassport") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeChinapassportRequest::~RecognizeChinapassportRequest() +{} + +std::string RecognizeChinapassportRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeChinapassportRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeChinapassportResult.cc b/ocr/src/model/RecognizeChinapassportResult.cc new file mode 100644 index 000000000..a11220aaa --- /dev/null +++ b/ocr/src/model/RecognizeChinapassportResult.cc @@ -0,0 +1,94 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeChinapassportResult::RecognizeChinapassportResult() : + ServiceResult() +{} + +RecognizeChinapassportResult::RecognizeChinapassportResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeChinapassportResult::~RecognizeChinapassportResult() +{} + +void RecognizeChinapassportResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Authority"].isNull()) + data_.authority = dataNode["Authority"].asString(); + if(!dataNode["BirthDate"].isNull()) + data_.birthDate = dataNode["BirthDate"].asString(); + if(!dataNode["BirthDay"].isNull()) + data_.birthDay = dataNode["BirthDay"].asString(); + if(!dataNode["BirthPlace"].isNull()) + data_.birthPlace = dataNode["BirthPlace"].asString(); + if(!dataNode["BirthPlaceRaw"].isNull()) + data_.birthPlaceRaw = dataNode["BirthPlaceRaw"].asString(); + if(!dataNode["Country"].isNull()) + data_.country = dataNode["Country"].asString(); + if(!dataNode["ExpiryDate"].isNull()) + data_.expiryDate = dataNode["ExpiryDate"].asString(); + if(!dataNode["ExpiryDay"].isNull()) + data_.expiryDay = dataNode["ExpiryDay"].asString(); + if(!dataNode["IssueDate"].isNull()) + data_.issueDate = dataNode["IssueDate"].asString(); + if(!dataNode["IssuePlace"].isNull()) + data_.issuePlace = dataNode["IssuePlace"].asString(); + if(!dataNode["IssuePlaceRaw"].isNull()) + data_.issuePlaceRaw = dataNode["IssuePlaceRaw"].asString(); + if(!dataNode["LineZero"].isNull()) + data_.lineZero = dataNode["LineZero"].asString(); + if(!dataNode["LineOne"].isNull()) + data_.lineOne = dataNode["LineOne"].asString(); + if(!dataNode["Name"].isNull()) + data_.name = dataNode["Name"].asString(); + if(!dataNode["NameChinese"].isNull()) + data_.nameChinese = dataNode["NameChinese"].asString(); + if(!dataNode["NameChineseRaw"].isNull()) + data_.nameChineseRaw = dataNode["NameChineseRaw"].asString(); + if(!dataNode["PassportNo"].isNull()) + data_.passportNo = dataNode["PassportNo"].asString(); + if(!dataNode["PersonId"].isNull()) + data_.personId = dataNode["PersonId"].asString(); + if(!dataNode["Sex"].isNull()) + data_.sex = dataNode["Sex"].asString(); + if(!dataNode["SourceCountry"].isNull()) + data_.sourceCountry = dataNode["SourceCountry"].asString(); + if(!dataNode["Success"].isNull()) + data_.success = dataNode["Success"].asString() == "true"; + if(!dataNode["Type"].isNull()) + data_.type = dataNode["Type"].asString(); + +} + +RecognizeChinapassportResult::Data RecognizeChinapassportResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeDriverLicenseRequest.cc b/ocr/src/model/RecognizeDriverLicenseRequest.cc new file mode 100644 index 000000000..c607b5de4 --- /dev/null +++ b/ocr/src/model/RecognizeDriverLicenseRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeDriverLicenseRequest; + +RecognizeDriverLicenseRequest::RecognizeDriverLicenseRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeDriverLicense") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeDriverLicenseRequest::~RecognizeDriverLicenseRequest() +{} + +int RecognizeDriverLicenseRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeDriverLicenseRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeDriverLicenseRequest::getSide()const +{ + return side_; +} + +void RecognizeDriverLicenseRequest::setSide(const std::string& side) +{ + side_ = side; + setBodyParameter("Side", side); +} + +std::string RecognizeDriverLicenseRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeDriverLicenseRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeDriverLicenseResult.cc b/ocr/src/model/RecognizeDriverLicenseResult.cc new file mode 100644 index 000000000..61bb29605 --- /dev/null +++ b/ocr/src/model/RecognizeDriverLicenseResult.cc @@ -0,0 +1,70 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeDriverLicenseResult::RecognizeDriverLicenseResult() : + ServiceResult() +{} + +RecognizeDriverLicenseResult::RecognizeDriverLicenseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeDriverLicenseResult::~RecognizeDriverLicenseResult() +{} + +void RecognizeDriverLicenseResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto faceResultNode = dataNode["FaceResult"]; + if(!faceResultNode["Name"].isNull()) + data_.faceResult.name = faceResultNode["Name"].asString(); + if(!faceResultNode["LicenseNumber"].isNull()) + data_.faceResult.licenseNumber = faceResultNode["LicenseNumber"].asString(); + if(!faceResultNode["VehicleType"].isNull()) + data_.faceResult.vehicleType = faceResultNode["VehicleType"].asString(); + if(!faceResultNode["StartDate"].isNull()) + data_.faceResult.startDate = faceResultNode["StartDate"].asString(); + if(!faceResultNode["EndDate"].isNull()) + data_.faceResult.endDate = faceResultNode["EndDate"].asString(); + if(!faceResultNode["IssueDate"].isNull()) + data_.faceResult.issueDate = faceResultNode["IssueDate"].asString(); + if(!faceResultNode["Address"].isNull()) + data_.faceResult.address = faceResultNode["Address"].asString(); + if(!faceResultNode["Gender"].isNull()) + data_.faceResult.gender = faceResultNode["Gender"].asString(); + auto backResultNode = dataNode["BackResult"]; + if(!backResultNode["ArchiveNumber"].isNull()) + data_.backResult.archiveNumber = backResultNode["ArchiveNumber"].asString(); + +} + +RecognizeDriverLicenseResult::Data RecognizeDriverLicenseResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeDrivingLicenseRequest.cc b/ocr/src/model/RecognizeDrivingLicenseRequest.cc new file mode 100644 index 000000000..35b629bc1 --- /dev/null +++ b/ocr/src/model/RecognizeDrivingLicenseRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeDrivingLicenseRequest; + +RecognizeDrivingLicenseRequest::RecognizeDrivingLicenseRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeDrivingLicense") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeDrivingLicenseRequest::~RecognizeDrivingLicenseRequest() +{} + +int RecognizeDrivingLicenseRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeDrivingLicenseRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeDrivingLicenseRequest::getSide()const +{ + return side_; +} + +void RecognizeDrivingLicenseRequest::setSide(const std::string& side) +{ + side_ = side; + setBodyParameter("Side", side); +} + +std::string RecognizeDrivingLicenseRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeDrivingLicenseRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeDrivingLicenseResult.cc b/ocr/src/model/RecognizeDrivingLicenseResult.cc new file mode 100644 index 000000000..6a1b05bb4 --- /dev/null +++ b/ocr/src/model/RecognizeDrivingLicenseResult.cc @@ -0,0 +1,92 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeDrivingLicenseResult::RecognizeDrivingLicenseResult() : + ServiceResult() +{} + +RecognizeDrivingLicenseResult::RecognizeDrivingLicenseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeDrivingLicenseResult::~RecognizeDrivingLicenseResult() +{} + +void RecognizeDrivingLicenseResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto faceResultNode = dataNode["FaceResult"]; + if(!faceResultNode["PlateNumber"].isNull()) + data_.faceResult.plateNumber = faceResultNode["PlateNumber"].asString(); + if(!faceResultNode["VehicleType"].isNull()) + data_.faceResult.vehicleType = faceResultNode["VehicleType"].asString(); + if(!faceResultNode["Owner"].isNull()) + data_.faceResult.owner = faceResultNode["Owner"].asString(); + if(!faceResultNode["UseCharacter"].isNull()) + data_.faceResult.useCharacter = faceResultNode["UseCharacter"].asString(); + if(!faceResultNode["Address"].isNull()) + data_.faceResult.address = faceResultNode["Address"].asString(); + if(!faceResultNode["Model"].isNull()) + data_.faceResult.model = faceResultNode["Model"].asString(); + if(!faceResultNode["Vin"].isNull()) + data_.faceResult.vin = faceResultNode["Vin"].asString(); + if(!faceResultNode["EngineNumber"].isNull()) + data_.faceResult.engineNumber = faceResultNode["EngineNumber"].asString(); + if(!faceResultNode["RegisterDate"].isNull()) + data_.faceResult.registerDate = faceResultNode["RegisterDate"].asString(); + if(!faceResultNode["IssueDate"].isNull()) + data_.faceResult.issueDate = faceResultNode["IssueDate"].asString(); + auto backResultNode = dataNode["BackResult"]; + if(!backResultNode["ApprovedPassengerCapacity"].isNull()) + data_.backResult.approvedPassengerCapacity = backResultNode["ApprovedPassengerCapacity"].asString(); + if(!backResultNode["ApprovedLoad"].isNull()) + data_.backResult.approvedLoad = backResultNode["ApprovedLoad"].asString(); + if(!backResultNode["FileNumber"].isNull()) + data_.backResult.fileNumber = backResultNode["FileNumber"].asString(); + if(!backResultNode["GrossMass"].isNull()) + data_.backResult.grossMass = backResultNode["GrossMass"].asString(); + if(!backResultNode["EnergyType"].isNull()) + data_.backResult.energyType = backResultNode["EnergyType"].asString(); + if(!backResultNode["InspectionRecord"].isNull()) + data_.backResult.inspectionRecord = backResultNode["InspectionRecord"].asString(); + if(!backResultNode["OverallDimension"].isNull()) + data_.backResult.overallDimension = backResultNode["OverallDimension"].asString(); + if(!backResultNode["TractionMass"].isNull()) + data_.backResult.tractionMass = backResultNode["TractionMass"].asString(); + if(!backResultNode["UnladenMass"].isNull()) + data_.backResult.unladenMass = backResultNode["UnladenMass"].asString(); + if(!backResultNode["PlateNumber"].isNull()) + data_.backResult.plateNumber = backResultNode["PlateNumber"].asString(); + +} + +RecognizeDrivingLicenseResult::Data RecognizeDrivingLicenseResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeIdentityCardRequest.cc b/ocr/src/model/RecognizeIdentityCardRequest.cc new file mode 100644 index 000000000..37bedab47 --- /dev/null +++ b/ocr/src/model/RecognizeIdentityCardRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeIdentityCardRequest; + +RecognizeIdentityCardRequest::RecognizeIdentityCardRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeIdentityCard") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeIdentityCardRequest::~RecognizeIdentityCardRequest() +{} + +int RecognizeIdentityCardRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeIdentityCardRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeIdentityCardRequest::getSide()const +{ + return side_; +} + +void RecognizeIdentityCardRequest::setSide(const std::string& side) +{ + side_ = side; + setBodyParameter("Side", side); +} + +std::string RecognizeIdentityCardRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeIdentityCardRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeIdentityCardResult.cc b/ocr/src/model/RecognizeIdentityCardResult.cc new file mode 100644 index 000000000..2a0603a2c --- /dev/null +++ b/ocr/src/model/RecognizeIdentityCardResult.cc @@ -0,0 +1,103 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeIdentityCardResult::RecognizeIdentityCardResult() : + ServiceResult() +{} + +RecognizeIdentityCardResult::RecognizeIdentityCardResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeIdentityCardResult::~RecognizeIdentityCardResult() +{} + +void RecognizeIdentityCardResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto frontResultNode = dataNode["FrontResult"]; + if(!frontResultNode["Address"].isNull()) + data_.frontResult.address = frontResultNode["Address"].asString(); + if(!frontResultNode["Name"].isNull()) + data_.frontResult.name = frontResultNode["Name"].asString(); + if(!frontResultNode["Nationality"].isNull()) + data_.frontResult.nationality = frontResultNode["Nationality"].asString(); + if(!frontResultNode["IDNumber"].isNull()) + data_.frontResult.iDNumber = frontResultNode["IDNumber"].asString(); + if(!frontResultNode["Gender"].isNull()) + data_.frontResult.gender = frontResultNode["Gender"].asString(); + if(!frontResultNode["BirthDate"].isNull()) + data_.frontResult.birthDate = frontResultNode["BirthDate"].asString(); + auto allCardAreasNode = frontResultNode["CardAreas"]["CardArea"]; + for (auto frontResultNodeCardAreasCardArea : allCardAreasNode) + { + Data::FrontResult::CardArea cardAreaObject; + if(!frontResultNodeCardAreasCardArea["X"].isNull()) + cardAreaObject.x = std::stof(frontResultNodeCardAreasCardArea["X"].asString()); + if(!frontResultNodeCardAreasCardArea["Y"].isNull()) + cardAreaObject.y = std::stof(frontResultNodeCardAreasCardArea["Y"].asString()); + data_.frontResult.cardAreas.push_back(cardAreaObject); + } + auto allFaceRectVerticesNode = frontResultNode["FaceRectVertices"]["FaceRectVertice"]; + for (auto frontResultNodeFaceRectVerticesFaceRectVertice : allFaceRectVerticesNode) + { + Data::FrontResult::FaceRectVertice faceRectVerticeObject; + if(!frontResultNodeFaceRectVerticesFaceRectVertice["X"].isNull()) + faceRectVerticeObject.x = std::stof(frontResultNodeFaceRectVerticesFaceRectVertice["X"].asString()); + if(!frontResultNodeFaceRectVerticesFaceRectVertice["Y"].isNull()) + faceRectVerticeObject.y = std::stof(frontResultNodeFaceRectVerticesFaceRectVertice["Y"].asString()); + data_.frontResult.faceRectVertices.push_back(faceRectVerticeObject); + } + auto faceRectangleNode = frontResultNode["FaceRectangle"]; + if(!faceRectangleNode["Angle"].isNull()) + data_.frontResult.faceRectangle.angle = std::stof(faceRectangleNode["Angle"].asString()); + auto centerNode = faceRectangleNode["Center"]; + if(!centerNode["X"].isNull()) + data_.frontResult.faceRectangle.center.x = std::stof(centerNode["X"].asString()); + if(!centerNode["Y"].isNull()) + data_.frontResult.faceRectangle.center.y = std::stof(centerNode["Y"].asString()); + auto sizeNode = faceRectangleNode["Size"]; + if(!sizeNode["Height"].isNull()) + data_.frontResult.faceRectangle.size.height = std::stof(sizeNode["Height"].asString()); + if(!sizeNode["Width"].isNull()) + data_.frontResult.faceRectangle.size.width = std::stof(sizeNode["Width"].asString()); + auto backResultNode = dataNode["BackResult"]; + if(!backResultNode["StartDate"].isNull()) + data_.backResult.startDate = backResultNode["StartDate"].asString(); + if(!backResultNode["EndDate"].isNull()) + data_.backResult.endDate = backResultNode["EndDate"].asString(); + if(!backResultNode["Issue"].isNull()) + data_.backResult.issue = backResultNode["Issue"].asString(); + +} + +RecognizeIdentityCardResult::Data RecognizeIdentityCardResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeLicensePlateRequest.cc b/ocr/src/model/RecognizeLicensePlateRequest.cc new file mode 100644 index 000000000..1ef10d540 --- /dev/null +++ b/ocr/src/model/RecognizeLicensePlateRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeLicensePlateRequest; + +RecognizeLicensePlateRequest::RecognizeLicensePlateRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeLicensePlate") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeLicensePlateRequest::~RecognizeLicensePlateRequest() +{} + +int RecognizeLicensePlateRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeLicensePlateRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeLicensePlateRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeLicensePlateRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeLicensePlateResult.cc b/ocr/src/model/RecognizeLicensePlateResult.cc new file mode 100644 index 000000000..b6df4036b --- /dev/null +++ b/ocr/src/model/RecognizeLicensePlateResult.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeLicensePlateResult::RecognizeLicensePlateResult() : + ServiceResult() +{} + +RecognizeLicensePlateResult::RecognizeLicensePlateResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeLicensePlateResult::~RecognizeLicensePlateResult() +{} + +void RecognizeLicensePlateResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allPlatesNode = dataNode["Plates"]["Plate"]; + for (auto dataNodePlatesPlate : allPlatesNode) + { + Data::Plate plateObject; + if(!dataNodePlatesPlate["Confidence"].isNull()) + plateObject.confidence = std::stof(dataNodePlatesPlate["Confidence"].asString()); + if(!dataNodePlatesPlate["PlateNumber"].isNull()) + plateObject.plateNumber = dataNodePlatesPlate["PlateNumber"].asString(); + if(!dataNodePlatesPlate["PlateType"].isNull()) + plateObject.plateType = dataNodePlatesPlate["PlateType"].asString(); + if(!dataNodePlatesPlate["PlateTypeConfidence"].isNull()) + plateObject.plateTypeConfidence = std::stof(dataNodePlatesPlate["PlateTypeConfidence"].asString()); + auto roiNode = value["Roi"]; + if(!roiNode["H"].isNull()) + plateObject.roi.h = std::stoi(roiNode["H"].asString()); + if(!roiNode["W"].isNull()) + plateObject.roi.w = std::stoi(roiNode["W"].asString()); + if(!roiNode["X"].isNull()) + plateObject.roi.x = std::stoi(roiNode["X"].asString()); + if(!roiNode["Y"].isNull()) + plateObject.roi.y = std::stoi(roiNode["Y"].asString()); + data_.plates.push_back(plateObject); + } + +} + +RecognizeLicensePlateResult::Data RecognizeLicensePlateResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizePassportMRZRequest.cc b/ocr/src/model/RecognizePassportMRZRequest.cc new file mode 100644 index 000000000..ff7d37929 --- /dev/null +++ b/ocr/src/model/RecognizePassportMRZRequest.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizePassportMRZRequest; + +RecognizePassportMRZRequest::RecognizePassportMRZRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizePassportMRZ") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizePassportMRZRequest::~RecognizePassportMRZRequest() +{} + +std::string RecognizePassportMRZRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizePassportMRZRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizePassportMRZResult.cc b/ocr/src/model/RecognizePassportMRZResult.cc new file mode 100644 index 000000000..c2c482e47 --- /dev/null +++ b/ocr/src/model/RecognizePassportMRZResult.cc @@ -0,0 +1,67 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizePassportMRZResult::RecognizePassportMRZResult() : + ServiceResult() +{} + +RecognizePassportMRZResult::RecognizePassportMRZResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizePassportMRZResult::~RecognizePassportMRZResult() +{} + +void RecognizePassportMRZResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allRegionsNode = dataNode["Regions"]["Region"]; + for (auto dataNodeRegionsRegion : allRegionsNode) + { + Data::Region regionObject; + if(!dataNodeRegionsRegion["Name"].isNull()) + regionObject.name = dataNodeRegionsRegion["Name"].asString(); + if(!dataNodeRegionsRegion["RecognitionScore"].isNull()) + regionObject.recognitionScore = std::stof(dataNodeRegionsRegion["RecognitionScore"].asString()); + if(!dataNodeRegionsRegion["Content"].isNull()) + regionObject.content = dataNodeRegionsRegion["Content"].asString(); + if(!dataNodeRegionsRegion["DetectionScore"].isNull()) + regionObject.detectionScore = std::stof(dataNodeRegionsRegion["DetectionScore"].asString()); + auto allBandBoxes = value["BandBoxes"]["BandBox"]; + for (auto value : allBandBoxes) + regionObject.bandBoxes.push_back(value.asString()); + data_.regions.push_back(regionObject); + } + +} + +RecognizePassportMRZResult::Data RecognizePassportMRZResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeQrCodeRequest.cc b/ocr/src/model/RecognizeQrCodeRequest.cc new file mode 100644 index 000000000..96c0ffb9c --- /dev/null +++ b/ocr/src/model/RecognizeQrCodeRequest.cc @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeQrCodeRequest; + +RecognizeQrCodeRequest::RecognizeQrCodeRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeQrCode") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeQrCodeRequest::~RecognizeQrCodeRequest() +{} + +std::vector RecognizeQrCodeRequest::getTasks()const +{ + return tasks_; +} + +void RecognizeQrCodeRequest::setTasks(const std::vector& tasks) +{ + tasks_ = tasks; + for(int dep1 = 0; dep1!= tasks.size(); dep1++) { + auto tasksObj = tasks.at(dep1); + std::string tasksObjStr = "Tasks." + std::to_string(dep1 + 1); + setParameter(tasksObjStr + ".ImageURL", tasksObj.imageURL); + } +} + diff --git a/ocr/src/model/RecognizeQrCodeResult.cc b/ocr/src/model/RecognizeQrCodeResult.cc new file mode 100644 index 000000000..491a741ec --- /dev/null +++ b/ocr/src/model/RecognizeQrCodeResult.cc @@ -0,0 +1,75 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeQrCodeResult::RecognizeQrCodeResult() : + ServiceResult() +{} + +RecognizeQrCodeResult::RecognizeQrCodeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeQrCodeResult::~RecognizeQrCodeResult() +{} + +void RecognizeQrCodeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allElementsNode = dataNode["Elements"]["Element"]; + for (auto dataNodeElementsElement : allElementsNode) + { + Data::Element elementObject; + if(!dataNodeElementsElement["TaskId"].isNull()) + elementObject.taskId = dataNodeElementsElement["TaskId"].asString(); + if(!dataNodeElementsElement["ImageURL"].isNull()) + elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString(); + auto allResultsNode = allElementsNode["Results"]["Result"]; + for (auto allElementsNodeResultsResult : allResultsNode) + { + Data::Element::Result resultsObject; + if(!allElementsNodeResultsResult["Label"].isNull()) + resultsObject.label = allElementsNodeResultsResult["Label"].asString(); + if(!allElementsNodeResultsResult["Suggestion"].isNull()) + resultsObject.suggestion = allElementsNodeResultsResult["Suggestion"].asString(); + if(!allElementsNodeResultsResult["Rate"].isNull()) + resultsObject.rate = std::stof(allElementsNodeResultsResult["Rate"].asString()); + auto allQrCodesData = value["QrCodesData"]["QrCodeData"]; + for (auto value : allQrCodesData) + resultsObject.qrCodesData.push_back(value.asString()); + elementObject.results.push_back(resultsObject); + } + data_.elements.push_back(elementObject); + } + +} + +RecognizeQrCodeResult::Data RecognizeQrCodeResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeStampRequest.cc b/ocr/src/model/RecognizeStampRequest.cc new file mode 100644 index 000000000..bbfc4f05c --- /dev/null +++ b/ocr/src/model/RecognizeStampRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeStampRequest; + +RecognizeStampRequest::RecognizeStampRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeStamp") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeStampRequest::~RecognizeStampRequest() +{} + +int RecognizeStampRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeStampRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeStampRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeStampRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeStampResult.cc b/ocr/src/model/RecognizeStampResult.cc new file mode 100644 index 000000000..c9983b57e --- /dev/null +++ b/ocr/src/model/RecognizeStampResult.cc @@ -0,0 +1,80 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeStampResult::RecognizeStampResult() : + ServiceResult() +{} + +RecognizeStampResult::RecognizeStampResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeStampResult::~RecognizeStampResult() +{} + +void RecognizeStampResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allResultsNode = dataNode["Results"]["ResultsItem"]; + for (auto dataNodeResultsResultsItem : allResultsNode) + { + Data::ResultsItem resultsItemObject; + auto allGeneralTextNode = allResultsNode["GeneralText"]["GeneralTextItem"]; + for (auto allResultsNodeGeneralTextGeneralTextItem : allGeneralTextNode) + { + Data::ResultsItem::GeneralTextItem generalTextObject; + if(!allResultsNodeGeneralTextGeneralTextItem["Content"].isNull()) + generalTextObject.content = allResultsNodeGeneralTextGeneralTextItem["Content"].asString(); + if(!allResultsNodeGeneralTextGeneralTextItem["Confidence"].isNull()) + generalTextObject.confidence = std::stof(allResultsNodeGeneralTextGeneralTextItem["Confidence"].asString()); + resultsItemObject.generalText.push_back(generalTextObject); + } + auto roiNode = value["Roi"]; + if(!roiNode["Left"].isNull()) + resultsItemObject.roi.left = std::stoi(roiNode["Left"].asString()); + if(!roiNode["Top"].isNull()) + resultsItemObject.roi.top = std::stoi(roiNode["Top"].asString()); + if(!roiNode["Width"].isNull()) + resultsItemObject.roi.width = std::stoi(roiNode["Width"].asString()); + if(!roiNode["Height"].isNull()) + resultsItemObject.roi.height = std::stoi(roiNode["Height"].asString()); + auto textNode = value["Text"]; + if(!textNode["Content"].isNull()) + resultsItemObject.text.content = textNode["Content"].asString(); + if(!textNode["Confidence"].isNull()) + resultsItemObject.text.confidence = std::stof(textNode["Confidence"].asString()); + data_.results.push_back(resultsItemObject); + } + +} + +RecognizeStampResult::Data RecognizeStampResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeTableRequest.cc b/ocr/src/model/RecognizeTableRequest.cc new file mode 100644 index 000000000..5a0f27aa1 --- /dev/null +++ b/ocr/src/model/RecognizeTableRequest.cc @@ -0,0 +1,106 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeTableRequest; + +RecognizeTableRequest::RecognizeTableRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeTable") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeTableRequest::~RecognizeTableRequest() +{} + +int RecognizeTableRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeTableRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +bool RecognizeTableRequest::getUseFinanceModel()const +{ + return useFinanceModel_; +} + +void RecognizeTableRequest::setUseFinanceModel(bool useFinanceModel) +{ + useFinanceModel_ = useFinanceModel; + setBodyParameter("UseFinanceModel", useFinanceModel ? "true" : "false"); +} + +bool RecognizeTableRequest::getSkipDetection()const +{ + return skipDetection_; +} + +void RecognizeTableRequest::setSkipDetection(bool skipDetection) +{ + skipDetection_ = skipDetection; + setBodyParameter("SkipDetection", skipDetection ? "true" : "false"); +} + +std::string RecognizeTableRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeTableRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + +std::string RecognizeTableRequest::getOutputFormat()const +{ + return outputFormat_; +} + +void RecognizeTableRequest::setOutputFormat(const std::string& outputFormat) +{ + outputFormat_ = outputFormat; + setBodyParameter("OutputFormat", outputFormat); +} + +bool RecognizeTableRequest::getAssureDirection()const +{ + return assureDirection_; +} + +void RecognizeTableRequest::setAssureDirection(bool assureDirection) +{ + assureDirection_ = assureDirection; + setBodyParameter("AssureDirection", assureDirection ? "true" : "false"); +} + +bool RecognizeTableRequest::getHasLine()const +{ + return hasLine_; +} + +void RecognizeTableRequest::setHasLine(bool hasLine) +{ + hasLine_ = hasLine; + setBodyParameter("HasLine", hasLine ? "true" : "false"); +} + diff --git a/ocr/src/model/RecognizeTableResult.cc b/ocr/src/model/RecognizeTableResult.cc new file mode 100644 index 000000000..3adf59519 --- /dev/null +++ b/ocr/src/model/RecognizeTableResult.cc @@ -0,0 +1,91 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeTableResult::RecognizeTableResult() : + ServiceResult() +{} + +RecognizeTableResult::RecognizeTableResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeTableResult::~RecognizeTableResult() +{} + +void RecognizeTableResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["FileContent"].isNull()) + data_.fileContent = dataNode["FileContent"].asString(); + auto allTablesNode = dataNode["Tables"]["Table"]; + for (auto dataNodeTablesTable : allTablesNode) + { + Data::Table tableObject; + auto allTableRowsNode = allTablesNode["TableRows"]["TableRow"]; + for (auto allTablesNodeTableRowsTableRow : allTableRowsNode) + { + Data::Table::TableRow tableRowsObject; + auto allTableColumnsNode = allTableRowsNode["TableColumns"]["TableColumn"]; + for (auto allTableRowsNodeTableColumnsTableColumn : allTableColumnsNode) + { + Data::Table::TableRow::TableColumn tableColumnsObject; + if(!allTableRowsNodeTableColumnsTableColumn["StartColumn"].isNull()) + tableColumnsObject.startColumn = std::stoi(allTableRowsNodeTableColumnsTableColumn["StartColumn"].asString()); + if(!allTableRowsNodeTableColumnsTableColumn["StartRow"].isNull()) + tableColumnsObject.startRow = std::stoi(allTableRowsNodeTableColumnsTableColumn["StartRow"].asString()); + if(!allTableRowsNodeTableColumnsTableColumn["EndColumn"].isNull()) + tableColumnsObject.endColumn = std::stoi(allTableRowsNodeTableColumnsTableColumn["EndColumn"].asString()); + if(!allTableRowsNodeTableColumnsTableColumn["EndRow"].isNull()) + tableColumnsObject.endRow = std::stoi(allTableRowsNodeTableColumnsTableColumn["EndRow"].asString()); + if(!allTableRowsNodeTableColumnsTableColumn["Height"].isNull()) + tableColumnsObject.height = std::stoi(allTableRowsNodeTableColumnsTableColumn["Height"].asString()); + if(!allTableRowsNodeTableColumnsTableColumn["Width"].isNull()) + tableColumnsObject.width = std::stoi(allTableRowsNodeTableColumnsTableColumn["Width"].asString()); + auto allTexts = value["Texts"]["Text"]; + for (auto value : allTexts) + tableColumnsObject.texts.push_back(value.asString()); + tableRowsObject.tableColumns.push_back(tableColumnsObject); + } + tableObject.tableRows.push_back(tableRowsObject); + } + auto allHead = value["Head"]["Head"]; + for (auto value : allHead) + tableObject.head.push_back(value.asString()); + auto allTail = value["Tail"]["Tail"]; + for (auto value : allTail) + tableObject.tail.push_back(value.asString()); + data_.tables.push_back(tableObject); + } + +} + +RecognizeTableResult::Data RecognizeTableResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeTakeoutOrderRequest.cc b/ocr/src/model/RecognizeTakeoutOrderRequest.cc new file mode 100644 index 000000000..75390afbc --- /dev/null +++ b/ocr/src/model/RecognizeTakeoutOrderRequest.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeTakeoutOrderRequest; + +RecognizeTakeoutOrderRequest::RecognizeTakeoutOrderRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeTakeoutOrder") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeTakeoutOrderRequest::~RecognizeTakeoutOrderRequest() +{} + +std::string RecognizeTakeoutOrderRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeTakeoutOrderRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeTakeoutOrderResult.cc b/ocr/src/model/RecognizeTakeoutOrderResult.cc new file mode 100644 index 000000000..dc04ff03f --- /dev/null +++ b/ocr/src/model/RecognizeTakeoutOrderResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeTakeoutOrderResult::RecognizeTakeoutOrderResult() : + ServiceResult() +{} + +RecognizeTakeoutOrderResult::RecognizeTakeoutOrderResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeTakeoutOrderResult::~RecognizeTakeoutOrderResult() +{} + +void RecognizeTakeoutOrderResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allElementsNode = dataNode["Elements"]["Element"]; + for (auto dataNodeElementsElement : allElementsNode) + { + Data::Element elementObject; + if(!dataNodeElementsElement["Score"].isNull()) + elementObject.score = std::stof(dataNodeElementsElement["Score"].asString()); + if(!dataNodeElementsElement["Name"].isNull()) + elementObject.name = dataNodeElementsElement["Name"].asString(); + if(!dataNodeElementsElement["Value"].isNull()) + elementObject.value = dataNodeElementsElement["Value"].asString(); + auto allBoxes = value["Boxes"]["Box"]; + for (auto value : allBoxes) + elementObject.boxes.push_back(value.asString()); + data_.elements.push_back(elementObject); + } + +} + +RecognizeTakeoutOrderResult::Data RecognizeTakeoutOrderResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeTaxiInvoiceRequest.cc b/ocr/src/model/RecognizeTaxiInvoiceRequest.cc new file mode 100644 index 000000000..9b2d8b801 --- /dev/null +++ b/ocr/src/model/RecognizeTaxiInvoiceRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeTaxiInvoiceRequest; + +RecognizeTaxiInvoiceRequest::RecognizeTaxiInvoiceRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeTaxiInvoice") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeTaxiInvoiceRequest::~RecognizeTaxiInvoiceRequest() +{} + +int RecognizeTaxiInvoiceRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeTaxiInvoiceRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeTaxiInvoiceRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeTaxiInvoiceRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeTaxiInvoiceResult.cc b/ocr/src/model/RecognizeTaxiInvoiceResult.cc new file mode 100644 index 000000000..700deefd4 --- /dev/null +++ b/ocr/src/model/RecognizeTaxiInvoiceResult.cc @@ -0,0 +1,88 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeTaxiInvoiceResult::RecognizeTaxiInvoiceResult() : + ServiceResult() +{} + +RecognizeTaxiInvoiceResult::RecognizeTaxiInvoiceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeTaxiInvoiceResult::~RecognizeTaxiInvoiceResult() +{} + +void RecognizeTaxiInvoiceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allInvoicesNode = dataNode["Invoices"]["Invoice"]; + for (auto dataNodeInvoicesInvoice : allInvoicesNode) + { + Data::Invoice invoiceObject; + if(!dataNodeInvoicesInvoice["RotateType"].isNull()) + invoiceObject.rotateType = std::stoi(dataNodeInvoicesInvoice["RotateType"].asString()); + auto allItemsNode = allInvoicesNode["Items"]["Item"]; + for (auto allInvoicesNodeItemsItem : allItemsNode) + { + Data::Invoice::Item itemsObject; + if(!allInvoicesNodeItemsItem["Text"].isNull()) + itemsObject.text = allInvoicesNodeItemsItem["Text"].asString(); + auto itemRoiNode = value["ItemRoi"]; + if(!itemRoiNode["Angle"].isNull()) + itemsObject.itemRoi.angle = std::stof(itemRoiNode["Angle"].asString()); + auto centerNode = itemRoiNode["Center"]; + if(!centerNode["X"].isNull()) + itemsObject.itemRoi.center.x = std::stof(centerNode["X"].asString()); + if(!centerNode["Y"].isNull()) + itemsObject.itemRoi.center.y = std::stof(centerNode["Y"].asString()); + auto sizeNode = itemRoiNode["Size"]; + if(!sizeNode["H"].isNull()) + itemsObject.itemRoi.size.h = std::stof(sizeNode["H"].asString()); + if(!sizeNode["W"].isNull()) + itemsObject.itemRoi.size.w = std::stof(sizeNode["W"].asString()); + invoiceObject.items.push_back(itemsObject); + } + auto invoiceRoiNode = value["InvoiceRoi"]; + if(!invoiceRoiNode["H"].isNull()) + invoiceObject.invoiceRoi.h = std::stof(invoiceRoiNode["H"].asString()); + if(!invoiceRoiNode["W"].isNull()) + invoiceObject.invoiceRoi.w = std::stof(invoiceRoiNode["W"].asString()); + if(!invoiceRoiNode["X"].isNull()) + invoiceObject.invoiceRoi.x = std::stof(invoiceRoiNode["X"].asString()); + if(!invoiceRoiNode["Y"].isNull()) + invoiceObject.invoiceRoi.y = std::stof(invoiceRoiNode["Y"].asString()); + data_.invoices.push_back(invoiceObject); + } + +} + +RecognizeTaxiInvoiceResult::Data RecognizeTaxiInvoiceResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeTrainTicketRequest.cc b/ocr/src/model/RecognizeTrainTicketRequest.cc new file mode 100644 index 000000000..87f58b331 --- /dev/null +++ b/ocr/src/model/RecognizeTrainTicketRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeTrainTicketRequest; + +RecognizeTrainTicketRequest::RecognizeTrainTicketRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeTrainTicket") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeTrainTicketRequest::~RecognizeTrainTicketRequest() +{} + +int RecognizeTrainTicketRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeTrainTicketRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setBodyParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeTrainTicketRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeTrainTicketRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeTrainTicketResult.cc b/ocr/src/model/RecognizeTrainTicketResult.cc new file mode 100644 index 000000000..53308f055 --- /dev/null +++ b/ocr/src/model/RecognizeTrainTicketResult.cc @@ -0,0 +1,66 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeTrainTicketResult::RecognizeTrainTicketResult() : + ServiceResult() +{} + +RecognizeTrainTicketResult::RecognizeTrainTicketResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeTrainTicketResult::~RecognizeTrainTicketResult() +{} + +void RecognizeTrainTicketResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Date"].isNull()) + data_.date = dataNode["Date"].asString(); + if(!dataNode["Destination"].isNull()) + data_.destination = dataNode["Destination"].asString(); + if(!dataNode["Level"].isNull()) + data_.level = dataNode["Level"].asString(); + if(!dataNode["Number"].isNull()) + data_.number = dataNode["Number"].asString(); + if(!dataNode["Name"].isNull()) + data_.name = dataNode["Name"].asString(); + if(!dataNode["DepartureStation"].isNull()) + data_.departureStation = dataNode["DepartureStation"].asString(); + if(!dataNode["Seat"].isNull()) + data_.seat = dataNode["Seat"].asString(); + if(!dataNode["Price"].isNull()) + data_.price = std::stof(dataNode["Price"].asString()); + +} + +RecognizeTrainTicketResult::Data RecognizeTrainTicketResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeVATInvoiceRequest.cc b/ocr/src/model/RecognizeVATInvoiceRequest.cc new file mode 100644 index 000000000..60eb1fd77 --- /dev/null +++ b/ocr/src/model/RecognizeVATInvoiceRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeVATInvoiceRequest; + +RecognizeVATInvoiceRequest::RecognizeVATInvoiceRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeVATInvoice") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeVATInvoiceRequest::~RecognizeVATInvoiceRequest() +{} + +std::string RecognizeVATInvoiceRequest::getFileType()const +{ + return fileType_; +} + +void RecognizeVATInvoiceRequest::setFileType(const std::string& fileType) +{ + fileType_ = fileType; + setBodyParameter("FileType", fileType); +} + +std::string RecognizeVATInvoiceRequest::getFileURL()const +{ + return fileURL_; +} + +void RecognizeVATInvoiceRequest::setFileURL(const std::string& fileURL) +{ + fileURL_ = fileURL; + setBodyParameter("FileURL", fileURL); +} + diff --git a/ocr/src/model/RecognizeVATInvoiceResult.cc b/ocr/src/model/RecognizeVATInvoiceResult.cc new file mode 100644 index 000000000..42b199f58 --- /dev/null +++ b/ocr/src/model/RecognizeVATInvoiceResult.cc @@ -0,0 +1,147 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeVATInvoiceResult::RecognizeVATInvoiceResult() : + ServiceResult() +{} + +RecognizeVATInvoiceResult::RecognizeVATInvoiceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeVATInvoiceResult::~RecognizeVATInvoiceResult() +{} + +void RecognizeVATInvoiceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto contentNode = dataNode["Content"]; + if(!contentNode["InvoiceCode"].isNull()) + data_.content.invoiceCode = contentNode["InvoiceCode"].asString(); + if(!contentNode["InvoiceNo"].isNull()) + data_.content.invoiceNo = contentNode["InvoiceNo"].asString(); + if(!contentNode["InvoiceDate"].isNull()) + data_.content.invoiceDate = contentNode["InvoiceDate"].asString(); + if(!contentNode["AntiFakeCode"].isNull()) + data_.content.antiFakeCode = contentNode["AntiFakeCode"].asString(); + if(!contentNode["PayerName"].isNull()) + data_.content.payerName = contentNode["PayerName"].asString(); + if(!contentNode["PayerRegisterNo"].isNull()) + data_.content.payerRegisterNo = contentNode["PayerRegisterNo"].asString(); + if(!contentNode["PayerAddress"].isNull()) + data_.content.payerAddress = contentNode["PayerAddress"].asString(); + if(!contentNode["PayerBankName"].isNull()) + data_.content.payerBankName = contentNode["PayerBankName"].asString(); + if(!contentNode["WithoutTaxAmount"].isNull()) + data_.content.withoutTaxAmount = contentNode["WithoutTaxAmount"].asString(); + if(!contentNode["TaxAmount"].isNull()) + data_.content.taxAmount = contentNode["TaxAmount"].asString(); + if(!contentNode["SumAmount"].isNull()) + data_.content.sumAmount = contentNode["SumAmount"].asString(); + if(!contentNode["InvoiceAmount"].isNull()) + data_.content.invoiceAmount = contentNode["InvoiceAmount"].asString(); + if(!contentNode["PayeeName"].isNull()) + data_.content.payeeName = contentNode["PayeeName"].asString(); + if(!contentNode["PayeeRegisterNo"].isNull()) + data_.content.payeeRegisterNo = contentNode["PayeeRegisterNo"].asString(); + if(!contentNode["PayeeAddress"].isNull()) + data_.content.payeeAddress = contentNode["PayeeAddress"].asString(); + if(!contentNode["PayeeBankName"].isNull()) + data_.content.payeeBankName = contentNode["PayeeBankName"].asString(); + if(!contentNode["Payee"].isNull()) + data_.content.payee = contentNode["Payee"].asString(); + if(!contentNode["Checker"].isNull()) + data_.content.checker = contentNode["Checker"].asString(); + if(!contentNode["Clerk"].isNull()) + data_.content.clerk = contentNode["Clerk"].asString(); + auto boxNode = dataNode["Box"]; + auto allInvoiceCodes = boxNode["InvoiceCodes"]["InvoiceCode"]; + for (auto value : allInvoiceCodes) + data_.box.invoiceCodes.push_back(value.asString()); + auto allInvoiceNoes = boxNode["InvoiceNoes"]["InvoiceNo"]; + for (auto value : allInvoiceNoes) + data_.box.invoiceNoes.push_back(value.asString()); + auto allInvoiceDates = boxNode["InvoiceDates"]["InvoiceDate"]; + for (auto value : allInvoiceDates) + data_.box.invoiceDates.push_back(value.asString()); + auto allInvoiceFakeCodes = boxNode["InvoiceFakeCodes"]["InvoiceFakeCode"]; + for (auto value : allInvoiceFakeCodes) + data_.box.invoiceFakeCodes.push_back(value.asString()); + auto allPayerNames = boxNode["PayerNames"]["PayerName"]; + for (auto value : allPayerNames) + data_.box.payerNames.push_back(value.asString()); + auto allPayerRegisterNoes = boxNode["PayerRegisterNoes"]["PayerRegisterNo"]; + for (auto value : allPayerRegisterNoes) + data_.box.payerRegisterNoes.push_back(value.asString()); + auto allPayerAddresses = boxNode["PayerAddresses"]["PayerAddress"]; + for (auto value : allPayerAddresses) + data_.box.payerAddresses.push_back(value.asString()); + auto allPayerBankNames = boxNode["PayerBankNames"]["PayerBankNames"]; + for (auto value : allPayerBankNames) + data_.box.payerBankNames.push_back(value.asString()); + auto allWithoutTaxAmounts = boxNode["WithoutTaxAmounts"]["WithoutTaxAmount"]; + for (auto value : allWithoutTaxAmounts) + data_.box.withoutTaxAmounts.push_back(value.asString()); + auto allTaxAmounts = boxNode["TaxAmounts"]["TaxAmount"]; + for (auto value : allTaxAmounts) + data_.box.taxAmounts.push_back(value.asString()); + auto allSumAmounts = boxNode["SumAmounts"]["SumAmount"]; + for (auto value : allSumAmounts) + data_.box.sumAmounts.push_back(value.asString()); + auto allInvoiceAmounts = boxNode["InvoiceAmounts"]["InvoiceAmount"]; + for (auto value : allInvoiceAmounts) + data_.box.invoiceAmounts.push_back(value.asString()); + auto allPayeeNames = boxNode["PayeeNames"]["PayeeName"]; + for (auto value : allPayeeNames) + data_.box.payeeNames.push_back(value.asString()); + auto allPayeeRegisterNoes = boxNode["PayeeRegisterNoes"]["PayeeRegisterNo"]; + for (auto value : allPayeeRegisterNoes) + data_.box.payeeRegisterNoes.push_back(value.asString()); + auto allPayeeAddresses = boxNode["PayeeAddresses"]["PayeeAddress"]; + for (auto value : allPayeeAddresses) + data_.box.payeeAddresses.push_back(value.asString()); + auto allPayeeBankNames = boxNode["PayeeBankNames"]["PayeeBankName"]; + for (auto value : allPayeeBankNames) + data_.box.payeeBankNames.push_back(value.asString()); + auto allPayees = boxNode["Payees"]["Payee"]; + for (auto value : allPayees) + data_.box.payees.push_back(value.asString()); + auto allCheckers = boxNode["Checkers"]["Checker"]; + for (auto value : allCheckers) + data_.box.checkers.push_back(value.asString()); + auto allClerks = boxNode["Clerks"]["Clerk"]; + for (auto value : allClerks) + data_.box.clerks.push_back(value.asString()); + +} + +RecognizeVATInvoiceResult::Data RecognizeVATInvoiceResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeVINCodeRequest.cc b/ocr/src/model/RecognizeVINCodeRequest.cc new file mode 100644 index 000000000..af32cea83 --- /dev/null +++ b/ocr/src/model/RecognizeVINCodeRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeVINCodeRequest; + +RecognizeVINCodeRequest::RecognizeVINCodeRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeVINCode") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeVINCodeRequest::~RecognizeVINCodeRequest() +{} + +int RecognizeVINCodeRequest::getImageType()const +{ + return imageType_; +} + +void RecognizeVINCodeRequest::setImageType(int imageType) +{ + imageType_ = imageType; + setParameter("ImageType", std::to_string(imageType)); +} + +std::string RecognizeVINCodeRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeVINCodeRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeVINCodeResult.cc b/ocr/src/model/RecognizeVINCodeResult.cc new file mode 100644 index 000000000..63eceee12 --- /dev/null +++ b/ocr/src/model/RecognizeVINCodeResult.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeVINCodeResult::RecognizeVINCodeResult() : + ServiceResult() +{} + +RecognizeVINCodeResult::RecognizeVINCodeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeVINCodeResult::~RecognizeVINCodeResult() +{} + +void RecognizeVINCodeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["VinCode"].isNull()) + data_.vinCode = dataNode["VinCode"].asString(); + +} + +RecognizeVINCodeResult::Data RecognizeVINCodeResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/RecognizeVerificationcodeRequest.cc b/ocr/src/model/RecognizeVerificationcodeRequest.cc new file mode 100644 index 000000000..9d827f221 --- /dev/null +++ b/ocr/src/model/RecognizeVerificationcodeRequest.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::RecognizeVerificationcodeRequest; + +RecognizeVerificationcodeRequest::RecognizeVerificationcodeRequest() : + RpcServiceRequest("ocr", "2019-12-30", "RecognizeVerificationcode") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeVerificationcodeRequest::~RecognizeVerificationcodeRequest() +{} + +std::string RecognizeVerificationcodeRequest::getImageURL()const +{ + return imageURL_; +} + +void RecognizeVerificationcodeRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/ocr/src/model/RecognizeVerificationcodeResult.cc b/ocr/src/model/RecognizeVerificationcodeResult.cc new file mode 100644 index 000000000..d229f52b2 --- /dev/null +++ b/ocr/src/model/RecognizeVerificationcodeResult.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +RecognizeVerificationcodeResult::RecognizeVerificationcodeResult() : + ServiceResult() +{} + +RecognizeVerificationcodeResult::RecognizeVerificationcodeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeVerificationcodeResult::~RecognizeVerificationcodeResult() +{} + +void RecognizeVerificationcodeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Content"].isNull()) + data_.content = dataNode["Content"].asString(); + +} + +RecognizeVerificationcodeResult::Data RecognizeVerificationcodeResult::getData()const +{ + return data_; +} + diff --git a/ocr/src/model/TrimDocumentRequest.cc b/ocr/src/model/TrimDocumentRequest.cc new file mode 100644 index 000000000..433cc07b2 --- /dev/null +++ b/ocr/src/model/TrimDocumentRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Ocr::Model::TrimDocumentRequest; + +TrimDocumentRequest::TrimDocumentRequest() : + RpcServiceRequest("ocr", "2019-12-30", "TrimDocument") +{ + setMethod(HttpRequest::Method::Post); +} + +TrimDocumentRequest::~TrimDocumentRequest() +{} + +std::string TrimDocumentRequest::getFileType()const +{ + return fileType_; +} + +void TrimDocumentRequest::setFileType(const std::string& fileType) +{ + fileType_ = fileType; + setBodyParameter("FileType", fileType); +} + +bool TrimDocumentRequest::getAsync()const +{ + return async_; +} + +void TrimDocumentRequest::setAsync(bool async) +{ + async_ = async; + setBodyParameter("Async", async ? "true" : "false"); +} + +std::string TrimDocumentRequest::getFileURL()const +{ + return fileURL_; +} + +void TrimDocumentRequest::setFileURL(const std::string& fileURL) +{ + fileURL_ = fileURL; + setBodyParameter("FileURL", fileURL); +} + +std::string TrimDocumentRequest::getOutputType()const +{ + return outputType_; +} + +void TrimDocumentRequest::setOutputType(const std::string& outputType) +{ + outputType_ = outputType; + setBodyParameter("OutputType", outputType); +} + diff --git a/ocr/src/model/TrimDocumentResult.cc b/ocr/src/model/TrimDocumentResult.cc new file mode 100644 index 000000000..709f0bdb2 --- /dev/null +++ b/ocr/src/model/TrimDocumentResult.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Ocr; +using namespace AlibabaCloud::Ocr::Model; + +TrimDocumentResult::TrimDocumentResult() : + ServiceResult() +{} + +TrimDocumentResult::TrimDocumentResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +TrimDocumentResult::~TrimDocumentResult() +{} + +void TrimDocumentResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Content"].isNull()) + data_.content = dataNode["Content"].asString(); + +} + +TrimDocumentResult::Data TrimDocumentResult::getData()const +{ + return data_; +} +