tencentcloud-sdk-tcex 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7eba7bef670d83cc293fd966cb214532233a8725
4
+ data.tar.gz: 4c33c21b86beb94c52f680d6071482aa744fd2ae
5
+ SHA512:
6
+ metadata.gz: f8cf986c76667194731f282c7f812ed6a1a7d6b510ff066ed027b226ef7f7662694f5ddf5c75708c9dcdf586b97357665f90fc18ad370defb6ae7704afcb583e
7
+ data.tar.gz: 1943ee1225e4753ca58e3edb0b791d0c4f8a70d8603e2beea83dd6b76448ef33647b991d0e8b017e863d2d8b24e6b42146bc2999b32c6fa6fe8f0ab1fb8f2cc2
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.200
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20200727/client'
6
+ require_relative 'v20200727/models'
7
+
8
+ module TencentCloud
9
+ module Tcex
10
+ end
11
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Tcex
21
+ module V20200727
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2020-07-27'
26
+ api_endpoint = 'tcex.tencentcloudapi.com'
27
+ sdk_version = 'TCEX_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 获取服务调用结果。和InvokeService接口配置合适,其InvokeId参数为InvokeService接口返回的RequestId。
33
+
34
+ # @param request: Request instance for DescribeInvocationResult.
35
+ # @type request: :class:`Tencentcloud::tcex::V20200727::DescribeInvocationResultRequest`
36
+ # @rtype: :class:`Tencentcloud::tcex::V20200727::DescribeInvocationResultResponse`
37
+ def DescribeInvocationResult(request)
38
+ body = send_request('DescribeInvocationResult', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = DescribeInvocationResultResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 通过传入文档url,测试服务算法。此接口需要和DescribeInvocationResult接口配置使用,该接口使用InvokeService返回的RequestId作为InvokeId参数,用于查询调用结果。
57
+
58
+ # @param request: Request instance for InvokeService.
59
+ # @type request: :class:`Tencentcloud::tcex::V20200727::InvokeServiceRequest`
60
+ # @rtype: :class:`Tencentcloud::tcex::V20200727::InvokeServiceResponse`
61
+ def InvokeService(request)
62
+ body = send_request('InvokeService', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = InvokeServiceResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module TencentCloud
18
+ module Tcex
19
+ module V20200727
20
+ # 每个算法的返回结果
21
+ class AlgorithmResult < TencentCloud::Common::AbstractModel
22
+ # @param AlgoId: 算法ID
23
+ # @type AlgoId: String
24
+ # @param AlgoName: 算法名称
25
+ # 注意:此字段可能返回 null,表示取不到有效值。
26
+ # @type AlgoName: String
27
+ # @param Result: 算法返回的结果。
28
+ # - 当算法类型为“OCR(1)”时,结果为文本字符串
29
+ # - 当算法类型为“文本分类(2)”时,结果字符串为json对象数组:
30
+ # Class:分类结果
31
+ # Confidence:置信度
32
+ # - 算法类型为“情感分析(3)”时,结果字符串为json对象:
33
+ # Positive:正面情感概率
34
+ # Negative:负面情感概率
35
+ # Neutral:中性情感概率
36
+ # - 当算法类型为“合同要素抽取(4)”时,结果字符串为json对象数组:
37
+ # NodeName:一级要素名称
38
+ # ItemName:二级要素名称
39
+ # Content:要素文本内容
40
+ # - 当算法类型为“实体识别(5)”时,结果字符串为json对象数组:
41
+ # - Entity:实体类型
42
+ # - Content:实体文本内容
43
+ # 注意:此字段可能返回 null,表示取不到有效值。
44
+ # @type Result: String
45
+ # @param Error: 算法调用错误信息
46
+ # 注意:此字段可能返回 null,表示取不到有效值。
47
+ # @type Error: String
48
+ # @param AlgoType: 算法类型:
49
+ # 1:OCR算法
50
+ # 2:文本分类算法
51
+ # 3:情感分析算法
52
+ # 4:合同要素抽取算法
53
+ # 5、实体识别算法
54
+ # 注意:此字段可能返回 null,表示取不到有效值。
55
+ # @type AlgoType: Integer
56
+
57
+ attr_accessor :AlgoId, :AlgoName, :Result, :Error, :AlgoType
58
+
59
+ def initialize(algoid=nil, algoname=nil, result=nil, error=nil, algotype=nil)
60
+ @AlgoId = algoid
61
+ @AlgoName = algoname
62
+ @Result = result
63
+ @Error = error
64
+ @AlgoType = algotype
65
+ end
66
+
67
+ def deserialize(params)
68
+ @AlgoId = params['AlgoId']
69
+ @AlgoName = params['AlgoName']
70
+ @Result = params['Result']
71
+ @Error = params['Error']
72
+ @AlgoType = params['AlgoType']
73
+ end
74
+ end
75
+
76
+ # DescribeInvocationResult请求参数结构体
77
+ class DescribeInvocationResultRequest < TencentCloud::Common::AbstractModel
78
+ # @param InvokeId: 调用id,为调用InvokeService接口返回的RequestId
79
+ # @type InvokeId: String
80
+
81
+ attr_accessor :InvokeId
82
+
83
+ def initialize(invokeid=nil)
84
+ @InvokeId = invokeid
85
+ end
86
+
87
+ def deserialize(params)
88
+ @InvokeId = params['InvokeId']
89
+ end
90
+ end
91
+
92
+ # DescribeInvocationResult返回参数结构体
93
+ class DescribeInvocationResultResponse < TencentCloud::Common::AbstractModel
94
+ # @param Results: 服务的调用结果
95
+ # @type Results: Array
96
+ # @param Status: 0:获取结果失败
97
+ # 1:结果还没有生成,继续轮询
98
+ # 2:获取结果成功
99
+ # @type Status: Integer
100
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
101
+ # @type RequestId: String
102
+
103
+ attr_accessor :Results, :Status, :RequestId
104
+
105
+ def initialize(results=nil, status=nil, requestid=nil)
106
+ @Results = results
107
+ @Status = status
108
+ @RequestId = requestid
109
+ end
110
+
111
+ def deserialize(params)
112
+ unless params['Results'].nil?
113
+ @Results = []
114
+ params['Results'].each do |i|
115
+ algorithmresult_tmp = AlgorithmResult.new
116
+ algorithmresult_tmp.deserialize(i)
117
+ @Results << algorithmresult_tmp
118
+ end
119
+ end
120
+ @Status = params['Status']
121
+ @RequestId = params['RequestId']
122
+ end
123
+ end
124
+
125
+ # InvokeService请求参数结构体
126
+ class InvokeServiceRequest < TencentCloud::Common::AbstractModel
127
+ # @param ServiceId: 待调用的服务ID。
128
+ # @type ServiceId: String
129
+ # @param ServiceStatus: 要调用服务的状态:0表示调试版本,1表示上线版本
130
+ # @type ServiceStatus: Integer
131
+ # @param FileUrl: 用于测试的文档的URL。
132
+ # @type FileUrl: String
133
+ # @param Input: 用于测试的文本,当此值不为空时,调用内容以此参数的值为准。
134
+ # @type Input: String
135
+
136
+ attr_accessor :ServiceId, :ServiceStatus, :FileUrl, :Input
137
+
138
+ def initialize(serviceid=nil, servicestatus=nil, fileurl=nil, input=nil)
139
+ @ServiceId = serviceid
140
+ @ServiceStatus = servicestatus
141
+ @FileUrl = fileurl
142
+ @Input = input
143
+ end
144
+
145
+ def deserialize(params)
146
+ @ServiceId = params['ServiceId']
147
+ @ServiceStatus = params['ServiceStatus']
148
+ @FileUrl = params['FileUrl']
149
+ @Input = params['Input']
150
+ end
151
+ end
152
+
153
+ # InvokeService返回参数结构体
154
+ class InvokeServiceResponse < TencentCloud::Common::AbstractModel
155
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
156
+ # @type RequestId: String
157
+
158
+ attr_accessor :RequestId
159
+
160
+ def initialize(requestid=nil)
161
+ @RequestId = requestid
162
+ end
163
+
164
+ def deserialize(params)
165
+ @RequestId = params['RequestId']
166
+ end
167
+ end
168
+
169
+ end
170
+ end
171
+ end
172
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-tcex
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.200
5
+ platform: ruby
6
+ authors:
7
+ - Tencent Cloud
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tencentcloud-sdk-common
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: Tencent Cloud Ruby SDK is the official software development kit, which
28
+ allows Ruby developers to write software that makes use of Tencent Cloud service
29
+ TCEX.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/VERSION
37
+ - lib/tencentcloud-sdk-tcex.rb
38
+ - lib/v20200727/client.rb
39
+ - lib/v20200727/models.rb
40
+ homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
41
+ licenses:
42
+ - Apache-2.0
43
+ metadata:
44
+ source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-tcex
45
+ changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.6.14
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Tencent Cloud SDK for Ruby - TCEX
66
+ test_files: []