tencentcloud-sdk-vtc 3.0.824

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: f840f7f32a1ac8c8a55b20243b42338c453bf3b2
4
+ data.tar.gz: 331c564c2778269189f28340ddc3f0f1b26d1ee7
5
+ SHA512:
6
+ metadata.gz: 3d7f218473d54c6e7ccdc765514e0e9081b8e77893f423b015beb7b6d008b86f8d2fcb5f50c8817b9f8f3caf6e0ca4fac32924ac0d6df078ade7badcab3e4e15
7
+ data.tar.gz: f8f044088adb863109bf7d2c6553b4698cbb3174aefe08d4225738617b1ce04df1993c1ef6eccea2593814221f42c36acce77b978277143299ed8d3b5b7a79fb
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 3.0.824
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20240223/client'
6
+ require_relative 'v20240223/models'
7
+
8
+ module TencentCloud
9
+ module Vtc
10
+ end
11
+ end
@@ -0,0 +1,108 @@
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 Vtc
21
+ module V20240223
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2024-02-23'
26
+ api_endpoint = 'vtc.tencentcloudapi.com'
27
+ sdk_version = 'VTC_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 确认视频翻译结果
33
+
34
+ # @param request: Request instance for ConfirmVideoTranslateJob.
35
+ # @type request: :class:`Tencentcloud::vtc::V20240223::ConfirmVideoTranslateJobRequest`
36
+ # @rtype: :class:`Tencentcloud::vtc::V20240223::ConfirmVideoTranslateJobResponse`
37
+ def ConfirmVideoTranslateJob(request)
38
+ body = send_request('ConfirmVideoTranslateJob', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = ConfirmVideoTranslateJobResponse.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
+ # 查询视频翻译任务
57
+
58
+ # @param request: Request instance for DescribeVideoTranslateJob.
59
+ # @type request: :class:`Tencentcloud::vtc::V20240223::DescribeVideoTranslateJobRequest`
60
+ # @rtype: :class:`Tencentcloud::vtc::V20240223::DescribeVideoTranslateJobResponse`
61
+ def DescribeVideoTranslateJob(request)
62
+ body = send_request('DescribeVideoTranslateJob', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = DescribeVideoTranslateJobResponse.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
+
82
+ # @param request: Request instance for SubmitVideoTranslateJob.
83
+ # @type request: :class:`Tencentcloud::vtc::V20240223::SubmitVideoTranslateJobRequest`
84
+ # @rtype: :class:`Tencentcloud::vtc::V20240223::SubmitVideoTranslateJobResponse`
85
+ def SubmitVideoTranslateJob(request)
86
+ body = send_request('SubmitVideoTranslateJob', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = SubmitVideoTranslateJobResponse.new
90
+ model.deserialize(response['Response'])
91
+ model
92
+ else
93
+ code = response['Response']['Error']['Code']
94
+ message = response['Response']['Error']['Message']
95
+ reqid = response['Response']['RequestId']
96
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
97
+ end
98
+ rescue TencentCloud::Common::TencentCloudSDKException => e
99
+ raise e
100
+ rescue StandardError => e
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
102
+ end
103
+
104
+
105
+ end
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,301 @@
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 Vtc
19
+ module V20240223
20
+ # 文本片段及其时间戳
21
+ class AsrTimestamps < TencentCloud::Common::AbstractModel
22
+ # @param Text: 文本片段
23
+ # 注意:此字段可能返回 null,表示取不到有效值。
24
+ # @type Text: String
25
+ # @param StartMs: 开始时间
26
+ # 注意:此字段可能返回 null,表示取不到有效值。
27
+ # @type StartMs: Integer
28
+ # @param EndMs: 结束时间
29
+ # 注意:此字段可能返回 null,表示取不到有效值。
30
+ # @type EndMs: Integer
31
+
32
+ attr_accessor :Text, :StartMs, :EndMs
33
+
34
+ def initialize(text=nil, startms=nil, endms=nil)
35
+ @Text = text
36
+ @StartMs = startms
37
+ @EndMs = endms
38
+ end
39
+
40
+ def deserialize(params)
41
+ @Text = params['Text']
42
+ @StartMs = params['StartMs']
43
+ @EndMs = params['EndMs']
44
+ end
45
+ end
46
+
47
+ # 音频翻译结果
48
+ class AudioTranslateResult < TencentCloud::Common::AbstractModel
49
+ # @param SourceText: 原文本
50
+ # @type SourceText: String
51
+ # @param TargetText: 目标文本
52
+ # @type TargetText: String
53
+
54
+ attr_accessor :SourceText, :TargetText
55
+
56
+ def initialize(sourcetext=nil, targettext=nil)
57
+ @SourceText = sourcetext
58
+ @TargetText = targettext
59
+ end
60
+
61
+ def deserialize(params)
62
+ @SourceText = params['SourceText']
63
+ @TargetText = params['TargetText']
64
+ end
65
+ end
66
+
67
+ # ConfirmVideoTranslateJob请求参数结构体
68
+ class ConfirmVideoTranslateJobRequest < TencentCloud::Common::AbstractModel
69
+ # @param JobId: 视频翻译任务 ID
70
+ # @type JobId: String
71
+ # @param TranslateResults: 待确认文本
72
+ # @type TranslateResults: Array
73
+
74
+ attr_accessor :JobId, :TranslateResults
75
+
76
+ def initialize(jobid=nil, translateresults=nil)
77
+ @JobId = jobid
78
+ @TranslateResults = translateresults
79
+ end
80
+
81
+ def deserialize(params)
82
+ @JobId = params['JobId']
83
+ unless params['TranslateResults'].nil?
84
+ @TranslateResults = []
85
+ params['TranslateResults'].each do |i|
86
+ audiotranslateresult_tmp = AudioTranslateResult.new
87
+ audiotranslateresult_tmp.deserialize(i)
88
+ @TranslateResults << audiotranslateresult_tmp
89
+ end
90
+ end
91
+ end
92
+ end
93
+
94
+ # ConfirmVideoTranslateJob返回参数结构体
95
+ class ConfirmVideoTranslateJobResponse < TencentCloud::Common::AbstractModel
96
+ # @param JobId: 视频翻译任务 ID
97
+ # @type JobId: String
98
+ # @param TaskId: 音频转换任务 ID
99
+ # @type TaskId: String
100
+ # @param SessionId: 音频翻译结果确认 session
101
+ # @type SessionId: String
102
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
103
+ # @type RequestId: String
104
+
105
+ attr_accessor :JobId, :TaskId, :SessionId, :RequestId
106
+
107
+ def initialize(jobid=nil, taskid=nil, sessionid=nil, requestid=nil)
108
+ @JobId = jobid
109
+ @TaskId = taskid
110
+ @SessionId = sessionid
111
+ @RequestId = requestid
112
+ end
113
+
114
+ def deserialize(params)
115
+ @JobId = params['JobId']
116
+ @TaskId = params['TaskId']
117
+ @SessionId = params['SessionId']
118
+ @RequestId = params['RequestId']
119
+ end
120
+ end
121
+
122
+ # DescribeVideoTranslateJob请求参数结构体
123
+ class DescribeVideoTranslateJobRequest < TencentCloud::Common::AbstractModel
124
+ # @param JobId: JobId。
125
+ # @type JobId: String
126
+
127
+ attr_accessor :JobId
128
+
129
+ def initialize(jobid=nil)
130
+ @JobId = jobid
131
+ end
132
+
133
+ def deserialize(params)
134
+ @JobId = params['JobId']
135
+ end
136
+ end
137
+
138
+ # DescribeVideoTranslateJob返回参数结构体
139
+ class DescribeVideoTranslateJobResponse < TencentCloud::Common::AbstractModel
140
+ # @param JobStatus: 任务状态。 1:音频翻译中。 2:音频翻译失败。 3:音频翻译成功。 4:音频结果待确认。 5:音频结果已确认完毕。6:视频翻译中。 7:视频翻译失败。 8:视频翻译成功。
141
+ # @type JobStatus: Integer
142
+ # @param JobErrorCode: 任务错误码。
143
+ # @type JobErrorCode: String
144
+ # @param JobErrorMsg: 任务错误信息。
145
+ # @type JobErrorMsg: String
146
+ # @param ResultVideoUrl: 视频翻译结果。
147
+ # @type ResultVideoUrl: String
148
+ # @param TranslateResults: 音频翻译结果。
149
+ # @type TranslateResults: Array
150
+ # @param JobConfirm: 是否需要确认翻译结果。0:不需要,1:需要
151
+ # @type JobConfirm: Integer
152
+ # @param JobAudioTaskId: 音频任务 ID
153
+ # @type JobAudioTaskId: String
154
+ # @param JobVideoModerationId: 视频审核任务ID
155
+ # @type JobVideoModerationId: String
156
+ # @param JobVideoId: 视频生成任务 ID
157
+ # @type JobVideoId: String
158
+ # @param OriginalVideoUrl: 视频素材原始 URL
159
+ # @type OriginalVideoUrl: String
160
+ # @param AsrTimestamps: 文本片段及其时间戳
161
+ # @type AsrTimestamps: Array
162
+ # @param JobSubmitReqId: 提交视频翻译任务时的 requestId
163
+ # @type JobSubmitReqId: String
164
+ # @param JobAudioModerationId: 音频审核任务 ID
165
+ # @type JobAudioModerationId: String
166
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
167
+ # @type RequestId: String
168
+
169
+ attr_accessor :JobStatus, :JobErrorCode, :JobErrorMsg, :ResultVideoUrl, :TranslateResults, :JobConfirm, :JobAudioTaskId, :JobVideoModerationId, :JobVideoId, :OriginalVideoUrl, :AsrTimestamps, :JobSubmitReqId, :JobAudioModerationId, :RequestId
170
+
171
+ def initialize(jobstatus=nil, joberrorcode=nil, joberrormsg=nil, resultvideourl=nil, translateresults=nil, jobconfirm=nil, jobaudiotaskid=nil, jobvideomoderationid=nil, jobvideoid=nil, originalvideourl=nil, asrtimestamps=nil, jobsubmitreqid=nil, jobaudiomoderationid=nil, requestid=nil)
172
+ @JobStatus = jobstatus
173
+ @JobErrorCode = joberrorcode
174
+ @JobErrorMsg = joberrormsg
175
+ @ResultVideoUrl = resultvideourl
176
+ @TranslateResults = translateresults
177
+ @JobConfirm = jobconfirm
178
+ @JobAudioTaskId = jobaudiotaskid
179
+ @JobVideoModerationId = jobvideomoderationid
180
+ @JobVideoId = jobvideoid
181
+ @OriginalVideoUrl = originalvideourl
182
+ @AsrTimestamps = asrtimestamps
183
+ @JobSubmitReqId = jobsubmitreqid
184
+ @JobAudioModerationId = jobaudiomoderationid
185
+ @RequestId = requestid
186
+ end
187
+
188
+ def deserialize(params)
189
+ @JobStatus = params['JobStatus']
190
+ @JobErrorCode = params['JobErrorCode']
191
+ @JobErrorMsg = params['JobErrorMsg']
192
+ @ResultVideoUrl = params['ResultVideoUrl']
193
+ unless params['TranslateResults'].nil?
194
+ @TranslateResults = []
195
+ params['TranslateResults'].each do |i|
196
+ translateresult_tmp = TranslateResult.new
197
+ translateresult_tmp.deserialize(i)
198
+ @TranslateResults << translateresult_tmp
199
+ end
200
+ end
201
+ @JobConfirm = params['JobConfirm']
202
+ @JobAudioTaskId = params['JobAudioTaskId']
203
+ @JobVideoModerationId = params['JobVideoModerationId']
204
+ @JobVideoId = params['JobVideoId']
205
+ @OriginalVideoUrl = params['OriginalVideoUrl']
206
+ unless params['AsrTimestamps'].nil?
207
+ @AsrTimestamps = []
208
+ params['AsrTimestamps'].each do |i|
209
+ asrtimestamps_tmp = AsrTimestamps.new
210
+ asrtimestamps_tmp.deserialize(i)
211
+ @AsrTimestamps << asrtimestamps_tmp
212
+ end
213
+ end
214
+ @JobSubmitReqId = params['JobSubmitReqId']
215
+ @JobAudioModerationId = params['JobAudioModerationId']
216
+ @RequestId = params['RequestId']
217
+ end
218
+ end
219
+
220
+ # SubmitVideoTranslateJob请求参数结构体
221
+ class SubmitVideoTranslateJobRequest < TencentCloud::Common::AbstractModel
222
+ # @param VideoUrl: 视频地址URL。
223
+ # @type VideoUrl: String
224
+ # @param SrcLang: 源语言:zh, en
225
+ # @type SrcLang: String
226
+ # @param DstLang: 目标语言:zh, en
227
+ # @type DstLang: String
228
+ # @param AudioUrl: 当音频 URL 不为空时,默认以音频驱动视频任务口型
229
+ # @type AudioUrl: String
230
+ # @param Confirm: 是否需要确认翻译结果0:不需要,1:需要
231
+ # @type Confirm: Integer
232
+ # @param LipSync: 是否开启口型驱动,0:不开启,1:开启。默认开启。
233
+ # @type LipSync: Integer
234
+
235
+ attr_accessor :VideoUrl, :SrcLang, :DstLang, :AudioUrl, :Confirm, :LipSync
236
+
237
+ def initialize(videourl=nil, srclang=nil, dstlang=nil, audiourl=nil, confirm=nil, lipsync=nil)
238
+ @VideoUrl = videourl
239
+ @SrcLang = srclang
240
+ @DstLang = dstlang
241
+ @AudioUrl = audiourl
242
+ @Confirm = confirm
243
+ @LipSync = lipsync
244
+ end
245
+
246
+ def deserialize(params)
247
+ @VideoUrl = params['VideoUrl']
248
+ @SrcLang = params['SrcLang']
249
+ @DstLang = params['DstLang']
250
+ @AudioUrl = params['AudioUrl']
251
+ @Confirm = params['Confirm']
252
+ @LipSync = params['LipSync']
253
+ end
254
+ end
255
+
256
+ # SubmitVideoTranslateJob返回参数结构体
257
+ class SubmitVideoTranslateJobResponse < TencentCloud::Common::AbstractModel
258
+ # @param JobId: 任务ID。
259
+ # @type JobId: String
260
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
261
+ # @type RequestId: String
262
+
263
+ attr_accessor :JobId, :RequestId
264
+
265
+ def initialize(jobid=nil, requestid=nil)
266
+ @JobId = jobid
267
+ @RequestId = requestid
268
+ end
269
+
270
+ def deserialize(params)
271
+ @JobId = params['JobId']
272
+ @RequestId = params['RequestId']
273
+ end
274
+ end
275
+
276
+ # 音频翻译结果。
277
+ class TranslateResult < TencentCloud::Common::AbstractModel
278
+ # @param SourceText: 翻译源文字。
279
+ # 注意:此字段可能返回 null,表示取不到有效值。
280
+ # @type SourceText: String
281
+ # @param TargetText: 翻译后文字。
282
+ # 注意:此字段可能返回 null,表示取不到有效值。
283
+ # @type TargetText: String
284
+
285
+ attr_accessor :SourceText, :TargetText
286
+
287
+ def initialize(sourcetext=nil, targettext=nil)
288
+ @SourceText = sourcetext
289
+ @TargetText = targettext
290
+ end
291
+
292
+ def deserialize(params)
293
+ @SourceText = params['SourceText']
294
+ @TargetText = params['TargetText']
295
+ end
296
+ end
297
+
298
+ end
299
+ end
300
+ end
301
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-vtc
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.824
5
+ platform: ruby
6
+ authors:
7
+ - Tencent Cloud
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-05-16 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: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.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
+ VTC.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/tencentcloud-sdk-vtc.rb
37
+ - lib/v20240223/models.rb
38
+ - lib/v20240223/client.rb
39
+ - lib/VERSION
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-vtc
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.0.14
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Tencent Cloud SDK for Ruby - VTC
66
+ test_files: []