tencentcloud-sdk-tmt 1.0.200

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 18d35a0aea36ef28ff023790e518f7e8458f16b7
4
+ data.tar.gz: 9a11b265fcb83e29741793bf801e63454bf31523
5
+ SHA512:
6
+ metadata.gz: aac506f08111ded7543fc74e895a3319d8267a7182f73efb43ee75cab7479c8e7e7e3141e92b9066d50c9dd558827ca7afe1b0ff98c752a05cbe84e741a539fd
7
+ data.tar.gz: 204f836341decc80a22217b737ab7dc4f812f320c18c17ee3dc82fa5fabb527c3130d8fe6dab36e0806d1f3ca41f149277866fbf351cd232d1791fea2b254379
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 'v20180321/client'
6
+ require_relative 'v20180321/models'
7
+
8
+ module TencentCloud
9
+ module Tmt
10
+ end
11
+ end
@@ -0,0 +1,162 @@
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 Tmt
21
+ module V20180321
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-03-21'
26
+ api_endpoint = 'tmt.tencentcloudapi.com'
27
+ sdk_version = 'TMT_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 提供13种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。<br />
33
+ # 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
34
+
35
+ # @param request: Request instance for ImageTranslate.
36
+ # @type request: :class:`Tencentcloud::tmt::V20180321::ImageTranslateRequest`
37
+ # @rtype: :class:`Tencentcloud::tmt::V20180321::ImageTranslateResponse`
38
+ def ImageTranslate(request)
39
+ body = send_request('ImageTranslate', request.serialize)
40
+ response = JSON.parse(body)
41
+ if response['Response'].key?('Error') == false
42
+ model = ImageTranslateResponse.new
43
+ model.deserialize(response['Response'])
44
+ model
45
+ else
46
+ code = response['Response']['Error']['Code']
47
+ message = response['Response']['Error']['Message']
48
+ reqid = response['Response']['RequestId']
49
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
50
+ end
51
+ rescue TencentCloud::Common::TencentCloudSDKException => e
52
+ raise e
53
+ rescue StandardError => e
54
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
55
+ end
56
+
57
+ # 可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
58
+ # 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
59
+
60
+ # @param request: Request instance for LanguageDetect.
61
+ # @type request: :class:`Tencentcloud::tmt::V20180321::LanguageDetectRequest`
62
+ # @rtype: :class:`Tencentcloud::tmt::V20180321::LanguageDetectResponse`
63
+ def LanguageDetect(request)
64
+ body = send_request('LanguageDetect', request.serialize)
65
+ response = JSON.parse(body)
66
+ if response['Response'].key?('Error') == false
67
+ model = LanguageDetectResponse.new
68
+ model.deserialize(response['Response'])
69
+ model
70
+ else
71
+ code = response['Response']['Error']['Code']
72
+ message = response['Response']['Error']['Message']
73
+ reqid = response['Response']['RequestId']
74
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
75
+ end
76
+ rescue TencentCloud::Common::TencentCloudSDKException => e
77
+ raise e
78
+ rescue StandardError => e
79
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
80
+ end
81
+
82
+ # 本接口提供上传音频,将音频进行语音识别并翻译成文本的服务,目前开放中英互译的语音翻译服务。
83
+ # 待识别和翻译的音频文件可以是 pcm、mp3和speex 格式,pcm采样率要求16kHz、位深16bit、单声道,音频内语音清晰。<br/>
84
+ # 如果采用流式传输的方式,要求每个分片时长200ms~500ms;如果采用非流式的传输方式,要求音频时长不超过8s。注意最后一个分片的IsEnd参数设置为1。<br />
85
+ # 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源部分。
86
+
87
+ # @param request: Request instance for SpeechTranslate.
88
+ # @type request: :class:`Tencentcloud::tmt::V20180321::SpeechTranslateRequest`
89
+ # @rtype: :class:`Tencentcloud::tmt::V20180321::SpeechTranslateResponse`
90
+ def SpeechTranslate(request)
91
+ body = send_request('SpeechTranslate', request.serialize)
92
+ response = JSON.parse(body)
93
+ if response['Response'].key?('Error') == false
94
+ model = SpeechTranslateResponse.new
95
+ model.deserialize(response['Response'])
96
+ model
97
+ else
98
+ code = response['Response']['Error']['Code']
99
+ message = response['Response']['Error']['Message']
100
+ reqid = response['Response']['RequestId']
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
102
+ end
103
+ rescue TencentCloud::Common::TencentCloudSDKException => e
104
+ raise e
105
+ rescue StandardError => e
106
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
107
+ end
108
+
109
+ # 提供中文到英文、英文到中文的等多种语言的文本内容翻译服务, 经过大数据语料库、多种解码算法、翻译引擎深度优化,在新闻文章、生活口语等不同语言场景中都有深厚积累,翻译结果专业评价处于行业领先水平。<br />
110
+ # 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
111
+
112
+ # @param request: Request instance for TextTranslate.
113
+ # @type request: :class:`Tencentcloud::tmt::V20180321::TextTranslateRequest`
114
+ # @rtype: :class:`Tencentcloud::tmt::V20180321::TextTranslateResponse`
115
+ def TextTranslate(request)
116
+ body = send_request('TextTranslate', request.serialize)
117
+ response = JSON.parse(body)
118
+ if response['Response'].key?('Error') == false
119
+ model = TextTranslateResponse.new
120
+ model.deserialize(response['Response'])
121
+ model
122
+ else
123
+ code = response['Response']['Error']['Code']
124
+ message = response['Response']['Error']['Message']
125
+ reqid = response['Response']['RequestId']
126
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
127
+ end
128
+ rescue TencentCloud::Common::TencentCloudSDKException => e
129
+ raise e
130
+ rescue StandardError => e
131
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
132
+ end
133
+
134
+ # 文本翻译的批量接口
135
+
136
+ # @param request: Request instance for TextTranslateBatch.
137
+ # @type request: :class:`Tencentcloud::tmt::V20180321::TextTranslateBatchRequest`
138
+ # @rtype: :class:`Tencentcloud::tmt::V20180321::TextTranslateBatchResponse`
139
+ def TextTranslateBatch(request)
140
+ body = send_request('TextTranslateBatch', request.serialize)
141
+ response = JSON.parse(body)
142
+ if response['Response'].key?('Error') == false
143
+ model = TextTranslateBatchResponse.new
144
+ model.deserialize(response['Response'])
145
+ model
146
+ else
147
+ code = response['Response']['Error']['Code']
148
+ message = response['Response']['Error']['Message']
149
+ reqid = response['Response']['RequestId']
150
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
151
+ end
152
+ rescue TencentCloud::Common::TencentCloudSDKException => e
153
+ raise e
154
+ rescue StandardError => e
155
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
156
+ end
157
+
158
+
159
+ end
160
+ end
161
+ end
162
+ end
@@ -0,0 +1,500 @@
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 Tmt
19
+ module V20180321
20
+ # 图片翻译结果
21
+ class ImageRecord < TencentCloud::Common::AbstractModel
22
+ # @param Value: 图片翻译结果
23
+ # @type Value: Array
24
+
25
+ attr_accessor :Value
26
+
27
+ def initialize(value=nil)
28
+ @Value = value
29
+ end
30
+
31
+ def deserialize(params)
32
+ unless params['Value'].nil?
33
+ @Value = []
34
+ params['Value'].each do |i|
35
+ itemvalue_tmp = ItemValue.new
36
+ itemvalue_tmp.deserialize(i)
37
+ @Value << itemvalue_tmp
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ # ImageTranslate请求参数结构体
44
+ class ImageTranslateRequest < TencentCloud::Common::AbstractModel
45
+ # @param SessionUuid: 唯一id,返回时原样返回
46
+ # @type SessionUuid: String
47
+ # @param Scene: doc:文档扫描
48
+ # @type Scene: String
49
+ # @param Data: 图片数据的Base64字符串,图片大小上限为4M,建议对源图片进行一定程度压缩
50
+ # @type Data: String
51
+ # @param Source: 源语言,支持语言列表:<li> auto:自动识别(识别为一种语言)</li> <li>zh:简体中文</li> <li>zh-TW:繁体中文</li> <li>en:英语</li> <li>ja:日语</li> <li>ko:韩语</li> <li>ru:俄语</li> <li>fr:法语</li> <li>de:德语</li> <li>it:意大利语</li> <li>es:西班牙语</li> <li>pt:葡萄牙语</li> <li>ms:马来西亚语</li> <li>th:泰语</li><li>vi:越南语</li>
52
+ # @type Source: String
53
+ # @param Target: 目标语言,各源语言的目标语言支持列表如下:
54
+ # <li>zh(简体中文):en(英语)、ja(日语)、ko(韩语)、ru(俄语)、fr(法语)、de(德语)、it(意大利语)、es(西班牙语)、pt(葡萄牙语)、ms(马来语)、th(泰语)、vi(越南语)</li>
55
+ # <li>zh-TW(繁体中文):en(英语)、ja(日语)、ko(韩语)、ru(俄语)、fr(法语)、de(德语)、it(意大利语)、es(西班牙语)、pt(葡萄牙语)、ms(马来语)、th(泰语)、vi(越南语)</li>
56
+ # <li>en(英语):zh(中文)、ja(日语)、ko(韩语)、ru(俄语)、fr(法语)、de(德语)、it(意大利语)、es(西班牙语)、pt(葡萄牙语)、ms(马来语)、th(泰语)、vi(越南语)</li>
57
+ # <li>ja(日语):zh(中文)、en(英语)、ko(韩语)</li>
58
+ # <li>ko(韩语):zh(中文)、en(英语)、ja(日语)</li>
59
+ # <li>ru:俄语:zh(中文)、en(英语)</li>
60
+ # <li>fr:法语:zh(中文)、en(英语)</li>
61
+ # <li>de:德语:zh(中文)、en(英语)</li>
62
+ # <li>it:意大利语:zh(中文)、en(英语)</li>
63
+ # <li>es:西班牙语:zh(中文)、en(英语)</li>
64
+ # <li>pt:葡萄牙语:zh(中文)、en(英语)</li>
65
+ # <li>ms:马来西亚语:zh(中文)、en(英语)</li>
66
+ # <li>th:泰语:zh(中文)、en(英语)</li>
67
+ # <li>vi:越南语:zh(中文)、en(英语)</li>
68
+ # @type Target: String
69
+ # @param ProjectId: 项目ID,可以根据控制台-账号中心-项目管理中的配置填写,如无配置请填写默认项目ID:0
70
+ # @type ProjectId: Integer
71
+
72
+ attr_accessor :SessionUuid, :Scene, :Data, :Source, :Target, :ProjectId
73
+
74
+ def initialize(sessionuuid=nil, scene=nil, data=nil, source=nil, target=nil, projectid=nil)
75
+ @SessionUuid = sessionuuid
76
+ @Scene = scene
77
+ @Data = data
78
+ @Source = source
79
+ @Target = target
80
+ @ProjectId = projectid
81
+ end
82
+
83
+ def deserialize(params)
84
+ @SessionUuid = params['SessionUuid']
85
+ @Scene = params['Scene']
86
+ @Data = params['Data']
87
+ @Source = params['Source']
88
+ @Target = params['Target']
89
+ @ProjectId = params['ProjectId']
90
+ end
91
+ end
92
+
93
+ # ImageTranslate返回参数结构体
94
+ class ImageTranslateResponse < TencentCloud::Common::AbstractModel
95
+ # @param SessionUuid: 请求的SessionUuid返回
96
+ # @type SessionUuid: String
97
+ # @param Source: 源语言
98
+ # @type Source: String
99
+ # @param Target: 目标语言
100
+ # @type Target: String
101
+ # @param ImageRecord: 图片翻译结果,翻译结果按识别的文本每一行独立翻译,后续会推出按段落划分并翻译的版本
102
+ # @type ImageRecord: :class:`Tencentcloud::Tmt.v20180321.models.ImageRecord`
103
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
104
+ # @type RequestId: String
105
+
106
+ attr_accessor :SessionUuid, :Source, :Target, :ImageRecord, :RequestId
107
+
108
+ def initialize(sessionuuid=nil, source=nil, target=nil, imagerecord=nil, requestid=nil)
109
+ @SessionUuid = sessionuuid
110
+ @Source = source
111
+ @Target = target
112
+ @ImageRecord = imagerecord
113
+ @RequestId = requestid
114
+ end
115
+
116
+ def deserialize(params)
117
+ @SessionUuid = params['SessionUuid']
118
+ @Source = params['Source']
119
+ @Target = params['Target']
120
+ unless params['ImageRecord'].nil?
121
+ @ImageRecord = ImageRecord.new
122
+ @ImageRecord.deserialize(params['ImageRecord'])
123
+ end
124
+ @RequestId = params['RequestId']
125
+ end
126
+ end
127
+
128
+ # 翻译结果
129
+ class ItemValue < TencentCloud::Common::AbstractModel
130
+ # @param SourceText: 识别出的源文
131
+ # @type SourceText: String
132
+ # @param TargetText: 翻译后的译文
133
+ # @type TargetText: String
134
+ # @param X: X坐标
135
+ # @type X: Integer
136
+ # @param Y: Y坐标
137
+ # @type Y: Integer
138
+ # @param W: 宽度
139
+ # @type W: Integer
140
+ # @param H: 高度
141
+ # @type H: Integer
142
+
143
+ attr_accessor :SourceText, :TargetText, :X, :Y, :W, :H
144
+
145
+ def initialize(sourcetext=nil, targettext=nil, x=nil, y=nil, w=nil, h=nil)
146
+ @SourceText = sourcetext
147
+ @TargetText = targettext
148
+ @X = x
149
+ @Y = y
150
+ @W = w
151
+ @H = h
152
+ end
153
+
154
+ def deserialize(params)
155
+ @SourceText = params['SourceText']
156
+ @TargetText = params['TargetText']
157
+ @X = params['X']
158
+ @Y = params['Y']
159
+ @W = params['W']
160
+ @H = params['H']
161
+ end
162
+ end
163
+
164
+ # LanguageDetect请求参数结构体
165
+ class LanguageDetectRequest < TencentCloud::Common::AbstractModel
166
+ # @param Text: 待识别的文本,文本统一使用utf-8格式编码,非utf-8格式编码字符会翻译失败。单次请求的文本长度需要低于2000。
167
+ # @type Text: String
168
+ # @param ProjectId: 项目ID,可以根据控制台-账号中心-项目管理中的配置填写,如无配置请填写默认项目ID:0
169
+ # @type ProjectId: Integer
170
+
171
+ attr_accessor :Text, :ProjectId
172
+
173
+ def initialize(text=nil, projectid=nil)
174
+ @Text = text
175
+ @ProjectId = projectid
176
+ end
177
+
178
+ def deserialize(params)
179
+ @Text = params['Text']
180
+ @ProjectId = params['ProjectId']
181
+ end
182
+ end
183
+
184
+ # LanguageDetect返回参数结构体
185
+ class LanguageDetectResponse < TencentCloud::Common::AbstractModel
186
+ # @param Lang: 识别出的语言种类,参考语言列表
187
+ # <li> zh : 中文 </li> <li> en : 英文 </li><li> jp : 日语 </li> <li> kr : 韩语 </li><li> de : 德语 </li><li> fr : 法语 </li><li> es : 西班牙文 </li> <li> it : 意大利文 </li><li> tr : 土耳其文 </li><li> ru : 俄文 </li><li> pt : 葡萄牙文 </li><li> vi : 越南文 </li><li> id : 印度尼西亚文 </li><li> ms : 马来西亚文 </li><li> th : 泰文 </li>
188
+ # @type Lang: String
189
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
190
+ # @type RequestId: String
191
+
192
+ attr_accessor :Lang, :RequestId
193
+
194
+ def initialize(lang=nil, requestid=nil)
195
+ @Lang = lang
196
+ @RequestId = requestid
197
+ end
198
+
199
+ def deserialize(params)
200
+ @Lang = params['Lang']
201
+ @RequestId = params['RequestId']
202
+ end
203
+ end
204
+
205
+ # SpeechTranslate请求参数结构体
206
+ class SpeechTranslateRequest < TencentCloud::Common::AbstractModel
207
+ # @param SessionUuid: 一段完整的语音对应一个SessionUuid
208
+ # @type SessionUuid: String
209
+ # @param Source: 音频中的语言类型,支持语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
210
+ # @type Source: String
211
+ # @param Target: 翻译目标语言类型,支持的语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
212
+ # @type Target: String
213
+ # @param AudioFormat: pcm : 146 speex : 16779154 mp3 : 83886080
214
+ # @type AudioFormat: Integer
215
+ # @param Seq: 语音分片的序号,从0开始
216
+ # @type Seq: Integer
217
+ # @param IsEnd: 是否最后一片语音分片,0-否,1-是
218
+ # @type IsEnd: Integer
219
+ # @param Data: 语音分片内容进行 Base64 编码后的字符串。音频内容需包含有效并可识别的文本信息。
220
+ # @type Data: String
221
+ # @param ProjectId: 项目ID,可以根据控制台-账号中心-项目管理中的配置填写,如无配置请填写默认项目ID:0
222
+ # @type ProjectId: Integer
223
+ # @param Mode: 识别模式,该参数已废弃
224
+ # @type Mode: String
225
+ # @param TransType: 该参数已废弃
226
+ # @type TransType: Integer
227
+
228
+ attr_accessor :SessionUuid, :Source, :Target, :AudioFormat, :Seq, :IsEnd, :Data, :ProjectId, :Mode, :TransType
229
+
230
+ def initialize(sessionuuid=nil, source=nil, target=nil, audioformat=nil, seq=nil, isend=nil, data=nil, projectid=nil, mode=nil, transtype=nil)
231
+ @SessionUuid = sessionuuid
232
+ @Source = source
233
+ @Target = target
234
+ @AudioFormat = audioformat
235
+ @Seq = seq
236
+ @IsEnd = isend
237
+ @Data = data
238
+ @ProjectId = projectid
239
+ @Mode = mode
240
+ @TransType = transtype
241
+ end
242
+
243
+ def deserialize(params)
244
+ @SessionUuid = params['SessionUuid']
245
+ @Source = params['Source']
246
+ @Target = params['Target']
247
+ @AudioFormat = params['AudioFormat']
248
+ @Seq = params['Seq']
249
+ @IsEnd = params['IsEnd']
250
+ @Data = params['Data']
251
+ @ProjectId = params['ProjectId']
252
+ @Mode = params['Mode']
253
+ @TransType = params['TransType']
254
+ end
255
+ end
256
+
257
+ # SpeechTranslate返回参数结构体
258
+ class SpeechTranslateResponse < TencentCloud::Common::AbstractModel
259
+ # @param SessionUuid: 请求的SessionUuid直接返回
260
+ # @type SessionUuid: String
261
+ # @param RecognizeStatus: 语音识别状态 1-进行中 0-完成
262
+ # @type RecognizeStatus: Integer
263
+ # @param SourceText: 识别出的原文
264
+ # @type SourceText: String
265
+ # @param TargetText: 翻译出的译文
266
+ # @type TargetText: String
267
+ # @param Seq: 第几个语音分片
268
+ # @type Seq: Integer
269
+ # @param Source: 原语言
270
+ # @type Source: String
271
+ # @param Target: 目标语言
272
+ # @type Target: String
273
+ # @param VadSeq: 当请求的Mode参数填写bvad是,启动VadSeq。此时Seq会被设置为后台vad(静音检测)后的新序号,而VadSeq代表客户端原始Seq值
274
+ # @type VadSeq: Integer
275
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
276
+ # @type RequestId: String
277
+
278
+ attr_accessor :SessionUuid, :RecognizeStatus, :SourceText, :TargetText, :Seq, :Source, :Target, :VadSeq, :RequestId
279
+
280
+ def initialize(sessionuuid=nil, recognizestatus=nil, sourcetext=nil, targettext=nil, seq=nil, source=nil, target=nil, vadseq=nil, requestid=nil)
281
+ @SessionUuid = sessionuuid
282
+ @RecognizeStatus = recognizestatus
283
+ @SourceText = sourcetext
284
+ @TargetText = targettext
285
+ @Seq = seq
286
+ @Source = source
287
+ @Target = target
288
+ @VadSeq = vadseq
289
+ @RequestId = requestid
290
+ end
291
+
292
+ def deserialize(params)
293
+ @SessionUuid = params['SessionUuid']
294
+ @RecognizeStatus = params['RecognizeStatus']
295
+ @SourceText = params['SourceText']
296
+ @TargetText = params['TargetText']
297
+ @Seq = params['Seq']
298
+ @Source = params['Source']
299
+ @Target = params['Target']
300
+ @VadSeq = params['VadSeq']
301
+ @RequestId = params['RequestId']
302
+ end
303
+ end
304
+
305
+ # TextTranslateBatch请求参数结构体
306
+ class TextTranslateBatchRequest < TencentCloud::Common::AbstractModel
307
+ # @param Source: 源语言,支持:
308
+ # auto:自动识别(识别为一种语言)
309
+ # zh:简体中文
310
+ # zh-TW:繁体中文
311
+ # en:英语
312
+ # ja:日语
313
+ # ko:韩语
314
+ # fr:法语
315
+ # es:西班牙语
316
+ # it:意大利语
317
+ # de:德语
318
+ # tr:土耳其语
319
+ # ru:俄语
320
+ # pt:葡萄牙语
321
+ # vi:越南语
322
+ # id:印尼语
323
+ # th:泰语
324
+ # ms:马来西亚语
325
+ # ar:阿拉伯语
326
+ # hi:印地语
327
+ # @type Source: String
328
+ # @param Target: 目标语言,各源语言的目标语言支持列表如下
329
+
330
+ # <li> zh(简体中文):en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)</li>
331
+ # <li>zh-TW(繁体中文):en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)</li>
332
+ # <li>en(英语):zh(中文)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)、ar(阿拉伯语)、hi(印地语)</li>
333
+ # <li>ja(日语):zh(中文)、en(英语)、ko(韩语)</li>
334
+ # <li>ko(韩语):zh(中文)、en(英语)、ja(日语)</li>
335
+ # <li>fr(法语):zh(中文)、en(英语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
336
+ # <li>es(西班牙语):zh(中文)、en(英语)、fr(法语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
337
+ # <li>it(意大利语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
338
+ # <li>de(德语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
339
+ # <li>tr(土耳其语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、ru(俄语)、pt(葡萄牙语)</li>
340
+ # <li>ru(俄语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、pt(葡萄牙语)</li>
341
+ # <li>pt(葡萄牙语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)</li>
342
+ # <li>vi(越南语):zh(中文)、en(英语)</li>
343
+ # <li>id(印尼语):zh(中文)、en(英语)</li>
344
+ # <li>th(泰语):zh(中文)、en(英语)</li>
345
+ # <li>ms(马来语):zh(中文)、en(英语)</li>
346
+ # <li>ar(阿拉伯语):en(英语)</li>
347
+ # <li>hi(印地语):en(英语)</li>
348
+ # @type Target: String
349
+ # @param ProjectId: 项目ID,可以根据控制台-账号中心-项目管理中的配置填写,如无配置请填写默认项目ID:0
350
+ # @type ProjectId: Integer
351
+ # @param SourceTextList: 待翻译的文本列表,批量接口可以以数组方式在一次请求中填写多个待翻译文本。文本统一使用utf-8格式编码,非utf-8格式编码字符会翻译失败,请传入有效文本,html标记等非常规翻译文本可能会翻译失败。单次请求的文本长度总和需要低于2000。
352
+ # @type SourceTextList: Array
353
+
354
+ attr_accessor :Source, :Target, :ProjectId, :SourceTextList
355
+
356
+ def initialize(source=nil, target=nil, projectid=nil, sourcetextlist=nil)
357
+ @Source = source
358
+ @Target = target
359
+ @ProjectId = projectid
360
+ @SourceTextList = sourcetextlist
361
+ end
362
+
363
+ def deserialize(params)
364
+ @Source = params['Source']
365
+ @Target = params['Target']
366
+ @ProjectId = params['ProjectId']
367
+ @SourceTextList = params['SourceTextList']
368
+ end
369
+ end
370
+
371
+ # TextTranslateBatch返回参数结构体
372
+ class TextTranslateBatchResponse < TencentCloud::Common::AbstractModel
373
+ # @param Source: 源语言,详见入参Target
374
+ # @type Source: String
375
+ # @param Target: 目标语言,详见入参Target
376
+ # @type Target: String
377
+ # @param TargetTextList: 翻译后的文本列表
378
+ # @type TargetTextList: Array
379
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
380
+ # @type RequestId: String
381
+
382
+ attr_accessor :Source, :Target, :TargetTextList, :RequestId
383
+
384
+ def initialize(source=nil, target=nil, targettextlist=nil, requestid=nil)
385
+ @Source = source
386
+ @Target = target
387
+ @TargetTextList = targettextlist
388
+ @RequestId = requestid
389
+ end
390
+
391
+ def deserialize(params)
392
+ @Source = params['Source']
393
+ @Target = params['Target']
394
+ @TargetTextList = params['TargetTextList']
395
+ @RequestId = params['RequestId']
396
+ end
397
+ end
398
+
399
+ # TextTranslate请求参数结构体
400
+ class TextTranslateRequest < TencentCloud::Common::AbstractModel
401
+ # @param SourceText: 待翻译的文本,文本统一使用utf-8格式编码,非utf-8格式编码字符会翻译失败,请传入有效文本,html标记等非常规翻译文本可能会翻译失败。单次请求的文本长度需要低于2000。
402
+ # @type SourceText: String
403
+ # @param Source: 源语言,支持:
404
+ # auto:自动识别(识别为一种语言)
405
+ # zh:简体中文
406
+ # zh-TW:繁体中文
407
+ # en:英语
408
+ # ja:日语
409
+ # ko:韩语
410
+ # fr:法语
411
+ # es:西班牙语
412
+ # it:意大利语
413
+ # de:德语
414
+ # tr:土耳其语
415
+ # ru:俄语
416
+ # pt:葡萄牙语
417
+ # vi:越南语
418
+ # id:印尼语
419
+ # th:泰语
420
+ # ms:马来西亚语
421
+ # ar:阿拉伯语
422
+ # hi:印地语
423
+ # @type Source: String
424
+ # @param Target: 目标语言,各源语言的目标语言支持列表如下
425
+
426
+ # <li> zh(简体中文):en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)</li>
427
+ # <li>zh-TW(繁体中文):en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)</li>
428
+ # <li>en(英语):zh(中文)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)、ar(阿拉伯语)、hi(印地语)</li>
429
+ # <li>ja(日语):zh(中文)、en(英语)、ko(韩语)</li>
430
+ # <li>ko(韩语):zh(中文)、en(英语)、ja(日语)</li>
431
+ # <li>fr(法语):zh(中文)、en(英语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
432
+ # <li>es(西班牙语):zh(中文)、en(英语)、fr(法语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
433
+ # <li>it(意大利语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
434
+ # <li>de(德语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)</li>
435
+ # <li>tr(土耳其语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、ru(俄语)、pt(葡萄牙语)</li>
436
+ # <li>ru(俄语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、pt(葡萄牙语)</li>
437
+ # <li>pt(葡萄牙语):zh(中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)</li>
438
+ # <li>vi(越南语):zh(中文)、en(英语)</li>
439
+ # <li>id(印尼语):zh(中文)、en(英语)</li>
440
+ # <li>th(泰语):zh(中文)、en(英语)</li>
441
+ # <li>ms(马来语):zh(中文)、en(英语)</li>
442
+ # <li>ar(阿拉伯语):en(英语)</li>
443
+ # <li>hi(印地语):en(英语)</li>
444
+ # @type Target: String
445
+ # @param ProjectId: 项目ID,可以根据控制台-账号中心-项目管理中的配置填写,如无配置请填写默认项目ID:0
446
+ # @type ProjectId: Integer
447
+ # @param UntranslatedText: 用来标记不希望被翻译的文本内容,如句子中的特殊符号、人名、地名等;每次请求只支持配置一个不被翻译的单词;仅支持配置人名、地名等名词,不要配置动词或短语,否则会影响翻译结果。
448
+ # @type UntranslatedText: String
449
+
450
+ attr_accessor :SourceText, :Source, :Target, :ProjectId, :UntranslatedText
451
+
452
+ def initialize(sourcetext=nil, source=nil, target=nil, projectid=nil, untranslatedtext=nil)
453
+ @SourceText = sourcetext
454
+ @Source = source
455
+ @Target = target
456
+ @ProjectId = projectid
457
+ @UntranslatedText = untranslatedtext
458
+ end
459
+
460
+ def deserialize(params)
461
+ @SourceText = params['SourceText']
462
+ @Source = params['Source']
463
+ @Target = params['Target']
464
+ @ProjectId = params['ProjectId']
465
+ @UntranslatedText = params['UntranslatedText']
466
+ end
467
+ end
468
+
469
+ # TextTranslate返回参数结构体
470
+ class TextTranslateResponse < TencentCloud::Common::AbstractModel
471
+ # @param TargetText: 翻译后的文本
472
+ # @type TargetText: String
473
+ # @param Source: 源语言,详见入参Target
474
+ # @type Source: String
475
+ # @param Target: 目标语言,详见入参Target
476
+ # @type Target: String
477
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
478
+ # @type RequestId: String
479
+
480
+ attr_accessor :TargetText, :Source, :Target, :RequestId
481
+
482
+ def initialize(targettext=nil, source=nil, target=nil, requestid=nil)
483
+ @TargetText = targettext
484
+ @Source = source
485
+ @Target = target
486
+ @RequestId = requestid
487
+ end
488
+
489
+ def deserialize(params)
490
+ @TargetText = params['TargetText']
491
+ @Source = params['Source']
492
+ @Target = params['Target']
493
+ @RequestId = params['RequestId']
494
+ end
495
+ end
496
+
497
+ end
498
+ end
499
+ end
500
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-tmt
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
+ TMT.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/VERSION
37
+ - lib/tencentcloud-sdk-tmt.rb
38
+ - lib/v20180321/client.rb
39
+ - lib/v20180321/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-tmt
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 - TMT
66
+ test_files: []