tccli 3.0.1216.1__py2.py3-none-any.whl → 3.0.1217.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/argparser.py +1 -1
  3. tccli/command.py +2 -2
  4. tccli/credentials.py +25 -0
  5. tccli/main.py +6 -2
  6. tccli/plugins/sso/__init__.py +61 -0
  7. tccli/plugins/sso/configs.py +4 -0
  8. tccli/plugins/sso/configure.py +45 -0
  9. tccli/plugins/sso/login.py +144 -0
  10. tccli/plugins/sso/logout.py +21 -0
  11. tccli/plugins/sso/terminal.py +161 -0
  12. tccli/plugins/sso/texts.py +40 -0
  13. tccli/services/__init__.py +6 -0
  14. tccli/services/acp/v20220105/api.json +7 -7
  15. tccli/services/acp/v20220105/examples.json +2 -2
  16. tccli/services/aiart/v20221229/api.json +29 -29
  17. tccli/services/aiart/v20221229/examples.json +8 -8
  18. tccli/services/apigateway/v20180808/api.json +18 -17
  19. tccli/services/apigateway/v20180808/examples.json +12 -12
  20. tccli/services/apm/v20210622/api.json +98 -4
  21. tccli/services/asr/v20190614/api.json +18 -17
  22. tccli/services/asr/v20190614/examples.json +13 -13
  23. tccli/services/autoscaling/v20180419/api.json +371 -309
  24. tccli/services/autoscaling/v20180419/examples.json +17 -17
  25. tccli/services/batch/v20170312/api.json +7 -7
  26. tccli/services/bda/v20200324/api.json +39 -31
  27. tccli/services/bda/v20200324/examples.json +9 -9
  28. tccli/services/bh/__init__.py +4 -0
  29. tccli/services/bh/bh_client.py +3428 -0
  30. tccli/services/bh/v20230418/api.json +8180 -0
  31. tccli/services/bh/v20230418/examples.json +519 -0
  32. tccli/services/bi/v20220105/api.json +48 -0
  33. tccli/services/billing/v20180709/api.json +26 -24
  34. tccli/services/bsca/v20210811/api.json +1 -1
  35. tccli/services/btoe/v20210514/api.json +4 -4
  36. tccli/services/btoe/v20210514/examples.json +2 -2
  37. tccli/services/ca/v20230228/api.json +60 -0
  38. tccli/services/cam/v20190116/api.json +11 -11
  39. tccli/services/cat/v20180409/api.json +9 -0
  40. tccli/services/cbs/v20170312/api.json +200 -188
  41. tccli/services/cbs/v20170312/examples.json +4 -4
  42. tccli/services/ccc/v20200210/api.json +390 -323
  43. tccli/services/ccc/v20200210/examples.json +15 -15
  44. tccli/services/cdb/cdb_client.py +13 -13
  45. tccli/services/cdb/v20170320/api.json +295 -270
  46. tccli/services/cdb/v20170320/examples.json +38 -38
  47. tccli/services/cdc/v20201214/api.json +283 -270
  48. tccli/services/cdc/v20201214/examples.json +26 -26
  49. tccli/services/cds/v20180420/api.json +82 -76
  50. tccli/services/cds/v20180420/examples.json +1 -1
  51. tccli/services/cdwch/v20200915/api.json +1 -1
  52. tccli/services/cdwdoris/v20211228/api.json +42 -2
  53. tccli/services/cdz/v20221123/api.json +41 -5
  54. tccli/services/cfg/v20210820/api.json +31 -0
  55. tccli/services/cfs/v20190719/api.json +89 -1
  56. tccli/services/cfs/v20190719/examples.json +1 -1
  57. tccli/services/cfw/cfw_client.py +0 -53
  58. tccli/services/cfw/v20190904/api.json +1849 -1999
  59. tccli/services/cfw/v20190904/examples.json +157 -159
  60. tccli/services/ckafka/v20190819/api.json +104 -75
  61. tccli/services/clb/v20180317/api.json +48 -26
  62. tccli/services/clb/v20180317/examples.json +1 -1
  63. tccli/services/cloudapp/v20220530/api.json +5 -1
  64. tccli/services/cloudaudit/v20190319/api.json +58 -44
  65. tccli/services/cloudaudit/v20190319/examples.json +6 -6
  66. tccli/services/cloudstudio/v20230508/api.json +38 -37
  67. tccli/services/cloudstudio/v20230508/examples.json +4 -4
  68. tccli/services/cls/cls_client.py +216 -4
  69. tccli/services/cls/v20201016/api.json +536 -47
  70. tccli/services/cls/v20201016/examples.json +34 -2
  71. tccli/services/csip/v20221121/api.json +2562 -2382
  72. tccli/services/csip/v20221121/examples.json +108 -108
  73. tccli/services/cvm/v20170312/api.json +149 -112
  74. tccli/services/cvm/v20170312/examples.json +2 -2
  75. tccli/services/cwp/cwp_client.py +4 -110
  76. tccli/services/cwp/v20180228/api.json +6338 -6146
  77. tccli/services/cwp/v20180228/examples.json +342 -370
  78. tccli/services/cynosdb/v20190107/api.json +93 -81
  79. tccli/services/cynosdb/v20190107/examples.json +70 -70
  80. tccli/services/dasb/v20191018/api.json +796 -651
  81. tccli/services/dasb/v20191018/examples.json +101 -101
  82. tccli/services/dcdb/dcdb_client.py +114 -61
  83. tccli/services/dcdb/v20180411/api.json +141 -7
  84. tccli/services/dcdb/v20180411/examples.json +32 -0
  85. tccli/services/dlc/v20210125/api.json +21 -11
  86. tccli/services/dnspod/dnspod_client.py +417 -46
  87. tccli/services/dnspod/v20210323/api.json +751 -30
  88. tccli/services/dnspod/v20210323/examples.json +62 -0
  89. tccli/services/dts/v20211206/api.json +4 -4
  90. tccli/services/ecm/v20190719/api.json +2 -2
  91. tccli/services/emr/v20190103/api.json +339 -114
  92. tccli/services/emr/v20190103/examples.json +64 -82
  93. tccli/services/es/v20180416/api.json +29 -0
  94. tccli/services/es/v20180416/examples.json +1 -1
  95. tccli/services/ess/v20201111/api.json +49 -31
  96. tccli/services/ess/v20201111/examples.json +20 -8
  97. tccli/services/essbasic/v20210526/api.json +54 -49
  98. tccli/services/essbasic/v20210526/examples.json +36 -18
  99. tccli/services/facefusion/v20181201/api.json +47 -45
  100. tccli/services/facefusion/v20181201/examples.json +2 -2
  101. tccli/services/facefusion/v20220927/api.json +54 -48
  102. tccli/services/facefusion/v20220927/examples.json +5 -5
  103. tccli/services/faceid/v20180301/api.json +497 -496
  104. tccli/services/faceid/v20180301/examples.json +219 -101
  105. tccli/services/fmu/v20191213/api.json +59 -67
  106. tccli/services/fmu/v20191213/examples.json +22 -22
  107. tccli/services/ft/v20200304/api.json +53 -57
  108. tccli/services/ft/v20200304/examples.json +14 -14
  109. tccli/services/gme/v20180711/api.json +21 -11
  110. tccli/services/gme/v20180711/examples.json +1 -1
  111. tccli/services/hai/v20230812/api.json +116 -9
  112. tccli/services/hai/v20230812/examples.json +4 -4
  113. tccli/services/hunyuan/hunyuan_client.py +436 -12
  114. tccli/services/hunyuan/v20230901/api.json +1482 -118
  115. tccli/services/hunyuan/v20230901/examples.json +82 -18
  116. tccli/services/iai/v20180301/api.json +23 -19
  117. tccli/services/iai/v20180301/examples.json +2 -2
  118. tccli/services/iai/v20200303/api.json +530 -511
  119. tccli/services/iai/v20200303/examples.json +116 -86
  120. tccli/services/ig/__init__.py +4 -0
  121. tccli/services/ig/ig_client.py +195 -0
  122. tccli/services/ig/v20210518/api.json +83 -0
  123. tccli/services/ig/v20210518/examples.json +13 -0
  124. tccli/services/ioa/ioa_client.py +53 -0
  125. tccli/services/ioa/v20220601/api.json +662 -413
  126. tccli/services/ioa/v20220601/examples.json +24 -10
  127. tccli/services/iotexplorer/v20190423/api.json +33 -13
  128. tccli/services/iotexplorer/v20190423/examples.json +3 -3
  129. tccli/services/iotvideo/iotvideo_client.py +106 -0
  130. tccli/services/iotvideo/v20191126/api.json +256 -24
  131. tccli/services/iotvideo/v20191126/examples.json +19 -3
  132. tccli/services/iotvideo/v20201215/api.json +1 -1
  133. tccli/services/iotvideo/v20201215/examples.json +1 -1
  134. tccli/services/iotvideo/v20211125/api.json +1 -1
  135. tccli/services/iotvideo/v20211125/examples.json +2 -2
  136. tccli/services/iss/iss_client.py +69 -122
  137. tccli/services/iss/v20230517/api.json +10 -54
  138. tccli/services/iss/v20230517/examples.json +0 -14
  139. tccli/services/kms/v20190118/api.json +301 -268
  140. tccli/services/kms/v20190118/examples.json +45 -51
  141. tccli/services/lcic/lcic_client.py +159 -0
  142. tccli/services/lcic/v20220817/api.json +273 -1
  143. tccli/services/lcic/v20220817/examples.json +24 -0
  144. tccli/services/lighthouse/v20200324/api.json +56 -0
  145. tccli/services/live/live_client.py +159 -0
  146. tccli/services/live/v20180801/api.json +244 -0
  147. tccli/services/live/v20180801/examples.json +24 -0
  148. tccli/services/lke/v20231130/api.json +17 -17
  149. tccli/services/lke/v20231130/examples.json +19 -25
  150. tccli/services/mariadb/v20170312/api.json +7 -7
  151. tccli/services/market/v20191010/api.json +3 -3
  152. tccli/services/market/v20191010/examples.json +2 -2
  153. tccli/services/mmps/v20200710/api.json +47 -47
  154. tccli/services/mmps/v20200710/examples.json +3 -3
  155. tccli/services/mongodb/v20190725/api.json +4 -4
  156. tccli/services/monitor/v20180724/api.json +46 -19
  157. tccli/services/mps/v20190612/api.json +282 -5
  158. tccli/services/mps/v20190612/examples.json +25 -1
  159. tccli/services/mqtt/v20240516/api.json +2 -2
  160. tccli/services/mrs/v20200910/api.json +72 -34
  161. tccli/services/mrs/v20200910/examples.json +2 -2
  162. tccli/services/ms/v20180408/api.json +535 -506
  163. tccli/services/ms/v20180408/examples.json +25 -25
  164. tccli/services/oceanus/v20190422/api.json +130 -0
  165. tccli/services/ocr/ocr_client.py +232 -20
  166. tccli/services/ocr/v20181119/api.json +2265 -760
  167. tccli/services/ocr/v20181119/examples.json +200 -180
  168. tccli/services/omics/v20221128/api.json +614 -553
  169. tccli/services/omics/v20221128/examples.json +9 -9
  170. tccli/services/organization/v20210331/api.json +13 -4
  171. tccli/services/organization/v20210331/examples.json +2 -2
  172. tccli/services/partners/v20180321/api.json +244 -234
  173. tccli/services/partners/v20180321/examples.json +19 -19
  174. tccli/services/privatedns/privatedns_client.py +428 -4
  175. tccli/services/privatedns/v20201028/api.json +815 -11
  176. tccli/services/privatedns/v20201028/examples.json +64 -0
  177. tccli/services/pts/v20210728/api.json +18 -0
  178. tccli/services/pts/v20210728/examples.json +1 -1
  179. tccli/services/rce/rce_client.py +53 -0
  180. tccli/services/rce/v20201103/api.json +146 -0
  181. tccli/services/rce/v20201103/examples.json +8 -0
  182. tccli/services/redis/v20180412/api.json +42 -42
  183. tccli/services/redis/v20180412/examples.json +19 -19
  184. tccli/services/rum/v20210622/api.json +9 -0
  185. tccli/services/scf/v20180416/api.json +15 -15
  186. tccli/services/scf/v20180416/examples.json +1 -1
  187. tccli/services/smop/v20201203/api.json +46 -42
  188. tccli/services/smop/v20201203/examples.json +2 -2
  189. tccli/services/soe/v20180724/api.json +10 -10
  190. tccli/services/sqlserver/v20180328/api.json +21 -8
  191. tccli/services/sqlserver/v20180328/examples.json +5 -5
  192. tccli/services/ssl/v20191205/api.json +97 -4
  193. tccli/services/ssm/v20190923/api.json +292 -231
  194. tccli/services/ssm/v20190923/examples.json +42 -42
  195. tccli/services/tat/v20201028/api.json +97 -97
  196. tccli/services/tat/v20201028/examples.json +20 -26
  197. tccli/services/tchd/v20230306/api.json +5 -5
  198. tccli/services/tchd/v20230306/examples.json +3 -3
  199. tccli/services/tcr/v20190924/api.json +1 -1
  200. tccli/services/tcr/v20190924/examples.json +1 -1
  201. tccli/services/tcss/v20201101/api.json +1973 -1426
  202. tccli/services/tcss/v20201101/examples.json +346 -364
  203. tccli/services/tdmq/v20200217/api.json +539 -401
  204. tccli/services/tdmq/v20200217/examples.json +104 -104
  205. tccli/services/tds/v20220801/api.json +4 -4
  206. tccli/services/tem/v20210701/api.json +287 -271
  207. tccli/services/tem/v20210701/examples.json +59 -59
  208. tccli/services/teo/v20220901/api.json +37 -9
  209. tccli/services/teo/v20220901/examples.json +13 -7
  210. tccli/services/thpc/v20230321/api.json +5 -5
  211. tccli/services/tke/tke_client.py +217 -58
  212. tccli/services/tke/v20180525/api.json +36 -27
  213. tccli/services/tke/v20180525/examples.json +1 -1
  214. tccli/services/tke/v20220501/api.json +176 -0
  215. tccli/services/tke/v20220501/examples.json +24 -0
  216. tccli/services/tmt/v20180321/api.json +38 -8
  217. tccli/services/trp/v20210515/api.json +86 -74
  218. tccli/services/trp/v20210515/examples.json +65 -65
  219. tccli/services/trro/v20220325/api.json +72 -71
  220. tccli/services/trro/v20220325/examples.json +8 -8
  221. tccli/services/trtc/trtc_client.py +8 -61
  222. tccli/services/trtc/v20190722/api.json +72 -30
  223. tccli/services/trtc/v20190722/examples.json +3 -11
  224. tccli/services/tse/tse_client.py +110 -4
  225. tccli/services/tse/v20201207/api.json +122 -7
  226. tccli/services/tse/v20201207/examples.json +25 -9
  227. tccli/services/vclm/v20240523/api.json +225 -82
  228. tccli/services/vclm/v20240523/examples.json +13 -19
  229. tccli/services/vod/v20180717/api.json +431 -4
  230. tccli/services/vod/v20180717/examples.json +25 -5
  231. tccli/services/vod/v20240718/api.json +11 -11
  232. tccli/services/vod/v20240718/examples.json +4 -4
  233. tccli/services/vod/vod_client.py +53 -0
  234. tccli/services/vpc/v20170312/api.json +1090 -862
  235. tccli/services/vpc/v20170312/examples.json +74 -66
  236. tccli/services/vpc/vpc_client.py +61 -8
  237. tccli/services/waf/v20180125/api.json +2540 -2177
  238. tccli/services/waf/v20180125/examples.json +216 -284
  239. tccli/services/waf/waf_client.py +172 -119
  240. tccli/services/wav/v20210129/api.json +48 -48
  241. tccli/services/wav/v20210129/examples.json +4 -4
  242. tccli/services/wedata/v20210820/api.json +909 -25
  243. tccli/services/wedata/v20210820/examples.json +28 -4
  244. tccli/services/wedata/wedata_client.py +159 -0
  245. tccli/services/weilingwith/v20230427/api.json +6 -6
  246. tccli/services/weilingwith/v20230427/examples.json +3 -3
  247. tccli/sso.py +229 -0
  248. {tccli-3.0.1216.1.dist-info → tccli-3.0.1217.1.dist-info}/METADATA +2 -2
  249. {tccli-3.0.1216.1.dist-info → tccli-3.0.1217.1.dist-info}/RECORD +252 -235
  250. {tccli-3.0.1216.1.dist-info → tccli-3.0.1217.1.dist-info}/WHEEL +0 -0
  251. {tccli-3.0.1216.1.dist-info → tccli-3.0.1217.1.dist-info}/entry_points.txt +0 -0
  252. {tccli-3.0.1216.1.dist-info → tccli-3.0.1217.1.dist-info}/license_files/LICENSE +0 -0
@@ -537,7 +537,7 @@ def doInvoiceGeneralOCR(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
- def doReconstructDocument(args, parsed_globals):
540
+ def doRideHailingTransportLicenseOCR(args, parsed_globals):
541
541
  g_param = parse_global_arg(parsed_globals)
542
542
 
543
543
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -566,11 +566,11 @@ def doReconstructDocument(args, parsed_globals):
566
566
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
567
567
  client._sdkVersion += ("_CLI_" + __version__)
568
568
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
- model = models.ReconstructDocumentRequest()
569
+ model = models.RideHailingTransportLicenseOCRRequest()
570
570
  model.from_json_string(json.dumps(args))
571
571
  start_time = time.time()
572
572
  while True:
573
- rsp = client.ReconstructDocument(model)
573
+ rsp = client.RideHailingTransportLicenseOCR(model)
574
574
  result = rsp.to_json_string()
575
575
  try:
576
576
  json_obj = json.loads(result)
@@ -641,6 +641,58 @@ def doHKIDCardOCR(args, parsed_globals):
641
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
642
 
643
643
 
644
+ def doMixedInvoiceOCR(args, parsed_globals):
645
+ g_param = parse_global_arg(parsed_globals)
646
+
647
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
648
+ cred = credential.CVMRoleCredential()
649
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
650
+ cred = credential.STSAssumeRoleCredential(
651
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
+ )
654
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
655
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
656
+ else:
657
+ cred = credential.Credential(
658
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
659
+ )
660
+ http_profile = HttpProfile(
661
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
662
+ reqMethod="POST",
663
+ endpoint=g_param[OptionsDefine.Endpoint],
664
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
665
+ )
666
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
667
+ if g_param[OptionsDefine.Language]:
668
+ profile.language = g_param[OptionsDefine.Language]
669
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
670
+ client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
671
+ client._sdkVersion += ("_CLI_" + __version__)
672
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
+ model = models.MixedInvoiceOCRRequest()
674
+ model.from_json_string(json.dumps(args))
675
+ start_time = time.time()
676
+ while True:
677
+ rsp = client.MixedInvoiceOCR(model)
678
+ result = rsp.to_json_string()
679
+ try:
680
+ json_obj = json.loads(result)
681
+ except TypeError as e:
682
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
683
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
684
+ break
685
+ cur_time = time.time()
686
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
687
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
688
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
689
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
690
+ else:
691
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
692
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
693
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
694
+
695
+
644
696
  def doPermitOCR(args, parsed_globals):
645
697
  g_param = parse_global_arg(parsed_globals)
646
698
 
@@ -1837,6 +1889,58 @@ def doRecognizePhilippinesUMIDOCR(args, parsed_globals):
1837
1889
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1838
1890
 
1839
1891
 
1892
+ def doRecognizeValidIDCardOCR(args, parsed_globals):
1893
+ g_param = parse_global_arg(parsed_globals)
1894
+
1895
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1896
+ cred = credential.CVMRoleCredential()
1897
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1898
+ cred = credential.STSAssumeRoleCredential(
1899
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1900
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1901
+ )
1902
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1903
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1904
+ else:
1905
+ cred = credential.Credential(
1906
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1907
+ )
1908
+ http_profile = HttpProfile(
1909
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1910
+ reqMethod="POST",
1911
+ endpoint=g_param[OptionsDefine.Endpoint],
1912
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1913
+ )
1914
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1915
+ if g_param[OptionsDefine.Language]:
1916
+ profile.language = g_param[OptionsDefine.Language]
1917
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1918
+ client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
1919
+ client._sdkVersion += ("_CLI_" + __version__)
1920
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1921
+ model = models.RecognizeValidIDCardOCRRequest()
1922
+ model.from_json_string(json.dumps(args))
1923
+ start_time = time.time()
1924
+ while True:
1925
+ rsp = client.RecognizeValidIDCardOCR(model)
1926
+ result = rsp.to_json_string()
1927
+ try:
1928
+ json_obj = json.loads(result)
1929
+ except TypeError as e:
1930
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1931
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1932
+ break
1933
+ cur_time = time.time()
1934
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1935
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1936
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1937
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1938
+ else:
1939
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1940
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1941
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1942
+
1943
+
1840
1944
  def doBankCardOCR(args, parsed_globals):
1841
1945
  g_param = parse_global_arg(parsed_globals)
1842
1946
 
@@ -3137,7 +3241,7 @@ def doBankSlipOCR(args, parsed_globals):
3137
3241
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3138
3242
 
3139
3243
 
3140
- def doResidenceBookletOCR(args, parsed_globals):
3244
+ def doVehicleRegCertOCR(args, parsed_globals):
3141
3245
  g_param = parse_global_arg(parsed_globals)
3142
3246
 
3143
3247
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3166,11 +3270,11 @@ def doResidenceBookletOCR(args, parsed_globals):
3166
3270
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3167
3271
  client._sdkVersion += ("_CLI_" + __version__)
3168
3272
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3169
- model = models.ResidenceBookletOCRRequest()
3273
+ model = models.VehicleRegCertOCRRequest()
3170
3274
  model.from_json_string(json.dumps(args))
3171
3275
  start_time = time.time()
3172
3276
  while True:
3173
- rsp = client.ResidenceBookletOCR(model)
3277
+ rsp = client.VehicleRegCertOCR(model)
3174
3278
  result = rsp.to_json_string()
3175
3279
  try:
3176
3280
  json_obj = json.loads(result)
@@ -3241,6 +3345,58 @@ def doRecognizeTravelCardOCR(args, parsed_globals):
3241
3345
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3242
3346
 
3243
3347
 
3348
+ def doRecognizeKoreanIDCardOCR(args, parsed_globals):
3349
+ g_param = parse_global_arg(parsed_globals)
3350
+
3351
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3352
+ cred = credential.CVMRoleCredential()
3353
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3354
+ cred = credential.STSAssumeRoleCredential(
3355
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3356
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3357
+ )
3358
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
3359
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3360
+ else:
3361
+ cred = credential.Credential(
3362
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3363
+ )
3364
+ http_profile = HttpProfile(
3365
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3366
+ reqMethod="POST",
3367
+ endpoint=g_param[OptionsDefine.Endpoint],
3368
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3369
+ )
3370
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3371
+ if g_param[OptionsDefine.Language]:
3372
+ profile.language = g_param[OptionsDefine.Language]
3373
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3374
+ client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3375
+ client._sdkVersion += ("_CLI_" + __version__)
3376
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3377
+ model = models.RecognizeKoreanIDCardOCRRequest()
3378
+ model.from_json_string(json.dumps(args))
3379
+ start_time = time.time()
3380
+ while True:
3381
+ rsp = client.RecognizeKoreanIDCardOCR(model)
3382
+ result = rsp.to_json_string()
3383
+ try:
3384
+ json_obj = json.loads(result)
3385
+ except TypeError as e:
3386
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3387
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3388
+ break
3389
+ cur_time = time.time()
3390
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3391
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3392
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3393
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3394
+ else:
3395
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3396
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3397
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3398
+
3399
+
3244
3400
  def doVerifyOfdVatInvoiceOCR(args, parsed_globals):
3245
3401
  g_param = parse_global_arg(parsed_globals)
3246
3402
 
@@ -3345,6 +3501,58 @@ def doDriverLicenseOCR(args, parsed_globals):
3345
3501
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3346
3502
 
3347
3503
 
3504
+ def doRecognizeKoreanDrivingLicenseOCR(args, parsed_globals):
3505
+ g_param = parse_global_arg(parsed_globals)
3506
+
3507
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3508
+ cred = credential.CVMRoleCredential()
3509
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3510
+ cred = credential.STSAssumeRoleCredential(
3511
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3512
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3513
+ )
3514
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
3515
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3516
+ else:
3517
+ cred = credential.Credential(
3518
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3519
+ )
3520
+ http_profile = HttpProfile(
3521
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3522
+ reqMethod="POST",
3523
+ endpoint=g_param[OptionsDefine.Endpoint],
3524
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3525
+ )
3526
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3527
+ if g_param[OptionsDefine.Language]:
3528
+ profile.language = g_param[OptionsDefine.Language]
3529
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3530
+ client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3531
+ client._sdkVersion += ("_CLI_" + __version__)
3532
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3533
+ model = models.RecognizeKoreanDrivingLicenseOCRRequest()
3534
+ model.from_json_string(json.dumps(args))
3535
+ start_time = time.time()
3536
+ while True:
3537
+ rsp = client.RecognizeKoreanDrivingLicenseOCR(model)
3538
+ result = rsp.to_json_string()
3539
+ try:
3540
+ json_obj = json.loads(result)
3541
+ except TypeError as e:
3542
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3543
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3544
+ break
3545
+ cur_time = time.time()
3546
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3547
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3548
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3549
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3550
+ else:
3551
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3552
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3553
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3554
+
3555
+
3348
3556
  def doFinanBillOCR(args, parsed_globals):
3349
3557
  g_param = parse_global_arg(parsed_globals)
3350
3558
 
@@ -3397,7 +3605,7 @@ def doFinanBillOCR(args, parsed_globals):
3397
3605
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3398
3606
 
3399
3607
 
3400
- def doMixedInvoiceOCR(args, parsed_globals):
3608
+ def doSmartStructuralPro(args, parsed_globals):
3401
3609
  g_param = parse_global_arg(parsed_globals)
3402
3610
 
3403
3611
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3426,11 +3634,11 @@ def doMixedInvoiceOCR(args, parsed_globals):
3426
3634
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3427
3635
  client._sdkVersion += ("_CLI_" + __version__)
3428
3636
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3429
- model = models.MixedInvoiceOCRRequest()
3637
+ model = models.SmartStructuralProRequest()
3430
3638
  model.from_json_string(json.dumps(args))
3431
3639
  start_time = time.time()
3432
3640
  while True:
3433
- rsp = client.MixedInvoiceOCR(model)
3641
+ rsp = client.SmartStructuralPro(model)
3434
3642
  result = rsp.to_json_string()
3435
3643
  try:
3436
3644
  json_obj = json.loads(result)
@@ -4021,7 +4229,7 @@ def doAdvertiseOCR(args, parsed_globals):
4021
4229
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4022
4230
 
4023
4231
 
4024
- def doVehicleRegCertOCR(args, parsed_globals):
4232
+ def doResidenceBookletOCR(args, parsed_globals):
4025
4233
  g_param = parse_global_arg(parsed_globals)
4026
4234
 
4027
4235
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4050,11 +4258,11 @@ def doVehicleRegCertOCR(args, parsed_globals):
4050
4258
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
4051
4259
  client._sdkVersion += ("_CLI_" + __version__)
4052
4260
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4053
- model = models.VehicleRegCertOCRRequest()
4261
+ model = models.ResidenceBookletOCRRequest()
4054
4262
  model.from_json_string(json.dumps(args))
4055
4263
  start_time = time.time()
4056
4264
  while True:
4057
- rsp = client.VehicleRegCertOCR(model)
4265
+ rsp = client.ResidenceBookletOCR(model)
4058
4266
  result = rsp.to_json_string()
4059
4267
  try:
4060
4268
  json_obj = json.loads(result)
@@ -4437,7 +4645,7 @@ def doRecognizeIndonesiaIDCardOCR(args, parsed_globals):
4437
4645
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4438
4646
 
4439
4647
 
4440
- def doRideHailingTransportLicenseOCR(args, parsed_globals):
4648
+ def doReconstructDocument(args, parsed_globals):
4441
4649
  g_param = parse_global_arg(parsed_globals)
4442
4650
 
4443
4651
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4466,11 +4674,11 @@ def doRideHailingTransportLicenseOCR(args, parsed_globals):
4466
4674
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
4467
4675
  client._sdkVersion += ("_CLI_" + __version__)
4468
4676
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4469
- model = models.RideHailingTransportLicenseOCRRequest()
4677
+ model = models.ReconstructDocumentRequest()
4470
4678
  model.from_json_string(json.dumps(args))
4471
4679
  start_time = time.time()
4472
4680
  while True:
4473
- rsp = client.RideHailingTransportLicenseOCR(model)
4681
+ rsp = client.ReconstructDocument(model)
4474
4682
  result = rsp.to_json_string()
4475
4683
  try:
4476
4684
  json_obj = json.loads(result)
@@ -4562,8 +4770,9 @@ ACTION_MAP = {
4562
4770
  "TrainTicketOCR": doTrainTicketOCR,
4563
4771
  "PropOwnerCertOCR": doPropOwnerCertOCR,
4564
4772
  "InvoiceGeneralOCR": doInvoiceGeneralOCR,
4565
- "ReconstructDocument": doReconstructDocument,
4773
+ "RideHailingTransportLicenseOCR": doRideHailingTransportLicenseOCR,
4566
4774
  "HKIDCardOCR": doHKIDCardOCR,
4775
+ "MixedInvoiceOCR": doMixedInvoiceOCR,
4567
4776
  "PermitOCR": doPermitOCR,
4568
4777
  "BusInvoiceOCR": doBusInvoiceOCR,
4569
4778
  "EnglishOCR": doEnglishOCR,
@@ -4587,6 +4796,7 @@ ACTION_MAP = {
4587
4796
  "ArithmeticOCR": doArithmeticOCR,
4588
4797
  "EstateCertOCR": doEstateCertOCR,
4589
4798
  "RecognizePhilippinesUMIDOCR": doRecognizePhilippinesUMIDOCR,
4799
+ "RecognizeValidIDCardOCR": doRecognizeValidIDCardOCR,
4590
4800
  "BankCardOCR": doBankCardOCR,
4591
4801
  "VatInvoiceVerify": doVatInvoiceVerify,
4592
4802
  "RecognizePhilippinesDrivingLicenseOCR": doRecognizePhilippinesDrivingLicenseOCR,
@@ -4612,12 +4822,14 @@ ACTION_MAP = {
4612
4822
  "SealOCR": doSealOCR,
4613
4823
  "RecognizePhilippinesVoteIDOCR": doRecognizePhilippinesVoteIDOCR,
4614
4824
  "BankSlipOCR": doBankSlipOCR,
4615
- "ResidenceBookletOCR": doResidenceBookletOCR,
4825
+ "VehicleRegCertOCR": doVehicleRegCertOCR,
4616
4826
  "RecognizeTravelCardOCR": doRecognizeTravelCardOCR,
4827
+ "RecognizeKoreanIDCardOCR": doRecognizeKoreanIDCardOCR,
4617
4828
  "VerifyOfdVatInvoiceOCR": doVerifyOfdVatInvoiceOCR,
4618
4829
  "DriverLicenseOCR": doDriverLicenseOCR,
4830
+ "RecognizeKoreanDrivingLicenseOCR": doRecognizeKoreanDrivingLicenseOCR,
4619
4831
  "FinanBillOCR": doFinanBillOCR,
4620
- "MixedInvoiceOCR": doMixedInvoiceOCR,
4832
+ "SmartStructuralPro": doSmartStructuralPro,
4621
4833
  "ImageEnhancement": doImageEnhancement,
4622
4834
  "MLIDCardOCR": doMLIDCardOCR,
4623
4835
  "RecognizeMedicalInvoiceOCR": doRecognizeMedicalInvoiceOCR,
@@ -4629,7 +4841,7 @@ ACTION_MAP = {
4629
4841
  "LicensePlateOCR": doLicensePlateOCR,
4630
4842
  "GeneralEfficientOCR": doGeneralEfficientOCR,
4631
4843
  "AdvertiseOCR": doAdvertiseOCR,
4632
- "VehicleRegCertOCR": doVehicleRegCertOCR,
4844
+ "ResidenceBookletOCR": doResidenceBookletOCR,
4633
4845
  "CarInvoiceOCR": doCarInvoiceOCR,
4634
4846
  "RecognizeHealthCodeOCR": doRecognizeHealthCodeOCR,
4635
4847
  "RecognizePhilippinesSssIDOCR": doRecognizePhilippinesSssIDOCR,
@@ -4637,7 +4849,7 @@ ACTION_MAP = {
4637
4849
  "PassportOCR": doPassportOCR,
4638
4850
  "ShipInvoiceOCR": doShipInvoiceOCR,
4639
4851
  "RecognizeIndonesiaIDCardOCR": doRecognizeIndonesiaIDCardOCR,
4640
- "RideHailingTransportLicenseOCR": doRideHailingTransportLicenseOCR,
4852
+ "ReconstructDocument": doReconstructDocument,
4641
4853
  "RecognizePhilippinesTinIDOCR": doRecognizePhilippinesTinIDOCR,
4642
4854
 
4643
4855
  }