tencentcloud-sdk-btoe 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,349 @@
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 Btoe
21
+ module V20210514
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2021-05-14'
26
+ api_endpoint = 'btoe.tencentcloudapi.com'
27
+ sdk_version = 'BTOE_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 用户通过本接口向BTOE写入待存证的音频原文件或下载URL,BTOE对音频原文件存储后,将其Hash值存证上链,并生成含有电子签章的区块链存证电子凭证。音频类型支持格式:mp3、wav、wma、midi、flac;原文件上传大小不超过5 MB,下载URL文件大小不超过25 MB。
33
+
34
+ # @param request: Request instance for CreateAudioDeposit.
35
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateAudioDepositRequest`
36
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateAudioDepositResponse`
37
+ def CreateAudioDeposit(request)
38
+ body = send_request('CreateAudioDeposit', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = CreateAudioDepositResponse.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
+ # 用户通过本接口向BTOE写入待存证的业务数据明文,业务数据明文存证写入后不可修改,BTOE对业务数据明文存证生成含有电子签章的区块链存证电子凭证。
57
+
58
+ # @param request: Request instance for CreateDataDeposit.
59
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateDataDepositRequest`
60
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateDataDepositResponse`
61
+ def CreateDataDeposit(request)
62
+ body = send_request('CreateDataDeposit', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CreateDataDepositResponse.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
+ # 用户通过本接口向BTOE写入待存证的文档原文件或下载URL,BTOE对文档原文件存储后,将其Hash值存证上链,并生成含有电子签章的区块链存证电子凭证。文档类型支持格式:doc、docx、xls、xlsx、ppt、pptx、 pdf、html、txt、md、csv;原文件上传大小不超过5 MB,下载URL文件大小不超过10 MB。
81
+
82
+ # @param request: Request instance for CreateDocDeposit.
83
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateDocDepositRequest`
84
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateDocDepositResponse`
85
+ def CreateDocDeposit(request)
86
+ body = send_request('CreateDocDeposit', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = CreateDocDepositResponse.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
+ # 用户通过本接口向BTOE写入待存证的原文数据Hash值,BTOE对业务数据Hash值存证上链,并生成含有电子签章的区块链存证电子凭证。
105
+
106
+ # @param request: Request instance for CreateHashDeposit.
107
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositRequest`
108
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositResponse`
109
+ def CreateHashDeposit(request)
110
+ body = send_request('CreateHashDeposit', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = CreateHashDepositResponse.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
+ # 用户通过本接口向BTOE写入待存证的原文数据Hash值,BTOE对业务数据Hash值存证上链,本接口不生成区块链存证电子凭证。
129
+
130
+ # @param request: Request instance for CreateHashDepositNoCert.
131
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositNoCertRequest`
132
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositNoCertResponse`
133
+ def CreateHashDepositNoCert(request)
134
+ body = send_request('CreateHashDepositNoCert', request.serialize)
135
+ response = JSON.parse(body)
136
+ if response['Response'].key?('Error') == false
137
+ model = CreateHashDepositNoCertResponse.new
138
+ model.deserialize(response['Response'])
139
+ model
140
+ else
141
+ code = response['Response']['Error']['Code']
142
+ message = response['Response']['Error']['Message']
143
+ reqid = response['Response']['RequestId']
144
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
145
+ end
146
+ rescue TencentCloud::Common::TencentCloudSDKException => e
147
+ raise e
148
+ rescue StandardError => e
149
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
150
+ end
151
+
152
+ # 用户通过本接口向BTOE写入待存证的原文数据Hash值,BTOE对业务数据Hash值存证上链,并生成无电子签章的区块链存证电子凭证。
153
+
154
+ # @param request: Request instance for CreateHashDepositNoSeal.
155
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositNoSealRequest`
156
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateHashDepositNoSealResponse`
157
+ def CreateHashDepositNoSeal(request)
158
+ body = send_request('CreateHashDepositNoSeal', request.serialize)
159
+ response = JSON.parse(body)
160
+ if response['Response'].key?('Error') == false
161
+ model = CreateHashDepositNoSealResponse.new
162
+ model.deserialize(response['Response'])
163
+ model
164
+ else
165
+ code = response['Response']['Error']['Code']
166
+ message = response['Response']['Error']['Message']
167
+ reqid = response['Response']['RequestId']
168
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
169
+ end
170
+ rescue TencentCloud::Common::TencentCloudSDKException => e
171
+ raise e
172
+ rescue StandardError => e
173
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
174
+ end
175
+
176
+ # 用户通过本接口向BTOE写入待存证的图片原文件或下载URL,BTOE对图片原文件存储后,将其Hash值存证上链,并生成含有电子签章的区块链存证电子凭证。图片类型支持格式:png、jpg、jpeg、bmp、gif、svg;原文件上传大小不超过5 MB,下载URL文件大小不超过10 MB。
177
+
178
+ # @param request: Request instance for CreateImageDeposit.
179
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateImageDepositRequest`
180
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateImageDepositResponse`
181
+ def CreateImageDeposit(request)
182
+ body = send_request('CreateImageDeposit', request.serialize)
183
+ response = JSON.parse(body)
184
+ if response['Response'].key?('Error') == false
185
+ model = CreateImageDepositResponse.new
186
+ model.deserialize(response['Response'])
187
+ model
188
+ else
189
+ code = response['Response']['Error']['Code']
190
+ message = response['Response']['Error']['Message']
191
+ reqid = response['Response']['RequestId']
192
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
193
+ end
194
+ rescue TencentCloud::Common::TencentCloudSDKException => e
195
+ raise e
196
+ rescue StandardError => e
197
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
198
+ end
199
+
200
+ # 用户通过本接口向BTOE写入待存证的视频的原文件或下载URL,BTOE对视频原文件存储后,将其Hash值存证上链,并生成含有电子签章的区块链存证电子凭证。视频文件支持格式:mp4、avi、mkv、mov、flv,wmv,rmvb,3gp;文件大小限制:直接上传原文件不大于5MB,下载URL文件大小不大于200 MB。
201
+
202
+ # @param request: Request instance for CreateVideoDeposit.
203
+ # @type request: :class:`Tencentcloud::btoe::V20210514::CreateVideoDepositRequest`
204
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::CreateVideoDepositResponse`
205
+ def CreateVideoDeposit(request)
206
+ body = send_request('CreateVideoDeposit', request.serialize)
207
+ response = JSON.parse(body)
208
+ if response['Response'].key?('Error') == false
209
+ model = CreateVideoDepositResponse.new
210
+ model.deserialize(response['Response'])
211
+ model
212
+ else
213
+ code = response['Response']['Error']['Code']
214
+ message = response['Response']['Error']['Message']
215
+ reqid = response['Response']['RequestId']
216
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
217
+ end
218
+ rescue TencentCloud::Common::TencentCloudSDKException => e
219
+ raise e
220
+ rescue StandardError => e
221
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
222
+ end
223
+
224
+ # 用户通过存证编码向BTOE查询存证电子凭证信息。
225
+
226
+ # @param request: Request instance for GetDepositCert.
227
+ # @type request: :class:`Tencentcloud::btoe::V20210514::GetDepositCertRequest`
228
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::GetDepositCertResponse`
229
+ def GetDepositCert(request)
230
+ body = send_request('GetDepositCert', request.serialize)
231
+ response = JSON.parse(body)
232
+ if response['Response'].key?('Error') == false
233
+ model = GetDepositCertResponse.new
234
+ model.deserialize(response['Response'])
235
+ model
236
+ else
237
+ code = response['Response']['Error']['Code']
238
+ message = response['Response']['Error']['Message']
239
+ reqid = response['Response']['RequestId']
240
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
241
+ end
242
+ rescue TencentCloud::Common::TencentCloudSDKException => e
243
+ raise e
244
+ rescue StandardError => e
245
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
246
+ end
247
+
248
+ # 用户通过存证编码向BTOE获取存证文件的下载URL。
249
+ # -注:Hash类存证、业务数据明文存证不产生存证文件。
250
+
251
+ # @param request: Request instance for GetDepositFile.
252
+ # @type request: :class:`Tencentcloud::btoe::V20210514::GetDepositFileRequest`
253
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::GetDepositFileResponse`
254
+ def GetDepositFile(request)
255
+ body = send_request('GetDepositFile', request.serialize)
256
+ response = JSON.parse(body)
257
+ if response['Response'].key?('Error') == false
258
+ model = GetDepositFileResponse.new
259
+ model.deserialize(response['Response'])
260
+ model
261
+ else
262
+ code = response['Response']['Error']['Code']
263
+ message = response['Response']['Error']['Message']
264
+ reqid = response['Response']['RequestId']
265
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
266
+ end
267
+ rescue TencentCloud::Common::TencentCloudSDKException => e
268
+ raise e
269
+ rescue StandardError => e
270
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
271
+ end
272
+
273
+ # 用户通过存证编码向BTOE查询存证基本信息。
274
+
275
+ # @param request: Request instance for GetDepositInfo.
276
+ # @type request: :class:`Tencentcloud::btoe::V20210514::GetDepositInfoRequest`
277
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::GetDepositInfoResponse`
278
+ def GetDepositInfo(request)
279
+ body = send_request('GetDepositInfo', request.serialize)
280
+ response = JSON.parse(body)
281
+ if response['Response'].key?('Error') == false
282
+ model = GetDepositInfoResponse.new
283
+ model.deserialize(response['Response'])
284
+ model
285
+ else
286
+ code = response['Response']['Error']['Code']
287
+ message = response['Response']['Error']['Message']
288
+ reqid = response['Response']['RequestId']
289
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
290
+ end
291
+ rescue TencentCloud::Common::TencentCloudSDKException => e
292
+ raise e
293
+ rescue StandardError => e
294
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
295
+ end
296
+
297
+ # 用户向BTOE核验存证结果中的区块链交易hash的真实性
298
+
299
+ # @param request: Request instance for VerifyEvidenceBlockChainTxHash.
300
+ # @type request: :class:`Tencentcloud::btoe::V20210514::VerifyEvidenceBlockChainTxHashRequest`
301
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::VerifyEvidenceBlockChainTxHashResponse`
302
+ def VerifyEvidenceBlockChainTxHash(request)
303
+ body = send_request('VerifyEvidenceBlockChainTxHash', request.serialize)
304
+ response = JSON.parse(body)
305
+ if response['Response'].key?('Error') == false
306
+ model = VerifyEvidenceBlockChainTxHashResponse.new
307
+ model.deserialize(response['Response'])
308
+ model
309
+ else
310
+ code = response['Response']['Error']['Code']
311
+ message = response['Response']['Error']['Message']
312
+ reqid = response['Response']['RequestId']
313
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
314
+ end
315
+ rescue TencentCloud::Common::TencentCloudSDKException => e
316
+ raise e
317
+ rescue StandardError => e
318
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
319
+ end
320
+
321
+ # 用户存证内容hash向BTOE核验存证记录的真实性。
322
+
323
+ # @param request: Request instance for VerifyEvidenceHash.
324
+ # @type request: :class:`Tencentcloud::btoe::V20210514::VerifyEvidenceHashRequest`
325
+ # @rtype: :class:`Tencentcloud::btoe::V20210514::VerifyEvidenceHashResponse`
326
+ def VerifyEvidenceHash(request)
327
+ body = send_request('VerifyEvidenceHash', request.serialize)
328
+ response = JSON.parse(body)
329
+ if response['Response'].key?('Error') == false
330
+ model = VerifyEvidenceHashResponse.new
331
+ model.deserialize(response['Response'])
332
+ model
333
+ else
334
+ code = response['Response']['Error']['Code']
335
+ message = response['Response']['Error']['Message']
336
+ reqid = response['Response']['RequestId']
337
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
338
+ end
339
+ rescue TencentCloud::Common::TencentCloudSDKException => e
340
+ raise e
341
+ rescue StandardError => e
342
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
343
+ end
344
+
345
+
346
+ end
347
+ end
348
+ end
349
+ end