tencentcloud-sdk-cms 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: 6607f74be0fe5c348f7a2c41041e486f4d1741bb
4
+ data.tar.gz: 292f28580141dbb84c868bcb9928bd25b2004085
5
+ SHA512:
6
+ metadata.gz: 60784a2395e5c1369e9fedd586b31072f83e45214a5df13acc1614ea9fc6e7ce8ebb93ffb253598d6e4dfab43326b655410305fa70f6e8b2a4ffc4b91b54f7c9
7
+ data.tar.gz: 5716f0626eaf345298f2ec569d9492a8a1d2cc68af06f01961d2aa66158a5bde6ed364803ce33652815a565f2c918232b9369d5db8e1b5b1b849f3957e06393d
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 'v20190321/client'
6
+ require_relative 'v20190321/models'
7
+
8
+ module TencentCloud
9
+ module Cms
10
+ end
11
+ end
@@ -0,0 +1,264 @@
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 Cms
21
+ module V20190321
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2019-03-21'
26
+ api_endpoint = 'cms.tencentcloudapi.com'
27
+ sdk_version = 'CMS_' + 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
+ # <br>
34
+ # 通过该接口可以将图片新增到样本库。
35
+
36
+ # @param request: Request instance for CreateFileSample.
37
+ # @type request: :class:`Tencentcloud::cms::V20190321::CreateFileSampleRequest`
38
+ # @rtype: :class:`Tencentcloud::cms::V20190321::CreateFileSampleResponse`
39
+ def CreateFileSample(request)
40
+ body = send_request('CreateFileSample', request.serialize)
41
+ response = JSON.parse(body)
42
+ if response['Response'].key?('Error') == false
43
+ model = CreateFileSampleResponse.new
44
+ model.deserialize(response['Response'])
45
+ model
46
+ else
47
+ code = response['Response']['Error']['Code']
48
+ message = response['Response']['Error']['Message']
49
+ reqid = response['Response']['RequestId']
50
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
51
+ end
52
+ rescue TencentCloud::Common::TencentCloudSDKException => e
53
+ raise e
54
+ rescue StandardError => e
55
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
56
+ end
57
+
58
+ # 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
59
+ # <br>
60
+ # 通过该接口可以将文本新增到样本库。
61
+
62
+ # @param request: Request instance for CreateTextSample.
63
+ # @type request: :class:`Tencentcloud::cms::V20190321::CreateTextSampleRequest`
64
+ # @rtype: :class:`Tencentcloud::cms::V20190321::CreateTextSampleResponse`
65
+ def CreateTextSample(request)
66
+ body = send_request('CreateTextSample', request.serialize)
67
+ response = JSON.parse(body)
68
+ if response['Response'].key?('Error') == false
69
+ model = CreateTextSampleResponse.new
70
+ model.deserialize(response['Response'])
71
+ model
72
+ else
73
+ code = response['Response']['Error']['Code']
74
+ message = response['Response']['Error']['Message']
75
+ reqid = response['Response']['RequestId']
76
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
77
+ end
78
+ rescue TencentCloud::Common::TencentCloudSDKException => e
79
+ raise e
80
+ rescue StandardError => e
81
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
82
+ end
83
+
84
+ # 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
85
+ # <br>
86
+ # 删除图片样本库,支持批量删除,一次提交不超过20个。
87
+
88
+ # @param request: Request instance for DeleteFileSample.
89
+ # @type request: :class:`Tencentcloud::cms::V20190321::DeleteFileSampleRequest`
90
+ # @rtype: :class:`Tencentcloud::cms::V20190321::DeleteFileSampleResponse`
91
+ def DeleteFileSample(request)
92
+ body = send_request('DeleteFileSample', request.serialize)
93
+ response = JSON.parse(body)
94
+ if response['Response'].key?('Error') == false
95
+ model = DeleteFileSampleResponse.new
96
+ model.deserialize(response['Response'])
97
+ model
98
+ else
99
+ code = response['Response']['Error']['Code']
100
+ message = response['Response']['Error']['Message']
101
+ reqid = response['Response']['RequestId']
102
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
103
+ end
104
+ rescue TencentCloud::Common::TencentCloudSDKException => e
105
+ raise e
106
+ rescue StandardError => e
107
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
108
+ end
109
+
110
+ # 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
111
+ # <br>
112
+ # 删除文本样本库,暂时只支持单个删除。
113
+
114
+ # @param request: Request instance for DeleteTextSample.
115
+ # @type request: :class:`Tencentcloud::cms::V20190321::DeleteTextSampleRequest`
116
+ # @rtype: :class:`Tencentcloud::cms::V20190321::DeleteTextSampleResponse`
117
+ def DeleteTextSample(request)
118
+ body = send_request('DeleteTextSample', request.serialize)
119
+ response = JSON.parse(body)
120
+ if response['Response'].key?('Error') == false
121
+ model = DeleteTextSampleResponse.new
122
+ model.deserialize(response['Response'])
123
+ model
124
+ else
125
+ code = response['Response']['Error']['Code']
126
+ message = response['Response']['Error']['Message']
127
+ reqid = response['Response']['RequestId']
128
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
129
+ end
130
+ rescue TencentCloud::Common::TencentCloudSDKException => e
131
+ raise e
132
+ rescue StandardError => e
133
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
134
+ end
135
+
136
+ # 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
137
+ # <br>
138
+ # 查询图片样本库,支持批量查询。
139
+
140
+ # @param request: Request instance for DescribeFileSample.
141
+ # @type request: :class:`Tencentcloud::cms::V20190321::DescribeFileSampleRequest`
142
+ # @rtype: :class:`Tencentcloud::cms::V20190321::DescribeFileSampleResponse`
143
+ def DescribeFileSample(request)
144
+ body = send_request('DescribeFileSample', request.serialize)
145
+ response = JSON.parse(body)
146
+ if response['Response'].key?('Error') == false
147
+ model = DescribeFileSampleResponse.new
148
+ model.deserialize(response['Response'])
149
+ model
150
+ else
151
+ code = response['Response']['Error']['Code']
152
+ message = response['Response']['Error']['Message']
153
+ reqid = response['Response']['RequestId']
154
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
155
+ end
156
+ rescue TencentCloud::Common::TencentCloudSDKException => e
157
+ raise e
158
+ rescue StandardError => e
159
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
160
+ end
161
+
162
+ # 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
163
+ # <br>
164
+ # 支持批量查询文本样本库。
165
+
166
+ # @param request: Request instance for DescribeTextSample.
167
+ # @type request: :class:`Tencentcloud::cms::V20190321::DescribeTextSampleRequest`
168
+ # @rtype: :class:`Tencentcloud::cms::V20190321::DescribeTextSampleResponse`
169
+ def DescribeTextSample(request)
170
+ body = send_request('DescribeTextSample', request.serialize)
171
+ response = JSON.parse(body)
172
+ if response['Response'].key?('Error') == false
173
+ model = DescribeTextSampleResponse.new
174
+ model.deserialize(response['Response'])
175
+ model
176
+ else
177
+ code = response['Response']['Error']['Code']
178
+ message = response['Response']['Error']['Message']
179
+ reqid = response['Response']['RequestId']
180
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
181
+ end
182
+ rescue TencentCloud::Common::TencentCloudSDKException => e
183
+ raise e
184
+ rescue StandardError => e
185
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
186
+ end
187
+
188
+ # 图片内容检测服务(Image Moderation, IM)能自动扫描图片,识别涉黄、涉恐、涉政、涉毒等有害内容,同时支持用户配置图片黑名单,打击自定义的违规图片。
189
+
190
+ # @param request: Request instance for ImageModeration.
191
+ # @type request: :class:`Tencentcloud::cms::V20190321::ImageModerationRequest`
192
+ # @rtype: :class:`Tencentcloud::cms::V20190321::ImageModerationResponse`
193
+ def ImageModeration(request)
194
+ body = send_request('ImageModeration', request.serialize)
195
+ response = JSON.parse(body)
196
+ if response['Response'].key?('Error') == false
197
+ model = ImageModerationResponse.new
198
+ model.deserialize(response['Response'])
199
+ model
200
+ else
201
+ code = response['Response']['Error']['Code']
202
+ message = response['Response']['Error']['Message']
203
+ reqid = response['Response']['RequestId']
204
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
205
+ end
206
+ rescue TencentCloud::Common::TencentCloudSDKException => e
207
+ raise e
208
+ rescue StandardError => e
209
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
210
+ end
211
+
212
+ # 人工审核对外接口
213
+
214
+ # @param request: Request instance for ManualReview.
215
+ # @type request: :class:`Tencentcloud::cms::V20190321::ManualReviewRequest`
216
+ # @rtype: :class:`Tencentcloud::cms::V20190321::ManualReviewResponse`
217
+ def ManualReview(request)
218
+ body = send_request('ManualReview', request.serialize)
219
+ response = JSON.parse(body)
220
+ if response['Response'].key?('Error') == false
221
+ model = ManualReviewResponse.new
222
+ model.deserialize(response['Response'])
223
+ model
224
+ else
225
+ code = response['Response']['Error']['Code']
226
+ message = response['Response']['Error']['Message']
227
+ reqid = response['Response']['RequestId']
228
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
229
+ end
230
+ rescue TencentCloud::Common::TencentCloudSDKException => e
231
+ raise e
232
+ rescue StandardError => e
233
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
234
+ end
235
+
236
+ # 文本内容检测(Text Moderation)服务使用了深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
237
+
238
+ # @param request: Request instance for TextModeration.
239
+ # @type request: :class:`Tencentcloud::cms::V20190321::TextModerationRequest`
240
+ # @rtype: :class:`Tencentcloud::cms::V20190321::TextModerationResponse`
241
+ def TextModeration(request)
242
+ body = send_request('TextModeration', request.serialize)
243
+ response = JSON.parse(body)
244
+ if response['Response'].key?('Error') == false
245
+ model = TextModerationResponse.new
246
+ model.deserialize(response['Response'])
247
+ model
248
+ else
249
+ code = response['Response']['Error']['Code']
250
+ message = response['Response']['Error']['Message']
251
+ reqid = response['Response']['RequestId']
252
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
253
+ end
254
+ rescue TencentCloud::Common::TencentCloudSDKException => e
255
+ raise e
256
+ rescue StandardError => e
257
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
258
+ end
259
+
260
+
261
+ end
262
+ end
263
+ end
264
+ end