tencentcloud-sdk-tms 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-tms.rb +14 -0
- data/lib/v20200713/client.rb +132 -0
- data/lib/v20200713/models.rb +651 -0
- data/lib/v20201229/client.rb +76 -0
- data/lib/v20201229/models.rb +295 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7c8e66c5d8ec27e5a2ebc49a3ed5684ecdb01164
|
4
|
+
data.tar.gz: 255bf8dc13bf2cb09f678bfae7b5761cd5f8193e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3e7b153efc090dfe78e2a21a8b95793a6de59f7ec3ec10240378a06b7019bb7f4d5f453433696797fce7881df6b7cf07502bee076914103b6ba51b3b1b2c40dd
|
7
|
+
data.tar.gz: e311cc5e9914b5ffafca0c4b3115a61d61f49b907cf161732e400f2cb0b429f2e170cb39c0bf17c1fa557d40ac83b7a1dce92a98155ded6631b5b04e2f798b52
|
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 'v20200713/client'
|
9
|
+
require_relative 'v20200713/models'
|
10
|
+
|
11
|
+
module TencentCloud
|
12
|
+
module Tms
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,132 @@
|
|
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 Tms
|
21
|
+
module V20200713
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2020-07-13'
|
26
|
+
api_endpoint = 'tms.tencentcloudapi.com'
|
27
|
+
sdk_version = 'TMS_' + 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 AccountTipoffAccess.
|
35
|
+
# @type request: :class:`Tencentcloud::tms::V20200713::AccountTipoffAccessRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::tms::V20200713::AccountTipoffAccessResponse`
|
37
|
+
def AccountTipoffAccess(request)
|
38
|
+
body = send_request('AccountTipoffAccess', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = AccountTipoffAccessResponse.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 DescribeTextLib.
|
59
|
+
# @type request: :class:`Tencentcloud::tms::V20200713::DescribeTextLibRequest`
|
60
|
+
# @rtype: :class:`Tencentcloud::tms::V20200713::DescribeTextLibResponse`
|
61
|
+
def DescribeTextLib(request)
|
62
|
+
body = send_request('DescribeTextLib', request.serialize)
|
63
|
+
response = JSON.parse(body)
|
64
|
+
if response['Response'].key?('Error') == false
|
65
|
+
model = DescribeTextLibResponse.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 DescribeTextStat.
|
83
|
+
# @type request: :class:`Tencentcloud::tms::V20200713::DescribeTextStatRequest`
|
84
|
+
# @rtype: :class:`Tencentcloud::tms::V20200713::DescribeTextStatResponse`
|
85
|
+
def DescribeTextStat(request)
|
86
|
+
body = send_request('DescribeTextStat', request.serialize)
|
87
|
+
response = JSON.parse(body)
|
88
|
+
if response['Response'].key?('Error') == false
|
89
|
+
model = DescribeTextStatResponse.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
|
+
# 文本内容检测(Text Moderation)服务使用了深度学习技术,识别可能令人反感、不安全或不适宜的文本内容,同时支持用户配置词库黑白名单,打击自定义识别类型的图片。
|
105
|
+
|
106
|
+
# @param request: Request instance for TextModeration.
|
107
|
+
# @type request: :class:`Tencentcloud::tms::V20200713::TextModerationRequest`
|
108
|
+
# @rtype: :class:`Tencentcloud::tms::V20200713::TextModerationResponse`
|
109
|
+
def TextModeration(request)
|
110
|
+
body = send_request('TextModeration', request.serialize)
|
111
|
+
response = JSON.parse(body)
|
112
|
+
if response['Response'].key?('Error') == false
|
113
|
+
model = TextModerationResponse.new
|
114
|
+
model.deserialize(response['Response'])
|
115
|
+
model
|
116
|
+
else
|
117
|
+
code = response['Response']['Error']['Code']
|
118
|
+
message = response['Response']['Error']['Message']
|
119
|
+
reqid = response['Response']['RequestId']
|
120
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
121
|
+
end
|
122
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
123
|
+
raise e
|
124
|
+
rescue StandardError => e
|
125
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,651 @@
|
|
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 Tms
|
19
|
+
module V20200713
|
20
|
+
# AccountTipoffAccess请求参数结构体
|
21
|
+
class AccountTipoffAccessRequest < TencentCloud::Common::AbstractModel
|
22
|
+
# @param ReportedAccount: 被举报账号,长度低于 128 个字符
|
23
|
+
# @type ReportedAccount: String
|
24
|
+
# @param ReportedAccountType: 被举报账号类型(1-手机号 2-QQ号 3-微信号 4-QQ群号 5-微信openid 6-QQopenid 0-其它)
|
25
|
+
# @type ReportedAccountType: Integer
|
26
|
+
# @param EvilType: 被举报账号所属恶意类型(1-诈骗,2-骚扰,3-广告,4-违法违规,5-赌博传销,0-其他)
|
27
|
+
# @type EvilType: Integer
|
28
|
+
# @param SenderAccount: 举报者账号,长度低于 128 个字符
|
29
|
+
# @type SenderAccount: String
|
30
|
+
# @param SenderAccountType: 举报者账号类型(1-手机号 2-QQ号 3-微信号 4-QQ群号 5-微信openid 6-QQopenid 0-其它)
|
31
|
+
# @type SenderAccountType: Integer
|
32
|
+
# @param SenderIP: 举报者IP地址
|
33
|
+
# @type SenderIP: String
|
34
|
+
# @param EvilContent: 包含被举报账号的恶意内容(比如文本、图片链接,长度低于1024个字符)
|
35
|
+
# @type EvilContent: String
|
36
|
+
|
37
|
+
attr_accessor :ReportedAccount, :ReportedAccountType, :EvilType, :SenderAccount, :SenderAccountType, :SenderIP, :EvilContent
|
38
|
+
|
39
|
+
def initialize(reportedaccount=nil, reportedaccounttype=nil, eviltype=nil, senderaccount=nil, senderaccounttype=nil, senderip=nil, evilcontent=nil)
|
40
|
+
@ReportedAccount = reportedaccount
|
41
|
+
@ReportedAccountType = reportedaccounttype
|
42
|
+
@EvilType = eviltype
|
43
|
+
@SenderAccount = senderaccount
|
44
|
+
@SenderAccountType = senderaccounttype
|
45
|
+
@SenderIP = senderip
|
46
|
+
@EvilContent = evilcontent
|
47
|
+
end
|
48
|
+
|
49
|
+
def deserialize(params)
|
50
|
+
@ReportedAccount = params['ReportedAccount']
|
51
|
+
@ReportedAccountType = params['ReportedAccountType']
|
52
|
+
@EvilType = params['EvilType']
|
53
|
+
@SenderAccount = params['SenderAccount']
|
54
|
+
@SenderAccountType = params['SenderAccountType']
|
55
|
+
@SenderIP = params['SenderIP']
|
56
|
+
@EvilContent = params['EvilContent']
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# AccountTipoffAccess返回参数结构体
|
61
|
+
class AccountTipoffAccessResponse < TencentCloud::Common::AbstractModel
|
62
|
+
# @param Data: 举报接口响应数据
|
63
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
64
|
+
# @type Data: :class:`Tencentcloud::Tms.v20200713.models.TipoffResponse`
|
65
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
66
|
+
# @type RequestId: String
|
67
|
+
|
68
|
+
attr_accessor :Data, :RequestId
|
69
|
+
|
70
|
+
def initialize(data=nil, requestid=nil)
|
71
|
+
@Data = data
|
72
|
+
@RequestId = requestid
|
73
|
+
end
|
74
|
+
|
75
|
+
def deserialize(params)
|
76
|
+
unless params['Data'].nil?
|
77
|
+
@Data = TipoffResponse.new
|
78
|
+
@Data.deserialize(params['Data'])
|
79
|
+
end
|
80
|
+
@RequestId = params['RequestId']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# DescribeTextLib请求参数结构体
|
85
|
+
class DescribeTextLibRequest < TencentCloud::Common::AbstractModel
|
86
|
+
# @param StrategyType: 内容类型 text: 1; image: 2; audio: 3; video: 4
|
87
|
+
# @type StrategyType: Integer
|
88
|
+
|
89
|
+
attr_accessor :StrategyType
|
90
|
+
|
91
|
+
def initialize(strategytype=nil)
|
92
|
+
@StrategyType = strategytype
|
93
|
+
end
|
94
|
+
|
95
|
+
def deserialize(params)
|
96
|
+
@StrategyType = params['StrategyType']
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# DescribeTextLib返回参数结构体
|
101
|
+
class DescribeTextLibResponse < TencentCloud::Common::AbstractModel
|
102
|
+
# @param TextLib: 文本库id和name列表
|
103
|
+
# @type TextLib: Array
|
104
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
105
|
+
# @type RequestId: String
|
106
|
+
|
107
|
+
attr_accessor :TextLib, :RequestId
|
108
|
+
|
109
|
+
def initialize(textlib=nil, requestid=nil)
|
110
|
+
@TextLib = textlib
|
111
|
+
@RequestId = requestid
|
112
|
+
end
|
113
|
+
|
114
|
+
def deserialize(params)
|
115
|
+
unless params['TextLib'].nil?
|
116
|
+
@TextLib = []
|
117
|
+
params['TextLib'].each do |i|
|
118
|
+
textlib_tmp = TextLib.new
|
119
|
+
textlib_tmp.deserialize(i)
|
120
|
+
@TextLib << textlib_tmp
|
121
|
+
end
|
122
|
+
end
|
123
|
+
@RequestId = params['RequestId']
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# DescribeTextStat请求参数结构体
|
128
|
+
class DescribeTextStatRequest < TencentCloud::Common::AbstractModel
|
129
|
+
# @param AuditType: 审核类型 1: 机器审核; 2: 人工审核
|
130
|
+
# @type AuditType: Integer
|
131
|
+
# @param Filters: 查询条件
|
132
|
+
# @type Filters: Array
|
133
|
+
|
134
|
+
attr_accessor :AuditType, :Filters
|
135
|
+
|
136
|
+
def initialize(audittype=nil, filters=nil)
|
137
|
+
@AuditType = audittype
|
138
|
+
@Filters = filters
|
139
|
+
end
|
140
|
+
|
141
|
+
def deserialize(params)
|
142
|
+
@AuditType = params['AuditType']
|
143
|
+
unless params['Filters'].nil?
|
144
|
+
@Filters = []
|
145
|
+
params['Filters'].each do |i|
|
146
|
+
filters_tmp = Filters.new
|
147
|
+
filters_tmp.deserialize(i)
|
148
|
+
@Filters << filters_tmp
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# DescribeTextStat返回参数结构体
|
155
|
+
class DescribeTextStatResponse < TencentCloud::Common::AbstractModel
|
156
|
+
# @param Overview: 识别结果统计
|
157
|
+
# @type Overview: :class:`Tencentcloud::Tms.v20200713.models.Overview`
|
158
|
+
# @param TrendCount: 识别量统计
|
159
|
+
# @type TrendCount: Array
|
160
|
+
# @param EvilCount: 违规数据分布
|
161
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
162
|
+
# @type EvilCount: Array
|
163
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
164
|
+
# @type RequestId: String
|
165
|
+
|
166
|
+
attr_accessor :Overview, :TrendCount, :EvilCount, :RequestId
|
167
|
+
|
168
|
+
def initialize(overview=nil, trendcount=nil, evilcount=nil, requestid=nil)
|
169
|
+
@Overview = overview
|
170
|
+
@TrendCount = trendcount
|
171
|
+
@EvilCount = evilcount
|
172
|
+
@RequestId = requestid
|
173
|
+
end
|
174
|
+
|
175
|
+
def deserialize(params)
|
176
|
+
unless params['Overview'].nil?
|
177
|
+
@Overview = Overview.new
|
178
|
+
@Overview.deserialize(params['Overview'])
|
179
|
+
end
|
180
|
+
unless params['TrendCount'].nil?
|
181
|
+
@TrendCount = []
|
182
|
+
params['TrendCount'].each do |i|
|
183
|
+
trendcount_tmp = TrendCount.new
|
184
|
+
trendcount_tmp.deserialize(i)
|
185
|
+
@TrendCount << trendcount_tmp
|
186
|
+
end
|
187
|
+
end
|
188
|
+
unless params['EvilCount'].nil?
|
189
|
+
@EvilCount = []
|
190
|
+
params['EvilCount'].each do |i|
|
191
|
+
evilcount_tmp = EvilCount.new
|
192
|
+
evilcount_tmp.deserialize(i)
|
193
|
+
@EvilCount << evilcount_tmp
|
194
|
+
end
|
195
|
+
end
|
196
|
+
@RequestId = params['RequestId']
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# 文本返回的详细结果
|
201
|
+
class DetailResults < TencentCloud::Common::AbstractModel
|
202
|
+
# @param Label: 恶意标签,Normal:正常,Porn:色情,Abuse:谩骂,Ad:广告,Custom:自定义词库。
|
203
|
+
# 以及令人反感、不安全或不适宜的内容类型。
|
204
|
+
# @type Label: String
|
205
|
+
# @param Suggestion: 建议您拿到判断结果后的执行操作。
|
206
|
+
# 建议值,Block:建议屏蔽,Review:建议复审,Pass:建议通过
|
207
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
208
|
+
# @type Suggestion: String
|
209
|
+
# @param Keywords: 该标签下命中的关键词
|
210
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
211
|
+
# @type Keywords: Array
|
212
|
+
# @param Score: 该标签模型命中的分值
|
213
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
214
|
+
# @type Score: Integer
|
215
|
+
# @param LibType: 仅当Label为Custom自定义关键词时有效,表示自定义关键词库类型,1:黑白库,2:自定义库
|
216
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
217
|
+
# @type LibType: Integer
|
218
|
+
# @param LibId: 仅当Label为Custom自定义关键词时有效,表示自定义库id
|
219
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
220
|
+
# @type LibId: String
|
221
|
+
# @param LibName: 仅当Labe为Custom自定义关键词时有效,表示自定义库名称
|
222
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
223
|
+
# @type LibName: String
|
224
|
+
|
225
|
+
attr_accessor :Label, :Suggestion, :Keywords, :Score, :LibType, :LibId, :LibName
|
226
|
+
|
227
|
+
def initialize(label=nil, suggestion=nil, keywords=nil, score=nil, libtype=nil, libid=nil, libname=nil)
|
228
|
+
@Label = label
|
229
|
+
@Suggestion = suggestion
|
230
|
+
@Keywords = keywords
|
231
|
+
@Score = score
|
232
|
+
@LibType = libtype
|
233
|
+
@LibId = libid
|
234
|
+
@LibName = libname
|
235
|
+
end
|
236
|
+
|
237
|
+
def deserialize(params)
|
238
|
+
@Label = params['Label']
|
239
|
+
@Suggestion = params['Suggestion']
|
240
|
+
@Keywords = params['Keywords']
|
241
|
+
@Score = params['Score']
|
242
|
+
@LibType = params['LibType']
|
243
|
+
@LibId = params['LibId']
|
244
|
+
@LibName = params['LibName']
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
# 设备信息
|
249
|
+
class Device < TencentCloud::Common::AbstractModel
|
250
|
+
# @param IP: 用户IP
|
251
|
+
# @type IP: String
|
252
|
+
# @param Mac: Mac地址
|
253
|
+
# @type Mac: String
|
254
|
+
# @param TokenId: 设备指纹Token
|
255
|
+
# @type TokenId: String
|
256
|
+
# @param DeviceId: 设备指纹ID
|
257
|
+
# @type DeviceId: String
|
258
|
+
# @param IMEI: 设备序列号
|
259
|
+
# @type IMEI: String
|
260
|
+
# @param IDFA: IOS设备,Identifier For Advertising(广告标识符)
|
261
|
+
# @type IDFA: String
|
262
|
+
# @param IDFV: IOS设备,IDFV - Identifier For Vendor(应用开发商标识符)
|
263
|
+
# @type IDFV: String
|
264
|
+
|
265
|
+
attr_accessor :IP, :Mac, :TokenId, :DeviceId, :IMEI, :IDFA, :IDFV
|
266
|
+
|
267
|
+
def initialize(ip=nil, mac=nil, tokenid=nil, deviceid=nil, imei=nil, idfa=nil, idfv=nil)
|
268
|
+
@IP = ip
|
269
|
+
@Mac = mac
|
270
|
+
@TokenId = tokenid
|
271
|
+
@DeviceId = deviceid
|
272
|
+
@IMEI = imei
|
273
|
+
@IDFA = idfa
|
274
|
+
@IDFV = idfv
|
275
|
+
end
|
276
|
+
|
277
|
+
def deserialize(params)
|
278
|
+
@IP = params['IP']
|
279
|
+
@Mac = params['Mac']
|
280
|
+
@TokenId = params['TokenId']
|
281
|
+
@DeviceId = params['DeviceId']
|
282
|
+
@IMEI = params['IMEI']
|
283
|
+
@IDFA = params['IDFA']
|
284
|
+
@IDFV = params['IDFV']
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
# 违规数据分布
|
289
|
+
class EvilCount < TencentCloud::Common::AbstractModel
|
290
|
+
# @param EvilType: ----非必选,该参数功能暂未对外开放
|
291
|
+
# @type EvilType: String
|
292
|
+
# @param Count: 分布类型总量
|
293
|
+
# @type Count: Integer
|
294
|
+
|
295
|
+
attr_accessor :EvilType, :Count
|
296
|
+
|
297
|
+
def initialize(eviltype=nil, count=nil)
|
298
|
+
@EvilType = eviltype
|
299
|
+
@Count = count
|
300
|
+
end
|
301
|
+
|
302
|
+
def deserialize(params)
|
303
|
+
@EvilType = params['EvilType']
|
304
|
+
@Count = params['Count']
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
# 文本过滤条件
|
309
|
+
class Filters < TencentCloud::Common::AbstractModel
|
310
|
+
# @param Name: 查询字段:
|
311
|
+
# 策略BizType
|
312
|
+
# 子账号SubUin
|
313
|
+
# 日期区间DateRange
|
314
|
+
# @type Name: String
|
315
|
+
# @param Values: 查询值
|
316
|
+
# @type Values: Array
|
317
|
+
|
318
|
+
attr_accessor :Name, :Values
|
319
|
+
|
320
|
+
def initialize(name=nil, values=nil)
|
321
|
+
@Name = name
|
322
|
+
@Values = values
|
323
|
+
end
|
324
|
+
|
325
|
+
def deserialize(params)
|
326
|
+
@Name = params['Name']
|
327
|
+
@Values = params['Values']
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
# 识别结果统计
|
332
|
+
class Overview < TencentCloud::Common::AbstractModel
|
333
|
+
# @param TotalCount: 总调用量
|
334
|
+
# @type TotalCount: Integer
|
335
|
+
# @param TotalHour: 总调用时长
|
336
|
+
# @type TotalHour: Integer
|
337
|
+
# @param PassCount: 通过量
|
338
|
+
# @type PassCount: Integer
|
339
|
+
# @param PassHour: 通过时长
|
340
|
+
# @type PassHour: Integer
|
341
|
+
# @param EvilCount: 违规量
|
342
|
+
# @type EvilCount: Integer
|
343
|
+
# @param EvilHour: 违规时长
|
344
|
+
# @type EvilHour: Integer
|
345
|
+
# @param SuspectCount: 疑似违规量
|
346
|
+
# @type SuspectCount: Integer
|
347
|
+
# @param SuspectHour: 疑似违规时长
|
348
|
+
# @type SuspectHour: Integer
|
349
|
+
|
350
|
+
attr_accessor :TotalCount, :TotalHour, :PassCount, :PassHour, :EvilCount, :EvilHour, :SuspectCount, :SuspectHour
|
351
|
+
|
352
|
+
def initialize(totalcount=nil, totalhour=nil, passcount=nil, passhour=nil, evilcount=nil, evilhour=nil, suspectcount=nil, suspecthour=nil)
|
353
|
+
@TotalCount = totalcount
|
354
|
+
@TotalHour = totalhour
|
355
|
+
@PassCount = passcount
|
356
|
+
@PassHour = passhour
|
357
|
+
@EvilCount = evilcount
|
358
|
+
@EvilHour = evilhour
|
359
|
+
@SuspectCount = suspectcount
|
360
|
+
@SuspectHour = suspecthour
|
361
|
+
end
|
362
|
+
|
363
|
+
def deserialize(params)
|
364
|
+
@TotalCount = params['TotalCount']
|
365
|
+
@TotalHour = params['TotalHour']
|
366
|
+
@PassCount = params['PassCount']
|
367
|
+
@PassHour = params['PassHour']
|
368
|
+
@EvilCount = params['EvilCount']
|
369
|
+
@EvilHour = params['EvilHour']
|
370
|
+
@SuspectCount = params['SuspectCount']
|
371
|
+
@SuspectHour = params['SuspectHour']
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
# 账号风险检测结果
|
376
|
+
class RiskDetails < TencentCloud::Common::AbstractModel
|
377
|
+
# @param Label: 风险类别,RiskAccount,RiskIP, RiskIMEI
|
378
|
+
# @type Label: String
|
379
|
+
# @param Level: 风险等级,1:疑似,2:恶意
|
380
|
+
# @type Level: Integer
|
381
|
+
|
382
|
+
attr_accessor :Label, :Level
|
383
|
+
|
384
|
+
def initialize(label=nil, level=nil)
|
385
|
+
@Label = label
|
386
|
+
@Level = level
|
387
|
+
end
|
388
|
+
|
389
|
+
def deserialize(params)
|
390
|
+
@Label = params['Label']
|
391
|
+
@Level = params['Level']
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
# 自定义库列表
|
396
|
+
class TextLib < TencentCloud::Common::AbstractModel
|
397
|
+
# @param LibId: 库id
|
398
|
+
# @type LibId: Integer
|
399
|
+
# @param LibName: 库名
|
400
|
+
# @type LibName: String
|
401
|
+
|
402
|
+
attr_accessor :LibId, :LibName
|
403
|
+
|
404
|
+
def initialize(libid=nil, libname=nil)
|
405
|
+
@LibId = libid
|
406
|
+
@LibName = libname
|
407
|
+
end
|
408
|
+
|
409
|
+
def deserialize(params)
|
410
|
+
@LibId = params['LibId']
|
411
|
+
@LibName = params['LibName']
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
# TextModeration请求参数结构体
|
416
|
+
class TextModerationRequest < TencentCloud::Common::AbstractModel
|
417
|
+
# @param Content: 文本内容Base64编码。限制原文长度不能超过10000个unicode字符
|
418
|
+
# @type Content: String
|
419
|
+
# @param BizType: 该字段用于标识业务场景。您可以在内容安全控制台创建对应的ID,配置不同的内容审核策略,通过接口调用,默认不填为0,后端使用默认策略
|
420
|
+
# @type BizType: String
|
421
|
+
# @param DataId: 数据ID,英文字母、下划线、-组成,不超过64个字符
|
422
|
+
# @type DataId: String
|
423
|
+
# @param User: 账号相关信息字段,填入后可识别违规风险账号
|
424
|
+
# @type User: :class:`Tencentcloud::Tms.v20200713.models.User`
|
425
|
+
# @param Device: 设备相关信息字段,填入后可识别违规风险设备
|
426
|
+
# @type Device: :class:`Tencentcloud::Tms.v20200713.models.Device`
|
427
|
+
|
428
|
+
attr_accessor :Content, :BizType, :DataId, :User, :Device
|
429
|
+
|
430
|
+
def initialize(content=nil, biztype=nil, dataid=nil, user=nil, device=nil)
|
431
|
+
@Content = content
|
432
|
+
@BizType = biztype
|
433
|
+
@DataId = dataid
|
434
|
+
@User = user
|
435
|
+
@Device = device
|
436
|
+
end
|
437
|
+
|
438
|
+
def deserialize(params)
|
439
|
+
@Content = params['Content']
|
440
|
+
@BizType = params['BizType']
|
441
|
+
@DataId = params['DataId']
|
442
|
+
unless params['User'].nil?
|
443
|
+
@User = User.new
|
444
|
+
@User.deserialize(params['User'])
|
445
|
+
end
|
446
|
+
unless params['Device'].nil?
|
447
|
+
@Device = Device.new
|
448
|
+
@Device.deserialize(params['Device'])
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
# TextModeration返回参数结构体
|
454
|
+
class TextModerationResponse < TencentCloud::Common::AbstractModel
|
455
|
+
# @param BizType: 您在入参时所填入的Biztype参数
|
456
|
+
# @type BizType: String
|
457
|
+
# @param EvilFlag: 数据是否属于恶意类型,0:正常 1:可疑
|
458
|
+
# @type EvilFlag: Integer
|
459
|
+
# @param Label: 恶意标签,Normal:正常,Porn:色情,Abuse:谩骂,Ad:广告,Custom:自定义词库,以及令人反感、不安全或不适宜的内容类型
|
460
|
+
# @type Label: String
|
461
|
+
# @param Suggestion: 建议您拿到判断结果后的执行操作
|
462
|
+
# 建议值,Block:建议屏蔽,Review:建议复审,Pass:建议通过
|
463
|
+
# @type Suggestion: String
|
464
|
+
# @param Keywords: 文本命中的关键词信息,用于提示您文本违规的具体原因,可能会返回多个命中的关键词。(如:加我微信)
|
465
|
+
# 如返回值为空,Score不为空,即识别结果(Label)是来自于语义模型判断的返回值
|
466
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
467
|
+
# @type Keywords: Array
|
468
|
+
# @param Score: 机器判断当前分类的置信度,取值范围:0.00~100.00。分数越高,表示越有可能属于当前分类。
|
469
|
+
# (如:色情 99.99,则该样本属于色情的置信度非常高。)
|
470
|
+
# @type Score: Integer
|
471
|
+
# @param DetailResults: 接口识别样本后返回的详细结果
|
472
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
473
|
+
# @type DetailResults: Array
|
474
|
+
# @param RiskDetails: 接口识别样本中存在违规账号风险的检测结果
|
475
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
476
|
+
# @type RiskDetails: Array
|
477
|
+
# @param Extra: 扩展字段,用于特定信息返回,不同客户/Biztype下返回信息不同
|
478
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
479
|
+
# @type Extra: String
|
480
|
+
# @param DataId: 请求参数中的DataId
|
481
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
482
|
+
# @type DataId: String
|
483
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
484
|
+
# @type RequestId: String
|
485
|
+
|
486
|
+
attr_accessor :BizType, :EvilFlag, :Label, :Suggestion, :Keywords, :Score, :DetailResults, :RiskDetails, :Extra, :DataId, :RequestId
|
487
|
+
|
488
|
+
def initialize(biztype=nil, evilflag=nil, label=nil, suggestion=nil, keywords=nil, score=nil, detailresults=nil, riskdetails=nil, extra=nil, dataid=nil, requestid=nil)
|
489
|
+
@BizType = biztype
|
490
|
+
@EvilFlag = evilflag
|
491
|
+
@Label = label
|
492
|
+
@Suggestion = suggestion
|
493
|
+
@Keywords = keywords
|
494
|
+
@Score = score
|
495
|
+
@DetailResults = detailresults
|
496
|
+
@RiskDetails = riskdetails
|
497
|
+
@Extra = extra
|
498
|
+
@DataId = dataid
|
499
|
+
@RequestId = requestid
|
500
|
+
end
|
501
|
+
|
502
|
+
def deserialize(params)
|
503
|
+
@BizType = params['BizType']
|
504
|
+
@EvilFlag = params['EvilFlag']
|
505
|
+
@Label = params['Label']
|
506
|
+
@Suggestion = params['Suggestion']
|
507
|
+
@Keywords = params['Keywords']
|
508
|
+
@Score = params['Score']
|
509
|
+
unless params['DetailResults'].nil?
|
510
|
+
@DetailResults = []
|
511
|
+
params['DetailResults'].each do |i|
|
512
|
+
detailresults_tmp = DetailResults.new
|
513
|
+
detailresults_tmp.deserialize(i)
|
514
|
+
@DetailResults << detailresults_tmp
|
515
|
+
end
|
516
|
+
end
|
517
|
+
unless params['RiskDetails'].nil?
|
518
|
+
@RiskDetails = []
|
519
|
+
params['RiskDetails'].each do |i|
|
520
|
+
riskdetails_tmp = RiskDetails.new
|
521
|
+
riskdetails_tmp.deserialize(i)
|
522
|
+
@RiskDetails << riskdetails_tmp
|
523
|
+
end
|
524
|
+
end
|
525
|
+
@Extra = params['Extra']
|
526
|
+
@DataId = params['DataId']
|
527
|
+
@RequestId = params['RequestId']
|
528
|
+
end
|
529
|
+
end
|
530
|
+
|
531
|
+
# 举报接口响应数据
|
532
|
+
class TipoffResponse < TencentCloud::Common::AbstractModel
|
533
|
+
# @param ResultCode: 举报结果, "0-举报数据提交成功 99-举报数据提交失败"
|
534
|
+
# @type ResultCode: Integer
|
535
|
+
# @param ResultMsg: 结果描述
|
536
|
+
# @type ResultMsg: String
|
537
|
+
|
538
|
+
attr_accessor :ResultCode, :ResultMsg
|
539
|
+
|
540
|
+
def initialize(resultcode=nil, resultmsg=nil)
|
541
|
+
@ResultCode = resultcode
|
542
|
+
@ResultMsg = resultmsg
|
543
|
+
end
|
544
|
+
|
545
|
+
def deserialize(params)
|
546
|
+
@ResultCode = params['ResultCode']
|
547
|
+
@ResultMsg = params['ResultMsg']
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
# 识别量统计
|
552
|
+
class TrendCount < TencentCloud::Common::AbstractModel
|
553
|
+
# @param TotalCount: 总调用量
|
554
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
555
|
+
# @type TotalCount: Integer
|
556
|
+
# @param TotalHour: 总调用时长
|
557
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
558
|
+
# @type TotalHour: Integer
|
559
|
+
# @param PassCount: 通过量
|
560
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
561
|
+
# @type PassCount: Integer
|
562
|
+
# @param PassHour: 通过时长
|
563
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
564
|
+
# @type PassHour: Integer
|
565
|
+
# @param EvilCount: 违规量
|
566
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
567
|
+
# @type EvilCount: Integer
|
568
|
+
# @param EvilHour: 违规时长
|
569
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
570
|
+
# @type EvilHour: Integer
|
571
|
+
# @param SuspectCount: 疑似违规量
|
572
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
573
|
+
# @type SuspectCount: Integer
|
574
|
+
# @param SuspectHour: 疑似违规时长
|
575
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
576
|
+
# @type SuspectHour: Integer
|
577
|
+
# @param Date: 日期
|
578
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
579
|
+
# @type Date: String
|
580
|
+
|
581
|
+
attr_accessor :TotalCount, :TotalHour, :PassCount, :PassHour, :EvilCount, :EvilHour, :SuspectCount, :SuspectHour, :Date
|
582
|
+
|
583
|
+
def initialize(totalcount=nil, totalhour=nil, passcount=nil, passhour=nil, evilcount=nil, evilhour=nil, suspectcount=nil, suspecthour=nil, date=nil)
|
584
|
+
@TotalCount = totalcount
|
585
|
+
@TotalHour = totalhour
|
586
|
+
@PassCount = passcount
|
587
|
+
@PassHour = passhour
|
588
|
+
@EvilCount = evilcount
|
589
|
+
@EvilHour = evilhour
|
590
|
+
@SuspectCount = suspectcount
|
591
|
+
@SuspectHour = suspecthour
|
592
|
+
@Date = date
|
593
|
+
end
|
594
|
+
|
595
|
+
def deserialize(params)
|
596
|
+
@TotalCount = params['TotalCount']
|
597
|
+
@TotalHour = params['TotalHour']
|
598
|
+
@PassCount = params['PassCount']
|
599
|
+
@PassHour = params['PassHour']
|
600
|
+
@EvilCount = params['EvilCount']
|
601
|
+
@EvilHour = params['EvilHour']
|
602
|
+
@SuspectCount = params['SuspectCount']
|
603
|
+
@SuspectHour = params['SuspectHour']
|
604
|
+
@Date = params['Date']
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
608
|
+
# 用户相关信息
|
609
|
+
class User < TencentCloud::Common::AbstractModel
|
610
|
+
# @param UserId: 用户账号ID,如填写,会根据账号历史恶意情况,判定消息有害结果,特别是有利于可疑恶意情况下的辅助判断。账号可以填写微信uin、QQ号、微信openid、QQopenid、字符串等。该字段和账号类别确定唯一账号。
|
611
|
+
# @type UserId: String
|
612
|
+
# @param Nickname: 用户昵称
|
613
|
+
# @type Nickname: String
|
614
|
+
# @param AccountType: 账号类别,"1-微信uin 2-QQ号 3-微信群uin 4-qq群号 5-微信openid 6-QQopenid 7-其它string"
|
615
|
+
# @type AccountType: Integer
|
616
|
+
# @param Gender: 性别 默认0 未知 1 男性 2 女性
|
617
|
+
# @type Gender: Integer
|
618
|
+
# @param Age: 年龄 默认0 未知
|
619
|
+
# @type Age: Integer
|
620
|
+
# @param Level: 用户等级,默认0 未知 1 低 2 中 3 高
|
621
|
+
# @type Level: Integer
|
622
|
+
# @param Phone: 手机号
|
623
|
+
# @type Phone: String
|
624
|
+
|
625
|
+
attr_accessor :UserId, :Nickname, :AccountType, :Gender, :Age, :Level, :Phone
|
626
|
+
|
627
|
+
def initialize(userid=nil, nickname=nil, accounttype=nil, gender=nil, age=nil, level=nil, phone=nil)
|
628
|
+
@UserId = userid
|
629
|
+
@Nickname = nickname
|
630
|
+
@AccountType = accounttype
|
631
|
+
@Gender = gender
|
632
|
+
@Age = age
|
633
|
+
@Level = level
|
634
|
+
@Phone = phone
|
635
|
+
end
|
636
|
+
|
637
|
+
def deserialize(params)
|
638
|
+
@UserId = params['UserId']
|
639
|
+
@Nickname = params['Nickname']
|
640
|
+
@AccountType = params['AccountType']
|
641
|
+
@Gender = params['Gender']
|
642
|
+
@Age = params['Age']
|
643
|
+
@Level = params['Level']
|
644
|
+
@Phone = params['Phone']
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
end
|
649
|
+
end
|
650
|
+
end
|
651
|
+
|
@@ -0,0 +1,76 @@
|
|
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 Tms
|
21
|
+
module V20201229
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2020-12-29'
|
26
|
+
api_endpoint = 'tms.tencentcloudapi.com'
|
27
|
+
sdk_version = 'TMS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms/text/package) 并调整好对应的业务配置。
|
33
|
+
|
34
|
+
# ### 接口使用说明
|
35
|
+
# - 前往“[内容安全控制台-文本内容安全](https://console.cloud.tencent.com/cms/text/package)”开启使用文本内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**1万条**文本识别额度,有效期为1个月。
|
36
|
+
# - 该接口为收费接口,计费方式敬请参见 [腾讯云文本内容安全定价](https://cloud.tencent.com/product/tms/pricing)。
|
37
|
+
|
38
|
+
# ### 接口功能说明:
|
39
|
+
# - 支持对文本文件进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规文本内容;
|
40
|
+
# - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
|
41
|
+
# - 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;
|
42
|
+
# - 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);
|
43
|
+
# - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。
|
44
|
+
|
45
|
+
# ### 接口调用说明:
|
46
|
+
# - 文本内容大小支持:文本原文base64编码后长度不能超过unicode编码长度10000;
|
47
|
+
# - 文本审核语言支持:目前支持中文、英文、阿拉伯数字的检测;
|
48
|
+
# - 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。
|
49
|
+
|
50
|
+
# @param request: Request instance for TextModeration.
|
51
|
+
# @type request: :class:`Tencentcloud::tms::V20201229::TextModerationRequest`
|
52
|
+
# @rtype: :class:`Tencentcloud::tms::V20201229::TextModerationResponse`
|
53
|
+
def TextModeration(request)
|
54
|
+
body = send_request('TextModeration', request.serialize)
|
55
|
+
response = JSON.parse(body)
|
56
|
+
if response['Response'].key?('Error') == false
|
57
|
+
model = TextModerationResponse.new
|
58
|
+
model.deserialize(response['Response'])
|
59
|
+
model
|
60
|
+
else
|
61
|
+
code = response['Response']['Error']['Code']
|
62
|
+
message = response['Response']['Error']['Message']
|
63
|
+
reqid = response['Response']['RequestId']
|
64
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
65
|
+
end
|
66
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
67
|
+
raise e
|
68
|
+
rescue StandardError => e
|
69
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,295 @@
|
|
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 Tms
|
19
|
+
module V20201229
|
20
|
+
# 文本审核返回的详细结果
|
21
|
+
class DetailResults < TencentCloud::Common::AbstractModel
|
22
|
+
# @param Label: 该字段用于返回检测结果所对应的全部恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
|
23
|
+
# @type Label: String
|
24
|
+
# @param Suggestion: 该字段用于返回对应当前标签的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
|
25
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
26
|
+
# @type Suggestion: String
|
27
|
+
# @param Keywords: 该字段用于返回检测文本命中的关键词信息,用于标注文本违规的具体原因(如:*加我微信*)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值。
|
28
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
29
|
+
# @type Keywords: Array
|
30
|
+
# @param Score: 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容。
|
31
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
32
|
+
# @type Score: Integer
|
33
|
+
# @param LibType: 该字段**仅当Label为Custom自定义关键词时有效**,用于返回自定义关键词对应的词库类型,取值为**1**(黑白库)和**2**(自定义关键词库),若未配置自定义关键词库,则默认值为1(黑白库匹配)。
|
34
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
35
|
+
# @type LibType: Integer
|
36
|
+
# @param LibId: 该字段**仅当Label为Custom:自定义关键词时该参数有效**,用于返回自定义库的ID,以方便自定义库管理和配置。
|
37
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
38
|
+
# @type LibId: String
|
39
|
+
# @param LibName: 该字段**仅当Label为Custom:自定义关键词时该参数有效**,用于返回自定义库的名称,以方便自定义库管理和配置。
|
40
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
41
|
+
# @type LibName: String
|
42
|
+
|
43
|
+
attr_accessor :Label, :Suggestion, :Keywords, :Score, :LibType, :LibId, :LibName
|
44
|
+
|
45
|
+
def initialize(label=nil, suggestion=nil, keywords=nil, score=nil, libtype=nil, libid=nil, libname=nil)
|
46
|
+
@Label = label
|
47
|
+
@Suggestion = suggestion
|
48
|
+
@Keywords = keywords
|
49
|
+
@Score = score
|
50
|
+
@LibType = libtype
|
51
|
+
@LibId = libid
|
52
|
+
@LibName = libname
|
53
|
+
end
|
54
|
+
|
55
|
+
def deserialize(params)
|
56
|
+
@Label = params['Label']
|
57
|
+
@Suggestion = params['Suggestion']
|
58
|
+
@Keywords = params['Keywords']
|
59
|
+
@Score = params['Score']
|
60
|
+
@LibType = params['LibType']
|
61
|
+
@LibId = params['LibId']
|
62
|
+
@LibName = params['LibName']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# 用于表示业务用户对应的设备信息
|
67
|
+
class Device < TencentCloud::Common::AbstractModel
|
68
|
+
# @param IP: 该字段表示业务用户对应设备的IP地址。<br>
|
69
|
+
# 备注:目前仅支持IPv4地址记录,不支持IPv6地址记录。
|
70
|
+
# @type IP: String
|
71
|
+
# @param Mac: 该字段表示业务用户对应的MAC地址,以方便设备识别与管理;其格式与取值与标准MAC地址一致。
|
72
|
+
# @type Mac: String
|
73
|
+
# @param TokenId: *内测中,敬请期待。*
|
74
|
+
# @type TokenId: String
|
75
|
+
# @param DeviceId: *内测中,敬请期待。*
|
76
|
+
# @type DeviceId: String
|
77
|
+
# @param IMEI: 该字段表示业务用户对应设备的**IMEI码**(国际移动设备识别码),该识别码可用于识别每一部独立的手机等移动通信设备,方便设备识别与管理。<br>备注:格式为**15-17位纯数字**。
|
78
|
+
# @type IMEI: String
|
79
|
+
# @param IDFA: **iOS设备专用**,该字段表示业务用户对应的**IDFA**(广告标识符),这是由苹果公司提供的用于追踪用户的广告标识符,由一串16进制的32位数字和字母组成。<br>
|
80
|
+
# 备注:苹果公司自2021年iOS14更新后允许用户手动关闭或者开启IDFA,故此字符串标记有效性可能有所降低。
|
81
|
+
# @type IDFA: String
|
82
|
+
# @param IDFV: **iOS设备专用**,该字段表示业务用户对应的**IDFV**(应用开发商标识符),这是由苹果公司提供的用于标注应用开发商的标识符,由一串16进制的32位数字和字母组成,可被用于唯一标识设备。
|
83
|
+
# @type IDFV: String
|
84
|
+
|
85
|
+
attr_accessor :IP, :Mac, :TokenId, :DeviceId, :IMEI, :IDFA, :IDFV
|
86
|
+
|
87
|
+
def initialize(ip=nil, mac=nil, tokenid=nil, deviceid=nil, imei=nil, idfa=nil, idfv=nil)
|
88
|
+
@IP = ip
|
89
|
+
@Mac = mac
|
90
|
+
@TokenId = tokenid
|
91
|
+
@DeviceId = deviceid
|
92
|
+
@IMEI = imei
|
93
|
+
@IDFA = idfa
|
94
|
+
@IDFV = idfv
|
95
|
+
end
|
96
|
+
|
97
|
+
def deserialize(params)
|
98
|
+
@IP = params['IP']
|
99
|
+
@Mac = params['Mac']
|
100
|
+
@TokenId = params['TokenId']
|
101
|
+
@DeviceId = params['DeviceId']
|
102
|
+
@IMEI = params['IMEI']
|
103
|
+
@IDFA = params['IDFA']
|
104
|
+
@IDFV = params['IDFV']
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# 账号风险检测结果
|
109
|
+
class RiskDetails < TencentCloud::Common::AbstractModel
|
110
|
+
# @param Label: 该字段用于返回账号信息检测对应的风险类别,取值为:**RiskAccount**(账号存在风险)、**RiskIP**(IP地址存在风险)、**RiskIMEI**(移动设备识别码存在风险)。
|
111
|
+
# @type Label: String
|
112
|
+
# @param Level: 该字段用于返回账号信息检测对应的风险等级,取值为:**1**(疑似存在风险)和**2**(存在恶意风险)。
|
113
|
+
# @type Level: Integer
|
114
|
+
|
115
|
+
attr_accessor :Label, :Level
|
116
|
+
|
117
|
+
def initialize(label=nil, level=nil)
|
118
|
+
@Label = label
|
119
|
+
@Level = level
|
120
|
+
end
|
121
|
+
|
122
|
+
def deserialize(params)
|
123
|
+
@Label = params['Label']
|
124
|
+
@Level = params['Level']
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# TextModeration请求参数结构体
|
129
|
+
class TextModerationRequest < TencentCloud::Common::AbstractModel
|
130
|
+
# @param Content: 文本内容Base64编码,限制原文长度不能超过10000个unicode字符
|
131
|
+
# @type Content: String
|
132
|
+
# @param BizType: 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。<br>备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype
|
133
|
+
# @type BizType: String
|
134
|
+
# @param DataId: 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**
|
135
|
+
# @type DataId: String
|
136
|
+
# @param User: 该字段表示待检测对象对应的用户相关信息,传入后可便于甄别相应违规风险用户
|
137
|
+
# @type User: :class:`Tencentcloud::Tms.v20201229.models.User`
|
138
|
+
# @param Device: 该字段表示待检测对象对应的设备相关信息,传入后可便于甄别相应违规风险设备
|
139
|
+
# @type Device: :class:`Tencentcloud::Tms.v20201229.models.Device`
|
140
|
+
|
141
|
+
attr_accessor :Content, :BizType, :DataId, :User, :Device
|
142
|
+
|
143
|
+
def initialize(content=nil, biztype=nil, dataid=nil, user=nil, device=nil)
|
144
|
+
@Content = content
|
145
|
+
@BizType = biztype
|
146
|
+
@DataId = dataid
|
147
|
+
@User = user
|
148
|
+
@Device = device
|
149
|
+
end
|
150
|
+
|
151
|
+
def deserialize(params)
|
152
|
+
@Content = params['Content']
|
153
|
+
@BizType = params['BizType']
|
154
|
+
@DataId = params['DataId']
|
155
|
+
unless params['User'].nil?
|
156
|
+
@User = User.new
|
157
|
+
@User.deserialize(params['User'])
|
158
|
+
end
|
159
|
+
unless params['Device'].nil?
|
160
|
+
@Device = Device.new
|
161
|
+
@Device.deserialize(params['Device'])
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# TextModeration返回参数结构体
|
167
|
+
class TextModerationResponse < TencentCloud::Common::AbstractModel
|
168
|
+
# @param BizType: 该字段用于返回请求参数中的BizType参数
|
169
|
+
# @type BizType: String
|
170
|
+
# @param Label: 该字段用于返回检测结果(DetailResults)中所对应的**优先级最高的恶意标签**,表示模型推荐的审核结果,建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型
|
171
|
+
# @type Label: String
|
172
|
+
# @param Suggestion: 该字段用于返回后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
|
173
|
+
# @type Suggestion: String
|
174
|
+
# @param Keywords: 该字段用于返回当前标签(Label)下被检测文本命中的关键词信息,用于标注文本违规的具体原因(如:*加我微信*)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值
|
175
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
176
|
+
# @type Keywords: Array
|
177
|
+
# @param Score: 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容
|
178
|
+
# @type Score: Integer
|
179
|
+
# @param DetailResults: 该字段用于返回基于文本风险库审核的详细结果,返回值信息可参阅对应数据结构(DetailResults)的详细描述
|
180
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
181
|
+
# @type DetailResults: Array
|
182
|
+
# @param RiskDetails: 该字段用于返回文本检测中存在违规风险的账号检测结果,主要包括违规风险类别和风险等级信息,具体内容可参阅对应数据结构(RiskDetails)的详细描述
|
183
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
184
|
+
# @type RiskDetails: Array
|
185
|
+
# @param Extra: 该字段用于返回根据您的需求配置的额外附加信息(Extra),如未配置则默认返回值为空。<br>备注:不同客户或Biztype下返回信息不同,如需配置该字段请提交工单咨询或联系售后专员处理
|
186
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
187
|
+
# @type Extra: String
|
188
|
+
# @param DataId: 该字段用于返回检测对象对应请求参数中的DataId,与输入的DataId字段中的内容对应
|
189
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
190
|
+
# @type DataId: String
|
191
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
192
|
+
# @type RequestId: String
|
193
|
+
|
194
|
+
attr_accessor :BizType, :Label, :Suggestion, :Keywords, :Score, :DetailResults, :RiskDetails, :Extra, :DataId, :RequestId
|
195
|
+
|
196
|
+
def initialize(biztype=nil, label=nil, suggestion=nil, keywords=nil, score=nil, detailresults=nil, riskdetails=nil, extra=nil, dataid=nil, requestid=nil)
|
197
|
+
@BizType = biztype
|
198
|
+
@Label = label
|
199
|
+
@Suggestion = suggestion
|
200
|
+
@Keywords = keywords
|
201
|
+
@Score = score
|
202
|
+
@DetailResults = detailresults
|
203
|
+
@RiskDetails = riskdetails
|
204
|
+
@Extra = extra
|
205
|
+
@DataId = dataid
|
206
|
+
@RequestId = requestid
|
207
|
+
end
|
208
|
+
|
209
|
+
def deserialize(params)
|
210
|
+
@BizType = params['BizType']
|
211
|
+
@Label = params['Label']
|
212
|
+
@Suggestion = params['Suggestion']
|
213
|
+
@Keywords = params['Keywords']
|
214
|
+
@Score = params['Score']
|
215
|
+
unless params['DetailResults'].nil?
|
216
|
+
@DetailResults = []
|
217
|
+
params['DetailResults'].each do |i|
|
218
|
+
detailresults_tmp = DetailResults.new
|
219
|
+
detailresults_tmp.deserialize(i)
|
220
|
+
@DetailResults << detailresults_tmp
|
221
|
+
end
|
222
|
+
end
|
223
|
+
unless params['RiskDetails'].nil?
|
224
|
+
@RiskDetails = []
|
225
|
+
params['RiskDetails'].each do |i|
|
226
|
+
riskdetails_tmp = RiskDetails.new
|
227
|
+
riskdetails_tmp.deserialize(i)
|
228
|
+
@RiskDetails << riskdetails_tmp
|
229
|
+
end
|
230
|
+
end
|
231
|
+
@Extra = params['Extra']
|
232
|
+
@DataId = params['DataId']
|
233
|
+
@RequestId = params['RequestId']
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# 用于表示业务用户的账号相关信息
|
238
|
+
class User < TencentCloud::Common::AbstractModel
|
239
|
+
# @param UserId: 该字段表示业务用户ID,填写后,系统可根据账号过往违规历史优化审核结果判定,有利于存在可疑违规风险时的辅助判断。<br>
|
240
|
+
# 备注:该字段可传入微信openid、QQopenid、字符串等账号信息,与账号类别参数(AccountType)配合使用可确定唯一账号。
|
241
|
+
# @type UserId: String
|
242
|
+
# @param Nickname: 该字段表示业务用户对应的账号昵称信息。
|
243
|
+
# @type Nickname: String
|
244
|
+
# @param AccountType: 该字段表示业务用户ID对应的账号类型,取值:**1**-微信uin,**2**-QQ号,**3**-微信群uin,**4**-qq群号,**5**-微信openid,**6**-QQopenid,**7**-其它string。<br>
|
245
|
+
# 该字段与账号ID参数(UserId)配合使用可确定唯一账号。
|
246
|
+
# @type AccountType: Integer
|
247
|
+
# @param Gender: 该字段表示业务用户对应账号的性别信息。<br>
|
248
|
+
# 取值:**0**(默认值,代表性别未知)、**1**(男性)、**2**(女性)。
|
249
|
+
# @type Gender: Integer
|
250
|
+
# @param Age: 该字段表示业务用户对应账号的年龄信息。<br>
|
251
|
+
# 取值:**0**(默认值,代表年龄未知)-(**自定义年龄上限**)之间的整数。
|
252
|
+
# @type Age: Integer
|
253
|
+
# @param Level: 该字段表示业务用户对应账号的等级信息。<br>
|
254
|
+
# 取值:**0**(默认值,代表等级未知)、**1**(等级较低)、**2**(等级中等)、**3**(等级较高),目前**暂不支持自定义等级**。
|
255
|
+
# @type Level: Integer
|
256
|
+
# @param Phone: 该字段表示业务用户对应账号的手机号信息,支持全球各地区手机号的记录。<br>
|
257
|
+
# 备注:请保持手机号格式的统一,如区号格式(086/+86)等。
|
258
|
+
# @type Phone: String
|
259
|
+
# @param HeadUrl: 该字段表示业务用户头像图片的访问链接(URL),支持PNG、JPG、JPEG、BMP、GIF、WEBP格式。
|
260
|
+
# 备注:头像图片大小不超过5MB,建议分辨率不低于256x256;图片下载时间限制为3秒,超过则会返回下载超时。
|
261
|
+
# @type HeadUrl: String
|
262
|
+
# @param Desc: 该字段表示业务用户的简介信息,支持汉字、英文及特殊符号,长度不超过5000个汉字字符。
|
263
|
+
# @type Desc: String
|
264
|
+
|
265
|
+
attr_accessor :UserId, :Nickname, :AccountType, :Gender, :Age, :Level, :Phone, :HeadUrl, :Desc
|
266
|
+
|
267
|
+
def initialize(userid=nil, nickname=nil, accounttype=nil, gender=nil, age=nil, level=nil, phone=nil, headurl=nil, desc=nil)
|
268
|
+
@UserId = userid
|
269
|
+
@Nickname = nickname
|
270
|
+
@AccountType = accounttype
|
271
|
+
@Gender = gender
|
272
|
+
@Age = age
|
273
|
+
@Level = level
|
274
|
+
@Phone = phone
|
275
|
+
@HeadUrl = headurl
|
276
|
+
@Desc = desc
|
277
|
+
end
|
278
|
+
|
279
|
+
def deserialize(params)
|
280
|
+
@UserId = params['UserId']
|
281
|
+
@Nickname = params['Nickname']
|
282
|
+
@AccountType = params['AccountType']
|
283
|
+
@Gender = params['Gender']
|
284
|
+
@Age = params['Age']
|
285
|
+
@Level = params['Level']
|
286
|
+
@Phone = params['Phone']
|
287
|
+
@HeadUrl = params['HeadUrl']
|
288
|
+
@Desc = params['Desc']
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tencentcloud-sdk-tms
|
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
|
+
TMS.
|
30
|
+
email:
|
31
|
+
- tencentcloudapi@tencent.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/VERSION
|
37
|
+
- lib/tencentcloud-sdk-tms.rb
|
38
|
+
- lib/v20200713/client.rb
|
39
|
+
- lib/v20200713/models.rb
|
40
|
+
- lib/v20201229/client.rb
|
41
|
+
- lib/v20201229/models.rb
|
42
|
+
homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
|
43
|
+
licenses:
|
44
|
+
- Apache-2.0
|
45
|
+
metadata:
|
46
|
+
source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-tms
|
47
|
+
changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 2.6.14
|
65
|
+
signing_key:
|
66
|
+
specification_version: 4
|
67
|
+
summary: Tencent Cloud SDK for Ruby - TMS
|
68
|
+
test_files: []
|