2 Star 8 Fork 0

tencentcloud/tencentcloud-sdk-cpp

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
OcrClient.cpp 121.61 KB
Copy Edit Raw Blame History
tencentcloud authored 2025-04-02 04:32 +08:00 . release 3.0.1203
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697
/*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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 <tencentcloud/ocr/v20181119/OcrClient.h>
#include <tencentcloud/core/Executor.h>
#include <tencentcloud/core/Runnable.h>
using namespace TencentCloud;
using namespace TencentCloud::Ocr::V20181119;
using namespace TencentCloud::Ocr::V20181119::Model;
using namespace std;
namespace
{
const string VERSION = "2018-11-19";
const string ENDPOINT = "ocr.tencentcloudapi.com";
}
OcrClient::OcrClient(const Credential &credential, const string &region) :
OcrClient(credential, region, ClientProfile())
{
}
OcrClient::OcrClient(const Credential &credential, const string &region, const ClientProfile &profile) :
AbstractClient(ENDPOINT, VERSION, credential, region, profile)
{
}
OcrClient::AdvertiseOCROutcome OcrClient::AdvertiseOCR(const AdvertiseOCRRequest &request)
{
auto outcome = MakeRequest(request, "AdvertiseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
AdvertiseOCRResponse rsp = AdvertiseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return AdvertiseOCROutcome(rsp);
else
return AdvertiseOCROutcome(o.GetError());
}
else
{
return AdvertiseOCROutcome(outcome.GetError());
}
}
void OcrClient::AdvertiseOCRAsync(const AdvertiseOCRRequest& request, const AdvertiseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->AdvertiseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::AdvertiseOCROutcomeCallable OcrClient::AdvertiseOCRCallable(const AdvertiseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<AdvertiseOCROutcome()>>(
[this, request]()
{
return this->AdvertiseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ArithmeticOCROutcome OcrClient::ArithmeticOCR(const ArithmeticOCRRequest &request)
{
auto outcome = MakeRequest(request, "ArithmeticOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ArithmeticOCRResponse rsp = ArithmeticOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ArithmeticOCROutcome(rsp);
else
return ArithmeticOCROutcome(o.GetError());
}
else
{
return ArithmeticOCROutcome(outcome.GetError());
}
}
void OcrClient::ArithmeticOCRAsync(const ArithmeticOCRRequest& request, const ArithmeticOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ArithmeticOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ArithmeticOCROutcomeCallable OcrClient::ArithmeticOCRCallable(const ArithmeticOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<ArithmeticOCROutcome()>>(
[this, request]()
{
return this->ArithmeticOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::BankCardOCROutcome OcrClient::BankCardOCR(const BankCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "BankCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BankCardOCRResponse rsp = BankCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BankCardOCROutcome(rsp);
else
return BankCardOCROutcome(o.GetError());
}
else
{
return BankCardOCROutcome(outcome.GetError());
}
}
void OcrClient::BankCardOCRAsync(const BankCardOCRRequest& request, const BankCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BankCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::BankCardOCROutcomeCallable OcrClient::BankCardOCRCallable(const BankCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<BankCardOCROutcome()>>(
[this, request]()
{
return this->BankCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::BankSlipOCROutcome OcrClient::BankSlipOCR(const BankSlipOCRRequest &request)
{
auto outcome = MakeRequest(request, "BankSlipOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BankSlipOCRResponse rsp = BankSlipOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BankSlipOCROutcome(rsp);
else
return BankSlipOCROutcome(o.GetError());
}
else
{
return BankSlipOCROutcome(outcome.GetError());
}
}
void OcrClient::BankSlipOCRAsync(const BankSlipOCRRequest& request, const BankSlipOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BankSlipOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::BankSlipOCROutcomeCallable OcrClient::BankSlipOCRCallable(const BankSlipOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<BankSlipOCROutcome()>>(
[this, request]()
{
return this->BankSlipOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::BizLicenseOCROutcome OcrClient::BizLicenseOCR(const BizLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "BizLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BizLicenseOCRResponse rsp = BizLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BizLicenseOCROutcome(rsp);
else
return BizLicenseOCROutcome(o.GetError());
}
else
{
return BizLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::BizLicenseOCRAsync(const BizLicenseOCRRequest& request, const BizLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BizLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::BizLicenseOCROutcomeCallable OcrClient::BizLicenseOCRCallable(const BizLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<BizLicenseOCROutcome()>>(
[this, request]()
{
return this->BizLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::BusInvoiceOCROutcome OcrClient::BusInvoiceOCR(const BusInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "BusInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BusInvoiceOCRResponse rsp = BusInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BusInvoiceOCROutcome(rsp);
else
return BusInvoiceOCROutcome(o.GetError());
}
else
{
return BusInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::BusInvoiceOCRAsync(const BusInvoiceOCRRequest& request, const BusInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BusInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::BusInvoiceOCROutcomeCallable OcrClient::BusInvoiceOCRCallable(const BusInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<BusInvoiceOCROutcome()>>(
[this, request]()
{
return this->BusInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::BusinessCardOCROutcome OcrClient::BusinessCardOCR(const BusinessCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "BusinessCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BusinessCardOCRResponse rsp = BusinessCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BusinessCardOCROutcome(rsp);
else
return BusinessCardOCROutcome(o.GetError());
}
else
{
return BusinessCardOCROutcome(outcome.GetError());
}
}
void OcrClient::BusinessCardOCRAsync(const BusinessCardOCRRequest& request, const BusinessCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BusinessCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::BusinessCardOCROutcomeCallable OcrClient::BusinessCardOCRCallable(const BusinessCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<BusinessCardOCROutcome()>>(
[this, request]()
{
return this->BusinessCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::CarInvoiceOCROutcome OcrClient::CarInvoiceOCR(const CarInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "CarInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CarInvoiceOCRResponse rsp = CarInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CarInvoiceOCROutcome(rsp);
else
return CarInvoiceOCROutcome(o.GetError());
}
else
{
return CarInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::CarInvoiceOCRAsync(const CarInvoiceOCRRequest& request, const CarInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CarInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::CarInvoiceOCROutcomeCallable OcrClient::CarInvoiceOCRCallable(const CarInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<CarInvoiceOCROutcome()>>(
[this, request]()
{
return this->CarInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ClassifyDetectOCROutcome OcrClient::ClassifyDetectOCR(const ClassifyDetectOCRRequest &request)
{
auto outcome = MakeRequest(request, "ClassifyDetectOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ClassifyDetectOCRResponse rsp = ClassifyDetectOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ClassifyDetectOCROutcome(rsp);
else
return ClassifyDetectOCROutcome(o.GetError());
}
else
{
return ClassifyDetectOCROutcome(outcome.GetError());
}
}
void OcrClient::ClassifyDetectOCRAsync(const ClassifyDetectOCRRequest& request, const ClassifyDetectOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ClassifyDetectOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ClassifyDetectOCROutcomeCallable OcrClient::ClassifyDetectOCRCallable(const ClassifyDetectOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<ClassifyDetectOCROutcome()>>(
[this, request]()
{
return this->ClassifyDetectOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ClassifyStoreNameOutcome OcrClient::ClassifyStoreName(const ClassifyStoreNameRequest &request)
{
auto outcome = MakeRequest(request, "ClassifyStoreName");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ClassifyStoreNameResponse rsp = ClassifyStoreNameResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ClassifyStoreNameOutcome(rsp);
else
return ClassifyStoreNameOutcome(o.GetError());
}
else
{
return ClassifyStoreNameOutcome(outcome.GetError());
}
}
void OcrClient::ClassifyStoreNameAsync(const ClassifyStoreNameRequest& request, const ClassifyStoreNameAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ClassifyStoreName(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ClassifyStoreNameOutcomeCallable OcrClient::ClassifyStoreNameCallable(const ClassifyStoreNameRequest &request)
{
auto task = std::make_shared<std::packaged_task<ClassifyStoreNameOutcome()>>(
[this, request]()
{
return this->ClassifyStoreName(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::DriverLicenseOCROutcome OcrClient::DriverLicenseOCR(const DriverLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "DriverLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DriverLicenseOCRResponse rsp = DriverLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DriverLicenseOCROutcome(rsp);
else
return DriverLicenseOCROutcome(o.GetError());
}
else
{
return DriverLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::DriverLicenseOCRAsync(const DriverLicenseOCRRequest& request, const DriverLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DriverLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::DriverLicenseOCROutcomeCallable OcrClient::DriverLicenseOCRCallable(const DriverLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<DriverLicenseOCROutcome()>>(
[this, request]()
{
return this->DriverLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::DutyPaidProofOCROutcome OcrClient::DutyPaidProofOCR(const DutyPaidProofOCRRequest &request)
{
auto outcome = MakeRequest(request, "DutyPaidProofOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DutyPaidProofOCRResponse rsp = DutyPaidProofOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DutyPaidProofOCROutcome(rsp);
else
return DutyPaidProofOCROutcome(o.GetError());
}
else
{
return DutyPaidProofOCROutcome(outcome.GetError());
}
}
void OcrClient::DutyPaidProofOCRAsync(const DutyPaidProofOCRRequest& request, const DutyPaidProofOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DutyPaidProofOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::DutyPaidProofOCROutcomeCallable OcrClient::DutyPaidProofOCRCallable(const DutyPaidProofOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<DutyPaidProofOCROutcome()>>(
[this, request]()
{
return this->DutyPaidProofOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::EduPaperOCROutcome OcrClient::EduPaperOCR(const EduPaperOCRRequest &request)
{
auto outcome = MakeRequest(request, "EduPaperOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
EduPaperOCRResponse rsp = EduPaperOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return EduPaperOCROutcome(rsp);
else
return EduPaperOCROutcome(o.GetError());
}
else
{
return EduPaperOCROutcome(outcome.GetError());
}
}
void OcrClient::EduPaperOCRAsync(const EduPaperOCRRequest& request, const EduPaperOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->EduPaperOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::EduPaperOCROutcomeCallable OcrClient::EduPaperOCRCallable(const EduPaperOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<EduPaperOCROutcome()>>(
[this, request]()
{
return this->EduPaperOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::EnglishOCROutcome OcrClient::EnglishOCR(const EnglishOCRRequest &request)
{
auto outcome = MakeRequest(request, "EnglishOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
EnglishOCRResponse rsp = EnglishOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return EnglishOCROutcome(rsp);
else
return EnglishOCROutcome(o.GetError());
}
else
{
return EnglishOCROutcome(outcome.GetError());
}
}
void OcrClient::EnglishOCRAsync(const EnglishOCRRequest& request, const EnglishOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->EnglishOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::EnglishOCROutcomeCallable OcrClient::EnglishOCRCallable(const EnglishOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<EnglishOCROutcome()>>(
[this, request]()
{
return this->EnglishOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::EnterpriseLicenseOCROutcome OcrClient::EnterpriseLicenseOCR(const EnterpriseLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "EnterpriseLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
EnterpriseLicenseOCRResponse rsp = EnterpriseLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return EnterpriseLicenseOCROutcome(rsp);
else
return EnterpriseLicenseOCROutcome(o.GetError());
}
else
{
return EnterpriseLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::EnterpriseLicenseOCRAsync(const EnterpriseLicenseOCRRequest& request, const EnterpriseLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->EnterpriseLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::EnterpriseLicenseOCROutcomeCallable OcrClient::EnterpriseLicenseOCRCallable(const EnterpriseLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<EnterpriseLicenseOCROutcome()>>(
[this, request]()
{
return this->EnterpriseLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::EstateCertOCROutcome OcrClient::EstateCertOCR(const EstateCertOCRRequest &request)
{
auto outcome = MakeRequest(request, "EstateCertOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
EstateCertOCRResponse rsp = EstateCertOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return EstateCertOCROutcome(rsp);
else
return EstateCertOCROutcome(o.GetError());
}
else
{
return EstateCertOCROutcome(outcome.GetError());
}
}
void OcrClient::EstateCertOCRAsync(const EstateCertOCRRequest& request, const EstateCertOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->EstateCertOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::EstateCertOCROutcomeCallable OcrClient::EstateCertOCRCallable(const EstateCertOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<EstateCertOCROutcome()>>(
[this, request]()
{
return this->EstateCertOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::FinanBillOCROutcome OcrClient::FinanBillOCR(const FinanBillOCRRequest &request)
{
auto outcome = MakeRequest(request, "FinanBillOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
FinanBillOCRResponse rsp = FinanBillOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return FinanBillOCROutcome(rsp);
else
return FinanBillOCROutcome(o.GetError());
}
else
{
return FinanBillOCROutcome(outcome.GetError());
}
}
void OcrClient::FinanBillOCRAsync(const FinanBillOCRRequest& request, const FinanBillOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->FinanBillOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::FinanBillOCROutcomeCallable OcrClient::FinanBillOCRCallable(const FinanBillOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<FinanBillOCROutcome()>>(
[this, request]()
{
return this->FinanBillOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::FinanBillSliceOCROutcome OcrClient::FinanBillSliceOCR(const FinanBillSliceOCRRequest &request)
{
auto outcome = MakeRequest(request, "FinanBillSliceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
FinanBillSliceOCRResponse rsp = FinanBillSliceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return FinanBillSliceOCROutcome(rsp);
else
return FinanBillSliceOCROutcome(o.GetError());
}
else
{
return FinanBillSliceOCROutcome(outcome.GetError());
}
}
void OcrClient::FinanBillSliceOCRAsync(const FinanBillSliceOCRRequest& request, const FinanBillSliceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->FinanBillSliceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::FinanBillSliceOCROutcomeCallable OcrClient::FinanBillSliceOCRCallable(const FinanBillSliceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<FinanBillSliceOCROutcome()>>(
[this, request]()
{
return this->FinanBillSliceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::FlightInvoiceOCROutcome OcrClient::FlightInvoiceOCR(const FlightInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "FlightInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
FlightInvoiceOCRResponse rsp = FlightInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return FlightInvoiceOCROutcome(rsp);
else
return FlightInvoiceOCROutcome(o.GetError());
}
else
{
return FlightInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::FlightInvoiceOCRAsync(const FlightInvoiceOCRRequest& request, const FlightInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->FlightInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::FlightInvoiceOCROutcomeCallable OcrClient::FlightInvoiceOCRCallable(const FlightInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<FlightInvoiceOCROutcome()>>(
[this, request]()
{
return this->FlightInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::FormulaOCROutcome OcrClient::FormulaOCR(const FormulaOCRRequest &request)
{
auto outcome = MakeRequest(request, "FormulaOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
FormulaOCRResponse rsp = FormulaOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return FormulaOCROutcome(rsp);
else
return FormulaOCROutcome(o.GetError());
}
else
{
return FormulaOCROutcome(outcome.GetError());
}
}
void OcrClient::FormulaOCRAsync(const FormulaOCRRequest& request, const FormulaOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->FormulaOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::FormulaOCROutcomeCallable OcrClient::FormulaOCRCallable(const FormulaOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<FormulaOCROutcome()>>(
[this, request]()
{
return this->FormulaOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GeneralAccurateOCROutcome OcrClient::GeneralAccurateOCR(const GeneralAccurateOCRRequest &request)
{
auto outcome = MakeRequest(request, "GeneralAccurateOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GeneralAccurateOCRResponse rsp = GeneralAccurateOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GeneralAccurateOCROutcome(rsp);
else
return GeneralAccurateOCROutcome(o.GetError());
}
else
{
return GeneralAccurateOCROutcome(outcome.GetError());
}
}
void OcrClient::GeneralAccurateOCRAsync(const GeneralAccurateOCRRequest& request, const GeneralAccurateOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GeneralAccurateOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GeneralAccurateOCROutcomeCallable OcrClient::GeneralAccurateOCRCallable(const GeneralAccurateOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<GeneralAccurateOCROutcome()>>(
[this, request]()
{
return this->GeneralAccurateOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GeneralBasicOCROutcome OcrClient::GeneralBasicOCR(const GeneralBasicOCRRequest &request)
{
auto outcome = MakeRequest(request, "GeneralBasicOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GeneralBasicOCRResponse rsp = GeneralBasicOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GeneralBasicOCROutcome(rsp);
else
return GeneralBasicOCROutcome(o.GetError());
}
else
{
return GeneralBasicOCROutcome(outcome.GetError());
}
}
void OcrClient::GeneralBasicOCRAsync(const GeneralBasicOCRRequest& request, const GeneralBasicOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GeneralBasicOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GeneralBasicOCROutcomeCallable OcrClient::GeneralBasicOCRCallable(const GeneralBasicOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<GeneralBasicOCROutcome()>>(
[this, request]()
{
return this->GeneralBasicOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GeneralEfficientOCROutcome OcrClient::GeneralEfficientOCR(const GeneralEfficientOCRRequest &request)
{
auto outcome = MakeRequest(request, "GeneralEfficientOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GeneralEfficientOCRResponse rsp = GeneralEfficientOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GeneralEfficientOCROutcome(rsp);
else
return GeneralEfficientOCROutcome(o.GetError());
}
else
{
return GeneralEfficientOCROutcome(outcome.GetError());
}
}
void OcrClient::GeneralEfficientOCRAsync(const GeneralEfficientOCRRequest& request, const GeneralEfficientOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GeneralEfficientOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GeneralEfficientOCROutcomeCallable OcrClient::GeneralEfficientOCRCallable(const GeneralEfficientOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<GeneralEfficientOCROutcome()>>(
[this, request]()
{
return this->GeneralEfficientOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GeneralFastOCROutcome OcrClient::GeneralFastOCR(const GeneralFastOCRRequest &request)
{
auto outcome = MakeRequest(request, "GeneralFastOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GeneralFastOCRResponse rsp = GeneralFastOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GeneralFastOCROutcome(rsp);
else
return GeneralFastOCROutcome(o.GetError());
}
else
{
return GeneralFastOCROutcome(outcome.GetError());
}
}
void OcrClient::GeneralFastOCRAsync(const GeneralFastOCRRequest& request, const GeneralFastOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GeneralFastOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GeneralFastOCROutcomeCallable OcrClient::GeneralFastOCRCallable(const GeneralFastOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<GeneralFastOCROutcome()>>(
[this, request]()
{
return this->GeneralFastOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GeneralHandwritingOCROutcome OcrClient::GeneralHandwritingOCR(const GeneralHandwritingOCRRequest &request)
{
auto outcome = MakeRequest(request, "GeneralHandwritingOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GeneralHandwritingOCRResponse rsp = GeneralHandwritingOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GeneralHandwritingOCROutcome(rsp);
else
return GeneralHandwritingOCROutcome(o.GetError());
}
else
{
return GeneralHandwritingOCROutcome(outcome.GetError());
}
}
void OcrClient::GeneralHandwritingOCRAsync(const GeneralHandwritingOCRRequest& request, const GeneralHandwritingOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GeneralHandwritingOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GeneralHandwritingOCROutcomeCallable OcrClient::GeneralHandwritingOCRCallable(const GeneralHandwritingOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<GeneralHandwritingOCROutcome()>>(
[this, request]()
{
return this->GeneralHandwritingOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GetOCRResultOutcome OcrClient::GetOCRResult(const GetOCRResultRequest &request)
{
auto outcome = MakeRequest(request, "GetOCRResult");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GetOCRResultResponse rsp = GetOCRResultResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GetOCRResultOutcome(rsp);
else
return GetOCRResultOutcome(o.GetError());
}
else
{
return GetOCRResultOutcome(outcome.GetError());
}
}
void OcrClient::GetOCRResultAsync(const GetOCRResultRequest& request, const GetOCRResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GetOCRResult(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GetOCRResultOutcomeCallable OcrClient::GetOCRResultCallable(const GetOCRResultRequest &request)
{
auto task = std::make_shared<std::packaged_task<GetOCRResultOutcome()>>(
[this, request]()
{
return this->GetOCRResult(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::GetOCRTokenOutcome OcrClient::GetOCRToken(const GetOCRTokenRequest &request)
{
auto outcome = MakeRequest(request, "GetOCRToken");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
GetOCRTokenResponse rsp = GetOCRTokenResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return GetOCRTokenOutcome(rsp);
else
return GetOCRTokenOutcome(o.GetError());
}
else
{
return GetOCRTokenOutcome(outcome.GetError());
}
}
void OcrClient::GetOCRTokenAsync(const GetOCRTokenRequest& request, const GetOCRTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->GetOCRToken(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::GetOCRTokenOutcomeCallable OcrClient::GetOCRTokenCallable(const GetOCRTokenRequest &request)
{
auto task = std::make_shared<std::packaged_task<GetOCRTokenOutcome()>>(
[this, request]()
{
return this->GetOCRToken(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::HKIDCardOCROutcome OcrClient::HKIDCardOCR(const HKIDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "HKIDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
HKIDCardOCRResponse rsp = HKIDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return HKIDCardOCROutcome(rsp);
else
return HKIDCardOCROutcome(o.GetError());
}
else
{
return HKIDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::HKIDCardOCRAsync(const HKIDCardOCRRequest& request, const HKIDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->HKIDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::HKIDCardOCROutcomeCallable OcrClient::HKIDCardOCRCallable(const HKIDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<HKIDCardOCROutcome()>>(
[this, request]()
{
return this->HKIDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::HmtResidentPermitOCROutcome OcrClient::HmtResidentPermitOCR(const HmtResidentPermitOCRRequest &request)
{
auto outcome = MakeRequest(request, "HmtResidentPermitOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
HmtResidentPermitOCRResponse rsp = HmtResidentPermitOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return HmtResidentPermitOCROutcome(rsp);
else
return HmtResidentPermitOCROutcome(o.GetError());
}
else
{
return HmtResidentPermitOCROutcome(outcome.GetError());
}
}
void OcrClient::HmtResidentPermitOCRAsync(const HmtResidentPermitOCRRequest& request, const HmtResidentPermitOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->HmtResidentPermitOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::HmtResidentPermitOCROutcomeCallable OcrClient::HmtResidentPermitOCRCallable(const HmtResidentPermitOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<HmtResidentPermitOCROutcome()>>(
[this, request]()
{
return this->HmtResidentPermitOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::IDCardOCROutcome OcrClient::IDCardOCR(const IDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "IDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
IDCardOCRResponse rsp = IDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return IDCardOCROutcome(rsp);
else
return IDCardOCROutcome(o.GetError());
}
else
{
return IDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::IDCardOCRAsync(const IDCardOCRRequest& request, const IDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->IDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::IDCardOCROutcomeCallable OcrClient::IDCardOCRCallable(const IDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<IDCardOCROutcome()>>(
[this, request]()
{
return this->IDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ImageEnhancementOutcome OcrClient::ImageEnhancement(const ImageEnhancementRequest &request)
{
auto outcome = MakeRequest(request, "ImageEnhancement");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ImageEnhancementResponse rsp = ImageEnhancementResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ImageEnhancementOutcome(rsp);
else
return ImageEnhancementOutcome(o.GetError());
}
else
{
return ImageEnhancementOutcome(outcome.GetError());
}
}
void OcrClient::ImageEnhancementAsync(const ImageEnhancementRequest& request, const ImageEnhancementAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ImageEnhancement(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ImageEnhancementOutcomeCallable OcrClient::ImageEnhancementCallable(const ImageEnhancementRequest &request)
{
auto task = std::make_shared<std::packaged_task<ImageEnhancementOutcome()>>(
[this, request]()
{
return this->ImageEnhancement(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::InstitutionOCROutcome OcrClient::InstitutionOCR(const InstitutionOCRRequest &request)
{
auto outcome = MakeRequest(request, "InstitutionOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
InstitutionOCRResponse rsp = InstitutionOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return InstitutionOCROutcome(rsp);
else
return InstitutionOCROutcome(o.GetError());
}
else
{
return InstitutionOCROutcome(outcome.GetError());
}
}
void OcrClient::InstitutionOCRAsync(const InstitutionOCRRequest& request, const InstitutionOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->InstitutionOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::InstitutionOCROutcomeCallable OcrClient::InstitutionOCRCallable(const InstitutionOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<InstitutionOCROutcome()>>(
[this, request]()
{
return this->InstitutionOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::InsuranceBillOCROutcome OcrClient::InsuranceBillOCR(const InsuranceBillOCRRequest &request)
{
auto outcome = MakeRequest(request, "InsuranceBillOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
InsuranceBillOCRResponse rsp = InsuranceBillOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return InsuranceBillOCROutcome(rsp);
else
return InsuranceBillOCROutcome(o.GetError());
}
else
{
return InsuranceBillOCROutcome(outcome.GetError());
}
}
void OcrClient::InsuranceBillOCRAsync(const InsuranceBillOCRRequest& request, const InsuranceBillOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->InsuranceBillOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::InsuranceBillOCROutcomeCallable OcrClient::InsuranceBillOCRCallable(const InsuranceBillOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<InsuranceBillOCROutcome()>>(
[this, request]()
{
return this->InsuranceBillOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::InvoiceGeneralOCROutcome OcrClient::InvoiceGeneralOCR(const InvoiceGeneralOCRRequest &request)
{
auto outcome = MakeRequest(request, "InvoiceGeneralOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
InvoiceGeneralOCRResponse rsp = InvoiceGeneralOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return InvoiceGeneralOCROutcome(rsp);
else
return InvoiceGeneralOCROutcome(o.GetError());
}
else
{
return InvoiceGeneralOCROutcome(outcome.GetError());
}
}
void OcrClient::InvoiceGeneralOCRAsync(const InvoiceGeneralOCRRequest& request, const InvoiceGeneralOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->InvoiceGeneralOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::InvoiceGeneralOCROutcomeCallable OcrClient::InvoiceGeneralOCRCallable(const InvoiceGeneralOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<InvoiceGeneralOCROutcome()>>(
[this, request]()
{
return this->InvoiceGeneralOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::LicensePlateOCROutcome OcrClient::LicensePlateOCR(const LicensePlateOCRRequest &request)
{
auto outcome = MakeRequest(request, "LicensePlateOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
LicensePlateOCRResponse rsp = LicensePlateOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return LicensePlateOCROutcome(rsp);
else
return LicensePlateOCROutcome(o.GetError());
}
else
{
return LicensePlateOCROutcome(outcome.GetError());
}
}
void OcrClient::LicensePlateOCRAsync(const LicensePlateOCRRequest& request, const LicensePlateOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->LicensePlateOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::LicensePlateOCROutcomeCallable OcrClient::LicensePlateOCRCallable(const LicensePlateOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<LicensePlateOCROutcome()>>(
[this, request]()
{
return this->LicensePlateOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::MLIDCardOCROutcome OcrClient::MLIDCardOCR(const MLIDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "MLIDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
MLIDCardOCRResponse rsp = MLIDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return MLIDCardOCROutcome(rsp);
else
return MLIDCardOCROutcome(o.GetError());
}
else
{
return MLIDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::MLIDCardOCRAsync(const MLIDCardOCRRequest& request, const MLIDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->MLIDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::MLIDCardOCROutcomeCallable OcrClient::MLIDCardOCRCallable(const MLIDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<MLIDCardOCROutcome()>>(
[this, request]()
{
return this->MLIDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::MLIDPassportOCROutcome OcrClient::MLIDPassportOCR(const MLIDPassportOCRRequest &request)
{
auto outcome = MakeRequest(request, "MLIDPassportOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
MLIDPassportOCRResponse rsp = MLIDPassportOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return MLIDPassportOCROutcome(rsp);
else
return MLIDPassportOCROutcome(o.GetError());
}
else
{
return MLIDPassportOCROutcome(outcome.GetError());
}
}
void OcrClient::MLIDPassportOCRAsync(const MLIDPassportOCRRequest& request, const MLIDPassportOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->MLIDPassportOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::MLIDPassportOCROutcomeCallable OcrClient::MLIDPassportOCRCallable(const MLIDPassportOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<MLIDPassportOCROutcome()>>(
[this, request]()
{
return this->MLIDPassportOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::MainlandPermitOCROutcome OcrClient::MainlandPermitOCR(const MainlandPermitOCRRequest &request)
{
auto outcome = MakeRequest(request, "MainlandPermitOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
MainlandPermitOCRResponse rsp = MainlandPermitOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return MainlandPermitOCROutcome(rsp);
else
return MainlandPermitOCROutcome(o.GetError());
}
else
{
return MainlandPermitOCROutcome(outcome.GetError());
}
}
void OcrClient::MainlandPermitOCRAsync(const MainlandPermitOCRRequest& request, const MainlandPermitOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->MainlandPermitOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::MainlandPermitOCROutcomeCallable OcrClient::MainlandPermitOCRCallable(const MainlandPermitOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<MainlandPermitOCROutcome()>>(
[this, request]()
{
return this->MainlandPermitOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::MixedInvoiceDetectOutcome OcrClient::MixedInvoiceDetect(const MixedInvoiceDetectRequest &request)
{
auto outcome = MakeRequest(request, "MixedInvoiceDetect");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
MixedInvoiceDetectResponse rsp = MixedInvoiceDetectResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return MixedInvoiceDetectOutcome(rsp);
else
return MixedInvoiceDetectOutcome(o.GetError());
}
else
{
return MixedInvoiceDetectOutcome(outcome.GetError());
}
}
void OcrClient::MixedInvoiceDetectAsync(const MixedInvoiceDetectRequest& request, const MixedInvoiceDetectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->MixedInvoiceDetect(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::MixedInvoiceDetectOutcomeCallable OcrClient::MixedInvoiceDetectCallable(const MixedInvoiceDetectRequest &request)
{
auto task = std::make_shared<std::packaged_task<MixedInvoiceDetectOutcome()>>(
[this, request]()
{
return this->MixedInvoiceDetect(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::MixedInvoiceOCROutcome OcrClient::MixedInvoiceOCR(const MixedInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "MixedInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
MixedInvoiceOCRResponse rsp = MixedInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return MixedInvoiceOCROutcome(rsp);
else
return MixedInvoiceOCROutcome(o.GetError());
}
else
{
return MixedInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::MixedInvoiceOCRAsync(const MixedInvoiceOCRRequest& request, const MixedInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->MixedInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::MixedInvoiceOCROutcomeCallable OcrClient::MixedInvoiceOCRCallable(const MixedInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<MixedInvoiceOCROutcome()>>(
[this, request]()
{
return this->MixedInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::OrgCodeCertOCROutcome OcrClient::OrgCodeCertOCR(const OrgCodeCertOCRRequest &request)
{
auto outcome = MakeRequest(request, "OrgCodeCertOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
OrgCodeCertOCRResponse rsp = OrgCodeCertOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return OrgCodeCertOCROutcome(rsp);
else
return OrgCodeCertOCROutcome(o.GetError());
}
else
{
return OrgCodeCertOCROutcome(outcome.GetError());
}
}
void OcrClient::OrgCodeCertOCRAsync(const OrgCodeCertOCRRequest& request, const OrgCodeCertOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->OrgCodeCertOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::OrgCodeCertOCROutcomeCallable OcrClient::OrgCodeCertOCRCallable(const OrgCodeCertOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<OrgCodeCertOCROutcome()>>(
[this, request]()
{
return this->OrgCodeCertOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::PassportOCROutcome OcrClient::PassportOCR(const PassportOCRRequest &request)
{
auto outcome = MakeRequest(request, "PassportOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
PassportOCRResponse rsp = PassportOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return PassportOCROutcome(rsp);
else
return PassportOCROutcome(o.GetError());
}
else
{
return PassportOCROutcome(outcome.GetError());
}
}
void OcrClient::PassportOCRAsync(const PassportOCRRequest& request, const PassportOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->PassportOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::PassportOCROutcomeCallable OcrClient::PassportOCRCallable(const PassportOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<PassportOCROutcome()>>(
[this, request]()
{
return this->PassportOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::PermitOCROutcome OcrClient::PermitOCR(const PermitOCRRequest &request)
{
auto outcome = MakeRequest(request, "PermitOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
PermitOCRResponse rsp = PermitOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return PermitOCROutcome(rsp);
else
return PermitOCROutcome(o.GetError());
}
else
{
return PermitOCROutcome(outcome.GetError());
}
}
void OcrClient::PermitOCRAsync(const PermitOCRRequest& request, const PermitOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->PermitOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::PermitOCROutcomeCallable OcrClient::PermitOCRCallable(const PermitOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<PermitOCROutcome()>>(
[this, request]()
{
return this->PermitOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::PropOwnerCertOCROutcome OcrClient::PropOwnerCertOCR(const PropOwnerCertOCRRequest &request)
{
auto outcome = MakeRequest(request, "PropOwnerCertOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
PropOwnerCertOCRResponse rsp = PropOwnerCertOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return PropOwnerCertOCROutcome(rsp);
else
return PropOwnerCertOCROutcome(o.GetError());
}
else
{
return PropOwnerCertOCROutcome(outcome.GetError());
}
}
void OcrClient::PropOwnerCertOCRAsync(const PropOwnerCertOCRRequest& request, const PropOwnerCertOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->PropOwnerCertOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::PropOwnerCertOCROutcomeCallable OcrClient::PropOwnerCertOCRCallable(const PropOwnerCertOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<PropOwnerCertOCROutcome()>>(
[this, request]()
{
return this->PropOwnerCertOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::QrcodeOCROutcome OcrClient::QrcodeOCR(const QrcodeOCRRequest &request)
{
auto outcome = MakeRequest(request, "QrcodeOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
QrcodeOCRResponse rsp = QrcodeOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return QrcodeOCROutcome(rsp);
else
return QrcodeOCROutcome(o.GetError());
}
else
{
return QrcodeOCROutcome(outcome.GetError());
}
}
void OcrClient::QrcodeOCRAsync(const QrcodeOCRRequest& request, const QrcodeOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->QrcodeOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::QrcodeOCROutcomeCallable OcrClient::QrcodeOCRCallable(const QrcodeOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<QrcodeOCROutcome()>>(
[this, request]()
{
return this->QrcodeOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::QuestionOCROutcome OcrClient::QuestionOCR(const QuestionOCRRequest &request)
{
auto outcome = MakeRequest(request, "QuestionOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
QuestionOCRResponse rsp = QuestionOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return QuestionOCROutcome(rsp);
else
return QuestionOCROutcome(o.GetError());
}
else
{
return QuestionOCROutcome(outcome.GetError());
}
}
void OcrClient::QuestionOCRAsync(const QuestionOCRRequest& request, const QuestionOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->QuestionOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::QuestionOCROutcomeCallable OcrClient::QuestionOCRCallable(const QuestionOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<QuestionOCROutcome()>>(
[this, request]()
{
return this->QuestionOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::QuestionSplitOCROutcome OcrClient::QuestionSplitOCR(const QuestionSplitOCRRequest &request)
{
auto outcome = MakeRequest(request, "QuestionSplitOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
QuestionSplitOCRResponse rsp = QuestionSplitOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return QuestionSplitOCROutcome(rsp);
else
return QuestionSplitOCROutcome(o.GetError());
}
else
{
return QuestionSplitOCROutcome(outcome.GetError());
}
}
void OcrClient::QuestionSplitOCRAsync(const QuestionSplitOCRRequest& request, const QuestionSplitOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->QuestionSplitOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::QuestionSplitOCROutcomeCallable OcrClient::QuestionSplitOCRCallable(const QuestionSplitOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<QuestionSplitOCROutcome()>>(
[this, request]()
{
return this->QuestionSplitOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::QuotaInvoiceOCROutcome OcrClient::QuotaInvoiceOCR(const QuotaInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "QuotaInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
QuotaInvoiceOCRResponse rsp = QuotaInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return QuotaInvoiceOCROutcome(rsp);
else
return QuotaInvoiceOCROutcome(o.GetError());
}
else
{
return QuotaInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::QuotaInvoiceOCRAsync(const QuotaInvoiceOCRRequest& request, const QuotaInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->QuotaInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::QuotaInvoiceOCROutcomeCallable OcrClient::QuotaInvoiceOCRCallable(const QuotaInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<QuotaInvoiceOCROutcome()>>(
[this, request]()
{
return this->QuotaInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeContainerOCROutcome OcrClient::RecognizeContainerOCR(const RecognizeContainerOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeContainerOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeContainerOCRResponse rsp = RecognizeContainerOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeContainerOCROutcome(rsp);
else
return RecognizeContainerOCROutcome(o.GetError());
}
else
{
return RecognizeContainerOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeContainerOCRAsync(const RecognizeContainerOCRRequest& request, const RecognizeContainerOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeContainerOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeContainerOCROutcomeCallable OcrClient::RecognizeContainerOCRCallable(const RecognizeContainerOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeContainerOCROutcome()>>(
[this, request]()
{
return this->RecognizeContainerOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeEncryptedIDCardOCROutcome OcrClient::RecognizeEncryptedIDCardOCR(const RecognizeEncryptedIDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeEncryptedIDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeEncryptedIDCardOCRResponse rsp = RecognizeEncryptedIDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeEncryptedIDCardOCROutcome(rsp);
else
return RecognizeEncryptedIDCardOCROutcome(o.GetError());
}
else
{
return RecognizeEncryptedIDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeEncryptedIDCardOCRAsync(const RecognizeEncryptedIDCardOCRRequest& request, const RecognizeEncryptedIDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeEncryptedIDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeEncryptedIDCardOCROutcomeCallable OcrClient::RecognizeEncryptedIDCardOCRCallable(const RecognizeEncryptedIDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeEncryptedIDCardOCROutcome()>>(
[this, request]()
{
return this->RecognizeEncryptedIDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeForeignPermanentResidentIdCardOutcome OcrClient::RecognizeForeignPermanentResidentIdCard(const RecognizeForeignPermanentResidentIdCardRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeForeignPermanentResidentIdCard");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeForeignPermanentResidentIdCardResponse rsp = RecognizeForeignPermanentResidentIdCardResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeForeignPermanentResidentIdCardOutcome(rsp);
else
return RecognizeForeignPermanentResidentIdCardOutcome(o.GetError());
}
else
{
return RecognizeForeignPermanentResidentIdCardOutcome(outcome.GetError());
}
}
void OcrClient::RecognizeForeignPermanentResidentIdCardAsync(const RecognizeForeignPermanentResidentIdCardRequest& request, const RecognizeForeignPermanentResidentIdCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeForeignPermanentResidentIdCard(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeForeignPermanentResidentIdCardOutcomeCallable OcrClient::RecognizeForeignPermanentResidentIdCardCallable(const RecognizeForeignPermanentResidentIdCardRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeForeignPermanentResidentIdCardOutcome()>>(
[this, request]()
{
return this->RecognizeForeignPermanentResidentIdCard(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeFormulaOCROutcome OcrClient::RecognizeFormulaOCR(const RecognizeFormulaOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeFormulaOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeFormulaOCRResponse rsp = RecognizeFormulaOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeFormulaOCROutcome(rsp);
else
return RecognizeFormulaOCROutcome(o.GetError());
}
else
{
return RecognizeFormulaOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeFormulaOCRAsync(const RecognizeFormulaOCRRequest& request, const RecognizeFormulaOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeFormulaOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeFormulaOCROutcomeCallable OcrClient::RecognizeFormulaOCRCallable(const RecognizeFormulaOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeFormulaOCROutcome()>>(
[this, request]()
{
return this->RecognizeFormulaOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeGeneralCardWarnOutcome OcrClient::RecognizeGeneralCardWarn(const RecognizeGeneralCardWarnRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeGeneralCardWarn");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeGeneralCardWarnResponse rsp = RecognizeGeneralCardWarnResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeGeneralCardWarnOutcome(rsp);
else
return RecognizeGeneralCardWarnOutcome(o.GetError());
}
else
{
return RecognizeGeneralCardWarnOutcome(outcome.GetError());
}
}
void OcrClient::RecognizeGeneralCardWarnAsync(const RecognizeGeneralCardWarnRequest& request, const RecognizeGeneralCardWarnAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeGeneralCardWarn(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeGeneralCardWarnOutcomeCallable OcrClient::RecognizeGeneralCardWarnCallable(const RecognizeGeneralCardWarnRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeGeneralCardWarnOutcome()>>(
[this, request]()
{
return this->RecognizeGeneralCardWarn(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeGeneralInvoiceOutcome OcrClient::RecognizeGeneralInvoice(const RecognizeGeneralInvoiceRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeGeneralInvoice");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeGeneralInvoiceResponse rsp = RecognizeGeneralInvoiceResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeGeneralInvoiceOutcome(rsp);
else
return RecognizeGeneralInvoiceOutcome(o.GetError());
}
else
{
return RecognizeGeneralInvoiceOutcome(outcome.GetError());
}
}
void OcrClient::RecognizeGeneralInvoiceAsync(const RecognizeGeneralInvoiceRequest& request, const RecognizeGeneralInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeGeneralInvoice(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeGeneralInvoiceOutcomeCallable OcrClient::RecognizeGeneralInvoiceCallable(const RecognizeGeneralInvoiceRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeGeneralInvoiceOutcome()>>(
[this, request]()
{
return this->RecognizeGeneralInvoice(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeGeneralTextImageWarnOutcome OcrClient::RecognizeGeneralTextImageWarn(const RecognizeGeneralTextImageWarnRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeGeneralTextImageWarn");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeGeneralTextImageWarnResponse rsp = RecognizeGeneralTextImageWarnResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeGeneralTextImageWarnOutcome(rsp);
else
return RecognizeGeneralTextImageWarnOutcome(o.GetError());
}
else
{
return RecognizeGeneralTextImageWarnOutcome(outcome.GetError());
}
}
void OcrClient::RecognizeGeneralTextImageWarnAsync(const RecognizeGeneralTextImageWarnRequest& request, const RecognizeGeneralTextImageWarnAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeGeneralTextImageWarn(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeGeneralTextImageWarnOutcomeCallable OcrClient::RecognizeGeneralTextImageWarnCallable(const RecognizeGeneralTextImageWarnRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeGeneralTextImageWarnOutcome()>>(
[this, request]()
{
return this->RecognizeGeneralTextImageWarn(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeHealthCodeOCROutcome OcrClient::RecognizeHealthCodeOCR(const RecognizeHealthCodeOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeHealthCodeOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeHealthCodeOCRResponse rsp = RecognizeHealthCodeOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeHealthCodeOCROutcome(rsp);
else
return RecognizeHealthCodeOCROutcome(o.GetError());
}
else
{
return RecognizeHealthCodeOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeHealthCodeOCRAsync(const RecognizeHealthCodeOCRRequest& request, const RecognizeHealthCodeOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeHealthCodeOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeHealthCodeOCROutcomeCallable OcrClient::RecognizeHealthCodeOCRCallable(const RecognizeHealthCodeOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeHealthCodeOCROutcome()>>(
[this, request]()
{
return this->RecognizeHealthCodeOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeMedicalInvoiceOCROutcome OcrClient::RecognizeMedicalInvoiceOCR(const RecognizeMedicalInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeMedicalInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeMedicalInvoiceOCRResponse rsp = RecognizeMedicalInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeMedicalInvoiceOCROutcome(rsp);
else
return RecognizeMedicalInvoiceOCROutcome(o.GetError());
}
else
{
return RecognizeMedicalInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeMedicalInvoiceOCRAsync(const RecognizeMedicalInvoiceOCRRequest& request, const RecognizeMedicalInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeMedicalInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeMedicalInvoiceOCROutcomeCallable OcrClient::RecognizeMedicalInvoiceOCRCallable(const RecognizeMedicalInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeMedicalInvoiceOCROutcome()>>(
[this, request]()
{
return this->RecognizeMedicalInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeOnlineTaxiItineraryOCROutcome OcrClient::RecognizeOnlineTaxiItineraryOCR(const RecognizeOnlineTaxiItineraryOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeOnlineTaxiItineraryOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeOnlineTaxiItineraryOCRResponse rsp = RecognizeOnlineTaxiItineraryOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeOnlineTaxiItineraryOCROutcome(rsp);
else
return RecognizeOnlineTaxiItineraryOCROutcome(o.GetError());
}
else
{
return RecognizeOnlineTaxiItineraryOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeOnlineTaxiItineraryOCRAsync(const RecognizeOnlineTaxiItineraryOCRRequest& request, const RecognizeOnlineTaxiItineraryOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeOnlineTaxiItineraryOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeOnlineTaxiItineraryOCROutcomeCallable OcrClient::RecognizeOnlineTaxiItineraryOCRCallable(const RecognizeOnlineTaxiItineraryOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeOnlineTaxiItineraryOCROutcome()>>(
[this, request]()
{
return this->RecognizeOnlineTaxiItineraryOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeStoreNameOutcome OcrClient::RecognizeStoreName(const RecognizeStoreNameRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeStoreName");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeStoreNameResponse rsp = RecognizeStoreNameResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeStoreNameOutcome(rsp);
else
return RecognizeStoreNameOutcome(o.GetError());
}
else
{
return RecognizeStoreNameOutcome(outcome.GetError());
}
}
void OcrClient::RecognizeStoreNameAsync(const RecognizeStoreNameRequest& request, const RecognizeStoreNameAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeStoreName(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeStoreNameOutcomeCallable OcrClient::RecognizeStoreNameCallable(const RecognizeStoreNameRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeStoreNameOutcome()>>(
[this, request]()
{
return this->RecognizeStoreName(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeTableAccurateOCROutcome OcrClient::RecognizeTableAccurateOCR(const RecognizeTableAccurateOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeTableAccurateOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeTableAccurateOCRResponse rsp = RecognizeTableAccurateOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeTableAccurateOCROutcome(rsp);
else
return RecognizeTableAccurateOCROutcome(o.GetError());
}
else
{
return RecognizeTableAccurateOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeTableAccurateOCRAsync(const RecognizeTableAccurateOCRRequest& request, const RecognizeTableAccurateOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeTableAccurateOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeTableAccurateOCROutcomeCallable OcrClient::RecognizeTableAccurateOCRCallable(const RecognizeTableAccurateOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeTableAccurateOCROutcome()>>(
[this, request]()
{
return this->RecognizeTableAccurateOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeTableOCROutcome OcrClient::RecognizeTableOCR(const RecognizeTableOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeTableOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeTableOCRResponse rsp = RecognizeTableOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeTableOCROutcome(rsp);
else
return RecognizeTableOCROutcome(o.GetError());
}
else
{
return RecognizeTableOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeTableOCRAsync(const RecognizeTableOCRRequest& request, const RecognizeTableOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeTableOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeTableOCROutcomeCallable OcrClient::RecognizeTableOCRCallable(const RecognizeTableOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeTableOCROutcome()>>(
[this, request]()
{
return this->RecognizeTableOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeThaiIDCardOCROutcome OcrClient::RecognizeThaiIDCardOCR(const RecognizeThaiIDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeThaiIDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeThaiIDCardOCRResponse rsp = RecognizeThaiIDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeThaiIDCardOCROutcome(rsp);
else
return RecognizeThaiIDCardOCROutcome(o.GetError());
}
else
{
return RecognizeThaiIDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeThaiIDCardOCRAsync(const RecognizeThaiIDCardOCRRequest& request, const RecognizeThaiIDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeThaiIDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeThaiIDCardOCROutcomeCallable OcrClient::RecognizeThaiIDCardOCRCallable(const RecognizeThaiIDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeThaiIDCardOCROutcome()>>(
[this, request]()
{
return this->RecognizeThaiIDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeTravelCardOCROutcome OcrClient::RecognizeTravelCardOCR(const RecognizeTravelCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeTravelCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeTravelCardOCRResponse rsp = RecognizeTravelCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeTravelCardOCROutcome(rsp);
else
return RecognizeTravelCardOCROutcome(o.GetError());
}
else
{
return RecognizeTravelCardOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeTravelCardOCRAsync(const RecognizeTravelCardOCRRequest& request, const RecognizeTravelCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeTravelCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeTravelCardOCROutcomeCallable OcrClient::RecognizeTravelCardOCRCallable(const RecognizeTravelCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeTravelCardOCROutcome()>>(
[this, request]()
{
return this->RecognizeTravelCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RecognizeValidIDCardOCROutcome OcrClient::RecognizeValidIDCardOCR(const RecognizeValidIDCardOCRRequest &request)
{
auto outcome = MakeRequest(request, "RecognizeValidIDCardOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RecognizeValidIDCardOCRResponse rsp = RecognizeValidIDCardOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RecognizeValidIDCardOCROutcome(rsp);
else
return RecognizeValidIDCardOCROutcome(o.GetError());
}
else
{
return RecognizeValidIDCardOCROutcome(outcome.GetError());
}
}
void OcrClient::RecognizeValidIDCardOCRAsync(const RecognizeValidIDCardOCRRequest& request, const RecognizeValidIDCardOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RecognizeValidIDCardOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RecognizeValidIDCardOCROutcomeCallable OcrClient::RecognizeValidIDCardOCRCallable(const RecognizeValidIDCardOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RecognizeValidIDCardOCROutcome()>>(
[this, request]()
{
return this->RecognizeValidIDCardOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ResidenceBookletOCROutcome OcrClient::ResidenceBookletOCR(const ResidenceBookletOCRRequest &request)
{
auto outcome = MakeRequest(request, "ResidenceBookletOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ResidenceBookletOCRResponse rsp = ResidenceBookletOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ResidenceBookletOCROutcome(rsp);
else
return ResidenceBookletOCROutcome(o.GetError());
}
else
{
return ResidenceBookletOCROutcome(outcome.GetError());
}
}
void OcrClient::ResidenceBookletOCRAsync(const ResidenceBookletOCRRequest& request, const ResidenceBookletOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ResidenceBookletOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ResidenceBookletOCROutcomeCallable OcrClient::ResidenceBookletOCRCallable(const ResidenceBookletOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<ResidenceBookletOCROutcome()>>(
[this, request]()
{
return this->ResidenceBookletOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RideHailingDriverLicenseOCROutcome OcrClient::RideHailingDriverLicenseOCR(const RideHailingDriverLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "RideHailingDriverLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RideHailingDriverLicenseOCRResponse rsp = RideHailingDriverLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RideHailingDriverLicenseOCROutcome(rsp);
else
return RideHailingDriverLicenseOCROutcome(o.GetError());
}
else
{
return RideHailingDriverLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::RideHailingDriverLicenseOCRAsync(const RideHailingDriverLicenseOCRRequest& request, const RideHailingDriverLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RideHailingDriverLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RideHailingDriverLicenseOCROutcomeCallable OcrClient::RideHailingDriverLicenseOCRCallable(const RideHailingDriverLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RideHailingDriverLicenseOCROutcome()>>(
[this, request]()
{
return this->RideHailingDriverLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::RideHailingTransportLicenseOCROutcome OcrClient::RideHailingTransportLicenseOCR(const RideHailingTransportLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "RideHailingTransportLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
RideHailingTransportLicenseOCRResponse rsp = RideHailingTransportLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return RideHailingTransportLicenseOCROutcome(rsp);
else
return RideHailingTransportLicenseOCROutcome(o.GetError());
}
else
{
return RideHailingTransportLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::RideHailingTransportLicenseOCRAsync(const RideHailingTransportLicenseOCRRequest& request, const RideHailingTransportLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->RideHailingTransportLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::RideHailingTransportLicenseOCROutcomeCallable OcrClient::RideHailingTransportLicenseOCRCallable(const RideHailingTransportLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<RideHailingTransportLicenseOCROutcome()>>(
[this, request]()
{
return this->RideHailingTransportLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::SealOCROutcome OcrClient::SealOCR(const SealOCRRequest &request)
{
auto outcome = MakeRequest(request, "SealOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
SealOCRResponse rsp = SealOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return SealOCROutcome(rsp);
else
return SealOCROutcome(o.GetError());
}
else
{
return SealOCROutcome(outcome.GetError());
}
}
void OcrClient::SealOCRAsync(const SealOCRRequest& request, const SealOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->SealOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::SealOCROutcomeCallable OcrClient::SealOCRCallable(const SealOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<SealOCROutcome()>>(
[this, request]()
{
return this->SealOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::ShipInvoiceOCROutcome OcrClient::ShipInvoiceOCR(const ShipInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "ShipInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ShipInvoiceOCRResponse rsp = ShipInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return ShipInvoiceOCROutcome(rsp);
else
return ShipInvoiceOCROutcome(o.GetError());
}
else
{
return ShipInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::ShipInvoiceOCRAsync(const ShipInvoiceOCRRequest& request, const ShipInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->ShipInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::ShipInvoiceOCROutcomeCallable OcrClient::ShipInvoiceOCRCallable(const ShipInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<ShipInvoiceOCROutcome()>>(
[this, request]()
{
return this->ShipInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::SmartStructuralOCROutcome OcrClient::SmartStructuralOCR(const SmartStructuralOCRRequest &request)
{
auto outcome = MakeRequest(request, "SmartStructuralOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
SmartStructuralOCRResponse rsp = SmartStructuralOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return SmartStructuralOCROutcome(rsp);
else
return SmartStructuralOCROutcome(o.GetError());
}
else
{
return SmartStructuralOCROutcome(outcome.GetError());
}
}
void OcrClient::SmartStructuralOCRAsync(const SmartStructuralOCRRequest& request, const SmartStructuralOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->SmartStructuralOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::SmartStructuralOCROutcomeCallable OcrClient::SmartStructuralOCRCallable(const SmartStructuralOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<SmartStructuralOCROutcome()>>(
[this, request]()
{
return this->SmartStructuralOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::SmartStructuralOCRV2Outcome OcrClient::SmartStructuralOCRV2(const SmartStructuralOCRV2Request &request)
{
auto outcome = MakeRequest(request, "SmartStructuralOCRV2");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
SmartStructuralOCRV2Response rsp = SmartStructuralOCRV2Response();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return SmartStructuralOCRV2Outcome(rsp);
else
return SmartStructuralOCRV2Outcome(o.GetError());
}
else
{
return SmartStructuralOCRV2Outcome(outcome.GetError());
}
}
void OcrClient::SmartStructuralOCRV2Async(const SmartStructuralOCRV2Request& request, const SmartStructuralOCRV2AsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->SmartStructuralOCRV2(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::SmartStructuralOCRV2OutcomeCallable OcrClient::SmartStructuralOCRV2Callable(const SmartStructuralOCRV2Request &request)
{
auto task = std::make_shared<std::packaged_task<SmartStructuralOCRV2Outcome()>>(
[this, request]()
{
return this->SmartStructuralOCRV2(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::SmartStructuralProOutcome OcrClient::SmartStructuralPro(const SmartStructuralProRequest &request)
{
auto outcome = MakeRequest(request, "SmartStructuralPro");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
SmartStructuralProResponse rsp = SmartStructuralProResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return SmartStructuralProOutcome(rsp);
else
return SmartStructuralProOutcome(o.GetError());
}
else
{
return SmartStructuralProOutcome(outcome.GetError());
}
}
void OcrClient::SmartStructuralProAsync(const SmartStructuralProRequest& request, const SmartStructuralProAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->SmartStructuralPro(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::SmartStructuralProOutcomeCallable OcrClient::SmartStructuralProCallable(const SmartStructuralProRequest &request)
{
auto task = std::make_shared<std::packaged_task<SmartStructuralProOutcome()>>(
[this, request]()
{
return this->SmartStructuralPro(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::TableOCROutcome OcrClient::TableOCR(const TableOCRRequest &request)
{
auto outcome = MakeRequest(request, "TableOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
TableOCRResponse rsp = TableOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return TableOCROutcome(rsp);
else
return TableOCROutcome(o.GetError());
}
else
{
return TableOCROutcome(outcome.GetError());
}
}
void OcrClient::TableOCRAsync(const TableOCRRequest& request, const TableOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->TableOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::TableOCROutcomeCallable OcrClient::TableOCRCallable(const TableOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<TableOCROutcome()>>(
[this, request]()
{
return this->TableOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::TaxiInvoiceOCROutcome OcrClient::TaxiInvoiceOCR(const TaxiInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "TaxiInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
TaxiInvoiceOCRResponse rsp = TaxiInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return TaxiInvoiceOCROutcome(rsp);
else
return TaxiInvoiceOCROutcome(o.GetError());
}
else
{
return TaxiInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::TaxiInvoiceOCRAsync(const TaxiInvoiceOCRRequest& request, const TaxiInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->TaxiInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::TaxiInvoiceOCROutcomeCallable OcrClient::TaxiInvoiceOCRCallable(const TaxiInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<TaxiInvoiceOCROutcome()>>(
[this, request]()
{
return this->TaxiInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::TextDetectOutcome OcrClient::TextDetect(const TextDetectRequest &request)
{
auto outcome = MakeRequest(request, "TextDetect");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
TextDetectResponse rsp = TextDetectResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return TextDetectOutcome(rsp);
else
return TextDetectOutcome(o.GetError());
}
else
{
return TextDetectOutcome(outcome.GetError());
}
}
void OcrClient::TextDetectAsync(const TextDetectRequest& request, const TextDetectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->TextDetect(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::TextDetectOutcomeCallable OcrClient::TextDetectCallable(const TextDetectRequest &request)
{
auto task = std::make_shared<std::packaged_task<TextDetectOutcome()>>(
[this, request]()
{
return this->TextDetect(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::TollInvoiceOCROutcome OcrClient::TollInvoiceOCR(const TollInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "TollInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
TollInvoiceOCRResponse rsp = TollInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return TollInvoiceOCROutcome(rsp);
else
return TollInvoiceOCROutcome(o.GetError());
}
else
{
return TollInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::TollInvoiceOCRAsync(const TollInvoiceOCRRequest& request, const TollInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->TollInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::TollInvoiceOCROutcomeCallable OcrClient::TollInvoiceOCRCallable(const TollInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<TollInvoiceOCROutcome()>>(
[this, request]()
{
return this->TollInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::TrainTicketOCROutcome OcrClient::TrainTicketOCR(const TrainTicketOCRRequest &request)
{
auto outcome = MakeRequest(request, "TrainTicketOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
TrainTicketOCRResponse rsp = TrainTicketOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return TrainTicketOCROutcome(rsp);
else
return TrainTicketOCROutcome(o.GetError());
}
else
{
return TrainTicketOCROutcome(outcome.GetError());
}
}
void OcrClient::TrainTicketOCRAsync(const TrainTicketOCRRequest& request, const TrainTicketOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->TrainTicketOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::TrainTicketOCROutcomeCallable OcrClient::TrainTicketOCRCallable(const TrainTicketOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<TrainTicketOCROutcome()>>(
[this, request]()
{
return this->TrainTicketOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VatInvoiceOCROutcome OcrClient::VatInvoiceOCR(const VatInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "VatInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VatInvoiceOCRResponse rsp = VatInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VatInvoiceOCROutcome(rsp);
else
return VatInvoiceOCROutcome(o.GetError());
}
else
{
return VatInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::VatInvoiceOCRAsync(const VatInvoiceOCRRequest& request, const VatInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VatInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VatInvoiceOCROutcomeCallable OcrClient::VatInvoiceOCRCallable(const VatInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VatInvoiceOCROutcome()>>(
[this, request]()
{
return this->VatInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VatInvoiceVerifyNewOutcome OcrClient::VatInvoiceVerifyNew(const VatInvoiceVerifyNewRequest &request)
{
auto outcome = MakeRequest(request, "VatInvoiceVerifyNew");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VatInvoiceVerifyNewResponse rsp = VatInvoiceVerifyNewResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VatInvoiceVerifyNewOutcome(rsp);
else
return VatInvoiceVerifyNewOutcome(o.GetError());
}
else
{
return VatInvoiceVerifyNewOutcome(outcome.GetError());
}
}
void OcrClient::VatInvoiceVerifyNewAsync(const VatInvoiceVerifyNewRequest& request, const VatInvoiceVerifyNewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VatInvoiceVerifyNew(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VatInvoiceVerifyNewOutcomeCallable OcrClient::VatInvoiceVerifyNewCallable(const VatInvoiceVerifyNewRequest &request)
{
auto task = std::make_shared<std::packaged_task<VatInvoiceVerifyNewOutcome()>>(
[this, request]()
{
return this->VatInvoiceVerifyNew(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VatRollInvoiceOCROutcome OcrClient::VatRollInvoiceOCR(const VatRollInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "VatRollInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VatRollInvoiceOCRResponse rsp = VatRollInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VatRollInvoiceOCROutcome(rsp);
else
return VatRollInvoiceOCROutcome(o.GetError());
}
else
{
return VatRollInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::VatRollInvoiceOCRAsync(const VatRollInvoiceOCRRequest& request, const VatRollInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VatRollInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VatRollInvoiceOCROutcomeCallable OcrClient::VatRollInvoiceOCRCallable(const VatRollInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VatRollInvoiceOCROutcome()>>(
[this, request]()
{
return this->VatRollInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VehicleLicenseOCROutcome OcrClient::VehicleLicenseOCR(const VehicleLicenseOCRRequest &request)
{
auto outcome = MakeRequest(request, "VehicleLicenseOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VehicleLicenseOCRResponse rsp = VehicleLicenseOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VehicleLicenseOCROutcome(rsp);
else
return VehicleLicenseOCROutcome(o.GetError());
}
else
{
return VehicleLicenseOCROutcome(outcome.GetError());
}
}
void OcrClient::VehicleLicenseOCRAsync(const VehicleLicenseOCRRequest& request, const VehicleLicenseOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VehicleLicenseOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VehicleLicenseOCROutcomeCallable OcrClient::VehicleLicenseOCRCallable(const VehicleLicenseOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VehicleLicenseOCROutcome()>>(
[this, request]()
{
return this->VehicleLicenseOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VehicleRegCertOCROutcome OcrClient::VehicleRegCertOCR(const VehicleRegCertOCRRequest &request)
{
auto outcome = MakeRequest(request, "VehicleRegCertOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VehicleRegCertOCRResponse rsp = VehicleRegCertOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VehicleRegCertOCROutcome(rsp);
else
return VehicleRegCertOCROutcome(o.GetError());
}
else
{
return VehicleRegCertOCROutcome(outcome.GetError());
}
}
void OcrClient::VehicleRegCertOCRAsync(const VehicleRegCertOCRRequest& request, const VehicleRegCertOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VehicleRegCertOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VehicleRegCertOCROutcomeCallable OcrClient::VehicleRegCertOCRCallable(const VehicleRegCertOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VehicleRegCertOCROutcome()>>(
[this, request]()
{
return this->VehicleRegCertOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VerifyOfdVatInvoiceOCROutcome OcrClient::VerifyOfdVatInvoiceOCR(const VerifyOfdVatInvoiceOCRRequest &request)
{
auto outcome = MakeRequest(request, "VerifyOfdVatInvoiceOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VerifyOfdVatInvoiceOCRResponse rsp = VerifyOfdVatInvoiceOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VerifyOfdVatInvoiceOCROutcome(rsp);
else
return VerifyOfdVatInvoiceOCROutcome(o.GetError());
}
else
{
return VerifyOfdVatInvoiceOCROutcome(outcome.GetError());
}
}
void OcrClient::VerifyOfdVatInvoiceOCRAsync(const VerifyOfdVatInvoiceOCRRequest& request, const VerifyOfdVatInvoiceOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VerifyOfdVatInvoiceOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VerifyOfdVatInvoiceOCROutcomeCallable OcrClient::VerifyOfdVatInvoiceOCRCallable(const VerifyOfdVatInvoiceOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VerifyOfdVatInvoiceOCROutcome()>>(
[this, request]()
{
return this->VerifyOfdVatInvoiceOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::VinOCROutcome OcrClient::VinOCR(const VinOCRRequest &request)
{
auto outcome = MakeRequest(request, "VinOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
VinOCRResponse rsp = VinOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return VinOCROutcome(rsp);
else
return VinOCROutcome(o.GetError());
}
else
{
return VinOCROutcome(outcome.GetError());
}
}
void OcrClient::VinOCRAsync(const VinOCRRequest& request, const VinOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->VinOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::VinOCROutcomeCallable OcrClient::VinOCRCallable(const VinOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<VinOCROutcome()>>(
[this, request]()
{
return this->VinOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OcrClient::WaybillOCROutcome OcrClient::WaybillOCR(const WaybillOCRRequest &request)
{
auto outcome = MakeRequest(request, "WaybillOCR");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
WaybillOCRResponse rsp = WaybillOCRResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return WaybillOCROutcome(rsp);
else
return WaybillOCROutcome(o.GetError());
}
else
{
return WaybillOCROutcome(outcome.GetError());
}
}
void OcrClient::WaybillOCRAsync(const WaybillOCRRequest& request, const WaybillOCRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->WaybillOCR(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
OcrClient::WaybillOCROutcomeCallable OcrClient::WaybillOCRCallable(const WaybillOCRRequest &request)
{
auto task = std::make_shared<std::packaged_task<WaybillOCROutcome()>>(
[this, request]()
{
return this->WaybillOCR(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-cpp.git
git@gitee.com:tencentcloud/tencentcloud-sdk-cpp.git
tencentcloud
tencentcloud-sdk-cpp
tencentcloud-sdk-cpp
master

Search