tencentcloud-sdk-ams 1.0.200
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-ams.rb +14 -0
- data/lib/v20200608/client.rb +231 -0
- data/lib/v20200608/models.rb +1503 -0
- data/lib/v20201229/client.rb +192 -0
- data/lib/v20201229/models.rb +1055 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4c62105f83c641d1f7842fb810048b2616a34798
|
4
|
+
data.tar.gz: ac38251b0a4d74adc79b65bf756fa2d6cd170c30
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 99af26adc782e6041928f5f4c3697adea0677b24d8e9232ad737edde2259ae04765c058cbc2cb21929c4f18349c33891ace6bebb5e8c6acf380b062fb01ebf0f
|
7
|
+
data.tar.gz: 1e443e9d04aaad230620de509903c2e9cdec787036487766b7e1b1abe5f832eaed704de0c891200328c2d06e56d06d078bc94842008af50b86b0e4ecb1235f53
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.200
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tencentcloud-sdk-common'
|
4
|
+
|
5
|
+
require_relative 'v20201229/client'
|
6
|
+
require_relative 'v20201229/models'
|
7
|
+
|
8
|
+
require_relative 'v20200608/client'
|
9
|
+
require_relative 'v20200608/models'
|
10
|
+
|
11
|
+
module TencentCloud
|
12
|
+
module Ams
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,231 @@
|
|
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 Ams
|
21
|
+
module V20200608
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2020-06-08'
|
26
|
+
api_endpoint = 'ams.tencentcloudapi.com'
|
27
|
+
sdk_version = 'AMS_' + 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 CancelTask.
|
35
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::CancelTaskRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::CancelTaskResponse`
|
37
|
+
def CancelTask(request)
|
38
|
+
body = send_request('CancelTask', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = CancelTaskResponse.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
|
+
# 本接口(Audio Moderation)用于提交音频内容(包括音频文件或流地址)进行智能审核任务,使用前请您登陆控制台开通音频内容安全服务。
|
57
|
+
|
58
|
+
# ### 功能使用说明:
|
59
|
+
# - 前往“内容安全控制台-音频内容安全”开启使用音频内容安全服务,首次开通可获得20小时免费调用时长
|
60
|
+
|
61
|
+
# ### 接口功能说明:
|
62
|
+
# - 支持对音频流或音频文件进行检测,判断其中是否包含违规内容;
|
63
|
+
# - 支持设置回调地址 Callback 获取检测结果,或通过接口(查询音频检测结果)主动轮询获取检测结果;
|
64
|
+
# - 支持识别违规内容,包括:低俗、谩骂、色情、涉政、广告等场景;
|
65
|
+
# - 支持批量提交检测任务。检测任务列表最多支持10个;
|
66
|
+
|
67
|
+
# ### 音频文件调用说明:
|
68
|
+
# - 音频文件大小支持:文件 < 500M;
|
69
|
+
# - 音频文件时长支持:< 1小时;
|
70
|
+
# - 音频码率类型支持:128 Kbps - 256 Kbps ;
|
71
|
+
# - 音频文件支持格式:wav、mp3、aac、flac、amr、3gp、 m4a、wma、ogg、ape;
|
72
|
+
# - 支持音视频文件分离并对音频文件进行独立识别;
|
73
|
+
|
74
|
+
# ### 音频流调用说明:
|
75
|
+
# - 音频流时长支持:< 3小时;
|
76
|
+
# - 音频码率类型支持:128 Kbps - 256 Kbps ;
|
77
|
+
# - 音频流支持的传输协议:RTMP、HTTP、HTTPS;
|
78
|
+
# - 音频流格式支持的类型:rtp、srtp、rtmp、rtmps、mmsh、 mmst、hls、http、tcp、https、m3u8;
|
79
|
+
# - 支持音视频流分离并对音频流进行独立识别;
|
80
|
+
|
81
|
+
# @param request: Request instance for CreateAudioModerationTask.
|
82
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::CreateAudioModerationTaskRequest`
|
83
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::CreateAudioModerationTaskResponse`
|
84
|
+
def CreateAudioModerationTask(request)
|
85
|
+
body = send_request('CreateAudioModerationTask', request.serialize)
|
86
|
+
response = JSON.parse(body)
|
87
|
+
if response['Response'].key?('Error') == false
|
88
|
+
model = CreateAudioModerationTaskResponse.new
|
89
|
+
model.deserialize(response['Response'])
|
90
|
+
model
|
91
|
+
else
|
92
|
+
code = response['Response']['Error']['Code']
|
93
|
+
message = response['Response']['Error']['Message']
|
94
|
+
reqid = response['Response']['RequestId']
|
95
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
96
|
+
end
|
97
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
98
|
+
raise e
|
99
|
+
rescue StandardError => e
|
100
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
101
|
+
end
|
102
|
+
|
103
|
+
# 创建业务配置,1个账号最多可以创建20个配置,可定义音频审核的场景,如色情、谩骂等,
|
104
|
+
|
105
|
+
# 在创建业务配置之前,你需要以下步骤:
|
106
|
+
# 1. 开通COS存储桶功能,新建存储桶,例如 cms_segments,用来存储 视频转换过程中生成对音频和图片。
|
107
|
+
# 2. 然后在COS控制台,授权天御内容安全主账号 对 cms_segments 存储桶对读写权限。具体授权操作,参考https://cloud.tencent.com/document/product/436/38648
|
108
|
+
|
109
|
+
# @param request: Request instance for CreateBizConfig.
|
110
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::CreateBizConfigRequest`
|
111
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::CreateBizConfigResponse`
|
112
|
+
def CreateBizConfig(request)
|
113
|
+
body = send_request('CreateBizConfig', request.serialize)
|
114
|
+
response = JSON.parse(body)
|
115
|
+
if response['Response'].key?('Error') == false
|
116
|
+
model = CreateBizConfigResponse.new
|
117
|
+
model.deserialize(response['Response'])
|
118
|
+
model
|
119
|
+
else
|
120
|
+
code = response['Response']['Error']['Code']
|
121
|
+
message = response['Response']['Error']['Message']
|
122
|
+
reqid = response['Response']['RequestId']
|
123
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
124
|
+
end
|
125
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
126
|
+
raise e
|
127
|
+
rescue StandardError => e
|
128
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
129
|
+
end
|
130
|
+
|
131
|
+
# 音频审核明细列表
|
132
|
+
|
133
|
+
# @param request: Request instance for DescribeAmsList.
|
134
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::DescribeAmsListRequest`
|
135
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::DescribeAmsListResponse`
|
136
|
+
def DescribeAmsList(request)
|
137
|
+
body = send_request('DescribeAmsList', request.serialize)
|
138
|
+
response = JSON.parse(body)
|
139
|
+
if response['Response'].key?('Error') == false
|
140
|
+
model = DescribeAmsListResponse.new
|
141
|
+
model.deserialize(response['Response'])
|
142
|
+
model
|
143
|
+
else
|
144
|
+
code = response['Response']['Error']['Code']
|
145
|
+
message = response['Response']['Error']['Message']
|
146
|
+
reqid = response['Response']['RequestId']
|
147
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
148
|
+
end
|
149
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
150
|
+
raise e
|
151
|
+
rescue StandardError => e
|
152
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
153
|
+
end
|
154
|
+
|
155
|
+
# 控制台识别统计
|
156
|
+
|
157
|
+
# @param request: Request instance for DescribeAudioStat.
|
158
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::DescribeAudioStatRequest`
|
159
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::DescribeAudioStatResponse`
|
160
|
+
def DescribeAudioStat(request)
|
161
|
+
body = send_request('DescribeAudioStat', request.serialize)
|
162
|
+
response = JSON.parse(body)
|
163
|
+
if response['Response'].key?('Error') == false
|
164
|
+
model = DescribeAudioStatResponse.new
|
165
|
+
model.deserialize(response['Response'])
|
166
|
+
model
|
167
|
+
else
|
168
|
+
code = response['Response']['Error']['Code']
|
169
|
+
message = response['Response']['Error']['Message']
|
170
|
+
reqid = response['Response']['RequestId']
|
171
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
172
|
+
end
|
173
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
174
|
+
raise e
|
175
|
+
rescue StandardError => e
|
176
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
177
|
+
end
|
178
|
+
|
179
|
+
# 查看单个配置
|
180
|
+
|
181
|
+
# @param request: Request instance for DescribeBizConfig.
|
182
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::DescribeBizConfigRequest`
|
183
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::DescribeBizConfigResponse`
|
184
|
+
def DescribeBizConfig(request)
|
185
|
+
body = send_request('DescribeBizConfig', request.serialize)
|
186
|
+
response = JSON.parse(body)
|
187
|
+
if response['Response'].key?('Error') == false
|
188
|
+
model = DescribeBizConfigResponse.new
|
189
|
+
model.deserialize(response['Response'])
|
190
|
+
model
|
191
|
+
else
|
192
|
+
code = response['Response']['Error']['Code']
|
193
|
+
message = response['Response']['Error']['Message']
|
194
|
+
reqid = response['Response']['RequestId']
|
195
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
196
|
+
end
|
197
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
198
|
+
raise e
|
199
|
+
rescue StandardError => e
|
200
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
201
|
+
end
|
202
|
+
|
203
|
+
# 查看任务详情
|
204
|
+
|
205
|
+
# @param request: Request instance for DescribeTaskDetail.
|
206
|
+
# @type request: :class:`Tencentcloud::ams::V20200608::DescribeTaskDetailRequest`
|
207
|
+
# @rtype: :class:`Tencentcloud::ams::V20200608::DescribeTaskDetailResponse`
|
208
|
+
def DescribeTaskDetail(request)
|
209
|
+
body = send_request('DescribeTaskDetail', request.serialize)
|
210
|
+
response = JSON.parse(body)
|
211
|
+
if response['Response'].key?('Error') == false
|
212
|
+
model = DescribeTaskDetailResponse.new
|
213
|
+
model.deserialize(response['Response'])
|
214
|
+
model
|
215
|
+
else
|
216
|
+
code = response['Response']['Error']['Code']
|
217
|
+
message = response['Response']['Error']['Message']
|
218
|
+
reqid = response['Response']['RequestId']
|
219
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
220
|
+
end
|
221
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
222
|
+
raise e
|
223
|
+
rescue StandardError => e
|
224
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
225
|
+
end
|
226
|
+
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|