tencentcloud-sdk-tdid 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: c0d71573e4be36a811ac1c777da1447826ca0b52
4
+ data.tar.gz: c44aaf3d77f694c682f7f8564ac5d93abcfa1aa9
5
+ SHA512:
6
+ metadata.gz: da1fc24d9cae9a0f51ae9fcd09f976ee3409a3cc23efed84eb90f62884f71a9775ab9a4df45ae50c3409626ade0656260c82d67d85bc430540867e1e35aa8d9f
7
+ data.tar.gz: 74012f345d6d36809d98362ea57b88e49b85f7c2d7695205c481fee0cdf28ad7179bcdf585808819ef684333b0a42e2f8f4c4d1ccf464101612bb47c74fabca0
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 'v20210519/client'
6
+ require_relative 'v20210519/models'
7
+
8
+ module TencentCloud
9
+ module Tdid
10
+ end
11
+ 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 Tdid
21
+ module V20210519
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2021-05-19'
26
+ api_endpoint = 'tdid.tencentcloudapi.com'
27
+ sdk_version = 'TDID_' + 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 CreateCredential.
35
+ # @type request: :class:`Tencentcloud::tdid::V20210519::CreateCredentialRequest`
36
+ # @rtype: :class:`Tencentcloud::tdid::V20210519::CreateCredentialResponse`
37
+ def CreateCredential(request)
38
+ body = send_request('CreateCredential', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = CreateCredentialResponse.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 CreateSelectiveCredential.
59
+ # @type request: :class:`Tencentcloud::tdid::V20210519::CreateSelectiveCredentialRequest`
60
+ # @rtype: :class:`Tencentcloud::tdid::V20210519::CreateSelectiveCredentialResponse`
61
+ def CreateSelectiveCredential(request)
62
+ body = send_request('CreateSelectiveCredential', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CreateSelectiveCredentialResponse.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
+ # 创建机构DID
81
+
82
+ # @param request: Request instance for CreateTDid.
83
+ # @type request: :class:`Tencentcloud::tdid::V20210519::CreateTDidRequest`
84
+ # @rtype: :class:`Tencentcloud::tdid::V20210519::CreateTDidResponse`
85
+ def CreateTDid(request)
86
+ body = send_request('CreateTDid', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = CreateTDidResponse.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
+
106
+ # @param request: Request instance for VerifyCredential.
107
+ # @type request: :class:`Tencentcloud::tdid::V20210519::VerifyCredentialRequest`
108
+ # @rtype: :class:`Tencentcloud::tdid::V20210519::VerifyCredentialResponse`
109
+ def VerifyCredential(request)
110
+ body = send_request('VerifyCredential', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = VerifyCredentialResponse.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,334 @@
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 Tdid
19
+ module V20210519
20
+ # CreateCredential请求参数结构体
21
+ class CreateCredentialRequest < TencentCloud::Common::AbstractModel
22
+ # @param FunctionArg: 参数集合,详见示例
23
+ # @type FunctionArg: :class:`Tencentcloud::Tdid.v20210519.models.FunctionArg`
24
+ # @param TransactionArg: 参数集合,详见示例
25
+ # @type TransactionArg: :class:`Tencentcloud::Tdid.v20210519.models.TransactionArg`
26
+ # @param VersionCredential: 版本
27
+ # @type VersionCredential: String
28
+
29
+ attr_accessor :FunctionArg, :TransactionArg, :VersionCredential
30
+
31
+ def initialize(functionarg=nil, transactionarg=nil, versioncredential=nil)
32
+ @FunctionArg = functionarg
33
+ @TransactionArg = transactionarg
34
+ @VersionCredential = versioncredential
35
+ end
36
+
37
+ def deserialize(params)
38
+ unless params['FunctionArg'].nil?
39
+ @FunctionArg = FunctionArg.new
40
+ @FunctionArg.deserialize(params['FunctionArg'])
41
+ end
42
+ unless params['TransactionArg'].nil?
43
+ @TransactionArg = TransactionArg.new
44
+ @TransactionArg.deserialize(params['TransactionArg'])
45
+ end
46
+ @VersionCredential = params['VersionCredential']
47
+ end
48
+ end
49
+
50
+ # CreateCredential返回参数结构体
51
+ class CreateCredentialResponse < TencentCloud::Common::AbstractModel
52
+ # @param CredentialData: Credential的具体信息
53
+ # @type CredentialData: String
54
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
55
+ # @type RequestId: String
56
+
57
+ attr_accessor :CredentialData, :RequestId
58
+
59
+ def initialize(credentialdata=nil, requestid=nil)
60
+ @CredentialData = credentialdata
61
+ @RequestId = requestid
62
+ end
63
+
64
+ def deserialize(params)
65
+ @CredentialData = params['CredentialData']
66
+ @RequestId = params['RequestId']
67
+ end
68
+ end
69
+
70
+ # CreateSelectiveCredential请求参数结构体
71
+ class CreateSelectiveCredentialRequest < TencentCloud::Common::AbstractModel
72
+ # @param FunctionArg: 参数集合
73
+ # @type FunctionArg: :class:`Tencentcloud::Tdid.v20210519.models.VerifyFunctionArg`
74
+ # @param PolicyId: 批露策略id
75
+ # @type PolicyId: Integer
76
+
77
+ attr_accessor :FunctionArg, :PolicyId
78
+
79
+ def initialize(functionarg=nil, policyid=nil)
80
+ @FunctionArg = functionarg
81
+ @PolicyId = policyid
82
+ end
83
+
84
+ def deserialize(params)
85
+ unless params['FunctionArg'].nil?
86
+ @FunctionArg = VerifyFunctionArg.new
87
+ @FunctionArg.deserialize(params['FunctionArg'])
88
+ end
89
+ @PolicyId = params['PolicyId']
90
+ end
91
+ end
92
+
93
+ # CreateSelectiveCredential返回参数结构体
94
+ class CreateSelectiveCredentialResponse < TencentCloud::Common::AbstractModel
95
+ # @param CredentialData: 凭证字符串
96
+ # @type CredentialData: String
97
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
98
+ # @type RequestId: String
99
+
100
+ attr_accessor :CredentialData, :RequestId
101
+
102
+ def initialize(credentialdata=nil, requestid=nil)
103
+ @CredentialData = credentialdata
104
+ @RequestId = requestid
105
+ end
106
+
107
+ def deserialize(params)
108
+ @CredentialData = params['CredentialData']
109
+ @RequestId = params['RequestId']
110
+ end
111
+ end
112
+
113
+ # CreateTDid请求参数结构体
114
+ class CreateTDidRequest < TencentCloud::Common::AbstractModel
115
+ # @param GroupId: 群组ID
116
+ # @type GroupId: Integer
117
+ # @param ClusterId: 网络ID
118
+ # @type ClusterId: String
119
+ # @param Relegation: 部署机构为1,否则为0
120
+ # @type Relegation: Integer
121
+
122
+ attr_accessor :GroupId, :ClusterId, :Relegation
123
+
124
+ def initialize(groupid=nil, clusterid=nil, relegation=nil)
125
+ @GroupId = groupid
126
+ @ClusterId = clusterid
127
+ @Relegation = relegation
128
+ end
129
+
130
+ def deserialize(params)
131
+ @GroupId = params['GroupId']
132
+ @ClusterId = params['ClusterId']
133
+ @Relegation = params['Relegation']
134
+ end
135
+ end
136
+
137
+ # CreateTDid返回参数结构体
138
+ class CreateTDidResponse < TencentCloud::Common::AbstractModel
139
+ # @param Did: TDID
140
+ # @type Did: String
141
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
142
+ # @type RequestId: String
143
+
144
+ attr_accessor :Did, :RequestId
145
+
146
+ def initialize(did=nil, requestid=nil)
147
+ @Did = did
148
+ @RequestId = requestid
149
+ end
150
+
151
+ def deserialize(params)
152
+ @Did = params['Did']
153
+ @RequestId = params['RequestId']
154
+ end
155
+ end
156
+
157
+ # 创建凭证入参的FunctionArg
158
+ class FunctionArg < TencentCloud::Common::AbstractModel
159
+ # @param CptId: CPT ID
160
+ # @type CptId: Integer
161
+ # @param Issuer: 签发者 did
162
+ # @type Issuer: String
163
+ # @param ExpirationDate: 过期时间
164
+ # @type ExpirationDate: String
165
+ # @param ClaimJson: 声明
166
+ # @type ClaimJson: String
167
+
168
+ attr_accessor :CptId, :Issuer, :ExpirationDate, :ClaimJson
169
+
170
+ def initialize(cptid=nil, issuer=nil, expirationdate=nil, claimjson=nil)
171
+ @CptId = cptid
172
+ @Issuer = issuer
173
+ @ExpirationDate = expirationdate
174
+ @ClaimJson = claimjson
175
+ end
176
+
177
+ def deserialize(params)
178
+ @CptId = params['CptId']
179
+ @Issuer = params['Issuer']
180
+ @ExpirationDate = params['ExpirationDate']
181
+ @ClaimJson = params['ClaimJson']
182
+ end
183
+ end
184
+
185
+ # 验证凭证签名
186
+ class Proof < TencentCloud::Common::AbstractModel
187
+ # @param Created: 创建时间
188
+ # @type Created: Integer
189
+ # @param Creator: 创建着did
190
+ # @type Creator: String
191
+ # @param SaltJson: salt值
192
+ # @type SaltJson: String
193
+ # @param SignatureValue: 签名
194
+ # @type SignatureValue: String
195
+ # @param Type: type类型
196
+ # @type Type: String
197
+
198
+ attr_accessor :Created, :Creator, :SaltJson, :SignatureValue, :Type
199
+
200
+ def initialize(created=nil, creator=nil, saltjson=nil, signaturevalue=nil, type=nil)
201
+ @Created = created
202
+ @Creator = creator
203
+ @SaltJson = saltjson
204
+ @SignatureValue = signaturevalue
205
+ @Type = type
206
+ end
207
+
208
+ def deserialize(params)
209
+ @Created = params['Created']
210
+ @Creator = params['Creator']
211
+ @SaltJson = params['SaltJson']
212
+ @SignatureValue = params['SignatureValue']
213
+ @Type = params['Type']
214
+ end
215
+ end
216
+
217
+ # 创建凭证第二个
218
+ class TransactionArg < TencentCloud::Common::AbstractModel
219
+ # @param InvokerTDid: 凭证did
220
+ # @type InvokerTDid: String
221
+
222
+ attr_accessor :InvokerTDid
223
+
224
+ def initialize(invokertdid=nil)
225
+ @InvokerTDid = invokertdid
226
+ end
227
+
228
+ def deserialize(params)
229
+ @InvokerTDid = params['InvokerTDid']
230
+ end
231
+ end
232
+
233
+ # VerifyCredential请求参数结构体
234
+ class VerifyCredentialRequest < TencentCloud::Common::AbstractModel
235
+ # @param FunctionArg: 参数集合
236
+ # @type FunctionArg: :class:`Tencentcloud::Tdid.v20210519.models.VerifyFunctionArg`
237
+
238
+ attr_accessor :FunctionArg
239
+
240
+ def initialize(functionarg=nil)
241
+ @FunctionArg = functionarg
242
+ end
243
+
244
+ def deserialize(params)
245
+ unless params['FunctionArg'].nil?
246
+ @FunctionArg = VerifyFunctionArg.new
247
+ @FunctionArg.deserialize(params['FunctionArg'])
248
+ end
249
+ end
250
+ end
251
+
252
+ # VerifyCredential返回参数结构体
253
+ class VerifyCredentialResponse < TencentCloud::Common::AbstractModel
254
+ # @param Result: 是否验证成功
255
+ # @type Result: Boolean
256
+ # @param VerifyCode: 验证返回码
257
+ # @type VerifyCode: Integer
258
+ # @param VerifyMessage: 验证消息
259
+ # @type VerifyMessage: String
260
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
261
+ # @type RequestId: String
262
+
263
+ attr_accessor :Result, :VerifyCode, :VerifyMessage, :RequestId
264
+
265
+ def initialize(result=nil, verifycode=nil, verifymessage=nil, requestid=nil)
266
+ @Result = result
267
+ @VerifyCode = verifycode
268
+ @VerifyMessage = verifymessage
269
+ @RequestId = requestid
270
+ end
271
+
272
+ def deserialize(params)
273
+ @Result = params['Result']
274
+ @VerifyCode = params['VerifyCode']
275
+ @VerifyMessage = params['VerifyMessage']
276
+ @RequestId = params['RequestId']
277
+ end
278
+ end
279
+
280
+ # 验证凭证参数值
281
+ class VerifyFunctionArg < TencentCloud::Common::AbstractModel
282
+ # @param CptId: CPT ID
283
+ # @type CptId: Integer
284
+ # @param Issuer: issuer did
285
+ # @type Issuer: String
286
+ # @param ExpirationDate: 过期时间
287
+ # @type ExpirationDate: Integer
288
+ # @param ClaimJson: 声明
289
+ # @type ClaimJson: String
290
+ # @param IssuanceDate: 颁发时间
291
+ # @type IssuanceDate: Integer
292
+ # @param Context: context值
293
+ # @type Context: String
294
+ # @param Id: id值
295
+ # @type Id: String
296
+ # @param Proof: 签名值
297
+ # @type Proof: :class:`Tencentcloud::Tdid.v20210519.models.Proof`
298
+ # @param Type: type值
299
+ # @type Type: Array
300
+
301
+ attr_accessor :CptId, :Issuer, :ExpirationDate, :ClaimJson, :IssuanceDate, :Context, :Id, :Proof, :Type
302
+
303
+ def initialize(cptid=nil, issuer=nil, expirationdate=nil, claimjson=nil, issuancedate=nil, context=nil, id=nil, proof=nil, type=nil)
304
+ @CptId = cptid
305
+ @Issuer = issuer
306
+ @ExpirationDate = expirationdate
307
+ @ClaimJson = claimjson
308
+ @IssuanceDate = issuancedate
309
+ @Context = context
310
+ @Id = id
311
+ @Proof = proof
312
+ @Type = type
313
+ end
314
+
315
+ def deserialize(params)
316
+ @CptId = params['CptId']
317
+ @Issuer = params['Issuer']
318
+ @ExpirationDate = params['ExpirationDate']
319
+ @ClaimJson = params['ClaimJson']
320
+ @IssuanceDate = params['IssuanceDate']
321
+ @Context = params['Context']
322
+ @Id = params['Id']
323
+ unless params['Proof'].nil?
324
+ @Proof = Proof.new
325
+ @Proof.deserialize(params['Proof'])
326
+ end
327
+ @Type = params['Type']
328
+ end
329
+ end
330
+
331
+ end
332
+ end
333
+ end
334
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-tdid
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
+ TDID.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/VERSION
37
+ - lib/tencentcloud-sdk-tdid.rb
38
+ - lib/v20210519/client.rb
39
+ - lib/v20210519/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-tdid
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 - TDID
66
+ test_files: []