huaweicloudsdkmsgsms 3.1.160__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. huaweicloudsdkmsgsms/__init__.py +0 -0
  2. huaweicloudsdkmsgsms/v2/__init__.py +60 -0
  3. huaweicloudsdkmsgsms/v2/model/__init__.py +57 -0
  4. huaweicloudsdkmsgsms/v2/model/api_template_variable.py +289 -0
  5. huaweicloudsdkmsgsms/v2/model/create_app_request.py +111 -0
  6. huaweicloudsdkmsgsms/v2/model/create_app_response.py +203 -0
  7. huaweicloudsdkmsgsms/v2/model/create_signature_request.py +111 -0
  8. huaweicloudsdkmsgsms/v2/model/create_signature_response.py +174 -0
  9. huaweicloudsdkmsgsms/v2/model/create_template_request.py +111 -0
  10. huaweicloudsdkmsgsms/v2/model/create_template_response.py +145 -0
  11. huaweicloudsdkmsgsms/v2/model/delete_signature_request.py +114 -0
  12. huaweicloudsdkmsgsms/v2/model/delete_signature_response.py +85 -0
  13. huaweicloudsdkmsgsms/v2/model/delete_template_request.py +114 -0
  14. huaweicloudsdkmsgsms/v2/model/delete_template_response.py +85 -0
  15. huaweicloudsdkmsgsms/v2/model/enable_signature_request.py +114 -0
  16. huaweicloudsdkmsgsms/v2/model/enable_signature_response.py +85 -0
  17. huaweicloudsdkmsgsms/v2/model/list_app_details_request.py +347 -0
  18. huaweicloudsdkmsgsms/v2/model/list_app_details_response.py +145 -0
  19. huaweicloudsdkmsgsms/v2/model/list_send_country_details_request.py +144 -0
  20. huaweicloudsdkmsgsms/v2/model/list_send_country_details_response.py +112 -0
  21. huaweicloudsdkmsgsms/v2/model/list_signature_details_request.py +434 -0
  22. huaweicloudsdkmsgsms/v2/model/list_signature_details_response.py +145 -0
  23. huaweicloudsdkmsgsms/v2/model/list_template_details_request.py +521 -0
  24. huaweicloudsdkmsgsms/v2/model/list_template_details_response.py +145 -0
  25. huaweicloudsdkmsgsms/v2/model/list_template_varilable_details_request.py +114 -0
  26. huaweicloudsdkmsgsms/v2/model/list_template_varilable_details_response.py +145 -0
  27. huaweicloudsdkmsgsms/v2/model/show_app_count_request.py +114 -0
  28. huaweicloudsdkmsgsms/v2/model/show_app_count_response.py +145 -0
  29. huaweicloudsdkmsgsms/v2/model/show_app_request.py +114 -0
  30. huaweicloudsdkmsgsms/v2/model/show_app_response.py +721 -0
  31. huaweicloudsdkmsgsms/v2/model/show_signature_file_request.py +114 -0
  32. huaweicloudsdkmsgsms/v2/model/show_signature_file_response.py +348 -0
  33. huaweicloudsdkmsgsms/v2/model/show_signature_request.py +114 -0
  34. huaweicloudsdkmsgsms/v2/model/show_signature_response.py +837 -0
  35. huaweicloudsdkmsgsms/v2/model/show_template_request.py +114 -0
  36. huaweicloudsdkmsgsms/v2/model/show_template_response.py +953 -0
  37. huaweicloudsdkmsgsms/v2/model/sms_app_add_req.py +287 -0
  38. huaweicloudsdkmsgsms/v2/model/sms_app_query_resp.py +720 -0
  39. huaweicloudsdkmsgsms/v2/model/sms_app_update_req.py +258 -0
  40. huaweicloudsdkmsgsms/v2/model/sms_country_resp.py +173 -0
  41. huaweicloudsdkmsgsms/v2/model/sms_signature_req.py +371 -0
  42. huaweicloudsdkmsgsms/v2/model/sms_signature_resp.py +836 -0
  43. huaweicloudsdkmsgsms/v2/model/sms_template_req.py +429 -0
  44. huaweicloudsdkmsgsms/v2/model/sms_template_resp.py +952 -0
  45. huaweicloudsdkmsgsms/v2/model/sms_template_variable_attr_req.py +171 -0
  46. huaweicloudsdkmsgsms/v2/model/tenant_basic.py +173 -0
  47. huaweicloudsdkmsgsms/v2/model/update_app_request.py +139 -0
  48. huaweicloudsdkmsgsms/v2/model/update_app_response.py +174 -0
  49. huaweicloudsdkmsgsms/v2/model/update_signature_request.py +139 -0
  50. huaweicloudsdkmsgsms/v2/model/update_signature_response.py +174 -0
  51. huaweicloudsdkmsgsms/v2/model/update_template_request.py +139 -0
  52. huaweicloudsdkmsgsms/v2/model/update_template_response.py +145 -0
  53. huaweicloudsdkmsgsms/v2/model/upload_signature_file_request.py +140 -0
  54. huaweicloudsdkmsgsms/v2/model/upload_signature_file_request_body.py +114 -0
  55. huaweicloudsdkmsgsms/v2/model/upload_signature_file_response.py +116 -0
  56. huaweicloudsdkmsgsms/v2/msgsms_async_client.py +1461 -0
  57. huaweicloudsdkmsgsms/v2/msgsms_client.py +1458 -0
  58. huaweicloudsdkmsgsms/v2/region/__init__.py +0 -0
  59. huaweicloudsdkmsgsms/v2/region/msgsms_region.py +34 -0
  60. huaweicloudsdkmsgsms-3.1.160.dist-info/LICENSE +13 -0
  61. huaweicloudsdkmsgsms-3.1.160.dist-info/METADATA +26 -0
  62. huaweicloudsdkmsgsms-3.1.160.dist-info/RECORD +64 -0
  63. huaweicloudsdkmsgsms-3.1.160.dist-info/WHEEL +5 -0
  64. huaweicloudsdkmsgsms-3.1.160.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1461 @@
1
+ # coding: utf-8
2
+
3
+ from __future__ import absolute_import
4
+
5
+ import importlib
6
+ import warnings
7
+
8
+ from huaweicloudsdkcore.client import Client, ClientBuilder
9
+ from huaweicloudsdkcore.utils import http_utils
10
+ from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
11
+
12
+ try:
13
+ from huaweicloudsdkcore.invoker.invoker import AsyncInvoker
14
+ except ImportError as e:
15
+ warnings.warn(str(e) + ", please check if you are using the same versions of 'huaweicloudsdkcore' and 'huaweicloudsdkmsgsms'")
16
+
17
+
18
+ class MsgsmsAsyncClient(Client):
19
+ def __init__(self):
20
+ super(MsgsmsAsyncClient, self).__init__()
21
+ self.model_package = importlib.import_module("huaweicloudsdkmsgsms.v2.model")
22
+
23
+ @classmethod
24
+ def new_builder(cls, clazz=None):
25
+ if not clazz:
26
+ client_builder = ClientBuilder(cls)
27
+ else:
28
+ if clazz.__name__ != "MsgsmsAsyncClient":
29
+ raise TypeError("client type error, support client type is MsgsmsAsyncClient")
30
+ client_builder = ClientBuilder(clazz)
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def create_app_async(self, request):
37
+ r"""创建短信应用
38
+
39
+ 该接口用于用户创建应用信息。
40
+
41
+ Please refer to HUAWEI cloud API Explorer for details.
42
+
43
+
44
+ :param request: Request instance for CreateApp
45
+ :type request: :class:`huaweicloudsdkmsgsms.v2.CreateAppRequest`
46
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.CreateAppResponse`
47
+ """
48
+ http_info = self._create_app_http_info(request)
49
+ return self._call_api(**http_info)
50
+
51
+ def create_app_async_invoker(self, request):
52
+ http_info = self._create_app_http_info(request)
53
+ return AsyncInvoker(self, http_info)
54
+
55
+ def _create_app_http_info(self, request):
56
+ http_info = {
57
+ "method": "POST",
58
+ "resource_path": "/v2/{project_id}/msgsms/apps",
59
+ "request_type": request.__class__.__name__,
60
+ "response_type": "CreateAppResponse"
61
+ }
62
+
63
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
64
+
65
+ cname = None
66
+
67
+ collection_formats = {}
68
+
69
+ path_params = {}
70
+
71
+ query_params = []
72
+
73
+ header_params = {}
74
+
75
+ form_params = {}
76
+
77
+ body = None
78
+ if 'body' in local_var_params:
79
+ body = local_var_params['body']
80
+ if isinstance(request, SdkStreamRequest):
81
+ body = request.get_file_stream()
82
+
83
+ response_headers = []
84
+
85
+ header_params['Content-Type'] = http_utils.select_header_content_type(
86
+ ['application/json'])
87
+
88
+ auth_settings = []
89
+
90
+ http_info["cname"] = cname
91
+ http_info["collection_formats"] = collection_formats
92
+ http_info["path_params"] = path_params
93
+ http_info["query_params"] = query_params
94
+ http_info["header_params"] = header_params
95
+ http_info["post_params"] = form_params
96
+ http_info["body"] = body
97
+ http_info["response_headers"] = response_headers
98
+
99
+ return http_info
100
+
101
+ def list_app_details_async(self, request):
102
+ r"""查询短信应用
103
+
104
+ 该接口用于用户查询已创建的应用信息。
105
+
106
+ Please refer to HUAWEI cloud API Explorer for details.
107
+
108
+
109
+ :param request: Request instance for ListAppDetails
110
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ListAppDetailsRequest`
111
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ListAppDetailsResponse`
112
+ """
113
+ http_info = self._list_app_details_http_info(request)
114
+ return self._call_api(**http_info)
115
+
116
+ def list_app_details_async_invoker(self, request):
117
+ http_info = self._list_app_details_http_info(request)
118
+ return AsyncInvoker(self, http_info)
119
+
120
+ def _list_app_details_http_info(self, request):
121
+ http_info = {
122
+ "method": "GET",
123
+ "resource_path": "/v2/{project_id}/msgsms/apps",
124
+ "request_type": request.__class__.__name__,
125
+ "response_type": "ListAppDetailsResponse"
126
+ }
127
+
128
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
129
+
130
+ cname = None
131
+
132
+ collection_formats = {}
133
+
134
+ path_params = {}
135
+
136
+ query_params = []
137
+ if 'app_name' in local_var_params:
138
+ query_params.append(('app_name', local_var_params['app_name']))
139
+ if 'start_time' in local_var_params:
140
+ query_params.append(('start_time', local_var_params['start_time']))
141
+ if 'end_time' in local_var_params:
142
+ query_params.append(('end_time', local_var_params['end_time']))
143
+ if 'limit' in local_var_params:
144
+ query_params.append(('limit', local_var_params['limit']))
145
+ if 'offset' in local_var_params:
146
+ query_params.append(('offset', local_var_params['offset']))
147
+ if 'region' in local_var_params:
148
+ query_params.append(('region', local_var_params['region']))
149
+ if 'sort_dir' in local_var_params:
150
+ query_params.append(('sort_dir', local_var_params['sort_dir']))
151
+ if 'sort_key' in local_var_params:
152
+ query_params.append(('sort_key', local_var_params['sort_key']))
153
+ if 'status' in local_var_params:
154
+ query_params.append(('status', local_var_params['status']))
155
+
156
+ header_params = {}
157
+
158
+ form_params = {}
159
+
160
+ body = None
161
+ if isinstance(request, SdkStreamRequest):
162
+ body = request.get_file_stream()
163
+
164
+ response_headers = []
165
+
166
+ header_params['Content-Type'] = http_utils.select_header_content_type(
167
+ ['application/json'])
168
+
169
+ auth_settings = []
170
+
171
+ http_info["cname"] = cname
172
+ http_info["collection_formats"] = collection_formats
173
+ http_info["path_params"] = path_params
174
+ http_info["query_params"] = query_params
175
+ http_info["header_params"] = header_params
176
+ http_info["post_params"] = form_params
177
+ http_info["body"] = body
178
+ http_info["response_headers"] = response_headers
179
+
180
+ return http_info
181
+
182
+ def show_app_async(self, request):
183
+ r"""获取应用详情
184
+
185
+ 该接口用于用户查询应用详情信息。
186
+
187
+ Please refer to HUAWEI cloud API Explorer for details.
188
+
189
+
190
+ :param request: Request instance for ShowApp
191
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ShowAppRequest`
192
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ShowAppResponse`
193
+ """
194
+ http_info = self._show_app_http_info(request)
195
+ return self._call_api(**http_info)
196
+
197
+ def show_app_async_invoker(self, request):
198
+ http_info = self._show_app_http_info(request)
199
+ return AsyncInvoker(self, http_info)
200
+
201
+ def _show_app_http_info(self, request):
202
+ http_info = {
203
+ "method": "GET",
204
+ "resource_path": "/v2/{project_id}/msgsms/apps/{id}",
205
+ "request_type": request.__class__.__name__,
206
+ "response_type": "ShowAppResponse"
207
+ }
208
+
209
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
210
+
211
+ cname = None
212
+
213
+ collection_formats = {}
214
+
215
+ path_params = {}
216
+ if 'id' in local_var_params:
217
+ path_params['id'] = local_var_params['id']
218
+
219
+ query_params = []
220
+
221
+ header_params = {}
222
+
223
+ form_params = {}
224
+
225
+ body = None
226
+ if isinstance(request, SdkStreamRequest):
227
+ body = request.get_file_stream()
228
+
229
+ response_headers = []
230
+
231
+ header_params['Content-Type'] = http_utils.select_header_content_type(
232
+ ['application/json'])
233
+
234
+ auth_settings = []
235
+
236
+ http_info["cname"] = cname
237
+ http_info["collection_formats"] = collection_formats
238
+ http_info["path_params"] = path_params
239
+ http_info["query_params"] = query_params
240
+ http_info["header_params"] = header_params
241
+ http_info["post_params"] = form_params
242
+ http_info["body"] = body
243
+ http_info["response_headers"] = response_headers
244
+
245
+ return http_info
246
+
247
+ def show_app_count_async(self, request):
248
+ r"""查询应用数量
249
+
250
+ 该接口用于用户查询应用使用的数量信息。
251
+
252
+ Please refer to HUAWEI cloud API Explorer for details.
253
+
254
+
255
+ :param request: Request instance for ShowAppCount
256
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ShowAppCountRequest`
257
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ShowAppCountResponse`
258
+ """
259
+ http_info = self._show_app_count_http_info(request)
260
+ return self._call_api(**http_info)
261
+
262
+ def show_app_count_async_invoker(self, request):
263
+ http_info = self._show_app_count_http_info(request)
264
+ return AsyncInvoker(self, http_info)
265
+
266
+ def _show_app_count_http_info(self, request):
267
+ http_info = {
268
+ "method": "GET",
269
+ "resource_path": "/v2/{project_id}/msgsms/apps-count",
270
+ "request_type": request.__class__.__name__,
271
+ "response_type": "ShowAppCountResponse"
272
+ }
273
+
274
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
275
+
276
+ cname = None
277
+
278
+ collection_formats = {}
279
+
280
+ path_params = {}
281
+
282
+ query_params = []
283
+ if 'region' in local_var_params:
284
+ query_params.append(('region', local_var_params['region']))
285
+
286
+ header_params = {}
287
+
288
+ form_params = {}
289
+
290
+ body = None
291
+ if isinstance(request, SdkStreamRequest):
292
+ body = request.get_file_stream()
293
+
294
+ response_headers = []
295
+
296
+ header_params['Content-Type'] = http_utils.select_header_content_type(
297
+ ['application/json'])
298
+
299
+ auth_settings = []
300
+
301
+ http_info["cname"] = cname
302
+ http_info["collection_formats"] = collection_formats
303
+ http_info["path_params"] = path_params
304
+ http_info["query_params"] = query_params
305
+ http_info["header_params"] = header_params
306
+ http_info["post_params"] = form_params
307
+ http_info["body"] = body
308
+ http_info["response_headers"] = response_headers
309
+
310
+ return http_info
311
+
312
+ def update_app_async(self, request):
313
+ r"""修改短信应用
314
+
315
+ 该接口用于用户修改应用信息。
316
+
317
+ Please refer to HUAWEI cloud API Explorer for details.
318
+
319
+
320
+ :param request: Request instance for UpdateApp
321
+ :type request: :class:`huaweicloudsdkmsgsms.v2.UpdateAppRequest`
322
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.UpdateAppResponse`
323
+ """
324
+ http_info = self._update_app_http_info(request)
325
+ return self._call_api(**http_info)
326
+
327
+ def update_app_async_invoker(self, request):
328
+ http_info = self._update_app_http_info(request)
329
+ return AsyncInvoker(self, http_info)
330
+
331
+ def _update_app_http_info(self, request):
332
+ http_info = {
333
+ "method": "PUT",
334
+ "resource_path": "/v2/{project_id}/msgsms/apps/{id}",
335
+ "request_type": request.__class__.__name__,
336
+ "response_type": "UpdateAppResponse"
337
+ }
338
+
339
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
340
+
341
+ cname = None
342
+
343
+ collection_formats = {}
344
+
345
+ path_params = {}
346
+ if 'id' in local_var_params:
347
+ path_params['id'] = local_var_params['id']
348
+
349
+ query_params = []
350
+
351
+ header_params = {}
352
+
353
+ form_params = {}
354
+
355
+ body = None
356
+ if 'body' in local_var_params:
357
+ body = local_var_params['body']
358
+ if isinstance(request, SdkStreamRequest):
359
+ body = request.get_file_stream()
360
+
361
+ response_headers = []
362
+
363
+ header_params['Content-Type'] = http_utils.select_header_content_type(
364
+ ['application/json'])
365
+
366
+ auth_settings = []
367
+
368
+ http_info["cname"] = cname
369
+ http_info["collection_formats"] = collection_formats
370
+ http_info["path_params"] = path_params
371
+ http_info["query_params"] = query_params
372
+ http_info["header_params"] = header_params
373
+ http_info["post_params"] = form_params
374
+ http_info["body"] = body
375
+ http_info["response_headers"] = response_headers
376
+
377
+ return http_info
378
+
379
+ def create_signature_async(self, request):
380
+ r"""创建短信签名
381
+
382
+ 该接口用于用户创建签名。
383
+
384
+ Please refer to HUAWEI cloud API Explorer for details.
385
+
386
+
387
+ :param request: Request instance for CreateSignature
388
+ :type request: :class:`huaweicloudsdkmsgsms.v2.CreateSignatureRequest`
389
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.CreateSignatureResponse`
390
+ """
391
+ http_info = self._create_signature_http_info(request)
392
+ return self._call_api(**http_info)
393
+
394
+ def create_signature_async_invoker(self, request):
395
+ http_info = self._create_signature_http_info(request)
396
+ return AsyncInvoker(self, http_info)
397
+
398
+ def _create_signature_http_info(self, request):
399
+ http_info = {
400
+ "method": "POST",
401
+ "resource_path": "/v2/{project_id}/msgsms/signatures",
402
+ "request_type": request.__class__.__name__,
403
+ "response_type": "CreateSignatureResponse"
404
+ }
405
+
406
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
407
+
408
+ cname = None
409
+
410
+ collection_formats = {}
411
+
412
+ path_params = {}
413
+
414
+ query_params = []
415
+
416
+ header_params = {}
417
+
418
+ form_params = {}
419
+
420
+ body = None
421
+ if 'body' in local_var_params:
422
+ body = local_var_params['body']
423
+ if isinstance(request, SdkStreamRequest):
424
+ body = request.get_file_stream()
425
+
426
+ response_headers = []
427
+
428
+ header_params['Content-Type'] = http_utils.select_header_content_type(
429
+ ['application/json'])
430
+
431
+ auth_settings = []
432
+
433
+ http_info["cname"] = cname
434
+ http_info["collection_formats"] = collection_formats
435
+ http_info["path_params"] = path_params
436
+ http_info["query_params"] = query_params
437
+ http_info["header_params"] = header_params
438
+ http_info["post_params"] = form_params
439
+ http_info["body"] = body
440
+ http_info["response_headers"] = response_headers
441
+
442
+ return http_info
443
+
444
+ def delete_signature_async(self, request):
445
+ r"""删除短信签名
446
+
447
+ 该接口用于用户删除已创建的签名信息息。
448
+
449
+ Please refer to HUAWEI cloud API Explorer for details.
450
+
451
+
452
+ :param request: Request instance for DeleteSignature
453
+ :type request: :class:`huaweicloudsdkmsgsms.v2.DeleteSignatureRequest`
454
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.DeleteSignatureResponse`
455
+ """
456
+ http_info = self._delete_signature_http_info(request)
457
+ return self._call_api(**http_info)
458
+
459
+ def delete_signature_async_invoker(self, request):
460
+ http_info = self._delete_signature_http_info(request)
461
+ return AsyncInvoker(self, http_info)
462
+
463
+ def _delete_signature_http_info(self, request):
464
+ http_info = {
465
+ "method": "DELETE",
466
+ "resource_path": "/v2/{project_id}/msgsms/signatures/{id}",
467
+ "request_type": request.__class__.__name__,
468
+ "response_type": "DeleteSignatureResponse"
469
+ }
470
+
471
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
472
+
473
+ cname = None
474
+
475
+ collection_formats = {}
476
+
477
+ path_params = {}
478
+ if 'id' in local_var_params:
479
+ path_params['id'] = local_var_params['id']
480
+
481
+ query_params = []
482
+
483
+ header_params = {}
484
+
485
+ form_params = {}
486
+
487
+ body = None
488
+ if isinstance(request, SdkStreamRequest):
489
+ body = request.get_file_stream()
490
+
491
+ response_headers = []
492
+
493
+ header_params['Content-Type'] = http_utils.select_header_content_type(
494
+ ['application/json'])
495
+
496
+ auth_settings = []
497
+
498
+ http_info["cname"] = cname
499
+ http_info["collection_formats"] = collection_formats
500
+ http_info["path_params"] = path_params
501
+ http_info["query_params"] = query_params
502
+ http_info["header_params"] = header_params
503
+ http_info["post_params"] = form_params
504
+ http_info["body"] = body
505
+ http_info["response_headers"] = response_headers
506
+
507
+ return http_info
508
+
509
+ def enable_signature_async(self, request):
510
+ r"""申请激活签名
511
+
512
+ 该接口用于用户申请激活签名信息。
513
+
514
+ Please refer to HUAWEI cloud API Explorer for details.
515
+
516
+
517
+ :param request: Request instance for EnableSignature
518
+ :type request: :class:`huaweicloudsdkmsgsms.v2.EnableSignatureRequest`
519
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.EnableSignatureResponse`
520
+ """
521
+ http_info = self._enable_signature_http_info(request)
522
+ return self._call_api(**http_info)
523
+
524
+ def enable_signature_async_invoker(self, request):
525
+ http_info = self._enable_signature_http_info(request)
526
+ return AsyncInvoker(self, http_info)
527
+
528
+ def _enable_signature_http_info(self, request):
529
+ http_info = {
530
+ "method": "PUT",
531
+ "resource_path": "/v2/{project_id}/msgsms/signatures/{id}/active",
532
+ "request_type": request.__class__.__name__,
533
+ "response_type": "EnableSignatureResponse"
534
+ }
535
+
536
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
537
+
538
+ cname = None
539
+
540
+ collection_formats = {}
541
+
542
+ path_params = {}
543
+ if 'id' in local_var_params:
544
+ path_params['id'] = local_var_params['id']
545
+
546
+ query_params = []
547
+
548
+ header_params = {}
549
+
550
+ form_params = {}
551
+
552
+ body = None
553
+ if isinstance(request, SdkStreamRequest):
554
+ body = request.get_file_stream()
555
+
556
+ response_headers = []
557
+
558
+ header_params['Content-Type'] = http_utils.select_header_content_type(
559
+ ['application/json'])
560
+
561
+ auth_settings = []
562
+
563
+ http_info["cname"] = cname
564
+ http_info["collection_formats"] = collection_formats
565
+ http_info["path_params"] = path_params
566
+ http_info["query_params"] = query_params
567
+ http_info["header_params"] = header_params
568
+ http_info["post_params"] = form_params
569
+ http_info["body"] = body
570
+ http_info["response_headers"] = response_headers
571
+
572
+ return http_info
573
+
574
+ def list_signature_details_async(self, request):
575
+ r"""查询签名信息
576
+
577
+ 该接口用于用户查询已创建的短信签名信息。
578
+
579
+ Please refer to HUAWEI cloud API Explorer for details.
580
+
581
+
582
+ :param request: Request instance for ListSignatureDetails
583
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ListSignatureDetailsRequest`
584
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ListSignatureDetailsResponse`
585
+ """
586
+ http_info = self._list_signature_details_http_info(request)
587
+ return self._call_api(**http_info)
588
+
589
+ def list_signature_details_async_invoker(self, request):
590
+ http_info = self._list_signature_details_http_info(request)
591
+ return AsyncInvoker(self, http_info)
592
+
593
+ def _list_signature_details_http_info(self, request):
594
+ http_info = {
595
+ "method": "GET",
596
+ "resource_path": "/v2/{project_id}/msgsms/signatures",
597
+ "request_type": request.__class__.__name__,
598
+ "response_type": "ListSignatureDetailsResponse"
599
+ }
600
+
601
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
602
+
603
+ cname = None
604
+
605
+ collection_formats = {}
606
+
607
+ path_params = {}
608
+
609
+ query_params = []
610
+ if 'app_name' in local_var_params:
611
+ query_params.append(('app_name', local_var_params['app_name']))
612
+ if 'start_time' in local_var_params:
613
+ query_params.append(('start_time', local_var_params['start_time']))
614
+ if 'end_time' in local_var_params:
615
+ query_params.append(('end_time', local_var_params['end_time']))
616
+ if 'limit' in local_var_params:
617
+ query_params.append(('limit', local_var_params['limit']))
618
+ if 'offset' in local_var_params:
619
+ query_params.append(('offset', local_var_params['offset']))
620
+ if 'signature_id' in local_var_params:
621
+ query_params.append(('signature_id', local_var_params['signature_id']))
622
+ if 'signature_name' in local_var_params:
623
+ query_params.append(('signature_name', local_var_params['signature_name']))
624
+ if 'signature_type' in local_var_params:
625
+ query_params.append(('signature_type', local_var_params['signature_type']))
626
+ if 'site' in local_var_params:
627
+ query_params.append(('site', local_var_params['site']))
628
+ if 'sort_dir' in local_var_params:
629
+ query_params.append(('sort_dir', local_var_params['sort_dir']))
630
+ if 'sort_key' in local_var_params:
631
+ query_params.append(('sort_key', local_var_params['sort_key']))
632
+ if 'status' in local_var_params:
633
+ query_params.append(('status', local_var_params['status']))
634
+
635
+ header_params = {}
636
+
637
+ form_params = {}
638
+
639
+ body = None
640
+ if isinstance(request, SdkStreamRequest):
641
+ body = request.get_file_stream()
642
+
643
+ response_headers = []
644
+
645
+ header_params['Content-Type'] = http_utils.select_header_content_type(
646
+ ['application/json'])
647
+
648
+ auth_settings = []
649
+
650
+ http_info["cname"] = cname
651
+ http_info["collection_formats"] = collection_formats
652
+ http_info["path_params"] = path_params
653
+ http_info["query_params"] = query_params
654
+ http_info["header_params"] = header_params
655
+ http_info["post_params"] = form_params
656
+ http_info["body"] = body
657
+ http_info["response_headers"] = response_headers
658
+
659
+ return http_info
660
+
661
+ def show_signature_async(self, request):
662
+ r"""获取签名详情
663
+
664
+ 该接口用于用户查询签名详情信息。
665
+
666
+ Please refer to HUAWEI cloud API Explorer for details.
667
+
668
+
669
+ :param request: Request instance for ShowSignature
670
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ShowSignatureRequest`
671
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ShowSignatureResponse`
672
+ """
673
+ http_info = self._show_signature_http_info(request)
674
+ return self._call_api(**http_info)
675
+
676
+ def show_signature_async_invoker(self, request):
677
+ http_info = self._show_signature_http_info(request)
678
+ return AsyncInvoker(self, http_info)
679
+
680
+ def _show_signature_http_info(self, request):
681
+ http_info = {
682
+ "method": "GET",
683
+ "resource_path": "/v2/{project_id}/msgsms/signatures/{id}",
684
+ "request_type": request.__class__.__name__,
685
+ "response_type": "ShowSignatureResponse"
686
+ }
687
+
688
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
689
+
690
+ cname = None
691
+
692
+ collection_formats = {}
693
+
694
+ path_params = {}
695
+ if 'id' in local_var_params:
696
+ path_params['id'] = local_var_params['id']
697
+
698
+ query_params = []
699
+
700
+ header_params = {}
701
+
702
+ form_params = {}
703
+
704
+ body = None
705
+ if isinstance(request, SdkStreamRequest):
706
+ body = request.get_file_stream()
707
+
708
+ response_headers = []
709
+
710
+ header_params['Content-Type'] = http_utils.select_header_content_type(
711
+ ['application/json'])
712
+
713
+ auth_settings = []
714
+
715
+ http_info["cname"] = cname
716
+ http_info["collection_formats"] = collection_formats
717
+ http_info["path_params"] = path_params
718
+ http_info["query_params"] = query_params
719
+ http_info["header_params"] = header_params
720
+ http_info["post_params"] = form_params
721
+ http_info["body"] = body
722
+ http_info["response_headers"] = response_headers
723
+
724
+ return http_info
725
+
726
+ def show_signature_file_async(self, request):
727
+ r"""查询申请文件
728
+
729
+ 该接口用于用户查询上传的文件信息。
730
+
731
+ Please refer to HUAWEI cloud API Explorer for details.
732
+
733
+
734
+ :param request: Request instance for ShowSignatureFile
735
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ShowSignatureFileRequest`
736
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ShowSignatureFileResponse`
737
+ """
738
+ http_info = self._show_signature_file_http_info(request)
739
+ return self._call_api(**http_info)
740
+
741
+ def show_signature_file_async_invoker(self, request):
742
+ http_info = self._show_signature_file_http_info(request)
743
+ return AsyncInvoker(self, http_info)
744
+
745
+ def _show_signature_file_http_info(self, request):
746
+ http_info = {
747
+ "method": "GET",
748
+ "resource_path": "/v2/{project_id}/msgsms/upload-files",
749
+ "request_type": request.__class__.__name__,
750
+ "response_type": "ShowSignatureFileResponse"
751
+ }
752
+
753
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
754
+
755
+ cname = None
756
+
757
+ collection_formats = {}
758
+
759
+ path_params = {}
760
+
761
+ query_params = []
762
+ if 'file_id' in local_var_params:
763
+ query_params.append(('file_id', local_var_params['file_id']))
764
+
765
+ header_params = {}
766
+
767
+ form_params = {}
768
+
769
+ body = None
770
+ if isinstance(request, SdkStreamRequest):
771
+ body = request.get_file_stream()
772
+
773
+ response_headers = []
774
+
775
+ header_params['Content-Type'] = http_utils.select_header_content_type(
776
+ ['application/json'])
777
+
778
+ auth_settings = []
779
+
780
+ http_info["cname"] = cname
781
+ http_info["collection_formats"] = collection_formats
782
+ http_info["path_params"] = path_params
783
+ http_info["query_params"] = query_params
784
+ http_info["header_params"] = header_params
785
+ http_info["post_params"] = form_params
786
+ http_info["body"] = body
787
+ http_info["response_headers"] = response_headers
788
+
789
+ return http_info
790
+
791
+ def update_signature_async(self, request):
792
+ r"""修改短信签名
793
+
794
+ 该接口用于用户更新签名信息,目前仅支持审核不通过的短信签名重新修改。
795
+
796
+ Please refer to HUAWEI cloud API Explorer for details.
797
+
798
+
799
+ :param request: Request instance for UpdateSignature
800
+ :type request: :class:`huaweicloudsdkmsgsms.v2.UpdateSignatureRequest`
801
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.UpdateSignatureResponse`
802
+ """
803
+ http_info = self._update_signature_http_info(request)
804
+ return self._call_api(**http_info)
805
+
806
+ def update_signature_async_invoker(self, request):
807
+ http_info = self._update_signature_http_info(request)
808
+ return AsyncInvoker(self, http_info)
809
+
810
+ def _update_signature_http_info(self, request):
811
+ http_info = {
812
+ "method": "PUT",
813
+ "resource_path": "/v2/{project_id}/msgsms/signatures/{id}",
814
+ "request_type": request.__class__.__name__,
815
+ "response_type": "UpdateSignatureResponse"
816
+ }
817
+
818
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
819
+
820
+ cname = None
821
+
822
+ collection_formats = {}
823
+
824
+ path_params = {}
825
+ if 'id' in local_var_params:
826
+ path_params['id'] = local_var_params['id']
827
+
828
+ query_params = []
829
+
830
+ header_params = {}
831
+
832
+ form_params = {}
833
+
834
+ body = None
835
+ if 'body' in local_var_params:
836
+ body = local_var_params['body']
837
+ if isinstance(request, SdkStreamRequest):
838
+ body = request.get_file_stream()
839
+
840
+ response_headers = []
841
+
842
+ header_params['Content-Type'] = http_utils.select_header_content_type(
843
+ ['application/json'])
844
+
845
+ auth_settings = []
846
+
847
+ http_info["cname"] = cname
848
+ http_info["collection_formats"] = collection_formats
849
+ http_info["path_params"] = path_params
850
+ http_info["query_params"] = query_params
851
+ http_info["header_params"] = header_params
852
+ http_info["post_params"] = form_params
853
+ http_info["body"] = body
854
+ http_info["response_headers"] = response_headers
855
+
856
+ return http_info
857
+
858
+ def upload_signature_file_async(self, request):
859
+ r"""上传申请文件
860
+
861
+ 该接口用于用户上传文件信息。
862
+
863
+ Please refer to HUAWEI cloud API Explorer for details.
864
+
865
+
866
+ :param request: Request instance for UploadSignatureFile
867
+ :type request: :class:`huaweicloudsdkmsgsms.v2.UploadSignatureFileRequest`
868
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.UploadSignatureFileResponse`
869
+ """
870
+ http_info = self._upload_signature_file_http_info(request)
871
+ return self._call_api(**http_info)
872
+
873
+ def upload_signature_file_async_invoker(self, request):
874
+ http_info = self._upload_signature_file_http_info(request)
875
+ return AsyncInvoker(self, http_info)
876
+
877
+ def _upload_signature_file_http_info(self, request):
878
+ http_info = {
879
+ "method": "POST",
880
+ "resource_path": "/v2/{project_id}/msgsms/upload-files",
881
+ "request_type": request.__class__.__name__,
882
+ "response_type": "UploadSignatureFileResponse"
883
+ }
884
+
885
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
886
+
887
+ cname = None
888
+
889
+ collection_formats = {}
890
+
891
+ path_params = {}
892
+
893
+ query_params = []
894
+ if 'file_desc' in local_var_params:
895
+ query_params.append(('file_desc', local_var_params['file_desc']))
896
+
897
+ header_params = {}
898
+
899
+ form_params = {}
900
+ if 'file' in local_var_params:
901
+ form_params['file'] = local_var_params['file']
902
+
903
+ body = None
904
+ if 'body' in local_var_params:
905
+ body = local_var_params['body']
906
+ if isinstance(request, SdkStreamRequest):
907
+ body = request.get_file_stream()
908
+
909
+ response_headers = []
910
+
911
+ header_params['Content-Type'] = http_utils.select_header_content_type(
912
+ ['multipart/form-data'])
913
+
914
+ auth_settings = []
915
+
916
+ http_info["cname"] = cname
917
+ http_info["collection_formats"] = collection_formats
918
+ http_info["path_params"] = path_params
919
+ http_info["query_params"] = query_params
920
+ http_info["header_params"] = header_params
921
+ http_info["post_params"] = form_params
922
+ http_info["body"] = body
923
+ http_info["response_headers"] = response_headers
924
+
925
+ return http_info
926
+
927
+ def create_template_async(self, request):
928
+ r"""创建短信模板
929
+
930
+ 该接口用于用户创建模板。
931
+
932
+ Please refer to HUAWEI cloud API Explorer for details.
933
+
934
+
935
+ :param request: Request instance for CreateTemplate
936
+ :type request: :class:`huaweicloudsdkmsgsms.v2.CreateTemplateRequest`
937
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.CreateTemplateResponse`
938
+ """
939
+ http_info = self._create_template_http_info(request)
940
+ return self._call_api(**http_info)
941
+
942
+ def create_template_async_invoker(self, request):
943
+ http_info = self._create_template_http_info(request)
944
+ return AsyncInvoker(self, http_info)
945
+
946
+ def _create_template_http_info(self, request):
947
+ http_info = {
948
+ "method": "POST",
949
+ "resource_path": "/v2/{project_id}/msgsms/templates",
950
+ "request_type": request.__class__.__name__,
951
+ "response_type": "CreateTemplateResponse"
952
+ }
953
+
954
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
955
+
956
+ cname = None
957
+
958
+ collection_formats = {}
959
+
960
+ path_params = {}
961
+
962
+ query_params = []
963
+
964
+ header_params = {}
965
+
966
+ form_params = {}
967
+
968
+ body = None
969
+ if 'body' in local_var_params:
970
+ body = local_var_params['body']
971
+ if isinstance(request, SdkStreamRequest):
972
+ body = request.get_file_stream()
973
+
974
+ response_headers = []
975
+
976
+ header_params['Content-Type'] = http_utils.select_header_content_type(
977
+ ['application/json'])
978
+
979
+ auth_settings = []
980
+
981
+ http_info["cname"] = cname
982
+ http_info["collection_formats"] = collection_formats
983
+ http_info["path_params"] = path_params
984
+ http_info["query_params"] = query_params
985
+ http_info["header_params"] = header_params
986
+ http_info["post_params"] = form_params
987
+ http_info["body"] = body
988
+ http_info["response_headers"] = response_headers
989
+
990
+ return http_info
991
+
992
+ def delete_template_async(self, request):
993
+ r"""删除短信模板
994
+
995
+ 该接口用于用户删除已创建的模板信息。
996
+
997
+ Please refer to HUAWEI cloud API Explorer for details.
998
+
999
+
1000
+ :param request: Request instance for DeleteTemplate
1001
+ :type request: :class:`huaweicloudsdkmsgsms.v2.DeleteTemplateRequest`
1002
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.DeleteTemplateResponse`
1003
+ """
1004
+ http_info = self._delete_template_http_info(request)
1005
+ return self._call_api(**http_info)
1006
+
1007
+ def delete_template_async_invoker(self, request):
1008
+ http_info = self._delete_template_http_info(request)
1009
+ return AsyncInvoker(self, http_info)
1010
+
1011
+ def _delete_template_http_info(self, request):
1012
+ http_info = {
1013
+ "method": "DELETE",
1014
+ "resource_path": "/v2/{project_id}/msgsms/templates/{id}",
1015
+ "request_type": request.__class__.__name__,
1016
+ "response_type": "DeleteTemplateResponse"
1017
+ }
1018
+
1019
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1020
+
1021
+ cname = None
1022
+
1023
+ collection_formats = {}
1024
+
1025
+ path_params = {}
1026
+ if 'id' in local_var_params:
1027
+ path_params['id'] = local_var_params['id']
1028
+
1029
+ query_params = []
1030
+
1031
+ header_params = {}
1032
+
1033
+ form_params = {}
1034
+
1035
+ body = None
1036
+ if isinstance(request, SdkStreamRequest):
1037
+ body = request.get_file_stream()
1038
+
1039
+ response_headers = []
1040
+
1041
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1042
+ ['application/json'])
1043
+
1044
+ auth_settings = []
1045
+
1046
+ http_info["cname"] = cname
1047
+ http_info["collection_formats"] = collection_formats
1048
+ http_info["path_params"] = path_params
1049
+ http_info["query_params"] = query_params
1050
+ http_info["header_params"] = header_params
1051
+ http_info["post_params"] = form_params
1052
+ http_info["body"] = body
1053
+ http_info["response_headers"] = response_headers
1054
+
1055
+ return http_info
1056
+
1057
+ def list_send_country_details_async(self, request):
1058
+ r"""查询发送国家
1059
+
1060
+ 该接口用于用户查询短信发送的国家信息
1061
+
1062
+ Please refer to HUAWEI cloud API Explorer for details.
1063
+
1064
+
1065
+ :param request: Request instance for ListSendCountryDetails
1066
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ListSendCountryDetailsRequest`
1067
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ListSendCountryDetailsResponse`
1068
+ """
1069
+ http_info = self._list_send_country_details_http_info(request)
1070
+ return self._call_api(**http_info)
1071
+
1072
+ def list_send_country_details_async_invoker(self, request):
1073
+ http_info = self._list_send_country_details_http_info(request)
1074
+ return AsyncInvoker(self, http_info)
1075
+
1076
+ def _list_send_country_details_http_info(self, request):
1077
+ http_info = {
1078
+ "method": "GET",
1079
+ "resource_path": "/v2/{project_id}/msgsms/country",
1080
+ "request_type": request.__class__.__name__,
1081
+ "response_type": "ListSendCountryDetailsResponse"
1082
+ }
1083
+
1084
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1085
+
1086
+ cname = None
1087
+
1088
+ collection_formats = {}
1089
+
1090
+ path_params = {}
1091
+
1092
+ query_params = []
1093
+ if 'country_name_en' in local_var_params:
1094
+ query_params.append(('country_name_en', local_var_params['country_name_en']))
1095
+ if 'country_name_zh' in local_var_params:
1096
+ query_params.append(('country_name_zh', local_var_params['country_name_zh']))
1097
+
1098
+ header_params = {}
1099
+
1100
+ form_params = {}
1101
+
1102
+ body = None
1103
+ if isinstance(request, SdkStreamRequest):
1104
+ body = request.get_file_stream()
1105
+
1106
+ response_headers = []
1107
+
1108
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1109
+ ['application/json'])
1110
+
1111
+ auth_settings = []
1112
+
1113
+ http_info["cname"] = cname
1114
+ http_info["collection_formats"] = collection_formats
1115
+ http_info["path_params"] = path_params
1116
+ http_info["query_params"] = query_params
1117
+ http_info["header_params"] = header_params
1118
+ http_info["post_params"] = form_params
1119
+ http_info["body"] = body
1120
+ http_info["response_headers"] = response_headers
1121
+
1122
+ return http_info
1123
+
1124
+ def list_template_details_async(self, request):
1125
+ r"""查询短信模板
1126
+
1127
+ 该接口用于用户查询已创建的模板信息。
1128
+
1129
+ Please refer to HUAWEI cloud API Explorer for details.
1130
+
1131
+
1132
+ :param request: Request instance for ListTemplateDetails
1133
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ListTemplateDetailsRequest`
1134
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ListTemplateDetailsResponse`
1135
+ """
1136
+ http_info = self._list_template_details_http_info(request)
1137
+ return self._call_api(**http_info)
1138
+
1139
+ def list_template_details_async_invoker(self, request):
1140
+ http_info = self._list_template_details_http_info(request)
1141
+ return AsyncInvoker(self, http_info)
1142
+
1143
+ def _list_template_details_http_info(self, request):
1144
+ http_info = {
1145
+ "method": "GET",
1146
+ "resource_path": "/v2/{project_id}/msgsms/templates",
1147
+ "request_type": request.__class__.__name__,
1148
+ "response_type": "ListTemplateDetailsResponse"
1149
+ }
1150
+
1151
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1152
+
1153
+ cname = None
1154
+
1155
+ collection_formats = {}
1156
+
1157
+ path_params = {}
1158
+
1159
+ query_params = []
1160
+ if 'app_key' in local_var_params:
1161
+ query_params.append(('app_key', local_var_params['app_key']))
1162
+ if 'app_name' in local_var_params:
1163
+ query_params.append(('app_name', local_var_params['app_name']))
1164
+ if 'start_time' in local_var_params:
1165
+ query_params.append(('start_time', local_var_params['start_time']))
1166
+ if 'end_time' in local_var_params:
1167
+ query_params.append(('end_time', local_var_params['end_time']))
1168
+ if 'limit' in local_var_params:
1169
+ query_params.append(('limit', local_var_params['limit']))
1170
+ if 'offset' in local_var_params:
1171
+ query_params.append(('offset', local_var_params['offset']))
1172
+ if 'flow_status' in local_var_params:
1173
+ query_params.append(('flow_status', local_var_params['flow_status']))
1174
+ if 'has_variable' in local_var_params:
1175
+ query_params.append(('has_variable', local_var_params['has_variable']))
1176
+ if 'region' in local_var_params:
1177
+ query_params.append(('region', local_var_params['region']))
1178
+ if 'sign_name' in local_var_params:
1179
+ query_params.append(('sign_name', local_var_params['sign_name']))
1180
+ if 'sort_dir' in local_var_params:
1181
+ query_params.append(('sort_dir', local_var_params['sort_dir']))
1182
+ if 'sort_key' in local_var_params:
1183
+ query_params.append(('sort_key', local_var_params['sort_key']))
1184
+ if 'template_id' in local_var_params:
1185
+ query_params.append(('template_id', local_var_params['template_id']))
1186
+ if 'template_name' in local_var_params:
1187
+ query_params.append(('template_name', local_var_params['template_name']))
1188
+ if 'template_type' in local_var_params:
1189
+ query_params.append(('template_type', local_var_params['template_type']))
1190
+
1191
+ header_params = {}
1192
+
1193
+ form_params = {}
1194
+
1195
+ body = None
1196
+ if isinstance(request, SdkStreamRequest):
1197
+ body = request.get_file_stream()
1198
+
1199
+ response_headers = []
1200
+
1201
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1202
+ ['application/json'])
1203
+
1204
+ auth_settings = []
1205
+
1206
+ http_info["cname"] = cname
1207
+ http_info["collection_formats"] = collection_formats
1208
+ http_info["path_params"] = path_params
1209
+ http_info["query_params"] = query_params
1210
+ http_info["header_params"] = header_params
1211
+ http_info["post_params"] = form_params
1212
+ http_info["body"] = body
1213
+ http_info["response_headers"] = response_headers
1214
+
1215
+ return http_info
1216
+
1217
+ def list_template_varilable_details_async(self, request):
1218
+ r"""查询模板变量
1219
+
1220
+ 该接口用于用户查询模板参数。
1221
+
1222
+ Please refer to HUAWEI cloud API Explorer for details.
1223
+
1224
+
1225
+ :param request: Request instance for ListTemplateVarilableDetails
1226
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ListTemplateVarilableDetailsRequest`
1227
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ListTemplateVarilableDetailsResponse`
1228
+ """
1229
+ http_info = self._list_template_varilable_details_http_info(request)
1230
+ return self._call_api(**http_info)
1231
+
1232
+ def list_template_varilable_details_async_invoker(self, request):
1233
+ http_info = self._list_template_varilable_details_http_info(request)
1234
+ return AsyncInvoker(self, http_info)
1235
+
1236
+ def _list_template_varilable_details_http_info(self, request):
1237
+ http_info = {
1238
+ "method": "GET",
1239
+ "resource_path": "/v2/{project_id}/msgsms/templates/{id}/varilable",
1240
+ "request_type": request.__class__.__name__,
1241
+ "response_type": "ListTemplateVarilableDetailsResponse"
1242
+ }
1243
+
1244
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1245
+
1246
+ cname = None
1247
+
1248
+ collection_formats = {}
1249
+
1250
+ path_params = {}
1251
+ if 'id' in local_var_params:
1252
+ path_params['id'] = local_var_params['id']
1253
+
1254
+ query_params = []
1255
+
1256
+ header_params = {}
1257
+
1258
+ form_params = {}
1259
+
1260
+ body = None
1261
+ if isinstance(request, SdkStreamRequest):
1262
+ body = request.get_file_stream()
1263
+
1264
+ response_headers = []
1265
+
1266
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1267
+ ['application/json'])
1268
+
1269
+ auth_settings = []
1270
+
1271
+ http_info["cname"] = cname
1272
+ http_info["collection_formats"] = collection_formats
1273
+ http_info["path_params"] = path_params
1274
+ http_info["query_params"] = query_params
1275
+ http_info["header_params"] = header_params
1276
+ http_info["post_params"] = form_params
1277
+ http_info["body"] = body
1278
+ http_info["response_headers"] = response_headers
1279
+
1280
+ return http_info
1281
+
1282
+ def show_template_async(self, request):
1283
+ r"""获取模板详情
1284
+
1285
+ 该接口用于用户查询已创建的模板详情。
1286
+
1287
+ Please refer to HUAWEI cloud API Explorer for details.
1288
+
1289
+
1290
+ :param request: Request instance for ShowTemplate
1291
+ :type request: :class:`huaweicloudsdkmsgsms.v2.ShowTemplateRequest`
1292
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.ShowTemplateResponse`
1293
+ """
1294
+ http_info = self._show_template_http_info(request)
1295
+ return self._call_api(**http_info)
1296
+
1297
+ def show_template_async_invoker(self, request):
1298
+ http_info = self._show_template_http_info(request)
1299
+ return AsyncInvoker(self, http_info)
1300
+
1301
+ def _show_template_http_info(self, request):
1302
+ http_info = {
1303
+ "method": "GET",
1304
+ "resource_path": "/v2/{project_id}/msgsms/templates/{id}",
1305
+ "request_type": request.__class__.__name__,
1306
+ "response_type": "ShowTemplateResponse"
1307
+ }
1308
+
1309
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1310
+
1311
+ cname = None
1312
+
1313
+ collection_formats = {}
1314
+
1315
+ path_params = {}
1316
+ if 'id' in local_var_params:
1317
+ path_params['id'] = local_var_params['id']
1318
+
1319
+ query_params = []
1320
+
1321
+ header_params = {}
1322
+
1323
+ form_params = {}
1324
+
1325
+ body = None
1326
+ if isinstance(request, SdkStreamRequest):
1327
+ body = request.get_file_stream()
1328
+
1329
+ response_headers = []
1330
+
1331
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1332
+ ['application/json'])
1333
+
1334
+ auth_settings = []
1335
+
1336
+ http_info["cname"] = cname
1337
+ http_info["collection_formats"] = collection_formats
1338
+ http_info["path_params"] = path_params
1339
+ http_info["query_params"] = query_params
1340
+ http_info["header_params"] = header_params
1341
+ http_info["post_params"] = form_params
1342
+ http_info["body"] = body
1343
+ http_info["response_headers"] = response_headers
1344
+
1345
+ return http_info
1346
+
1347
+ def update_template_async(self, request):
1348
+ r"""修改短信模板
1349
+
1350
+ 该接口用于用户修改模板信息,目前仅支持审核不通过的短信模板重新修改
1351
+
1352
+ Please refer to HUAWEI cloud API Explorer for details.
1353
+
1354
+
1355
+ :param request: Request instance for UpdateTemplate
1356
+ :type request: :class:`huaweicloudsdkmsgsms.v2.UpdateTemplateRequest`
1357
+ :rtype: :class:`huaweicloudsdkmsgsms.v2.UpdateTemplateResponse`
1358
+ """
1359
+ http_info = self._update_template_http_info(request)
1360
+ return self._call_api(**http_info)
1361
+
1362
+ def update_template_async_invoker(self, request):
1363
+ http_info = self._update_template_http_info(request)
1364
+ return AsyncInvoker(self, http_info)
1365
+
1366
+ def _update_template_http_info(self, request):
1367
+ http_info = {
1368
+ "method": "PUT",
1369
+ "resource_path": "/v2/{project_id}/msgsms/templates/{id}",
1370
+ "request_type": request.__class__.__name__,
1371
+ "response_type": "UpdateTemplateResponse"
1372
+ }
1373
+
1374
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1375
+
1376
+ cname = None
1377
+
1378
+ collection_formats = {}
1379
+
1380
+ path_params = {}
1381
+ if 'id' in local_var_params:
1382
+ path_params['id'] = local_var_params['id']
1383
+
1384
+ query_params = []
1385
+
1386
+ header_params = {}
1387
+
1388
+ form_params = {}
1389
+
1390
+ body = None
1391
+ if 'body' in local_var_params:
1392
+ body = local_var_params['body']
1393
+ if isinstance(request, SdkStreamRequest):
1394
+ body = request.get_file_stream()
1395
+
1396
+ response_headers = []
1397
+
1398
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1399
+ ['application/json'])
1400
+
1401
+ auth_settings = []
1402
+
1403
+ http_info["cname"] = cname
1404
+ http_info["collection_formats"] = collection_formats
1405
+ http_info["path_params"] = path_params
1406
+ http_info["query_params"] = query_params
1407
+ http_info["header_params"] = header_params
1408
+ http_info["post_params"] = form_params
1409
+ http_info["body"] = body
1410
+ http_info["response_headers"] = response_headers
1411
+
1412
+ return http_info
1413
+
1414
+ def _call_api(self, **kwargs):
1415
+ try:
1416
+ kwargs["async_request"] = True
1417
+ return self.do_http_request(**kwargs)
1418
+ except TypeError:
1419
+ import inspect
1420
+ params = inspect.signature(self.do_http_request).parameters
1421
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
1422
+ return self.do_http_request(**http_info)
1423
+
1424
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
1425
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
1426
+ collection_formats=None, request_type=None):
1427
+ """Makes the HTTP request and returns deserialized data.
1428
+
1429
+ :param resource_path: Path to method endpoint.
1430
+ :param method: Method to call.
1431
+ :param path_params: Path parameters in the url.
1432
+ :param query_params: Query parameters in the url.
1433
+ :param header_params: Header parameters to be
1434
+ placed in the request header.
1435
+ :param body: Request body.
1436
+ :param post_params: Request post form parameters,
1437
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
1438
+ :param cname: Used for obs endpoint.
1439
+ :param auth_settings: Auth Settings names for the request.
1440
+ :param response_type: Response data type.
1441
+ :param response_headers: Header should be added to response data.
1442
+ :param collection_formats: dict of collection formats for path, query,
1443
+ header, and post parameters.
1444
+ :param request_type: Request data type.
1445
+ :return:
1446
+ Return the response directly.
1447
+ """
1448
+ return self.do_http_request(
1449
+ method=method,
1450
+ resource_path=resource_path,
1451
+ path_params=path_params,
1452
+ query_params=query_params,
1453
+ header_params=header_params,
1454
+ body=body,
1455
+ post_params=post_params,
1456
+ cname=cname,
1457
+ response_type=response_type,
1458
+ response_headers=response_headers,
1459
+ collection_formats=collection_formats,
1460
+ request_type=request_type,
1461
+ async_request=True)