tccli 3.0.1333.1__py2.py3-none-any.whl → 3.0.1335.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/cdn/v20180606/api.json +3 -3
  3. tccli/services/cfs/v20190719/api.json +2 -2
  4. tccli/services/clb/v20180317/api.json +1 -1
  5. tccli/services/csip/csip_client.py +53 -0
  6. tccli/services/csip/v20221121/api.json +466 -0
  7. tccli/services/csip/v20221121/examples.json +9 -1
  8. tccli/services/ess/v20201111/api.json +33 -4
  9. tccli/services/essbasic/v20210526/api.json +33 -4
  10. tccli/services/goosefs/goosefs_client.py +53 -0
  11. tccli/services/goosefs/v20220519/api.json +53 -0
  12. tccli/services/goosefs/v20220519/examples.json +8 -0
  13. tccli/services/gs/v20191118/api.json +11 -1
  14. tccli/services/gs/v20191118/examples.json +1 -1
  15. tccli/services/hunyuan/v20230901/api.json +64 -0
  16. tccli/services/lke/v20231130/api.json +3 -3
  17. tccli/services/mps/v20190612/api.json +129 -0
  18. tccli/services/ocr/ocr_client.py +4 -110
  19. tccli/services/ocr/v20181119/api.json +0 -282
  20. tccli/services/ocr/v20181119/examples.json +0 -16
  21. tccli/services/ssl/ssl_client.py +53 -0
  22. tccli/services/ssl/v20191205/api.json +100 -0
  23. tccli/services/ssl/v20191205/examples.json +8 -0
  24. tccli/services/tcss/v20201101/api.json +5 -5
  25. tccli/services/tcss/v20201101/examples.json +2 -2
  26. tccli/services/trocket/v20230308/api.json +1 -1
  27. tccli/services/trocket/v20230308/examples.json +1 -1
  28. tccli/services/trtc/v20190722/api.json +30 -2
  29. tccli/services/tse/v20201207/api.json +1 -1
  30. tccli/services/tsf/v20180326/api.json +1 -1
  31. {tccli-3.0.1333.1.dist-info → tccli-3.0.1335.1.dist-info}/METADATA +2 -2
  32. {tccli-3.0.1333.1.dist-info → tccli-3.0.1335.1.dist-info}/RECORD +35 -35
  33. {tccli-3.0.1333.1.dist-info → tccli-3.0.1335.1.dist-info}/WHEEL +0 -0
  34. {tccli-3.0.1333.1.dist-info → tccli-3.0.1335.1.dist-info}/entry_points.txt +0 -0
  35. {tccli-3.0.1333.1.dist-info → tccli-3.0.1335.1.dist-info}/license_files/LICENSE +0 -0
@@ -641,58 +641,6 @@ 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
-
696
644
  def doPermitOCR(args, parsed_globals):
697
645
  g_param = parse_global_arg(parsed_globals)
698
646
 
@@ -2357,58 +2305,6 @@ def doInstitutionOCR(args, parsed_globals):
2357
2305
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2358
2306
 
2359
2307
 
2360
- def doSmartStructuralOCRV2(args, parsed_globals):
2361
- g_param = parse_global_arg(parsed_globals)
2362
-
2363
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2364
- cred = credential.CVMRoleCredential()
2365
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2366
- cred = credential.STSAssumeRoleCredential(
2367
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2368
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2369
- )
2370
- 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):
2371
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2372
- else:
2373
- cred = credential.Credential(
2374
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2375
- )
2376
- http_profile = HttpProfile(
2377
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2378
- reqMethod="POST",
2379
- endpoint=g_param[OptionsDefine.Endpoint],
2380
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2381
- )
2382
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2383
- if g_param[OptionsDefine.Language]:
2384
- profile.language = g_param[OptionsDefine.Language]
2385
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2386
- client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
2387
- client._sdkVersion += ("_CLI_" + __version__)
2388
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
2389
- model = models.SmartStructuralOCRV2Request()
2390
- model.from_json_string(json.dumps(args))
2391
- start_time = time.time()
2392
- while True:
2393
- rsp = client.SmartStructuralOCRV2(model)
2394
- result = rsp.to_json_string()
2395
- try:
2396
- json_obj = json.loads(result)
2397
- except TypeError as e:
2398
- json_obj = json.loads(result.decode('utf-8')) # python3.3
2399
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2400
- break
2401
- cur_time = time.time()
2402
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2403
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2404
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2405
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2406
- else:
2407
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2408
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2409
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2410
-
2411
-
2412
2308
  def doRecognizeTableAccurateOCR(args, parsed_globals):
2413
2309
  g_param = parse_global_arg(parsed_globals)
2414
2310
 
@@ -3501,7 +3397,7 @@ def doFinanBillOCR(args, parsed_globals):
3501
3397
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3502
3398
 
3503
3399
 
3504
- def doSmartStructuralPro(args, parsed_globals):
3400
+ def doMixedInvoiceOCR(args, parsed_globals):
3505
3401
  g_param = parse_global_arg(parsed_globals)
3506
3402
 
3507
3403
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3530,11 +3426,11 @@ def doSmartStructuralPro(args, parsed_globals):
3530
3426
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3531
3427
  client._sdkVersion += ("_CLI_" + __version__)
3532
3428
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3533
- model = models.SmartStructuralProRequest()
3429
+ model = models.MixedInvoiceOCRRequest()
3534
3430
  model.from_json_string(json.dumps(args))
3535
3431
  start_time = time.time()
3536
3432
  while True:
3537
- rsp = client.SmartStructuralPro(model)
3433
+ rsp = client.MixedInvoiceOCR(model)
3538
3434
  result = rsp.to_json_string()
3539
3435
  try:
3540
3436
  json_obj = json.loads(result)
@@ -4668,7 +4564,6 @@ ACTION_MAP = {
4668
4564
  "PropOwnerCertOCR": doPropOwnerCertOCR,
4669
4565
  "InvoiceGeneralOCR": doInvoiceGeneralOCR,
4670
4566
  "HKIDCardOCR": doHKIDCardOCR,
4671
- "MixedInvoiceOCR": doMixedInvoiceOCR,
4672
4567
  "PermitOCR": doPermitOCR,
4673
4568
  "BusInvoiceOCR": doBusInvoiceOCR,
4674
4569
  "EnglishOCR": doEnglishOCR,
@@ -4701,7 +4596,6 @@ ACTION_MAP = {
4701
4596
  "IDCardOCR": doIDCardOCR,
4702
4597
  "RecognizeGeneralTextImageWarn": doRecognizeGeneralTextImageWarn,
4703
4598
  "InstitutionOCR": doInstitutionOCR,
4704
- "SmartStructuralOCRV2": doSmartStructuralOCRV2,
4705
4599
  "RecognizeTableAccurateOCR": doRecognizeTableAccurateOCR,
4706
4600
  "MixedInvoiceDetect": doMixedInvoiceDetect,
4707
4601
  "VatRollInvoiceOCR": doVatRollInvoiceOCR,
@@ -4723,7 +4617,7 @@ ACTION_MAP = {
4723
4617
  "VerifyOfdVatInvoiceOCR": doVerifyOfdVatInvoiceOCR,
4724
4618
  "DriverLicenseOCR": doDriverLicenseOCR,
4725
4619
  "FinanBillOCR": doFinanBillOCR,
4726
- "SmartStructuralPro": doSmartStructuralPro,
4620
+ "MixedInvoiceOCR": doMixedInvoiceOCR,
4727
4621
  "RecognizeHealthCodeOCR": doRecognizeHealthCodeOCR,
4728
4622
  "ImageEnhancement": doImageEnhancement,
4729
4623
  "QuestionSplitOCR": doQuestionSplitOCR,
@@ -518,20 +518,6 @@
518
518
  "output": "SmartStructuralOCRResponse",
519
519
  "status": "online"
520
520
  },
521
- "SmartStructuralOCRV2": {
522
- "document": "本接口支持识别并提取制式卡证、票据、表单等结构化场景的字段信息。无需任何配置,灵活高效。适用于各类结构化信息录入场景。点击[立即体验](https://ocrdemo.cloud.tencent.com/)。\n\n默认接口请求频率限制:5次/秒。",
523
- "input": "SmartStructuralOCRV2Request",
524
- "name": "文档抽取(基础版)-旧版不再更新维护",
525
- "output": "SmartStructuralOCRV2Response",
526
- "status": "online"
527
- },
528
- "SmartStructuralPro": {
529
- "document": "本接口支持识别并提取场景复杂、版式多等结构化场景的字段信息。重点场景包括:金融、医疗、交通、出行、保险。点击[立即体验](https://ocrdemo.cloud.tencent.com/)。\n\n默认接口请求频率限制:5次/秒。",
530
- "input": "SmartStructuralProRequest",
531
- "name": "文档抽取(多模态版)-旧版不再更新维护",
532
- "output": "SmartStructuralProResponse",
533
- "status": "online"
534
- },
535
521
  "TableOCR": {
536
522
  "document": "<b>此接口为表格识别的旧版本服务,不再进行服务升级,建议您使用识别能力更强、服务性能更优的<a href=\"https://cloud.tencent.com/document/product/866/49525\">新版表格识别</a>。</b>\n\n本接口支持图片内表格文档的检测和识别,返回每个单元格的文字内容,支持将识别结果保存为 Excel 格式。\n\n默认接口请求频率限制:10次/秒。",
537
523
  "input": "TableOCRRequest",
@@ -17012,274 +16998,6 @@
17012
16998
  ],
17013
16999
  "type": "object"
17014
17000
  },
17015
- "SmartStructuralOCRV2Request": {
17016
- "document": "SmartStructuralOCRV2请求参数结构体",
17017
- "members": [
17018
- {
17019
- "disabled": false,
17020
- "document": "图片的 Url 地址。支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。支持的图片大小:所下载图片经 Base64 编码后不超过 10M。图片下载时间不超过 3 秒。支持的图片像素:需介于20-10000px之间。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。",
17021
- "example": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/document/SmartStructuralOCR/SmartStructuralPro1.png",
17022
- "member": "string",
17023
- "name": "ImageUrl",
17024
- "required": false,
17025
- "type": "string"
17026
- },
17027
- {
17028
- "disabled": false,
17029
- "document": "图片的 Base64 值。支持的图片格式:PNG、JPG、JPEG,暂不支持 GIF 格式。支持的图片大小:所下载图片经Base64编码后不超过 10M。图片下载时间不超过 3 秒。支持的图片像素:需介于20-10000px之间。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。",
17030
- "example": "/9j/4AAQSkZJRg.....s97n//2Q==",
17031
- "member": "string",
17032
- "name": "ImageBase64",
17033
- "required": false,
17034
- "type": "string"
17035
- },
17036
- {
17037
- "disabled": false,
17038
- "document": "是否开启PDF识别,默认值为false,开启后可同时支持图片和PDF的识别。",
17039
- "example": "true",
17040
- "member": "bool",
17041
- "name": "IsPdf",
17042
- "required": false,
17043
- "type": "bool"
17044
- },
17045
- {
17046
- "disabled": false,
17047
- "document": "需要识别的PDF页面的对应页码,仅支持PDF单页识别,当上传文件为PDF且IsPdf参数值为true时有效,默认值为1。",
17048
- "example": "1",
17049
- "member": "uint64",
17050
- "name": "PdfPageNumber",
17051
- "required": false,
17052
- "type": "int"
17053
- },
17054
- {
17055
- "disabled": false,
17056
- "document": "自定义结构化功能需返回的字段名称,例:\n若客户只想返回姓名、性别两个字段的识别结果,则输入\nItemNames=[\"姓名\",\"性别\"]",
17057
- "example": "[\"姓名\",\"性别\"]",
17058
- "member": "string",
17059
- "name": "ItemNames",
17060
- "required": false,
17061
- "type": "list"
17062
- },
17063
- {
17064
- "disabled": false,
17065
- "document": "是否开启全文字段识别",
17066
- "example": "false",
17067
- "member": "bool",
17068
- "name": "ReturnFullText",
17069
- "required": false,
17070
- "type": "bool"
17071
- },
17072
- {
17073
- "disabled": false,
17074
- "document": "配置id支持:\nGeneral -- 通用场景\nOnlineTaxiItinerary -- 网约车行程单\nRideHailingDriverLicense -- 网约车驾驶证\nRideHailingTransportLicense -- 网约车运输证\nWayBill -- 快递运单\nAccountOpeningPermit -- 银行开户许可证\nInvoiceEng -- 海外发票模版\nCoin --钱币识别模板\nOnboardingDocuments -- 入职材料识别\nPropertyOwnershipCertificate -- 房产证识别\nRealEstateCertificate --不动产权证识别\nHouseEncumbranceCertificate -- 他权证识别\nCarInsurance -- 车险保单\nMultiRealEstateCertificate -- 房产证、不动产证、产权证等材料合一模板",
17075
- "example": "General",
17076
- "member": "string",
17077
- "name": "ConfigId",
17078
- "required": false,
17079
- "type": "string"
17080
- },
17081
- {
17082
- "disabled": false,
17083
- "document": "是否打开印章识别",
17084
- "example": "true",
17085
- "member": "bool",
17086
- "name": "EnableSealRecognize",
17087
- "required": false,
17088
- "type": "bool"
17089
- }
17090
- ],
17091
- "type": "object"
17092
- },
17093
- "SmartStructuralOCRV2Response": {
17094
- "document": "SmartStructuralOCRV2返回参数结构体",
17095
- "members": [
17096
- {
17097
- "disabled": false,
17098
- "document": "图片旋转角度(角度制),文本的水平方向\n为 0;顺时针为正,逆时针为负",
17099
- "example": "0",
17100
- "member": "float",
17101
- "name": "Angle",
17102
- "output_required": true,
17103
- "type": "float",
17104
- "value_allowed_null": false
17105
- },
17106
- {
17107
- "disabled": false,
17108
- "document": "配置结构化文本信息",
17109
- "example": "无",
17110
- "member": "GroupInfo",
17111
- "name": "StructuralList",
17112
- "output_required": true,
17113
- "type": "list",
17114
- "value_allowed_null": false
17115
- },
17116
- {
17117
- "disabled": false,
17118
- "document": "还原文本信息",
17119
- "example": "无",
17120
- "member": "WordItem",
17121
- "name": "WordList",
17122
- "output_required": true,
17123
- "type": "list",
17124
- "value_allowed_null": false
17125
- },
17126
- {
17127
- "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
17128
- "member": "string",
17129
- "name": "RequestId",
17130
- "type": "string"
17131
- }
17132
- ],
17133
- "type": "object"
17134
- },
17135
- "SmartStructuralProRequest": {
17136
- "document": "SmartStructuralPro请求参数结构体",
17137
- "members": [
17138
- {
17139
- "disabled": false,
17140
- "document": "图片的 Url 地址。支持的图片格式:PNG、JPG、JPEG,WORD,EXCEL,暂不支持 GIF 格式。支持的图片大小:所下载图片经 Base64 编码后不超过 7M。图片下载时间不超过 3 秒。支持的图片像素:需介于20-10000px之间。图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。非腾讯云存储的 Url 速度和稳定性可能受一定影响。",
17141
- "example": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/document/SmartStructuralOCR/SmartStructuralPro1.png",
17142
- "member": "string",
17143
- "name": "ImageUrl",
17144
- "required": false,
17145
- "type": "string"
17146
- },
17147
- {
17148
- "disabled": false,
17149
- "document": "图片的 Base64 值。支持的图片格式:PNG、JPG、JPEG,WORD,EXCEL,暂不支持 GIF 格式。支持的图片大小:所下载图片经Base64编码后不超过 7M。图片下载时间不超过 3 秒。支持的图片像素:需介于20-10000px之间。图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。",
17150
- "example": "/9j/4AAQSkZJRg.....s97n//2Q==",
17151
- "member": "string",
17152
- "name": "ImageBase64",
17153
- "required": false,
17154
- "type": "string"
17155
- },
17156
- {
17157
- "disabled": false,
17158
- "document": "需要识别的PDF页面的对应页码,仅支持PDF单页识别,当上传文件为PDF且IsPdf参数值为true时有效,默认值为前3页。",
17159
- "example": "1",
17160
- "member": "uint64",
17161
- "name": "PdfPageNumber",
17162
- "required": false,
17163
- "type": "int"
17164
- },
17165
- {
17166
- "disabled": false,
17167
- "document": "自定义结构化功能需返回的字段名称,例:若客户想新增返回姓名、性别两个字段的识别结果,则输入ItemNames=[\"姓名\",\"性别\"]",
17168
- "example": "[\"姓名\",\"性别\"]",
17169
- "member": "string",
17170
- "name": "ItemNames",
17171
- "required": false,
17172
- "type": "list"
17173
- },
17174
- {
17175
- "disabled": false,
17176
- "document": "true:仅输出自定义字段\nflase:输出默认字段+自定义字段\n默认true",
17177
- "example": "true",
17178
- "member": "bool",
17179
- "name": "ItemNamesShowMode",
17180
- "required": false,
17181
- "type": "bool"
17182
- },
17183
- {
17184
- "disabled": false,
17185
- "document": "是否开启全文字段识别",
17186
- "example": "false",
17187
- "member": "bool",
17188
- "name": "ReturnFullText",
17189
- "required": false,
17190
- "type": "bool"
17191
- },
17192
- {
17193
- "disabled": false,
17194
- "document": "配置id支持:\nGeneral -- 通用场景 \nInvoiceEng -- 国际invoice模版 \nWayBillEng --海运订单模板\nCustomsDeclaration -- 进出口报关单\nWeightNote -- 磅单\nMedicalMeter -- 血压仪表识别\nBillOfLading -- 海运提单\nEntrustmentBook -- 海运托书\nWordRecognize -- 手写英文作文模版\nStatement -- 对账单识别模板\nBookingConfirmation -- 配舱通知书识别模板\nAirWayBill -- 航空运单识别模板\nDispatchWeightNote -- 磅单发货单识别模板\nReceiptWeightNote -- 磅单收货单识别模板\nArticalRecognize -- 手写作文模版\nTable -- 表格模版\nSteelLabel -- 实物标签识别模板\nCarInsurance -- 车辆保险单识别模板",
17195
- "example": "General",
17196
- "member": "string",
17197
- "name": "ConfigId",
17198
- "required": false,
17199
- "type": "string"
17200
- },
17201
- {
17202
- "disabled": false,
17203
- "document": "是否开启全文字段坐标值的识别",
17204
- "example": "false",
17205
- "member": "bool",
17206
- "name": "EnableCoord",
17207
- "required": false,
17208
- "type": "bool"
17209
- },
17210
- {
17211
- "disabled": false,
17212
- "document": "是否开启父子key识别,默认是",
17213
- "example": "true",
17214
- "member": "bool",
17215
- "name": "OutputParentKey",
17216
- "required": false,
17217
- "type": "bool"
17218
- },
17219
- {
17220
- "disabled": false,
17221
- "document": "模版的单个属性配置",
17222
- "example": "{\"Scene\": \"only_hw\"}",
17223
- "member": "ConfigAdvanced",
17224
- "name": "ConfigAdvanced",
17225
- "required": false,
17226
- "type": "object"
17227
- }
17228
- ],
17229
- "type": "object"
17230
- },
17231
- "SmartStructuralProResponse": {
17232
- "document": "SmartStructuralPro返回参数结构体",
17233
- "members": [
17234
- {
17235
- "disabled": false,
17236
- "document": "图片旋转角度(角度制),文本的水平方向为 0;顺时针为正,逆时针为负",
17237
- "example": "0",
17238
- "member": "float",
17239
- "name": "Angle",
17240
- "output_required": true,
17241
- "type": "float",
17242
- "value_allowed_null": false
17243
- },
17244
- {
17245
- "disabled": false,
17246
- "document": "配置结构化文本信息",
17247
- "example": "无",
17248
- "member": "GroupInfo",
17249
- "name": "StructuralList",
17250
- "output_required": true,
17251
- "type": "list",
17252
- "value_allowed_null": false
17253
- },
17254
- {
17255
- "disabled": false,
17256
- "document": "还原文本信息",
17257
- "example": "无",
17258
- "member": "WordItem",
17259
- "name": "WordList",
17260
- "output_required": true,
17261
- "type": "list",
17262
- "value_allowed_null": false
17263
- },
17264
- {
17265
- "disabled": false,
17266
- "document": "识别出的token个数",
17267
- "example": "12",
17268
- "member": "int64",
17269
- "name": "TokenNum",
17270
- "output_required": false,
17271
- "type": "int",
17272
- "value_allowed_null": false
17273
- },
17274
- {
17275
- "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
17276
- "member": "string",
17277
- "name": "RequestId",
17278
- "type": "string"
17279
- }
17280
- ],
17281
- "type": "object"
17282
- },
17283
17001
  "StoreInfo": {
17284
17002
  "document": "门头照识别结果",
17285
17003
  "members": [
@@ -634,22 +634,6 @@
634
634
  "title": "智能结构化识别"
635
635
  }
636
636
  ],
637
- "SmartStructuralOCRV2": [
638
- {
639
- "document": "智能结构化识别新接口",
640
- "input": "POST / HTTP/1.1\nHost: ocr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SmartStructuralOCRV2\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/document/SmartStructuralOCR/SmartStructuralPro1.png\",\n \"ImageBase64\": \"/9j/4AAQSkZJRg.....s97n//2Q==\",\n \"IsPdf\": true,\n \"PdfPageNumber\": 1,\n \"ItemNames\": [\n \"号码\"\n ],\n \"ReturnFullText\": false,\n \"ConfigId\": \"General\"\n}",
641
- "output": "{\n \"Response\": {\n \"Angle\": 0,\n \"StructuralList\": [\n {\n \"Groups\": [\n {\n \"Lines\": [\n {\n \"Key\": {\n \"AutoName\": \"号码\",\n \"ConfigName\": \"number\"\n },\n \"Value\": {\n \"AutoContent\": \"176***101\",\n \"Coord\": {\n \"LeftTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"LeftBottom\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightBottom\": {\n \"X\": 0,\n \"Y\": 0\n }\n }\n }\n }\n ]\n }\n ]\n }\n ],\n \"WordList\": [\n {\n \"DetectedText\": \"ORD0****9\",\n \"Coord\": {\n \"LeftTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"LeftBottom\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightBottom\": {\n \"X\": 0,\n \"Y\": 0\n }\n }\n }\n ],\n \"RequestId\": \"137****9\"\n }\n}",
642
- "title": "智能结构化识别V2"
643
- }
644
- ],
645
- "SmartStructuralPro": [
646
- {
647
- "document": "智能结构化高级版识别",
648
- "input": "POST / HTTP/1.1\nHost: ocr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SmartStructuralPro\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/document/SmartStructuralOCR/SmartStructuralPro1.png\",\n \"ImageBase64\": \"/9j/4AAQSkZJRg.....s97n//2Q==\",\n \"PdfPageNumber\": 1,\n \"EnableCoord\": false,\n \"ItemNames\": [\n \"号码\"\n ],\n \"ReturnFullText\": false,\n \"ConfigId\": \"General\"\n}",
649
- "output": "{\n \"Response\": {\n \"Angle\": 0,\n \"StructuralList\": [\n {\n \"Groups\": [\n {\n \"Lines\": [\n {\n \"Key\": {\n \"AutoName\": \"号码\",\n \"ConfigName\": \"number\"\n },\n \"Value\": {\n \"AutoContent\": \"176***101\",\n \"Coord\": {\n \"LeftTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightBottom\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"LeftBottom\": {\n \"X\": 0,\n \"Y\": 0\n }\n }\n }\n }\n ]\n }\n ]\n }\n ],\n \"WordList\": [\n {\n \"DetectedText\": \"ORD0****9\",\n \"Coord\": {\n \"LeftTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightTop\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"RightBottom\": {\n \"X\": 0,\n \"Y\": 0\n },\n \"LeftBottom\": {\n \"X\": 0,\n \"Y\": 0\n }\n }\n }\n ],\n \"RequestId\": \"2378****90\"\n }\n}",
650
- "title": "智能结构化高级版识别"
651
- }
652
- ],
653
637
  "TableOCR": [
654
638
  {
655
639
  "document": "表格识别示例代码",
@@ -1265,6 +1265,58 @@ def doVerifyManager(args, parsed_globals):
1265
1265
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1266
1266
 
1267
1267
 
1268
+ def doUploadUpdateCertificateInstance(args, parsed_globals):
1269
+ g_param = parse_global_arg(parsed_globals)
1270
+
1271
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1272
+ cred = credential.CVMRoleCredential()
1273
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1274
+ cred = credential.STSAssumeRoleCredential(
1275
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1276
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1277
+ )
1278
+ 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):
1279
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1280
+ else:
1281
+ cred = credential.Credential(
1282
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1283
+ )
1284
+ http_profile = HttpProfile(
1285
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1286
+ reqMethod="POST",
1287
+ endpoint=g_param[OptionsDefine.Endpoint],
1288
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1289
+ )
1290
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1291
+ if g_param[OptionsDefine.Language]:
1292
+ profile.language = g_param[OptionsDefine.Language]
1293
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1294
+ client = mod.SslClient(cred, g_param[OptionsDefine.Region], profile)
1295
+ client._sdkVersion += ("_CLI_" + __version__)
1296
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1297
+ model = models.UploadUpdateCertificateInstanceRequest()
1298
+ model.from_json_string(json.dumps(args))
1299
+ start_time = time.time()
1300
+ while True:
1301
+ rsp = client.UploadUpdateCertificateInstance(model)
1302
+ result = rsp.to_json_string()
1303
+ try:
1304
+ json_obj = json.loads(result)
1305
+ except TypeError as e:
1306
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1307
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1308
+ break
1309
+ cur_time = time.time()
1310
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1311
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1312
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1313
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1314
+ else:
1315
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1316
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1317
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1318
+
1319
+
1268
1320
  def doUpdateCertificateInstance(args, parsed_globals):
1269
1321
  g_param = parse_global_arg(parsed_globals)
1270
1322
 
@@ -3328,6 +3380,7 @@ ACTION_MAP = {
3328
3380
  "DownloadCertificate": doDownloadCertificate,
3329
3381
  "DeleteCertificate": doDeleteCertificate,
3330
3382
  "VerifyManager": doVerifyManager,
3383
+ "UploadUpdateCertificateInstance": doUploadUpdateCertificateInstance,
3331
3384
  "UpdateCertificateInstance": doUpdateCertificateInstance,
3332
3385
  "UploadCertificate": doUploadCertificate,
3333
3386
  "CheckCertificateChain": doCheckCertificateChain,