/
client.rb
596 lines (543 loc) · 29.7 KB
/
client.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'json'
module TencentCloud
module Ms
module V20180408
class Client < TencentCloud::Common::AbstractClient
def initialize(credential, region, profile = nil)
api_version = '2018-04-08'
api_endpoint = 'ms.tencentcloudapi.com'
sdk_version = 'MS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
super(credential, region, api_version, api_endpoint, sdk_version, profile)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制,取消渠道合作加固中的任务
# @param request: Request instance for CancelEncryptTask.
# @type request: :class:`Tencentcloud::ms::V20180408::CancelEncryptTaskRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CancelEncryptTaskResponse`
def CancelEncryptTask(request)
body = send_request('CancelEncryptTask', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CancelEncryptTaskResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 将应用和资源进行绑定。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for CreateBindInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateBindInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateBindInstanceResponse`
def CreateBindInstance(request)
body = send_request('CreateBindInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateBindInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取云COS文件存储临时密钥,密钥仅限于临时上传文件,有访问限制和时效性,请保管好临时密钥。
# @param request: Request instance for CreateCosSecKeyInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateCosSecKeyInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateCosSecKeyInstanceResponse`
def CreateCosSecKeyInstance(request)
body = send_request('CreateCosSecKeyInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateCosSecKeyInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制,用于创建加固任务。
# @param request: Request instance for CreateEncryptInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateEncryptInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateEncryptInstanceResponse`
def CreateEncryptInstance(request)
body = send_request('CreateEncryptInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateEncryptInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制。
# 订单类型有:免费试用、按年收费、按次收费。
# 应用加固支持的平台类型有:android加固 、ios源码混淆 、sdk加固、applet小程序加固
# @param request: Request instance for CreateOrderInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateOrderInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateOrderInstanceResponse`
def CreateOrderInstance(request)
body = send_request('CreateOrderInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateOrderInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 用户可以使用该接口自建资源,只支持白名单用户
# @param request: Request instance for CreateResourceInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateResourceInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateResourceInstancesResponse`
def CreateResourceInstances(request)
body = send_request('CreateResourceInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateResourceInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 用户通过该接口提交应用进行应用加固,加固后需通过DescribeShieldResult接口查询加固结果。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for CreateShieldInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateShieldInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateShieldInstanceResponse`
def CreateShieldInstance(request)
body = send_request('CreateShieldInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateShieldInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 对资源进行策略新增。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for CreateShieldPlanInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::CreateShieldPlanInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::CreateShieldPlanInstanceResponse`
def CreateShieldPlanInstance(request)
body = send_request('CreateShieldPlanInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateShieldPlanInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除一个或者多个app加固信息。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for DeleteShieldInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DeleteShieldInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DeleteShieldInstancesResponse`
def DeleteShieldInstances(request)
body = send_request('DeleteShieldInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteShieldInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口采用同步模式请求腾讯APK云检测服务,即时返回检测数据,需要用户用轮询的方式调用本接口来进行样本送检并获取检测结果(每隔60s发送一次请求,传相同的参数,重试30次),一般情况下0.5h内会出检测结果,最长时间是3h。当Result为ok并且ResultList数组非空有值时,代表检测完毕,若长时间获取不到检测结果,请联系客服。
# @param request: Request instance for DescribeApkDetectionResult.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeApkDetectionResultRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeApkDetectionResultResponse`
def DescribeApkDetectionResult(request)
body = send_request('DescribeApkDetectionResult', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeApkDetectionResultResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制,用于查询加固任务,入参中的条件过滤字段均为精准匹配。支持功能点: 1. 多任务分页查询 2.根据任务Id唯一值查询单记录
# @param request: Request instance for DescribeEncryptInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeEncryptInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeEncryptInstancesResponse`
def DescribeEncryptInstances(request)
body = send_request('DescribeEncryptInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeEncryptInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制。入参中的条件过滤字段均为精准匹配。
# @param request: Request instance for DescribeEncryptPlan.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeEncryptPlanRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeEncryptPlanResponse`
def DescribeEncryptPlan(request)
body = send_request('DescribeEncryptPlan', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeEncryptPlanResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口供渠道合作应用加固使用,接口调用有白名单用户限制。 接口返回的结果为:创建订单后,订单审批状态信息,以及与订单关联的资源状态等信息,入参中的条件过滤字段均为精准匹配.
# 接口功能点:
# 1.支持多订单分页查询;
# 2.支持唯一订单号精准匹配查询;
# 3.支持唯一资源号精准匹配查询;
# @param request: Request instance for DescribeOrderInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeOrderInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeOrderInstancesResponse`
def DescribeOrderInstances(request)
body = send_request('DescribeOrderInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeOrderInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取某个用户的所有资源信息。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for DescribeResourceInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeResourceInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeResourceInstancesResponse`
def DescribeResourceInstances(request)
body = send_request('DescribeResourceInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeResourceInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口用于查看app列表。
# 可以通过指定任务唯一标识ItemId来查询指定app的详细信息,或通过设定过滤器来查询满足过滤条件的app的详细信息。 指定偏移(Offset)和限制(Limit)来选择结果中的一部分,默认返回满足条件的前20个app信息。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for DescribeShieldInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeShieldInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeShieldInstancesResponse`
def DescribeShieldInstances(request)
body = send_request('DescribeShieldInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeShieldInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询加固策略。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for DescribeShieldPlanInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeShieldPlanInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeShieldPlanInstanceResponse`
def DescribeShieldPlanInstance(request)
body = send_request('DescribeShieldPlanInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeShieldPlanInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 通过唯一标识获取加固的结果。(注意:根据国家互联网用户实名制相关要求,使用该产品前,需先完成实名认证。)
# @param request: Request instance for DescribeShieldResult.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeShieldResultRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeShieldResultResponse`
def DescribeShieldResult(request)
body = send_request('DescribeShieldResult', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeShieldResultResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 移动安全-网址检测服务
# @param request: Request instance for DescribeUrlDetectionResult.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeUrlDetectionResultRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeUrlDetectionResultResponse`
def DescribeUrlDetectionResult(request)
body = send_request('DescribeUrlDetectionResult', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeUrlDetectionResultResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取用户基础信息
# @param request: Request instance for DescribeUserBaseInfoInstance.
# @type request: :class:`Tencentcloud::ms::V20180408::DescribeUserBaseInfoInstanceRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DescribeUserBaseInfoInstanceResponse`
def DescribeUserBaseInfoInstance(request)
body = send_request('DescribeUserBaseInfoInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeUserBaseInfoInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 渠道合作资源销毁
# 安卓应用加固-按年收费资源销毁,其他类型暂不支持
# @param request: Request instance for DestroyResourceInstances.
# @type request: :class:`Tencentcloud::ms::V20180408::DestroyResourceInstancesRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::DestroyResourceInstancesResponse`
def DestroyResourceInstances(request)
body = send_request('DestroyResourceInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DestroyResourceInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# client任务请求
# @param request: Request instance for RequestLocalTask.
# @type request: :class:`Tencentcloud::ms::V20180408::RequestLocalTaskRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::RequestLocalTaskResponse`
def RequestLocalTask(request)
body = send_request('RequestLocalTask', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = RequestLocalTaskResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新client状态,需要白名单
# @param request: Request instance for UpdateClientState.
# @type request: :class:`Tencentcloud::ms::V20180408::UpdateClientStateRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::UpdateClientStateResponse`
def UpdateClientState(request)
body = send_request('UpdateClientState', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateClientStateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 更新本地任务执行结果
# @param request: Request instance for UpdateLocalTaskResult.
# @type request: :class:`Tencentcloud::ms::V20180408::UpdateLocalTaskResultRequest`
# @rtype: :class:`Tencentcloud::ms::V20180408::UpdateLocalTaskResultResponse`
def UpdateLocalTaskResult(request)
body = send_request('UpdateLocalTaskResult', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpdateLocalTaskResultResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
end
end
end
end