tencentcloud-sdk-scf 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1051 @@
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 Scf
21
+ module V20180416
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-04-16'
26
+ api_endpoint = 'scf.tencentcloudapi.com'
27
+ sdk_version = 'SCF_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 复制一个函数,您可以选择将复制出的新函数放置在特定的Region和Namespace。
33
+ # 注:本接口**不会**复制函数的以下对象或属性:
34
+ # 1. 函数的触发器
35
+ # 2. 除了$LATEST以外的其它版本
36
+ # 3. 函数配置的日志投递到的CLS目标。
37
+
38
+ # 如有需要,您可以在复制后手动配置新函数。
39
+
40
+ # @param request: Request instance for CopyFunction.
41
+ # @type request: :class:`Tencentcloud::scf::V20180416::CopyFunctionRequest`
42
+ # @rtype: :class:`Tencentcloud::scf::V20180416::CopyFunctionResponse`
43
+ def CopyFunction(request)
44
+ body = send_request('CopyFunction', request.serialize)
45
+ response = JSON.parse(body)
46
+ if response['Response'].key?('Error') == false
47
+ model = CopyFunctionResponse.new
48
+ model.deserialize(response['Response'])
49
+ model
50
+ else
51
+ code = response['Response']['Error']['Code']
52
+ message = response['Response']['Error']['Message']
53
+ reqid = response['Response']['RequestId']
54
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
55
+ end
56
+ rescue TencentCloud::Common::TencentCloudSDKException => e
57
+ raise e
58
+ rescue StandardError => e
59
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
60
+ end
61
+
62
+ # 为某个函数版本创建一个别名,您可以使用别名来标记特定的函数版本,如DEV/RELEASE版本,也可以随时修改别名指向的版本。
63
+ # 一个别名必须指向一个主版本,此外还可以同时指向一个附加版本。调用函数时指定特定的别名,则请求会被发送到别名指向的版本上,您可以配置请求发送到主版本和附加版本的比例。
64
+
65
+ # @param request: Request instance for CreateAlias.
66
+ # @type request: :class:`Tencentcloud::scf::V20180416::CreateAliasRequest`
67
+ # @rtype: :class:`Tencentcloud::scf::V20180416::CreateAliasResponse`
68
+ def CreateAlias(request)
69
+ body = send_request('CreateAlias', request.serialize)
70
+ response = JSON.parse(body)
71
+ if response['Response'].key?('Error') == false
72
+ model = CreateAliasResponse.new
73
+ model.deserialize(response['Response'])
74
+ model
75
+ else
76
+ code = response['Response']['Error']['Code']
77
+ message = response['Response']['Error']['Message']
78
+ reqid = response['Response']['RequestId']
79
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
80
+ end
81
+ rescue TencentCloud::Common::TencentCloudSDKException => e
82
+ raise e
83
+ rescue StandardError => e
84
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
85
+ end
86
+
87
+ # 该接口根据传入参数创建新的函数。
88
+
89
+ # @param request: Request instance for CreateFunction.
90
+ # @type request: :class:`Tencentcloud::scf::V20180416::CreateFunctionRequest`
91
+ # @rtype: :class:`Tencentcloud::scf::V20180416::CreateFunctionResponse`
92
+ def CreateFunction(request)
93
+ body = send_request('CreateFunction', request.serialize)
94
+ response = JSON.parse(body)
95
+ if response['Response'].key?('Error') == false
96
+ model = CreateFunctionResponse.new
97
+ model.deserialize(response['Response'])
98
+ model
99
+ else
100
+ code = response['Response']['Error']['Code']
101
+ message = response['Response']['Error']['Message']
102
+ reqid = response['Response']['RequestId']
103
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
104
+ end
105
+ rescue TencentCloud::Common::TencentCloudSDKException => e
106
+ raise e
107
+ rescue StandardError => e
108
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
109
+ end
110
+
111
+ # 该接口根据传入的参数创建命名空间。
112
+
113
+ # @param request: Request instance for CreateNamespace.
114
+ # @type request: :class:`Tencentcloud::scf::V20180416::CreateNamespaceRequest`
115
+ # @rtype: :class:`Tencentcloud::scf::V20180416::CreateNamespaceResponse`
116
+ def CreateNamespace(request)
117
+ body = send_request('CreateNamespace', request.serialize)
118
+ response = JSON.parse(body)
119
+ if response['Response'].key?('Error') == false
120
+ model = CreateNamespaceResponse.new
121
+ model.deserialize(response['Response'])
122
+ model
123
+ else
124
+ code = response['Response']['Error']['Code']
125
+ message = response['Response']['Error']['Message']
126
+ reqid = response['Response']['RequestId']
127
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
128
+ end
129
+ rescue TencentCloud::Common::TencentCloudSDKException => e
130
+ raise e
131
+ rescue StandardError => e
132
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
133
+ end
134
+
135
+ # 该接口根据参数输入设置新的触发方式。
136
+
137
+ # @param request: Request instance for CreateTrigger.
138
+ # @type request: :class:`Tencentcloud::scf::V20180416::CreateTriggerRequest`
139
+ # @rtype: :class:`Tencentcloud::scf::V20180416::CreateTriggerResponse`
140
+ def CreateTrigger(request)
141
+ body = send_request('CreateTrigger', request.serialize)
142
+ response = JSON.parse(body)
143
+ if response['Response'].key?('Error') == false
144
+ model = CreateTriggerResponse.new
145
+ model.deserialize(response['Response'])
146
+ model
147
+ else
148
+ code = response['Response']['Error']['Code']
149
+ message = response['Response']['Error']['Message']
150
+ reqid = response['Response']['RequestId']
151
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
152
+ end
153
+ rescue TencentCloud::Common::TencentCloudSDKException => e
154
+ raise e
155
+ rescue StandardError => e
156
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
157
+ end
158
+
159
+ # 删除一个函数版本的别名
160
+
161
+ # @param request: Request instance for DeleteAlias.
162
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteAliasRequest`
163
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteAliasResponse`
164
+ def DeleteAlias(request)
165
+ body = send_request('DeleteAlias', request.serialize)
166
+ response = JSON.parse(body)
167
+ if response['Response'].key?('Error') == false
168
+ model = DeleteAliasResponse.new
169
+ model.deserialize(response['Response'])
170
+ model
171
+ else
172
+ code = response['Response']['Error']['Code']
173
+ message = response['Response']['Error']['Message']
174
+ reqid = response['Response']['RequestId']
175
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
176
+ end
177
+ rescue TencentCloud::Common::TencentCloudSDKException => e
178
+ raise e
179
+ rescue StandardError => e
180
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
181
+ end
182
+
183
+ # 该接口根据传入参数删除函数。
184
+
185
+ # @param request: Request instance for DeleteFunction.
186
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteFunctionRequest`
187
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteFunctionResponse`
188
+ def DeleteFunction(request)
189
+ body = send_request('DeleteFunction', request.serialize)
190
+ response = JSON.parse(body)
191
+ if response['Response'].key?('Error') == false
192
+ model = DeleteFunctionResponse.new
193
+ model.deserialize(response['Response'])
194
+ model
195
+ else
196
+ code = response['Response']['Error']['Code']
197
+ message = response['Response']['Error']['Message']
198
+ reqid = response['Response']['RequestId']
199
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
200
+ end
201
+ rescue TencentCloud::Common::TencentCloudSDKException => e
202
+ raise e
203
+ rescue StandardError => e
204
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
205
+ end
206
+
207
+ # 删除指定层的指定版本,被删除的版本无法再关联到函数上,但不会影响正在引用这个层的函数。
208
+
209
+ # @param request: Request instance for DeleteLayerVersion.
210
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteLayerVersionRequest`
211
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteLayerVersionResponse`
212
+ def DeleteLayerVersion(request)
213
+ body = send_request('DeleteLayerVersion', request.serialize)
214
+ response = JSON.parse(body)
215
+ if response['Response'].key?('Error') == false
216
+ model = DeleteLayerVersionResponse.new
217
+ model.deserialize(response['Response'])
218
+ model
219
+ else
220
+ code = response['Response']['Error']['Code']
221
+ message = response['Response']['Error']['Message']
222
+ reqid = response['Response']['RequestId']
223
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
224
+ end
225
+ rescue TencentCloud::Common::TencentCloudSDKException => e
226
+ raise e
227
+ rescue StandardError => e
228
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
229
+ end
230
+
231
+ # 该接口根据传入的参数删除命名空间。
232
+
233
+ # @param request: Request instance for DeleteNamespace.
234
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteNamespaceRequest`
235
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteNamespaceResponse`
236
+ def DeleteNamespace(request)
237
+ body = send_request('DeleteNamespace', request.serialize)
238
+ response = JSON.parse(body)
239
+ if response['Response'].key?('Error') == false
240
+ model = DeleteNamespaceResponse.new
241
+ model.deserialize(response['Response'])
242
+ model
243
+ else
244
+ code = response['Response']['Error']['Code']
245
+ message = response['Response']['Error']['Message']
246
+ reqid = response['Response']['RequestId']
247
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
248
+ end
249
+ rescue TencentCloud::Common::TencentCloudSDKException => e
250
+ raise e
251
+ rescue StandardError => e
252
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
253
+ end
254
+
255
+ # 删除函数版本的预置并发配置。
256
+
257
+ # @param request: Request instance for DeleteProvisionedConcurrencyConfig.
258
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteProvisionedConcurrencyConfigRequest`
259
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteProvisionedConcurrencyConfigResponse`
260
+ def DeleteProvisionedConcurrencyConfig(request)
261
+ body = send_request('DeleteProvisionedConcurrencyConfig', request.serialize)
262
+ response = JSON.parse(body)
263
+ if response['Response'].key?('Error') == false
264
+ model = DeleteProvisionedConcurrencyConfigResponse.new
265
+ model.deserialize(response['Response'])
266
+ model
267
+ else
268
+ code = response['Response']['Error']['Code']
269
+ message = response['Response']['Error']['Message']
270
+ reqid = response['Response']['RequestId']
271
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
272
+ end
273
+ rescue TencentCloud::Common::TencentCloudSDKException => e
274
+ raise e
275
+ rescue StandardError => e
276
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
277
+ end
278
+
279
+ # 删除函数的最大独占配额配置。
280
+
281
+ # @param request: Request instance for DeleteReservedConcurrencyConfig.
282
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteReservedConcurrencyConfigRequest`
283
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteReservedConcurrencyConfigResponse`
284
+ def DeleteReservedConcurrencyConfig(request)
285
+ body = send_request('DeleteReservedConcurrencyConfig', request.serialize)
286
+ response = JSON.parse(body)
287
+ if response['Response'].key?('Error') == false
288
+ model = DeleteReservedConcurrencyConfigResponse.new
289
+ model.deserialize(response['Response'])
290
+ model
291
+ else
292
+ code = response['Response']['Error']['Code']
293
+ message = response['Response']['Error']['Message']
294
+ reqid = response['Response']['RequestId']
295
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
296
+ end
297
+ rescue TencentCloud::Common::TencentCloudSDKException => e
298
+ raise e
299
+ rescue StandardError => e
300
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
301
+ end
302
+
303
+ # 该接口根据参数传入删除已有的触发方式。
304
+
305
+ # @param request: Request instance for DeleteTrigger.
306
+ # @type request: :class:`Tencentcloud::scf::V20180416::DeleteTriggerRequest`
307
+ # @rtype: :class:`Tencentcloud::scf::V20180416::DeleteTriggerResponse`
308
+ def DeleteTrigger(request)
309
+ body = send_request('DeleteTrigger', request.serialize)
310
+ response = JSON.parse(body)
311
+ if response['Response'].key?('Error') == false
312
+ model = DeleteTriggerResponse.new
313
+ model.deserialize(response['Response'])
314
+ model
315
+ else
316
+ code = response['Response']['Error']['Code']
317
+ message = response['Response']['Error']['Message']
318
+ reqid = response['Response']['RequestId']
319
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
320
+ end
321
+ rescue TencentCloud::Common::TencentCloudSDKException => e
322
+ raise e
323
+ rescue StandardError => e
324
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
325
+ end
326
+
327
+ # 获取账户信息
328
+
329
+ # @param request: Request instance for GetAccount.
330
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetAccountRequest`
331
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetAccountResponse`
332
+ def GetAccount(request)
333
+ body = send_request('GetAccount', request.serialize)
334
+ response = JSON.parse(body)
335
+ if response['Response'].key?('Error') == false
336
+ model = GetAccountResponse.new
337
+ model.deserialize(response['Response'])
338
+ model
339
+ else
340
+ code = response['Response']['Error']['Code']
341
+ message = response['Response']['Error']['Message']
342
+ reqid = response['Response']['RequestId']
343
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
344
+ end
345
+ rescue TencentCloud::Common::TencentCloudSDKException => e
346
+ raise e
347
+ rescue StandardError => e
348
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
349
+ end
350
+
351
+ # 获取别名的详细信息,包括名称、描述、版本、路由信息等。
352
+
353
+ # @param request: Request instance for GetAlias.
354
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetAliasRequest`
355
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetAliasResponse`
356
+ def GetAlias(request)
357
+ body = send_request('GetAlias', request.serialize)
358
+ response = JSON.parse(body)
359
+ if response['Response'].key?('Error') == false
360
+ model = GetAliasResponse.new
361
+ model.deserialize(response['Response'])
362
+ model
363
+ else
364
+ code = response['Response']['Error']['Code']
365
+ message = response['Response']['Error']['Message']
366
+ reqid = response['Response']['RequestId']
367
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
368
+ end
369
+ rescue TencentCloud::Common::TencentCloudSDKException => e
370
+ raise e
371
+ rescue StandardError => e
372
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
373
+ end
374
+
375
+ # 该接口获取某个函数的详细信息,包括名称、代码、处理方法、关联触发器和超时时间等字段。
376
+
377
+ # @param request: Request instance for GetFunction.
378
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetFunctionRequest`
379
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetFunctionResponse`
380
+ def GetFunction(request)
381
+ body = send_request('GetFunction', request.serialize)
382
+ response = JSON.parse(body)
383
+ if response['Response'].key?('Error') == false
384
+ model = GetFunctionResponse.new
385
+ model.deserialize(response['Response'])
386
+ model
387
+ else
388
+ code = response['Response']['Error']['Code']
389
+ message = response['Response']['Error']['Message']
390
+ reqid = response['Response']['RequestId']
391
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
392
+ end
393
+ rescue TencentCloud::Common::TencentCloudSDKException => e
394
+ raise e
395
+ rescue StandardError => e
396
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
397
+ end
398
+
399
+ # 该接口用于获取函数代码包的下载地址。
400
+
401
+ # @param request: Request instance for GetFunctionAddress.
402
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetFunctionAddressRequest`
403
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetFunctionAddressResponse`
404
+ def GetFunctionAddress(request)
405
+ body = send_request('GetFunctionAddress', request.serialize)
406
+ response = JSON.parse(body)
407
+ if response['Response'].key?('Error') == false
408
+ model = GetFunctionAddressResponse.new
409
+ model.deserialize(response['Response'])
410
+ model
411
+ else
412
+ code = response['Response']['Error']['Code']
413
+ message = response['Response']['Error']['Message']
414
+ reqid = response['Response']['RequestId']
415
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
416
+ end
417
+ rescue TencentCloud::Common::TencentCloudSDKException => e
418
+ raise e
419
+ rescue StandardError => e
420
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
421
+ end
422
+
423
+ # 获取函数异步重试配置,包括重试次数和消息保留时间
424
+
425
+ # @param request: Request instance for GetFunctionEventInvokeConfig.
426
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetFunctionEventInvokeConfigRequest`
427
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetFunctionEventInvokeConfigResponse`
428
+ def GetFunctionEventInvokeConfig(request)
429
+ body = send_request('GetFunctionEventInvokeConfig', request.serialize)
430
+ response = JSON.parse(body)
431
+ if response['Response'].key?('Error') == false
432
+ model = GetFunctionEventInvokeConfigResponse.new
433
+ model.deserialize(response['Response'])
434
+ model
435
+ else
436
+ code = response['Response']['Error']['Code']
437
+ message = response['Response']['Error']['Message']
438
+ reqid = response['Response']['RequestId']
439
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
440
+ end
441
+ rescue TencentCloud::Common::TencentCloudSDKException => e
442
+ raise e
443
+ rescue StandardError => e
444
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
445
+ end
446
+
447
+ # 该接口根据指定的日志查询条件返回函数运行日志。
448
+
449
+ # @param request: Request instance for GetFunctionLogs.
450
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetFunctionLogsRequest`
451
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetFunctionLogsResponse`
452
+ def GetFunctionLogs(request)
453
+ body = send_request('GetFunctionLogs', request.serialize)
454
+ response = JSON.parse(body)
455
+ if response['Response'].key?('Error') == false
456
+ model = GetFunctionLogsResponse.new
457
+ model.deserialize(response['Response'])
458
+ model
459
+ else
460
+ code = response['Response']['Error']['Code']
461
+ message = response['Response']['Error']['Message']
462
+ reqid = response['Response']['RequestId']
463
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
464
+ end
465
+ rescue TencentCloud::Common::TencentCloudSDKException => e
466
+ raise e
467
+ rescue StandardError => e
468
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
469
+ end
470
+
471
+ # 获取层版本详细信息,包括用于下载层中文件的链接。
472
+
473
+ # @param request: Request instance for GetLayerVersion.
474
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetLayerVersionRequest`
475
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetLayerVersionResponse`
476
+ def GetLayerVersion(request)
477
+ body = send_request('GetLayerVersion', request.serialize)
478
+ response = JSON.parse(body)
479
+ if response['Response'].key?('Error') == false
480
+ model = GetLayerVersionResponse.new
481
+ model.deserialize(response['Response'])
482
+ model
483
+ else
484
+ code = response['Response']['Error']['Code']
485
+ message = response['Response']['Error']['Message']
486
+ reqid = response['Response']['RequestId']
487
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
488
+ end
489
+ rescue TencentCloud::Common::TencentCloudSDKException => e
490
+ raise e
491
+ rescue StandardError => e
492
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
493
+ end
494
+
495
+ # 获取函数或函数某一版本的预置并发详情。
496
+
497
+ # @param request: Request instance for GetProvisionedConcurrencyConfig.
498
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetProvisionedConcurrencyConfigRequest`
499
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetProvisionedConcurrencyConfigResponse`
500
+ def GetProvisionedConcurrencyConfig(request)
501
+ body = send_request('GetProvisionedConcurrencyConfig', request.serialize)
502
+ response = JSON.parse(body)
503
+ if response['Response'].key?('Error') == false
504
+ model = GetProvisionedConcurrencyConfigResponse.new
505
+ model.deserialize(response['Response'])
506
+ model
507
+ else
508
+ code = response['Response']['Error']['Code']
509
+ message = response['Response']['Error']['Message']
510
+ reqid = response['Response']['RequestId']
511
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
512
+ end
513
+ rescue TencentCloud::Common::TencentCloudSDKException => e
514
+ raise e
515
+ rescue StandardError => e
516
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
517
+ end
518
+
519
+ # 获取函数的最大独占配额详情。
520
+
521
+ # @param request: Request instance for GetReservedConcurrencyConfig.
522
+ # @type request: :class:`Tencentcloud::scf::V20180416::GetReservedConcurrencyConfigRequest`
523
+ # @rtype: :class:`Tencentcloud::scf::V20180416::GetReservedConcurrencyConfigResponse`
524
+ def GetReservedConcurrencyConfig(request)
525
+ body = send_request('GetReservedConcurrencyConfig', request.serialize)
526
+ response = JSON.parse(body)
527
+ if response['Response'].key?('Error') == false
528
+ model = GetReservedConcurrencyConfigResponse.new
529
+ model.deserialize(response['Response'])
530
+ model
531
+ else
532
+ code = response['Response']['Error']['Code']
533
+ message = response['Response']['Error']['Message']
534
+ reqid = response['Response']['RequestId']
535
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
536
+ end
537
+ rescue TencentCloud::Common::TencentCloudSDKException => e
538
+ raise e
539
+ rescue StandardError => e
540
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
541
+ end
542
+
543
+ # 该接口用于运行函数。
544
+
545
+ # @param request: Request instance for Invoke.
546
+ # @type request: :class:`Tencentcloud::scf::V20180416::InvokeRequest`
547
+ # @rtype: :class:`Tencentcloud::scf::V20180416::InvokeResponse`
548
+ def Invoke(request)
549
+ body = send_request('Invoke', request.serialize)
550
+ response = JSON.parse(body)
551
+ if response['Response'].key?('Error') == false
552
+ model = InvokeResponse.new
553
+ model.deserialize(response['Response'])
554
+ model
555
+ else
556
+ code = response['Response']['Error']['Code']
557
+ message = response['Response']['Error']['Message']
558
+ reqid = response['Response']['RequestId']
559
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
560
+ end
561
+ rescue TencentCloud::Common::TencentCloudSDKException => e
562
+ raise e
563
+ rescue StandardError => e
564
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
565
+ end
566
+
567
+ # SCF同步调用函数接口
568
+
569
+ # @param request: Request instance for InvokeFunction.
570
+ # @type request: :class:`Tencentcloud::scf::V20180416::InvokeFunctionRequest`
571
+ # @rtype: :class:`Tencentcloud::scf::V20180416::InvokeFunctionResponse`
572
+ def InvokeFunction(request)
573
+ body = send_request('InvokeFunction', request.serialize)
574
+ response = JSON.parse(body)
575
+ if response['Response'].key?('Error') == false
576
+ model = InvokeFunctionResponse.new
577
+ model.deserialize(response['Response'])
578
+ model
579
+ else
580
+ code = response['Response']['Error']['Code']
581
+ message = response['Response']['Error']['Message']
582
+ reqid = response['Response']['RequestId']
583
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
584
+ end
585
+ rescue TencentCloud::Common::TencentCloudSDKException => e
586
+ raise e
587
+ rescue StandardError => e
588
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
589
+ end
590
+
591
+ # 返回一个函数下的全部别名,可以根据特定函数版本过滤。
592
+
593
+ # @param request: Request instance for ListAliases.
594
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListAliasesRequest`
595
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListAliasesResponse`
596
+ def ListAliases(request)
597
+ body = send_request('ListAliases', request.serialize)
598
+ response = JSON.parse(body)
599
+ if response['Response'].key?('Error') == false
600
+ model = ListAliasesResponse.new
601
+ model.deserialize(response['Response'])
602
+ model
603
+ else
604
+ code = response['Response']['Error']['Code']
605
+ message = response['Response']['Error']['Message']
606
+ reqid = response['Response']['RequestId']
607
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
608
+ end
609
+ rescue TencentCloud::Common::TencentCloudSDKException => e
610
+ raise e
611
+ rescue StandardError => e
612
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
613
+ end
614
+
615
+ # 拉取函数异步事件列表
616
+
617
+ # @param request: Request instance for ListAsyncEvents.
618
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListAsyncEventsRequest`
619
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListAsyncEventsResponse`
620
+ def ListAsyncEvents(request)
621
+ body = send_request('ListAsyncEvents', request.serialize)
622
+ response = JSON.parse(body)
623
+ if response['Response'].key?('Error') == false
624
+ model = ListAsyncEventsResponse.new
625
+ model.deserialize(response['Response'])
626
+ model
627
+ else
628
+ code = response['Response']['Error']['Code']
629
+ message = response['Response']['Error']['Message']
630
+ reqid = response['Response']['RequestId']
631
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
632
+ end
633
+ rescue TencentCloud::Common::TencentCloudSDKException => e
634
+ raise e
635
+ rescue StandardError => e
636
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
637
+ end
638
+
639
+ # 该接口根据传入的查询参数返回相关函数信息。
640
+
641
+ # @param request: Request instance for ListFunctions.
642
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListFunctionsRequest`
643
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListFunctionsResponse`
644
+ def ListFunctions(request)
645
+ body = send_request('ListFunctions', request.serialize)
646
+ response = JSON.parse(body)
647
+ if response['Response'].key?('Error') == false
648
+ model = ListFunctionsResponse.new
649
+ model.deserialize(response['Response'])
650
+ model
651
+ else
652
+ code = response['Response']['Error']['Code']
653
+ message = response['Response']['Error']['Message']
654
+ reqid = response['Response']['RequestId']
655
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
656
+ end
657
+ rescue TencentCloud::Common::TencentCloudSDKException => e
658
+ raise e
659
+ rescue StandardError => e
660
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
661
+ end
662
+
663
+ # 返回指定层的全部版本的信息
664
+
665
+ # @param request: Request instance for ListLayerVersions.
666
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListLayerVersionsRequest`
667
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListLayerVersionsResponse`
668
+ def ListLayerVersions(request)
669
+ body = send_request('ListLayerVersions', request.serialize)
670
+ response = JSON.parse(body)
671
+ if response['Response'].key?('Error') == false
672
+ model = ListLayerVersionsResponse.new
673
+ model.deserialize(response['Response'])
674
+ model
675
+ else
676
+ code = response['Response']['Error']['Code']
677
+ message = response['Response']['Error']['Message']
678
+ reqid = response['Response']['RequestId']
679
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
680
+ end
681
+ rescue TencentCloud::Common::TencentCloudSDKException => e
682
+ raise e
683
+ rescue StandardError => e
684
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
685
+ end
686
+
687
+ # 返回全部层的列表,其中包含了每个层最新版本的信息,可以通过适配运行时进行过滤。
688
+
689
+ # @param request: Request instance for ListLayers.
690
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListLayersRequest`
691
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListLayersResponse`
692
+ def ListLayers(request)
693
+ body = send_request('ListLayers', request.serialize)
694
+ response = JSON.parse(body)
695
+ if response['Response'].key?('Error') == false
696
+ model = ListLayersResponse.new
697
+ model.deserialize(response['Response'])
698
+ model
699
+ else
700
+ code = response['Response']['Error']['Code']
701
+ message = response['Response']['Error']['Message']
702
+ reqid = response['Response']['RequestId']
703
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
704
+ end
705
+ rescue TencentCloud::Common::TencentCloudSDKException => e
706
+ raise e
707
+ rescue StandardError => e
708
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
709
+ end
710
+
711
+ # 列出命名空间列表
712
+
713
+ # @param request: Request instance for ListNamespaces.
714
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListNamespacesRequest`
715
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListNamespacesResponse`
716
+ def ListNamespaces(request)
717
+ body = send_request('ListNamespaces', request.serialize)
718
+ response = JSON.parse(body)
719
+ if response['Response'].key?('Error') == false
720
+ model = ListNamespacesResponse.new
721
+ model.deserialize(response['Response'])
722
+ model
723
+ else
724
+ code = response['Response']['Error']['Code']
725
+ message = response['Response']['Error']['Message']
726
+ reqid = response['Response']['RequestId']
727
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
728
+ end
729
+ rescue TencentCloud::Common::TencentCloudSDKException => e
730
+ raise e
731
+ rescue StandardError => e
732
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
733
+ end
734
+
735
+ # 获取函数触发器列表
736
+
737
+ # @param request: Request instance for ListTriggers.
738
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListTriggersRequest`
739
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListTriggersResponse`
740
+ def ListTriggers(request)
741
+ body = send_request('ListTriggers', request.serialize)
742
+ response = JSON.parse(body)
743
+ if response['Response'].key?('Error') == false
744
+ model = ListTriggersResponse.new
745
+ model.deserialize(response['Response'])
746
+ model
747
+ else
748
+ code = response['Response']['Error']['Code']
749
+ message = response['Response']['Error']['Message']
750
+ reqid = response['Response']['RequestId']
751
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
752
+ end
753
+ rescue TencentCloud::Common::TencentCloudSDKException => e
754
+ raise e
755
+ rescue StandardError => e
756
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
757
+ end
758
+
759
+ # 该接口根据传入的参数查询函数的版本。
760
+
761
+ # @param request: Request instance for ListVersionByFunction.
762
+ # @type request: :class:`Tencentcloud::scf::V20180416::ListVersionByFunctionRequest`
763
+ # @rtype: :class:`Tencentcloud::scf::V20180416::ListVersionByFunctionResponse`
764
+ def ListVersionByFunction(request)
765
+ body = send_request('ListVersionByFunction', request.serialize)
766
+ response = JSON.parse(body)
767
+ if response['Response'].key?('Error') == false
768
+ model = ListVersionByFunctionResponse.new
769
+ model.deserialize(response['Response'])
770
+ model
771
+ else
772
+ code = response['Response']['Error']['Code']
773
+ message = response['Response']['Error']['Message']
774
+ reqid = response['Response']['RequestId']
775
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
776
+ end
777
+ rescue TencentCloud::Common::TencentCloudSDKException => e
778
+ raise e
779
+ rescue StandardError => e
780
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
781
+ end
782
+
783
+ # 使用给定的zip文件或cos对象创建一个层的新版本,每次使用相同的层的名称调用本接口,都会生成一个新版本。
784
+
785
+ # @param request: Request instance for PublishLayerVersion.
786
+ # @type request: :class:`Tencentcloud::scf::V20180416::PublishLayerVersionRequest`
787
+ # @rtype: :class:`Tencentcloud::scf::V20180416::PublishLayerVersionResponse`
788
+ def PublishLayerVersion(request)
789
+ body = send_request('PublishLayerVersion', request.serialize)
790
+ response = JSON.parse(body)
791
+ if response['Response'].key?('Error') == false
792
+ model = PublishLayerVersionResponse.new
793
+ model.deserialize(response['Response'])
794
+ model
795
+ else
796
+ code = response['Response']['Error']['Code']
797
+ message = response['Response']['Error']['Message']
798
+ reqid = response['Response']['RequestId']
799
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
800
+ end
801
+ rescue TencentCloud::Common::TencentCloudSDKException => e
802
+ raise e
803
+ rescue StandardError => e
804
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
805
+ end
806
+
807
+ # 该接口用于用户发布新版本函数。
808
+
809
+ # @param request: Request instance for PublishVersion.
810
+ # @type request: :class:`Tencentcloud::scf::V20180416::PublishVersionRequest`
811
+ # @rtype: :class:`Tencentcloud::scf::V20180416::PublishVersionResponse`
812
+ def PublishVersion(request)
813
+ body = send_request('PublishVersion', request.serialize)
814
+ response = JSON.parse(body)
815
+ if response['Response'].key?('Error') == false
816
+ model = PublishVersionResponse.new
817
+ model.deserialize(response['Response'])
818
+ model
819
+ else
820
+ code = response['Response']['Error']['Code']
821
+ message = response['Response']['Error']['Message']
822
+ reqid = response['Response']['RequestId']
823
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
824
+ end
825
+ rescue TencentCloud::Common::TencentCloudSDKException => e
826
+ raise e
827
+ rescue StandardError => e
828
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
829
+ end
830
+
831
+ # 设置函数某一非$LATEST版本的预置并发。
832
+
833
+ # @param request: Request instance for PutProvisionedConcurrencyConfig.
834
+ # @type request: :class:`Tencentcloud::scf::V20180416::PutProvisionedConcurrencyConfigRequest`
835
+ # @rtype: :class:`Tencentcloud::scf::V20180416::PutProvisionedConcurrencyConfigResponse`
836
+ def PutProvisionedConcurrencyConfig(request)
837
+ body = send_request('PutProvisionedConcurrencyConfig', request.serialize)
838
+ response = JSON.parse(body)
839
+ if response['Response'].key?('Error') == false
840
+ model = PutProvisionedConcurrencyConfigResponse.new
841
+ model.deserialize(response['Response'])
842
+ model
843
+ else
844
+ code = response['Response']['Error']['Code']
845
+ message = response['Response']['Error']['Message']
846
+ reqid = response['Response']['RequestId']
847
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
848
+ end
849
+ rescue TencentCloud::Common::TencentCloudSDKException => e
850
+ raise e
851
+ rescue StandardError => e
852
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
853
+ end
854
+
855
+ # 设置函数最大独占配额
856
+
857
+ # @param request: Request instance for PutReservedConcurrencyConfig.
858
+ # @type request: :class:`Tencentcloud::scf::V20180416::PutReservedConcurrencyConfigRequest`
859
+ # @rtype: :class:`Tencentcloud::scf::V20180416::PutReservedConcurrencyConfigResponse`
860
+ def PutReservedConcurrencyConfig(request)
861
+ body = send_request('PutReservedConcurrencyConfig', request.serialize)
862
+ response = JSON.parse(body)
863
+ if response['Response'].key?('Error') == false
864
+ model = PutReservedConcurrencyConfigResponse.new
865
+ model.deserialize(response['Response'])
866
+ model
867
+ else
868
+ code = response['Response']['Error']['Code']
869
+ message = response['Response']['Error']['Message']
870
+ reqid = response['Response']['RequestId']
871
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
872
+ end
873
+ rescue TencentCloud::Common::TencentCloudSDKException => e
874
+ raise e
875
+ rescue StandardError => e
876
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
877
+ end
878
+
879
+ # 修改账号并发限制配额
880
+
881
+ # @param request: Request instance for PutTotalConcurrencyConfig.
882
+ # @type request: :class:`Tencentcloud::scf::V20180416::PutTotalConcurrencyConfigRequest`
883
+ # @rtype: :class:`Tencentcloud::scf::V20180416::PutTotalConcurrencyConfigResponse`
884
+ def PutTotalConcurrencyConfig(request)
885
+ body = send_request('PutTotalConcurrencyConfig', request.serialize)
886
+ response = JSON.parse(body)
887
+ if response['Response'].key?('Error') == false
888
+ model = PutTotalConcurrencyConfigResponse.new
889
+ model.deserialize(response['Response'])
890
+ model
891
+ else
892
+ code = response['Response']['Error']['Code']
893
+ message = response['Response']['Error']['Message']
894
+ reqid = response['Response']['RequestId']
895
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
896
+ end
897
+ rescue TencentCloud::Common::TencentCloudSDKException => e
898
+ raise e
899
+ rescue StandardError => e
900
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
901
+ end
902
+
903
+ # 终止正在运行中的函数异步事件
904
+
905
+ # @param request: Request instance for TerminateAsyncEvent.
906
+ # @type request: :class:`Tencentcloud::scf::V20180416::TerminateAsyncEventRequest`
907
+ # @rtype: :class:`Tencentcloud::scf::V20180416::TerminateAsyncEventResponse`
908
+ def TerminateAsyncEvent(request)
909
+ body = send_request('TerminateAsyncEvent', request.serialize)
910
+ response = JSON.parse(body)
911
+ if response['Response'].key?('Error') == false
912
+ model = TerminateAsyncEventResponse.new
913
+ model.deserialize(response['Response'])
914
+ model
915
+ else
916
+ code = response['Response']['Error']['Code']
917
+ message = response['Response']['Error']['Message']
918
+ reqid = response['Response']['RequestId']
919
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
920
+ end
921
+ rescue TencentCloud::Common::TencentCloudSDKException => e
922
+ raise e
923
+ rescue StandardError => e
924
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
925
+ end
926
+
927
+ # 更新别名的配置
928
+
929
+ # @param request: Request instance for UpdateAlias.
930
+ # @type request: :class:`Tencentcloud::scf::V20180416::UpdateAliasRequest`
931
+ # @rtype: :class:`Tencentcloud::scf::V20180416::UpdateAliasResponse`
932
+ def UpdateAlias(request)
933
+ body = send_request('UpdateAlias', request.serialize)
934
+ response = JSON.parse(body)
935
+ if response['Response'].key?('Error') == false
936
+ model = UpdateAliasResponse.new
937
+ model.deserialize(response['Response'])
938
+ model
939
+ else
940
+ code = response['Response']['Error']['Code']
941
+ message = response['Response']['Error']['Message']
942
+ reqid = response['Response']['RequestId']
943
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
944
+ end
945
+ rescue TencentCloud::Common::TencentCloudSDKException => e
946
+ raise e
947
+ rescue StandardError => e
948
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
949
+ end
950
+
951
+ # 该接口根据传入参数更新函数代码。
952
+
953
+ # @param request: Request instance for UpdateFunctionCode.
954
+ # @type request: :class:`Tencentcloud::scf::V20180416::UpdateFunctionCodeRequest`
955
+ # @rtype: :class:`Tencentcloud::scf::V20180416::UpdateFunctionCodeResponse`
956
+ def UpdateFunctionCode(request)
957
+ body = send_request('UpdateFunctionCode', request.serialize)
958
+ response = JSON.parse(body)
959
+ if response['Response'].key?('Error') == false
960
+ model = UpdateFunctionCodeResponse.new
961
+ model.deserialize(response['Response'])
962
+ model
963
+ else
964
+ code = response['Response']['Error']['Code']
965
+ message = response['Response']['Error']['Message']
966
+ reqid = response['Response']['RequestId']
967
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
968
+ end
969
+ rescue TencentCloud::Common::TencentCloudSDKException => e
970
+ raise e
971
+ rescue StandardError => e
972
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
973
+ end
974
+
975
+ # 该接口根据传入参数更新函数配置。
976
+
977
+ # @param request: Request instance for UpdateFunctionConfiguration.
978
+ # @type request: :class:`Tencentcloud::scf::V20180416::UpdateFunctionConfigurationRequest`
979
+ # @rtype: :class:`Tencentcloud::scf::V20180416::UpdateFunctionConfigurationResponse`
980
+ def UpdateFunctionConfiguration(request)
981
+ body = send_request('UpdateFunctionConfiguration', request.serialize)
982
+ response = JSON.parse(body)
983
+ if response['Response'].key?('Error') == false
984
+ model = UpdateFunctionConfigurationResponse.new
985
+ model.deserialize(response['Response'])
986
+ model
987
+ else
988
+ code = response['Response']['Error']['Code']
989
+ message = response['Response']['Error']['Message']
990
+ reqid = response['Response']['RequestId']
991
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
992
+ end
993
+ rescue TencentCloud::Common::TencentCloudSDKException => e
994
+ raise e
995
+ rescue StandardError => e
996
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
997
+ end
998
+
999
+ # 更新函数的异步重试配置,包括重试次数和消息保留时间
1000
+
1001
+ # @param request: Request instance for UpdateFunctionEventInvokeConfig.
1002
+ # @type request: :class:`Tencentcloud::scf::V20180416::UpdateFunctionEventInvokeConfigRequest`
1003
+ # @rtype: :class:`Tencentcloud::scf::V20180416::UpdateFunctionEventInvokeConfigResponse`
1004
+ def UpdateFunctionEventInvokeConfig(request)
1005
+ body = send_request('UpdateFunctionEventInvokeConfig', request.serialize)
1006
+ response = JSON.parse(body)
1007
+ if response['Response'].key?('Error') == false
1008
+ model = UpdateFunctionEventInvokeConfigResponse.new
1009
+ model.deserialize(response['Response'])
1010
+ model
1011
+ else
1012
+ code = response['Response']['Error']['Code']
1013
+ message = response['Response']['Error']['Message']
1014
+ reqid = response['Response']['RequestId']
1015
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1016
+ end
1017
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1018
+ raise e
1019
+ rescue StandardError => e
1020
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1021
+ end
1022
+
1023
+ # 更新命名空间
1024
+
1025
+ # @param request: Request instance for UpdateNamespace.
1026
+ # @type request: :class:`Tencentcloud::scf::V20180416::UpdateNamespaceRequest`
1027
+ # @rtype: :class:`Tencentcloud::scf::V20180416::UpdateNamespaceResponse`
1028
+ def UpdateNamespace(request)
1029
+ body = send_request('UpdateNamespace', request.serialize)
1030
+ response = JSON.parse(body)
1031
+ if response['Response'].key?('Error') == false
1032
+ model = UpdateNamespaceResponse.new
1033
+ model.deserialize(response['Response'])
1034
+ model
1035
+ else
1036
+ code = response['Response']['Error']['Code']
1037
+ message = response['Response']['Error']['Message']
1038
+ reqid = response['Response']['RequestId']
1039
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1040
+ end
1041
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1042
+ raise e
1043
+ rescue StandardError => e
1044
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1045
+ end
1046
+
1047
+
1048
+ end
1049
+ end
1050
+ end
1051
+ end