one-msg-sdk 1.0.0__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 (85) hide show
  1. one_msg_sdk/__init__.py +189 -0
  2. one_msg_sdk/api/__init__.py +14 -0
  3. one_msg_sdk/api/calling_api.py +901 -0
  4. one_msg_sdk/api/catalog_api.py +607 -0
  5. one_msg_sdk/api/channel_api.py +874 -0
  6. one_msg_sdk/api/flows_api.py +3212 -0
  7. one_msg_sdk/api/groups_api.py +1935 -0
  8. one_msg_sdk/api/messaging_api.py +7419 -0
  9. one_msg_sdk/api/profile_api.py +609 -0
  10. one_msg_sdk/api/templates_api.py +1180 -0
  11. one_msg_sdk/api/users_api.py +903 -0
  12. one_msg_sdk/api/webhooks_api.py +605 -0
  13. one_msg_sdk/api_client.py +805 -0
  14. one_msg_sdk/api_response.py +21 -0
  15. one_msg_sdk/configuration.py +635 -0
  16. one_msg_sdk/exceptions.py +219 -0
  17. one_msg_sdk/models/__init__.py +78 -0
  18. one_msg_sdk/models/add_template_request.py +108 -0
  19. one_msg_sdk/models/block_user_request.py +102 -0
  20. one_msg_sdk/models/conversational_automation.py +115 -0
  21. one_msg_sdk/models/conversational_automation_commands_inner.py +105 -0
  22. one_msg_sdk/models/create_commerce200_response.py +102 -0
  23. one_msg_sdk/models/create_commerce_request.py +106 -0
  24. one_msg_sdk/models/create_commerce_request_params.py +104 -0
  25. one_msg_sdk/models/create_groups200_response.py +107 -0
  26. one_msg_sdk/models/create_read_message200_response.py +102 -0
  27. one_msg_sdk/models/create_read_message401_response.py +89 -0
  28. one_msg_sdk/models/create_read_message_request.py +93 -0
  29. one_msg_sdk/models/delete_flows_flow_id200_response.py +109 -0
  30. one_msg_sdk/models/delete_groups_group_id200_response.py +104 -0
  31. one_msg_sdk/models/delete_media_legacy_request.py +102 -0
  32. one_msg_sdk/models/error_response.py +89 -0
  33. one_msg_sdk/models/get_commerce200_response_inner.py +106 -0
  34. one_msg_sdk/models/get_mm_lite_status200_response.py +106 -0
  35. one_msg_sdk/models/get_webhook200_response.py +102 -0
  36. one_msg_sdk/models/get_whatsapp_business_encryption200_response.py +116 -0
  37. one_msg_sdk/models/list_blocked_users200_response.py +102 -0
  38. one_msg_sdk/models/list_flows200_response.py +115 -0
  39. one_msg_sdk/models/list_messages200_response.py +104 -0
  40. one_msg_sdk/models/list_templates200_response.py +106 -0
  41. one_msg_sdk/models/message_sent_response.py +108 -0
  42. one_msg_sdk/models/patch_flows_flow_id_assets200_response.py +111 -0
  43. one_msg_sdk/models/profile_info.py +126 -0
  44. one_msg_sdk/models/retrieve_media200_response.py +110 -0
  45. one_msg_sdk/models/send_address_message_request.py +126 -0
  46. one_msg_sdk/models/send_button_request.py +103 -0
  47. one_msg_sdk/models/send_button_request_sections_inner.py +95 -0
  48. one_msg_sdk/models/send_button_request_sections_inner_reply.py +91 -0
  49. one_msg_sdk/models/send_carousel_request1.py +97 -0
  50. one_msg_sdk/models/send_contact_request.py +99 -0
  51. one_msg_sdk/models/send_contact_request_contacts_inner.py +117 -0
  52. one_msg_sdk/models/send_contact_request_contacts_inner_name.py +99 -0
  53. one_msg_sdk/models/send_contact_request_contacts_inner_org.py +93 -0
  54. one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.py +93 -0
  55. one_msg_sdk/models/send_cta_url_request.py +116 -0
  56. one_msg_sdk/models/send_file_request.py +129 -0
  57. one_msg_sdk/models/send_flow_request1.py +141 -0
  58. one_msg_sdk/models/send_flow_request1_header.py +144 -0
  59. one_msg_sdk/models/send_flow_request_header.py +144 -0
  60. one_msg_sdk/models/send_list_request.py +105 -0
  61. one_msg_sdk/models/send_list_request_sections_inner.py +99 -0
  62. one_msg_sdk/models/send_list_request_sections_inner_rows_inner.py +93 -0
  63. one_msg_sdk/models/send_location_request1.py +101 -0
  64. one_msg_sdk/models/send_location_request_request.py +91 -0
  65. one_msg_sdk/models/send_message_request.py +122 -0
  66. one_msg_sdk/models/send_order_details_request.py +128 -0
  67. one_msg_sdk/models/send_order_details_request_language.py +104 -0
  68. one_msg_sdk/models/send_order_details_request_order.py +124 -0
  69. one_msg_sdk/models/send_order_details_request_order_items_inner.py +112 -0
  70. one_msg_sdk/models/send_order_details_request_order_items_inner_amount.py +104 -0
  71. one_msg_sdk/models/send_payment_request_request.py +117 -0
  72. one_msg_sdk/models/send_reaction_request.py +93 -0
  73. one_msg_sdk/models/send_sticker_request.py +110 -0
  74. one_msg_sdk/models/send_template_request.py +107 -0
  75. one_msg_sdk/models/send_template_request_language.py +91 -0
  76. one_msg_sdk/models/set_whatsapp_business_encryption_request.py +89 -0
  77. one_msg_sdk/models/success_response.py +102 -0
  78. one_msg_sdk/models/update_me_request.py +114 -0
  79. one_msg_sdk/py.typed +0 -0
  80. one_msg_sdk/rest.py +264 -0
  81. one_msg_sdk-1.0.0.dist-info/METADATA +19 -0
  82. one_msg_sdk-1.0.0.dist-info/RECORD +85 -0
  83. one_msg_sdk-1.0.0.dist-info/WHEEL +5 -0
  84. one_msg_sdk-1.0.0.dist-info/licenses/LICENSE +21 -0
  85. one_msg_sdk-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3212 @@
1
+ """
2
+ 1MSG WhatsApp Business API (Public)
3
+
4
+ Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@1msg.io
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing import Any, Dict, Optional
21
+ from typing_extensions import Annotated
22
+ from one_msg_sdk.models.create_commerce200_response import CreateCommerce200Response
23
+ from one_msg_sdk.models.create_groups200_response import CreateGroups200Response
24
+ from one_msg_sdk.models.delete_flows_flow_id200_response import DeleteFlowsFlowId200Response
25
+ from one_msg_sdk.models.get_whatsapp_business_encryption200_response import GetWhatsappBusinessEncryption200Response
26
+ from one_msg_sdk.models.list_flows200_response import ListFlows200Response
27
+ from one_msg_sdk.models.patch_flows_flow_id_assets200_response import PatchFlowsFlowIdAssets200Response
28
+ from one_msg_sdk.models.set_whatsapp_business_encryption_request import SetWhatsappBusinessEncryptionRequest
29
+
30
+ from one_msg_sdk.api_client import ApiClient, RequestSerialized
31
+ from one_msg_sdk.api_response import ApiResponse
32
+ from one_msg_sdk.rest import RESTResponseType
33
+
34
+
35
+ class FlowsApi:
36
+ """NOTE: This class is auto generated by OpenAPI Generator
37
+ Ref: https://openapi-generator.tech
38
+
39
+ Do not edit the class manually.
40
+ """
41
+
42
+ def __init__(self, api_client=None) -> None:
43
+ if api_client is None:
44
+ api_client = ApiClient.get_default()
45
+ self.api_client = api_client
46
+
47
+
48
+ @validate_call
49
+ def create_flows(
50
+ self,
51
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
52
+ waba_account_id: Optional[StrictStr] = None,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> CreateGroups200Response:
66
+ """Create Flow
67
+
68
+
69
+ :param token: JWT token or API key for authorization (required)
70
+ :type token: str
71
+ :param waba_account_id:
72
+ :type waba_account_id: str
73
+ :param _request_timeout: timeout setting for this request. If one
74
+ number provided, it will be total request
75
+ timeout. It can also be a pair (tuple) of
76
+ (connection, read) timeouts.
77
+ :type _request_timeout: int, tuple(int, int), optional
78
+ :param _request_auth: set to override the auth_settings for an a single
79
+ request; this effectively ignores the
80
+ authentication in the spec for a single request.
81
+ :type _request_auth: dict, optional
82
+ :param _content_type: force content-type for the request.
83
+ :type _content_type: str, Optional
84
+ :param _headers: set to override the headers for a single
85
+ request; this effectively ignores the headers
86
+ in the spec for a single request.
87
+ :type _headers: dict, optional
88
+ :param _host_index: set to override the host_index for a single
89
+ request; this effectively ignores the host_index
90
+ in the spec for a single request.
91
+ :type _host_index: int, optional
92
+ :return: Returns the result object.
93
+ """ # noqa: E501
94
+
95
+ _param = self._create_flows_serialize(
96
+ token=token,
97
+ waba_account_id=waba_account_id,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index
102
+ )
103
+
104
+ _response_types_map: Dict[str, Optional[str]] = {
105
+ '200': "CreateGroups200Response",
106
+ }
107
+ response_data = self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ def create_flows_with_http_info(
120
+ self,
121
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
122
+ waba_account_id: Optional[StrictStr] = None,
123
+ _request_timeout: Union[
124
+ None,
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Tuple[
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Annotated[StrictFloat, Field(gt=0)]
129
+ ]
130
+ ] = None,
131
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
+ _content_type: Optional[StrictStr] = None,
133
+ _headers: Optional[Dict[StrictStr, Any]] = None,
134
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
+ ) -> ApiResponse[CreateGroups200Response]:
136
+ """Create Flow
137
+
138
+
139
+ :param token: JWT token or API key for authorization (required)
140
+ :type token: str
141
+ :param waba_account_id:
142
+ :type waba_account_id: str
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_flows_serialize(
166
+ token=token,
167
+ waba_account_id=waba_account_id,
168
+ _request_auth=_request_auth,
169
+ _content_type=_content_type,
170
+ _headers=_headers,
171
+ _host_index=_host_index
172
+ )
173
+
174
+ _response_types_map: Dict[str, Optional[str]] = {
175
+ '200': "CreateGroups200Response",
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def create_flows_without_preload_content(
190
+ self,
191
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
192
+ waba_account_id: Optional[StrictStr] = None,
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Create Flow
207
+
208
+
209
+ :param token: JWT token or API key for authorization (required)
210
+ :type token: str
211
+ :param waba_account_id:
212
+ :type waba_account_id: str
213
+ :param _request_timeout: timeout setting for this request. If one
214
+ number provided, it will be total request
215
+ timeout. It can also be a pair (tuple) of
216
+ (connection, read) timeouts.
217
+ :type _request_timeout: int, tuple(int, int), optional
218
+ :param _request_auth: set to override the auth_settings for an a single
219
+ request; this effectively ignores the
220
+ authentication in the spec for a single request.
221
+ :type _request_auth: dict, optional
222
+ :param _content_type: force content-type for the request.
223
+ :type _content_type: str, Optional
224
+ :param _headers: set to override the headers for a single
225
+ request; this effectively ignores the headers
226
+ in the spec for a single request.
227
+ :type _headers: dict, optional
228
+ :param _host_index: set to override the host_index for a single
229
+ request; this effectively ignores the host_index
230
+ in the spec for a single request.
231
+ :type _host_index: int, optional
232
+ :return: Returns the result object.
233
+ """ # noqa: E501
234
+
235
+ _param = self._create_flows_serialize(
236
+ token=token,
237
+ waba_account_id=waba_account_id,
238
+ _request_auth=_request_auth,
239
+ _content_type=_content_type,
240
+ _headers=_headers,
241
+ _host_index=_host_index
242
+ )
243
+
244
+ _response_types_map: Dict[str, Optional[str]] = {
245
+ '200': "CreateGroups200Response",
246
+ }
247
+ response_data = self.api_client.call_api(
248
+ *_param,
249
+ _request_timeout=_request_timeout
250
+ )
251
+ return response_data.response
252
+
253
+
254
+ def _create_flows_serialize(
255
+ self,
256
+ token,
257
+ waba_account_id,
258
+ _request_auth,
259
+ _content_type,
260
+ _headers,
261
+ _host_index,
262
+ ) -> RequestSerialized:
263
+
264
+ _host = None
265
+
266
+ _collection_formats: Dict[str, str] = {
267
+ }
268
+
269
+ _path_params: Dict[str, str] = {}
270
+ _query_params: List[Tuple[str, str]] = []
271
+ _header_params: Dict[str, Optional[str]] = _headers or {}
272
+ _form_params: List[Tuple[str, str]] = []
273
+ _files: Dict[
274
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
+ ] = {}
276
+ _body_params: Optional[bytes] = None
277
+
278
+ # process the path parameters
279
+ # process the query parameters
280
+ if token is not None:
281
+
282
+ _query_params.append(('token', token))
283
+
284
+ if waba_account_id is not None:
285
+
286
+ _query_params.append(('wabaAccountId', waba_account_id))
287
+
288
+ # process the header parameters
289
+ # process the form parameters
290
+ # process the body parameter
291
+
292
+
293
+ # set the HTTP header `Accept`
294
+ if 'Accept' not in _header_params:
295
+ _header_params['Accept'] = self.api_client.select_header_accept(
296
+ [
297
+ 'application/json'
298
+ ]
299
+ )
300
+
301
+
302
+ # authentication setting
303
+ _auth_settings: List[str] = [
304
+ 'tokenAuth'
305
+ ]
306
+
307
+ return self.api_client.param_serialize(
308
+ method='POST',
309
+ resource_path='/flows',
310
+ path_params=_path_params,
311
+ query_params=_query_params,
312
+ header_params=_header_params,
313
+ body=_body_params,
314
+ post_params=_form_params,
315
+ files=_files,
316
+ auth_settings=_auth_settings,
317
+ collection_formats=_collection_formats,
318
+ _host=_host,
319
+ _request_auth=_request_auth
320
+ )
321
+
322
+
323
+
324
+
325
+ @validate_call
326
+ def create_flows_flow_id_deprecate(
327
+ self,
328
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
329
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
330
+ waba_account_id: Optional[StrictStr] = None,
331
+ _request_timeout: Union[
332
+ None,
333
+ Annotated[StrictFloat, Field(gt=0)],
334
+ Tuple[
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Annotated[StrictFloat, Field(gt=0)]
337
+ ]
338
+ ] = None,
339
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
340
+ _content_type: Optional[StrictStr] = None,
341
+ _headers: Optional[Dict[StrictStr, Any]] = None,
342
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
343
+ ) -> Dict[str, object]:
344
+ """Deprecate Flow
345
+
346
+
347
+ :param flow_id: Flow ID (required)
348
+ :type flow_id: str
349
+ :param token: JWT token or API key for authorization (required)
350
+ :type token: str
351
+ :param waba_account_id:
352
+ :type waba_account_id: str
353
+ :param _request_timeout: timeout setting for this request. If one
354
+ number provided, it will be total request
355
+ timeout. It can also be a pair (tuple) of
356
+ (connection, read) timeouts.
357
+ :type _request_timeout: int, tuple(int, int), optional
358
+ :param _request_auth: set to override the auth_settings for an a single
359
+ request; this effectively ignores the
360
+ authentication in the spec for a single request.
361
+ :type _request_auth: dict, optional
362
+ :param _content_type: force content-type for the request.
363
+ :type _content_type: str, Optional
364
+ :param _headers: set to override the headers for a single
365
+ request; this effectively ignores the headers
366
+ in the spec for a single request.
367
+ :type _headers: dict, optional
368
+ :param _host_index: set to override the host_index for a single
369
+ request; this effectively ignores the host_index
370
+ in the spec for a single request.
371
+ :type _host_index: int, optional
372
+ :return: Returns the result object.
373
+ """ # noqa: E501
374
+
375
+ _param = self._create_flows_flow_id_deprecate_serialize(
376
+ flow_id=flow_id,
377
+ token=token,
378
+ waba_account_id=waba_account_id,
379
+ _request_auth=_request_auth,
380
+ _content_type=_content_type,
381
+ _headers=_headers,
382
+ _host_index=_host_index
383
+ )
384
+
385
+ _response_types_map: Dict[str, Optional[str]] = {
386
+ '200': "Dict[str, object]",
387
+ }
388
+ response_data = self.api_client.call_api(
389
+ *_param,
390
+ _request_timeout=_request_timeout
391
+ )
392
+ response_data.read()
393
+ return self.api_client.response_deserialize(
394
+ response_data=response_data,
395
+ response_types_map=_response_types_map,
396
+ ).data
397
+
398
+
399
+ @validate_call
400
+ def create_flows_flow_id_deprecate_with_http_info(
401
+ self,
402
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
403
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
404
+ waba_account_id: Optional[StrictStr] = None,
405
+ _request_timeout: Union[
406
+ None,
407
+ Annotated[StrictFloat, Field(gt=0)],
408
+ Tuple[
409
+ Annotated[StrictFloat, Field(gt=0)],
410
+ Annotated[StrictFloat, Field(gt=0)]
411
+ ]
412
+ ] = None,
413
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
414
+ _content_type: Optional[StrictStr] = None,
415
+ _headers: Optional[Dict[StrictStr, Any]] = None,
416
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
417
+ ) -> ApiResponse[Dict[str, object]]:
418
+ """Deprecate Flow
419
+
420
+
421
+ :param flow_id: Flow ID (required)
422
+ :type flow_id: str
423
+ :param token: JWT token or API key for authorization (required)
424
+ :type token: str
425
+ :param waba_account_id:
426
+ :type waba_account_id: str
427
+ :param _request_timeout: timeout setting for this request. If one
428
+ number provided, it will be total request
429
+ timeout. It can also be a pair (tuple) of
430
+ (connection, read) timeouts.
431
+ :type _request_timeout: int, tuple(int, int), optional
432
+ :param _request_auth: set to override the auth_settings for an a single
433
+ request; this effectively ignores the
434
+ authentication in the spec for a single request.
435
+ :type _request_auth: dict, optional
436
+ :param _content_type: force content-type for the request.
437
+ :type _content_type: str, Optional
438
+ :param _headers: set to override the headers for a single
439
+ request; this effectively ignores the headers
440
+ in the spec for a single request.
441
+ :type _headers: dict, optional
442
+ :param _host_index: set to override the host_index for a single
443
+ request; this effectively ignores the host_index
444
+ in the spec for a single request.
445
+ :type _host_index: int, optional
446
+ :return: Returns the result object.
447
+ """ # noqa: E501
448
+
449
+ _param = self._create_flows_flow_id_deprecate_serialize(
450
+ flow_id=flow_id,
451
+ token=token,
452
+ waba_account_id=waba_account_id,
453
+ _request_auth=_request_auth,
454
+ _content_type=_content_type,
455
+ _headers=_headers,
456
+ _host_index=_host_index
457
+ )
458
+
459
+ _response_types_map: Dict[str, Optional[str]] = {
460
+ '200': "Dict[str, object]",
461
+ }
462
+ response_data = self.api_client.call_api(
463
+ *_param,
464
+ _request_timeout=_request_timeout
465
+ )
466
+ response_data.read()
467
+ return self.api_client.response_deserialize(
468
+ response_data=response_data,
469
+ response_types_map=_response_types_map,
470
+ )
471
+
472
+
473
+ @validate_call
474
+ def create_flows_flow_id_deprecate_without_preload_content(
475
+ self,
476
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
477
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
478
+ waba_account_id: Optional[StrictStr] = None,
479
+ _request_timeout: Union[
480
+ None,
481
+ Annotated[StrictFloat, Field(gt=0)],
482
+ Tuple[
483
+ Annotated[StrictFloat, Field(gt=0)],
484
+ Annotated[StrictFloat, Field(gt=0)]
485
+ ]
486
+ ] = None,
487
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
488
+ _content_type: Optional[StrictStr] = None,
489
+ _headers: Optional[Dict[StrictStr, Any]] = None,
490
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
491
+ ) -> RESTResponseType:
492
+ """Deprecate Flow
493
+
494
+
495
+ :param flow_id: Flow ID (required)
496
+ :type flow_id: str
497
+ :param token: JWT token or API key for authorization (required)
498
+ :type token: str
499
+ :param waba_account_id:
500
+ :type waba_account_id: str
501
+ :param _request_timeout: timeout setting for this request. If one
502
+ number provided, it will be total request
503
+ timeout. It can also be a pair (tuple) of
504
+ (connection, read) timeouts.
505
+ :type _request_timeout: int, tuple(int, int), optional
506
+ :param _request_auth: set to override the auth_settings for an a single
507
+ request; this effectively ignores the
508
+ authentication in the spec for a single request.
509
+ :type _request_auth: dict, optional
510
+ :param _content_type: force content-type for the request.
511
+ :type _content_type: str, Optional
512
+ :param _headers: set to override the headers for a single
513
+ request; this effectively ignores the headers
514
+ in the spec for a single request.
515
+ :type _headers: dict, optional
516
+ :param _host_index: set to override the host_index for a single
517
+ request; this effectively ignores the host_index
518
+ in the spec for a single request.
519
+ :type _host_index: int, optional
520
+ :return: Returns the result object.
521
+ """ # noqa: E501
522
+
523
+ _param = self._create_flows_flow_id_deprecate_serialize(
524
+ flow_id=flow_id,
525
+ token=token,
526
+ waba_account_id=waba_account_id,
527
+ _request_auth=_request_auth,
528
+ _content_type=_content_type,
529
+ _headers=_headers,
530
+ _host_index=_host_index
531
+ )
532
+
533
+ _response_types_map: Dict[str, Optional[str]] = {
534
+ '200': "Dict[str, object]",
535
+ }
536
+ response_data = self.api_client.call_api(
537
+ *_param,
538
+ _request_timeout=_request_timeout
539
+ )
540
+ return response_data.response
541
+
542
+
543
+ def _create_flows_flow_id_deprecate_serialize(
544
+ self,
545
+ flow_id,
546
+ token,
547
+ waba_account_id,
548
+ _request_auth,
549
+ _content_type,
550
+ _headers,
551
+ _host_index,
552
+ ) -> RequestSerialized:
553
+
554
+ _host = None
555
+
556
+ _collection_formats: Dict[str, str] = {
557
+ }
558
+
559
+ _path_params: Dict[str, str] = {}
560
+ _query_params: List[Tuple[str, str]] = []
561
+ _header_params: Dict[str, Optional[str]] = _headers or {}
562
+ _form_params: List[Tuple[str, str]] = []
563
+ _files: Dict[
564
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
565
+ ] = {}
566
+ _body_params: Optional[bytes] = None
567
+
568
+ # process the path parameters
569
+ if flow_id is not None:
570
+ _path_params['flowId'] = flow_id
571
+ # process the query parameters
572
+ if token is not None:
573
+
574
+ _query_params.append(('token', token))
575
+
576
+ if waba_account_id is not None:
577
+
578
+ _query_params.append(('wabaAccountId', waba_account_id))
579
+
580
+ # process the header parameters
581
+ # process the form parameters
582
+ # process the body parameter
583
+
584
+
585
+ # set the HTTP header `Accept`
586
+ if 'Accept' not in _header_params:
587
+ _header_params['Accept'] = self.api_client.select_header_accept(
588
+ [
589
+ 'application/json'
590
+ ]
591
+ )
592
+
593
+
594
+ # authentication setting
595
+ _auth_settings: List[str] = [
596
+ 'tokenAuth'
597
+ ]
598
+
599
+ return self.api_client.param_serialize(
600
+ method='POST',
601
+ resource_path='/flows/{flowId}/deprecate',
602
+ path_params=_path_params,
603
+ query_params=_query_params,
604
+ header_params=_header_params,
605
+ body=_body_params,
606
+ post_params=_form_params,
607
+ files=_files,
608
+ auth_settings=_auth_settings,
609
+ collection_formats=_collection_formats,
610
+ _host=_host,
611
+ _request_auth=_request_auth
612
+ )
613
+
614
+
615
+
616
+
617
+ @validate_call
618
+ def create_flows_flow_id_publish(
619
+ self,
620
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
621
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
622
+ waba_account_id: Optional[StrictStr] = None,
623
+ _request_timeout: Union[
624
+ None,
625
+ Annotated[StrictFloat, Field(gt=0)],
626
+ Tuple[
627
+ Annotated[StrictFloat, Field(gt=0)],
628
+ Annotated[StrictFloat, Field(gt=0)]
629
+ ]
630
+ ] = None,
631
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
632
+ _content_type: Optional[StrictStr] = None,
633
+ _headers: Optional[Dict[StrictStr, Any]] = None,
634
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
635
+ ) -> Dict[str, object]:
636
+ """Publish Flow
637
+
638
+
639
+ :param flow_id: Flow ID (required)
640
+ :type flow_id: str
641
+ :param token: JWT token or API key for authorization (required)
642
+ :type token: str
643
+ :param waba_account_id:
644
+ :type waba_account_id: str
645
+ :param _request_timeout: timeout setting for this request. If one
646
+ number provided, it will be total request
647
+ timeout. It can also be a pair (tuple) of
648
+ (connection, read) timeouts.
649
+ :type _request_timeout: int, tuple(int, int), optional
650
+ :param _request_auth: set to override the auth_settings for an a single
651
+ request; this effectively ignores the
652
+ authentication in the spec for a single request.
653
+ :type _request_auth: dict, optional
654
+ :param _content_type: force content-type for the request.
655
+ :type _content_type: str, Optional
656
+ :param _headers: set to override the headers for a single
657
+ request; this effectively ignores the headers
658
+ in the spec for a single request.
659
+ :type _headers: dict, optional
660
+ :param _host_index: set to override the host_index for a single
661
+ request; this effectively ignores the host_index
662
+ in the spec for a single request.
663
+ :type _host_index: int, optional
664
+ :return: Returns the result object.
665
+ """ # noqa: E501
666
+
667
+ _param = self._create_flows_flow_id_publish_serialize(
668
+ flow_id=flow_id,
669
+ token=token,
670
+ waba_account_id=waba_account_id,
671
+ _request_auth=_request_auth,
672
+ _content_type=_content_type,
673
+ _headers=_headers,
674
+ _host_index=_host_index
675
+ )
676
+
677
+ _response_types_map: Dict[str, Optional[str]] = {
678
+ '200': "Dict[str, object]",
679
+ }
680
+ response_data = self.api_client.call_api(
681
+ *_param,
682
+ _request_timeout=_request_timeout
683
+ )
684
+ response_data.read()
685
+ return self.api_client.response_deserialize(
686
+ response_data=response_data,
687
+ response_types_map=_response_types_map,
688
+ ).data
689
+
690
+
691
+ @validate_call
692
+ def create_flows_flow_id_publish_with_http_info(
693
+ self,
694
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
695
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
696
+ waba_account_id: Optional[StrictStr] = None,
697
+ _request_timeout: Union[
698
+ None,
699
+ Annotated[StrictFloat, Field(gt=0)],
700
+ Tuple[
701
+ Annotated[StrictFloat, Field(gt=0)],
702
+ Annotated[StrictFloat, Field(gt=0)]
703
+ ]
704
+ ] = None,
705
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
706
+ _content_type: Optional[StrictStr] = None,
707
+ _headers: Optional[Dict[StrictStr, Any]] = None,
708
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
709
+ ) -> ApiResponse[Dict[str, object]]:
710
+ """Publish Flow
711
+
712
+
713
+ :param flow_id: Flow ID (required)
714
+ :type flow_id: str
715
+ :param token: JWT token or API key for authorization (required)
716
+ :type token: str
717
+ :param waba_account_id:
718
+ :type waba_account_id: str
719
+ :param _request_timeout: timeout setting for this request. If one
720
+ number provided, it will be total request
721
+ timeout. It can also be a pair (tuple) of
722
+ (connection, read) timeouts.
723
+ :type _request_timeout: int, tuple(int, int), optional
724
+ :param _request_auth: set to override the auth_settings for an a single
725
+ request; this effectively ignores the
726
+ authentication in the spec for a single request.
727
+ :type _request_auth: dict, optional
728
+ :param _content_type: force content-type for the request.
729
+ :type _content_type: str, Optional
730
+ :param _headers: set to override the headers for a single
731
+ request; this effectively ignores the headers
732
+ in the spec for a single request.
733
+ :type _headers: dict, optional
734
+ :param _host_index: set to override the host_index for a single
735
+ request; this effectively ignores the host_index
736
+ in the spec for a single request.
737
+ :type _host_index: int, optional
738
+ :return: Returns the result object.
739
+ """ # noqa: E501
740
+
741
+ _param = self._create_flows_flow_id_publish_serialize(
742
+ flow_id=flow_id,
743
+ token=token,
744
+ waba_account_id=waba_account_id,
745
+ _request_auth=_request_auth,
746
+ _content_type=_content_type,
747
+ _headers=_headers,
748
+ _host_index=_host_index
749
+ )
750
+
751
+ _response_types_map: Dict[str, Optional[str]] = {
752
+ '200': "Dict[str, object]",
753
+ }
754
+ response_data = self.api_client.call_api(
755
+ *_param,
756
+ _request_timeout=_request_timeout
757
+ )
758
+ response_data.read()
759
+ return self.api_client.response_deserialize(
760
+ response_data=response_data,
761
+ response_types_map=_response_types_map,
762
+ )
763
+
764
+
765
+ @validate_call
766
+ def create_flows_flow_id_publish_without_preload_content(
767
+ self,
768
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
769
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
770
+ waba_account_id: Optional[StrictStr] = None,
771
+ _request_timeout: Union[
772
+ None,
773
+ Annotated[StrictFloat, Field(gt=0)],
774
+ Tuple[
775
+ Annotated[StrictFloat, Field(gt=0)],
776
+ Annotated[StrictFloat, Field(gt=0)]
777
+ ]
778
+ ] = None,
779
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
780
+ _content_type: Optional[StrictStr] = None,
781
+ _headers: Optional[Dict[StrictStr, Any]] = None,
782
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
783
+ ) -> RESTResponseType:
784
+ """Publish Flow
785
+
786
+
787
+ :param flow_id: Flow ID (required)
788
+ :type flow_id: str
789
+ :param token: JWT token or API key for authorization (required)
790
+ :type token: str
791
+ :param waba_account_id:
792
+ :type waba_account_id: str
793
+ :param _request_timeout: timeout setting for this request. If one
794
+ number provided, it will be total request
795
+ timeout. It can also be a pair (tuple) of
796
+ (connection, read) timeouts.
797
+ :type _request_timeout: int, tuple(int, int), optional
798
+ :param _request_auth: set to override the auth_settings for an a single
799
+ request; this effectively ignores the
800
+ authentication in the spec for a single request.
801
+ :type _request_auth: dict, optional
802
+ :param _content_type: force content-type for the request.
803
+ :type _content_type: str, Optional
804
+ :param _headers: set to override the headers for a single
805
+ request; this effectively ignores the headers
806
+ in the spec for a single request.
807
+ :type _headers: dict, optional
808
+ :param _host_index: set to override the host_index for a single
809
+ request; this effectively ignores the host_index
810
+ in the spec for a single request.
811
+ :type _host_index: int, optional
812
+ :return: Returns the result object.
813
+ """ # noqa: E501
814
+
815
+ _param = self._create_flows_flow_id_publish_serialize(
816
+ flow_id=flow_id,
817
+ token=token,
818
+ waba_account_id=waba_account_id,
819
+ _request_auth=_request_auth,
820
+ _content_type=_content_type,
821
+ _headers=_headers,
822
+ _host_index=_host_index
823
+ )
824
+
825
+ _response_types_map: Dict[str, Optional[str]] = {
826
+ '200': "Dict[str, object]",
827
+ }
828
+ response_data = self.api_client.call_api(
829
+ *_param,
830
+ _request_timeout=_request_timeout
831
+ )
832
+ return response_data.response
833
+
834
+
835
+ def _create_flows_flow_id_publish_serialize(
836
+ self,
837
+ flow_id,
838
+ token,
839
+ waba_account_id,
840
+ _request_auth,
841
+ _content_type,
842
+ _headers,
843
+ _host_index,
844
+ ) -> RequestSerialized:
845
+
846
+ _host = None
847
+
848
+ _collection_formats: Dict[str, str] = {
849
+ }
850
+
851
+ _path_params: Dict[str, str] = {}
852
+ _query_params: List[Tuple[str, str]] = []
853
+ _header_params: Dict[str, Optional[str]] = _headers or {}
854
+ _form_params: List[Tuple[str, str]] = []
855
+ _files: Dict[
856
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
857
+ ] = {}
858
+ _body_params: Optional[bytes] = None
859
+
860
+ # process the path parameters
861
+ if flow_id is not None:
862
+ _path_params['flowId'] = flow_id
863
+ # process the query parameters
864
+ if token is not None:
865
+
866
+ _query_params.append(('token', token))
867
+
868
+ if waba_account_id is not None:
869
+
870
+ _query_params.append(('wabaAccountId', waba_account_id))
871
+
872
+ # process the header parameters
873
+ # process the form parameters
874
+ # process the body parameter
875
+
876
+
877
+ # set the HTTP header `Accept`
878
+ if 'Accept' not in _header_params:
879
+ _header_params['Accept'] = self.api_client.select_header_accept(
880
+ [
881
+ 'application/json'
882
+ ]
883
+ )
884
+
885
+
886
+ # authentication setting
887
+ _auth_settings: List[str] = [
888
+ 'tokenAuth'
889
+ ]
890
+
891
+ return self.api_client.param_serialize(
892
+ method='POST',
893
+ resource_path='/flows/{flowId}/publish',
894
+ path_params=_path_params,
895
+ query_params=_query_params,
896
+ header_params=_header_params,
897
+ body=_body_params,
898
+ post_params=_form_params,
899
+ files=_files,
900
+ auth_settings=_auth_settings,
901
+ collection_formats=_collection_formats,
902
+ _host=_host,
903
+ _request_auth=_request_auth
904
+ )
905
+
906
+
907
+
908
+
909
+ @validate_call
910
+ def delete_flows_flow_id(
911
+ self,
912
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
913
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
914
+ waba_account_id: Optional[StrictStr] = None,
915
+ _request_timeout: Union[
916
+ None,
917
+ Annotated[StrictFloat, Field(gt=0)],
918
+ Tuple[
919
+ Annotated[StrictFloat, Field(gt=0)],
920
+ Annotated[StrictFloat, Field(gt=0)]
921
+ ]
922
+ ] = None,
923
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
924
+ _content_type: Optional[StrictStr] = None,
925
+ _headers: Optional[Dict[StrictStr, Any]] = None,
926
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
927
+ ) -> DeleteFlowsFlowId200Response:
928
+ """Delete Flow
929
+
930
+
931
+ :param flow_id: Flow ID (required)
932
+ :type flow_id: str
933
+ :param token: JWT token or API key for authorization (required)
934
+ :type token: str
935
+ :param waba_account_id:
936
+ :type waba_account_id: str
937
+ :param _request_timeout: timeout setting for this request. If one
938
+ number provided, it will be total request
939
+ timeout. It can also be a pair (tuple) of
940
+ (connection, read) timeouts.
941
+ :type _request_timeout: int, tuple(int, int), optional
942
+ :param _request_auth: set to override the auth_settings for an a single
943
+ request; this effectively ignores the
944
+ authentication in the spec for a single request.
945
+ :type _request_auth: dict, optional
946
+ :param _content_type: force content-type for the request.
947
+ :type _content_type: str, Optional
948
+ :param _headers: set to override the headers for a single
949
+ request; this effectively ignores the headers
950
+ in the spec for a single request.
951
+ :type _headers: dict, optional
952
+ :param _host_index: set to override the host_index for a single
953
+ request; this effectively ignores the host_index
954
+ in the spec for a single request.
955
+ :type _host_index: int, optional
956
+ :return: Returns the result object.
957
+ """ # noqa: E501
958
+
959
+ _param = self._delete_flows_flow_id_serialize(
960
+ flow_id=flow_id,
961
+ token=token,
962
+ waba_account_id=waba_account_id,
963
+ _request_auth=_request_auth,
964
+ _content_type=_content_type,
965
+ _headers=_headers,
966
+ _host_index=_host_index
967
+ )
968
+
969
+ _response_types_map: Dict[str, Optional[str]] = {
970
+ '200': "DeleteFlowsFlowId200Response",
971
+ }
972
+ response_data = self.api_client.call_api(
973
+ *_param,
974
+ _request_timeout=_request_timeout
975
+ )
976
+ response_data.read()
977
+ return self.api_client.response_deserialize(
978
+ response_data=response_data,
979
+ response_types_map=_response_types_map,
980
+ ).data
981
+
982
+
983
+ @validate_call
984
+ def delete_flows_flow_id_with_http_info(
985
+ self,
986
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
987
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
988
+ waba_account_id: Optional[StrictStr] = None,
989
+ _request_timeout: Union[
990
+ None,
991
+ Annotated[StrictFloat, Field(gt=0)],
992
+ Tuple[
993
+ Annotated[StrictFloat, Field(gt=0)],
994
+ Annotated[StrictFloat, Field(gt=0)]
995
+ ]
996
+ ] = None,
997
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
998
+ _content_type: Optional[StrictStr] = None,
999
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1000
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1001
+ ) -> ApiResponse[DeleteFlowsFlowId200Response]:
1002
+ """Delete Flow
1003
+
1004
+
1005
+ :param flow_id: Flow ID (required)
1006
+ :type flow_id: str
1007
+ :param token: JWT token or API key for authorization (required)
1008
+ :type token: str
1009
+ :param waba_account_id:
1010
+ :type waba_account_id: str
1011
+ :param _request_timeout: timeout setting for this request. If one
1012
+ number provided, it will be total request
1013
+ timeout. It can also be a pair (tuple) of
1014
+ (connection, read) timeouts.
1015
+ :type _request_timeout: int, tuple(int, int), optional
1016
+ :param _request_auth: set to override the auth_settings for an a single
1017
+ request; this effectively ignores the
1018
+ authentication in the spec for a single request.
1019
+ :type _request_auth: dict, optional
1020
+ :param _content_type: force content-type for the request.
1021
+ :type _content_type: str, Optional
1022
+ :param _headers: set to override the headers for a single
1023
+ request; this effectively ignores the headers
1024
+ in the spec for a single request.
1025
+ :type _headers: dict, optional
1026
+ :param _host_index: set to override the host_index for a single
1027
+ request; this effectively ignores the host_index
1028
+ in the spec for a single request.
1029
+ :type _host_index: int, optional
1030
+ :return: Returns the result object.
1031
+ """ # noqa: E501
1032
+
1033
+ _param = self._delete_flows_flow_id_serialize(
1034
+ flow_id=flow_id,
1035
+ token=token,
1036
+ waba_account_id=waba_account_id,
1037
+ _request_auth=_request_auth,
1038
+ _content_type=_content_type,
1039
+ _headers=_headers,
1040
+ _host_index=_host_index
1041
+ )
1042
+
1043
+ _response_types_map: Dict[str, Optional[str]] = {
1044
+ '200': "DeleteFlowsFlowId200Response",
1045
+ }
1046
+ response_data = self.api_client.call_api(
1047
+ *_param,
1048
+ _request_timeout=_request_timeout
1049
+ )
1050
+ response_data.read()
1051
+ return self.api_client.response_deserialize(
1052
+ response_data=response_data,
1053
+ response_types_map=_response_types_map,
1054
+ )
1055
+
1056
+
1057
+ @validate_call
1058
+ def delete_flows_flow_id_without_preload_content(
1059
+ self,
1060
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1061
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1062
+ waba_account_id: Optional[StrictStr] = None,
1063
+ _request_timeout: Union[
1064
+ None,
1065
+ Annotated[StrictFloat, Field(gt=0)],
1066
+ Tuple[
1067
+ Annotated[StrictFloat, Field(gt=0)],
1068
+ Annotated[StrictFloat, Field(gt=0)]
1069
+ ]
1070
+ ] = None,
1071
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1072
+ _content_type: Optional[StrictStr] = None,
1073
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1074
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1075
+ ) -> RESTResponseType:
1076
+ """Delete Flow
1077
+
1078
+
1079
+ :param flow_id: Flow ID (required)
1080
+ :type flow_id: str
1081
+ :param token: JWT token or API key for authorization (required)
1082
+ :type token: str
1083
+ :param waba_account_id:
1084
+ :type waba_account_id: str
1085
+ :param _request_timeout: timeout setting for this request. If one
1086
+ number provided, it will be total request
1087
+ timeout. It can also be a pair (tuple) of
1088
+ (connection, read) timeouts.
1089
+ :type _request_timeout: int, tuple(int, int), optional
1090
+ :param _request_auth: set to override the auth_settings for an a single
1091
+ request; this effectively ignores the
1092
+ authentication in the spec for a single request.
1093
+ :type _request_auth: dict, optional
1094
+ :param _content_type: force content-type for the request.
1095
+ :type _content_type: str, Optional
1096
+ :param _headers: set to override the headers for a single
1097
+ request; this effectively ignores the headers
1098
+ in the spec for a single request.
1099
+ :type _headers: dict, optional
1100
+ :param _host_index: set to override the host_index for a single
1101
+ request; this effectively ignores the host_index
1102
+ in the spec for a single request.
1103
+ :type _host_index: int, optional
1104
+ :return: Returns the result object.
1105
+ """ # noqa: E501
1106
+
1107
+ _param = self._delete_flows_flow_id_serialize(
1108
+ flow_id=flow_id,
1109
+ token=token,
1110
+ waba_account_id=waba_account_id,
1111
+ _request_auth=_request_auth,
1112
+ _content_type=_content_type,
1113
+ _headers=_headers,
1114
+ _host_index=_host_index
1115
+ )
1116
+
1117
+ _response_types_map: Dict[str, Optional[str]] = {
1118
+ '200': "DeleteFlowsFlowId200Response",
1119
+ }
1120
+ response_data = self.api_client.call_api(
1121
+ *_param,
1122
+ _request_timeout=_request_timeout
1123
+ )
1124
+ return response_data.response
1125
+
1126
+
1127
+ def _delete_flows_flow_id_serialize(
1128
+ self,
1129
+ flow_id,
1130
+ token,
1131
+ waba_account_id,
1132
+ _request_auth,
1133
+ _content_type,
1134
+ _headers,
1135
+ _host_index,
1136
+ ) -> RequestSerialized:
1137
+
1138
+ _host = None
1139
+
1140
+ _collection_formats: Dict[str, str] = {
1141
+ }
1142
+
1143
+ _path_params: Dict[str, str] = {}
1144
+ _query_params: List[Tuple[str, str]] = []
1145
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1146
+ _form_params: List[Tuple[str, str]] = []
1147
+ _files: Dict[
1148
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1149
+ ] = {}
1150
+ _body_params: Optional[bytes] = None
1151
+
1152
+ # process the path parameters
1153
+ if flow_id is not None:
1154
+ _path_params['flowId'] = flow_id
1155
+ # process the query parameters
1156
+ if token is not None:
1157
+
1158
+ _query_params.append(('token', token))
1159
+
1160
+ if waba_account_id is not None:
1161
+
1162
+ _query_params.append(('wabaAccountId', waba_account_id))
1163
+
1164
+ # process the header parameters
1165
+ # process the form parameters
1166
+ # process the body parameter
1167
+
1168
+
1169
+ # set the HTTP header `Accept`
1170
+ if 'Accept' not in _header_params:
1171
+ _header_params['Accept'] = self.api_client.select_header_accept(
1172
+ [
1173
+ 'application/json'
1174
+ ]
1175
+ )
1176
+
1177
+
1178
+ # authentication setting
1179
+ _auth_settings: List[str] = [
1180
+ 'tokenAuth'
1181
+ ]
1182
+
1183
+ return self.api_client.param_serialize(
1184
+ method='DELETE',
1185
+ resource_path='/flows/{flowId}',
1186
+ path_params=_path_params,
1187
+ query_params=_query_params,
1188
+ header_params=_header_params,
1189
+ body=_body_params,
1190
+ post_params=_form_params,
1191
+ files=_files,
1192
+ auth_settings=_auth_settings,
1193
+ collection_formats=_collection_formats,
1194
+ _host=_host,
1195
+ _request_auth=_request_auth
1196
+ )
1197
+
1198
+
1199
+
1200
+
1201
+ @validate_call
1202
+ def get_flows_flow_id(
1203
+ self,
1204
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1205
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1206
+ waba_account_id: Optional[StrictStr] = None,
1207
+ _request_timeout: Union[
1208
+ None,
1209
+ Annotated[StrictFloat, Field(gt=0)],
1210
+ Tuple[
1211
+ Annotated[StrictFloat, Field(gt=0)],
1212
+ Annotated[StrictFloat, Field(gt=0)]
1213
+ ]
1214
+ ] = None,
1215
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1216
+ _content_type: Optional[StrictStr] = None,
1217
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1218
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1219
+ ) -> CreateGroups200Response:
1220
+ """Get Flow Details
1221
+
1222
+
1223
+ :param flow_id: Flow ID (required)
1224
+ :type flow_id: str
1225
+ :param token: JWT token or API key for authorization (required)
1226
+ :type token: str
1227
+ :param waba_account_id:
1228
+ :type waba_account_id: str
1229
+ :param _request_timeout: timeout setting for this request. If one
1230
+ number provided, it will be total request
1231
+ timeout. It can also be a pair (tuple) of
1232
+ (connection, read) timeouts.
1233
+ :type _request_timeout: int, tuple(int, int), optional
1234
+ :param _request_auth: set to override the auth_settings for an a single
1235
+ request; this effectively ignores the
1236
+ authentication in the spec for a single request.
1237
+ :type _request_auth: dict, optional
1238
+ :param _content_type: force content-type for the request.
1239
+ :type _content_type: str, Optional
1240
+ :param _headers: set to override the headers for a single
1241
+ request; this effectively ignores the headers
1242
+ in the spec for a single request.
1243
+ :type _headers: dict, optional
1244
+ :param _host_index: set to override the host_index for a single
1245
+ request; this effectively ignores the host_index
1246
+ in the spec for a single request.
1247
+ :type _host_index: int, optional
1248
+ :return: Returns the result object.
1249
+ """ # noqa: E501
1250
+
1251
+ _param = self._get_flows_flow_id_serialize(
1252
+ flow_id=flow_id,
1253
+ token=token,
1254
+ waba_account_id=waba_account_id,
1255
+ _request_auth=_request_auth,
1256
+ _content_type=_content_type,
1257
+ _headers=_headers,
1258
+ _host_index=_host_index
1259
+ )
1260
+
1261
+ _response_types_map: Dict[str, Optional[str]] = {
1262
+ '200': "CreateGroups200Response",
1263
+ }
1264
+ response_data = self.api_client.call_api(
1265
+ *_param,
1266
+ _request_timeout=_request_timeout
1267
+ )
1268
+ response_data.read()
1269
+ return self.api_client.response_deserialize(
1270
+ response_data=response_data,
1271
+ response_types_map=_response_types_map,
1272
+ ).data
1273
+
1274
+
1275
+ @validate_call
1276
+ def get_flows_flow_id_with_http_info(
1277
+ self,
1278
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1279
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1280
+ waba_account_id: Optional[StrictStr] = None,
1281
+ _request_timeout: Union[
1282
+ None,
1283
+ Annotated[StrictFloat, Field(gt=0)],
1284
+ Tuple[
1285
+ Annotated[StrictFloat, Field(gt=0)],
1286
+ Annotated[StrictFloat, Field(gt=0)]
1287
+ ]
1288
+ ] = None,
1289
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1290
+ _content_type: Optional[StrictStr] = None,
1291
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1292
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1293
+ ) -> ApiResponse[CreateGroups200Response]:
1294
+ """Get Flow Details
1295
+
1296
+
1297
+ :param flow_id: Flow ID (required)
1298
+ :type flow_id: str
1299
+ :param token: JWT token or API key for authorization (required)
1300
+ :type token: str
1301
+ :param waba_account_id:
1302
+ :type waba_account_id: str
1303
+ :param _request_timeout: timeout setting for this request. If one
1304
+ number provided, it will be total request
1305
+ timeout. It can also be a pair (tuple) of
1306
+ (connection, read) timeouts.
1307
+ :type _request_timeout: int, tuple(int, int), optional
1308
+ :param _request_auth: set to override the auth_settings for an a single
1309
+ request; this effectively ignores the
1310
+ authentication in the spec for a single request.
1311
+ :type _request_auth: dict, optional
1312
+ :param _content_type: force content-type for the request.
1313
+ :type _content_type: str, Optional
1314
+ :param _headers: set to override the headers for a single
1315
+ request; this effectively ignores the headers
1316
+ in the spec for a single request.
1317
+ :type _headers: dict, optional
1318
+ :param _host_index: set to override the host_index for a single
1319
+ request; this effectively ignores the host_index
1320
+ in the spec for a single request.
1321
+ :type _host_index: int, optional
1322
+ :return: Returns the result object.
1323
+ """ # noqa: E501
1324
+
1325
+ _param = self._get_flows_flow_id_serialize(
1326
+ flow_id=flow_id,
1327
+ token=token,
1328
+ waba_account_id=waba_account_id,
1329
+ _request_auth=_request_auth,
1330
+ _content_type=_content_type,
1331
+ _headers=_headers,
1332
+ _host_index=_host_index
1333
+ )
1334
+
1335
+ _response_types_map: Dict[str, Optional[str]] = {
1336
+ '200': "CreateGroups200Response",
1337
+ }
1338
+ response_data = self.api_client.call_api(
1339
+ *_param,
1340
+ _request_timeout=_request_timeout
1341
+ )
1342
+ response_data.read()
1343
+ return self.api_client.response_deserialize(
1344
+ response_data=response_data,
1345
+ response_types_map=_response_types_map,
1346
+ )
1347
+
1348
+
1349
+ @validate_call
1350
+ def get_flows_flow_id_without_preload_content(
1351
+ self,
1352
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1353
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1354
+ waba_account_id: Optional[StrictStr] = None,
1355
+ _request_timeout: Union[
1356
+ None,
1357
+ Annotated[StrictFloat, Field(gt=0)],
1358
+ Tuple[
1359
+ Annotated[StrictFloat, Field(gt=0)],
1360
+ Annotated[StrictFloat, Field(gt=0)]
1361
+ ]
1362
+ ] = None,
1363
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1364
+ _content_type: Optional[StrictStr] = None,
1365
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1366
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1367
+ ) -> RESTResponseType:
1368
+ """Get Flow Details
1369
+
1370
+
1371
+ :param flow_id: Flow ID (required)
1372
+ :type flow_id: str
1373
+ :param token: JWT token or API key for authorization (required)
1374
+ :type token: str
1375
+ :param waba_account_id:
1376
+ :type waba_account_id: str
1377
+ :param _request_timeout: timeout setting for this request. If one
1378
+ number provided, it will be total request
1379
+ timeout. It can also be a pair (tuple) of
1380
+ (connection, read) timeouts.
1381
+ :type _request_timeout: int, tuple(int, int), optional
1382
+ :param _request_auth: set to override the auth_settings for an a single
1383
+ request; this effectively ignores the
1384
+ authentication in the spec for a single request.
1385
+ :type _request_auth: dict, optional
1386
+ :param _content_type: force content-type for the request.
1387
+ :type _content_type: str, Optional
1388
+ :param _headers: set to override the headers for a single
1389
+ request; this effectively ignores the headers
1390
+ in the spec for a single request.
1391
+ :type _headers: dict, optional
1392
+ :param _host_index: set to override the host_index for a single
1393
+ request; this effectively ignores the host_index
1394
+ in the spec for a single request.
1395
+ :type _host_index: int, optional
1396
+ :return: Returns the result object.
1397
+ """ # noqa: E501
1398
+
1399
+ _param = self._get_flows_flow_id_serialize(
1400
+ flow_id=flow_id,
1401
+ token=token,
1402
+ waba_account_id=waba_account_id,
1403
+ _request_auth=_request_auth,
1404
+ _content_type=_content_type,
1405
+ _headers=_headers,
1406
+ _host_index=_host_index
1407
+ )
1408
+
1409
+ _response_types_map: Dict[str, Optional[str]] = {
1410
+ '200': "CreateGroups200Response",
1411
+ }
1412
+ response_data = self.api_client.call_api(
1413
+ *_param,
1414
+ _request_timeout=_request_timeout
1415
+ )
1416
+ return response_data.response
1417
+
1418
+
1419
+ def _get_flows_flow_id_serialize(
1420
+ self,
1421
+ flow_id,
1422
+ token,
1423
+ waba_account_id,
1424
+ _request_auth,
1425
+ _content_type,
1426
+ _headers,
1427
+ _host_index,
1428
+ ) -> RequestSerialized:
1429
+
1430
+ _host = None
1431
+
1432
+ _collection_formats: Dict[str, str] = {
1433
+ }
1434
+
1435
+ _path_params: Dict[str, str] = {}
1436
+ _query_params: List[Tuple[str, str]] = []
1437
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1438
+ _form_params: List[Tuple[str, str]] = []
1439
+ _files: Dict[
1440
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1441
+ ] = {}
1442
+ _body_params: Optional[bytes] = None
1443
+
1444
+ # process the path parameters
1445
+ if flow_id is not None:
1446
+ _path_params['flowId'] = flow_id
1447
+ # process the query parameters
1448
+ if token is not None:
1449
+
1450
+ _query_params.append(('token', token))
1451
+
1452
+ if waba_account_id is not None:
1453
+
1454
+ _query_params.append(('wabaAccountId', waba_account_id))
1455
+
1456
+ # process the header parameters
1457
+ # process the form parameters
1458
+ # process the body parameter
1459
+
1460
+
1461
+ # set the HTTP header `Accept`
1462
+ if 'Accept' not in _header_params:
1463
+ _header_params['Accept'] = self.api_client.select_header_accept(
1464
+ [
1465
+ 'application/json'
1466
+ ]
1467
+ )
1468
+
1469
+
1470
+ # authentication setting
1471
+ _auth_settings: List[str] = [
1472
+ 'tokenAuth'
1473
+ ]
1474
+
1475
+ return self.api_client.param_serialize(
1476
+ method='GET',
1477
+ resource_path='/flows/{flowId}',
1478
+ path_params=_path_params,
1479
+ query_params=_query_params,
1480
+ header_params=_header_params,
1481
+ body=_body_params,
1482
+ post_params=_form_params,
1483
+ files=_files,
1484
+ auth_settings=_auth_settings,
1485
+ collection_formats=_collection_formats,
1486
+ _host=_host,
1487
+ _request_auth=_request_auth
1488
+ )
1489
+
1490
+
1491
+
1492
+
1493
+ @validate_call
1494
+ def get_flows_flow_id_preview(
1495
+ self,
1496
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1497
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1498
+ waba_account_id: Optional[StrictStr] = None,
1499
+ _request_timeout: Union[
1500
+ None,
1501
+ Annotated[StrictFloat, Field(gt=0)],
1502
+ Tuple[
1503
+ Annotated[StrictFloat, Field(gt=0)],
1504
+ Annotated[StrictFloat, Field(gt=0)]
1505
+ ]
1506
+ ] = None,
1507
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1508
+ _content_type: Optional[StrictStr] = None,
1509
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1510
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1511
+ ) -> Dict[str, object]:
1512
+ """Preview Flow
1513
+
1514
+
1515
+ :param flow_id: Flow ID (required)
1516
+ :type flow_id: str
1517
+ :param token: JWT token or API key for authorization (required)
1518
+ :type token: str
1519
+ :param waba_account_id:
1520
+ :type waba_account_id: str
1521
+ :param _request_timeout: timeout setting for this request. If one
1522
+ number provided, it will be total request
1523
+ timeout. It can also be a pair (tuple) of
1524
+ (connection, read) timeouts.
1525
+ :type _request_timeout: int, tuple(int, int), optional
1526
+ :param _request_auth: set to override the auth_settings for an a single
1527
+ request; this effectively ignores the
1528
+ authentication in the spec for a single request.
1529
+ :type _request_auth: dict, optional
1530
+ :param _content_type: force content-type for the request.
1531
+ :type _content_type: str, Optional
1532
+ :param _headers: set to override the headers for a single
1533
+ request; this effectively ignores the headers
1534
+ in the spec for a single request.
1535
+ :type _headers: dict, optional
1536
+ :param _host_index: set to override the host_index for a single
1537
+ request; this effectively ignores the host_index
1538
+ in the spec for a single request.
1539
+ :type _host_index: int, optional
1540
+ :return: Returns the result object.
1541
+ """ # noqa: E501
1542
+
1543
+ _param = self._get_flows_flow_id_preview_serialize(
1544
+ flow_id=flow_id,
1545
+ token=token,
1546
+ waba_account_id=waba_account_id,
1547
+ _request_auth=_request_auth,
1548
+ _content_type=_content_type,
1549
+ _headers=_headers,
1550
+ _host_index=_host_index
1551
+ )
1552
+
1553
+ _response_types_map: Dict[str, Optional[str]] = {
1554
+ '200': "Dict[str, object]",
1555
+ }
1556
+ response_data = self.api_client.call_api(
1557
+ *_param,
1558
+ _request_timeout=_request_timeout
1559
+ )
1560
+ response_data.read()
1561
+ return self.api_client.response_deserialize(
1562
+ response_data=response_data,
1563
+ response_types_map=_response_types_map,
1564
+ ).data
1565
+
1566
+
1567
+ @validate_call
1568
+ def get_flows_flow_id_preview_with_http_info(
1569
+ self,
1570
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1571
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1572
+ waba_account_id: Optional[StrictStr] = None,
1573
+ _request_timeout: Union[
1574
+ None,
1575
+ Annotated[StrictFloat, Field(gt=0)],
1576
+ Tuple[
1577
+ Annotated[StrictFloat, Field(gt=0)],
1578
+ Annotated[StrictFloat, Field(gt=0)]
1579
+ ]
1580
+ ] = None,
1581
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1582
+ _content_type: Optional[StrictStr] = None,
1583
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1584
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1585
+ ) -> ApiResponse[Dict[str, object]]:
1586
+ """Preview Flow
1587
+
1588
+
1589
+ :param flow_id: Flow ID (required)
1590
+ :type flow_id: str
1591
+ :param token: JWT token or API key for authorization (required)
1592
+ :type token: str
1593
+ :param waba_account_id:
1594
+ :type waba_account_id: str
1595
+ :param _request_timeout: timeout setting for this request. If one
1596
+ number provided, it will be total request
1597
+ timeout. It can also be a pair (tuple) of
1598
+ (connection, read) timeouts.
1599
+ :type _request_timeout: int, tuple(int, int), optional
1600
+ :param _request_auth: set to override the auth_settings for an a single
1601
+ request; this effectively ignores the
1602
+ authentication in the spec for a single request.
1603
+ :type _request_auth: dict, optional
1604
+ :param _content_type: force content-type for the request.
1605
+ :type _content_type: str, Optional
1606
+ :param _headers: set to override the headers for a single
1607
+ request; this effectively ignores the headers
1608
+ in the spec for a single request.
1609
+ :type _headers: dict, optional
1610
+ :param _host_index: set to override the host_index for a single
1611
+ request; this effectively ignores the host_index
1612
+ in the spec for a single request.
1613
+ :type _host_index: int, optional
1614
+ :return: Returns the result object.
1615
+ """ # noqa: E501
1616
+
1617
+ _param = self._get_flows_flow_id_preview_serialize(
1618
+ flow_id=flow_id,
1619
+ token=token,
1620
+ waba_account_id=waba_account_id,
1621
+ _request_auth=_request_auth,
1622
+ _content_type=_content_type,
1623
+ _headers=_headers,
1624
+ _host_index=_host_index
1625
+ )
1626
+
1627
+ _response_types_map: Dict[str, Optional[str]] = {
1628
+ '200': "Dict[str, object]",
1629
+ }
1630
+ response_data = self.api_client.call_api(
1631
+ *_param,
1632
+ _request_timeout=_request_timeout
1633
+ )
1634
+ response_data.read()
1635
+ return self.api_client.response_deserialize(
1636
+ response_data=response_data,
1637
+ response_types_map=_response_types_map,
1638
+ )
1639
+
1640
+
1641
+ @validate_call
1642
+ def get_flows_flow_id_preview_without_preload_content(
1643
+ self,
1644
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
1645
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1646
+ waba_account_id: Optional[StrictStr] = None,
1647
+ _request_timeout: Union[
1648
+ None,
1649
+ Annotated[StrictFloat, Field(gt=0)],
1650
+ Tuple[
1651
+ Annotated[StrictFloat, Field(gt=0)],
1652
+ Annotated[StrictFloat, Field(gt=0)]
1653
+ ]
1654
+ ] = None,
1655
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1656
+ _content_type: Optional[StrictStr] = None,
1657
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1658
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1659
+ ) -> RESTResponseType:
1660
+ """Preview Flow
1661
+
1662
+
1663
+ :param flow_id: Flow ID (required)
1664
+ :type flow_id: str
1665
+ :param token: JWT token or API key for authorization (required)
1666
+ :type token: str
1667
+ :param waba_account_id:
1668
+ :type waba_account_id: str
1669
+ :param _request_timeout: timeout setting for this request. If one
1670
+ number provided, it will be total request
1671
+ timeout. It can also be a pair (tuple) of
1672
+ (connection, read) timeouts.
1673
+ :type _request_timeout: int, tuple(int, int), optional
1674
+ :param _request_auth: set to override the auth_settings for an a single
1675
+ request; this effectively ignores the
1676
+ authentication in the spec for a single request.
1677
+ :type _request_auth: dict, optional
1678
+ :param _content_type: force content-type for the request.
1679
+ :type _content_type: str, Optional
1680
+ :param _headers: set to override the headers for a single
1681
+ request; this effectively ignores the headers
1682
+ in the spec for a single request.
1683
+ :type _headers: dict, optional
1684
+ :param _host_index: set to override the host_index for a single
1685
+ request; this effectively ignores the host_index
1686
+ in the spec for a single request.
1687
+ :type _host_index: int, optional
1688
+ :return: Returns the result object.
1689
+ """ # noqa: E501
1690
+
1691
+ _param = self._get_flows_flow_id_preview_serialize(
1692
+ flow_id=flow_id,
1693
+ token=token,
1694
+ waba_account_id=waba_account_id,
1695
+ _request_auth=_request_auth,
1696
+ _content_type=_content_type,
1697
+ _headers=_headers,
1698
+ _host_index=_host_index
1699
+ )
1700
+
1701
+ _response_types_map: Dict[str, Optional[str]] = {
1702
+ '200': "Dict[str, object]",
1703
+ }
1704
+ response_data = self.api_client.call_api(
1705
+ *_param,
1706
+ _request_timeout=_request_timeout
1707
+ )
1708
+ return response_data.response
1709
+
1710
+
1711
+ def _get_flows_flow_id_preview_serialize(
1712
+ self,
1713
+ flow_id,
1714
+ token,
1715
+ waba_account_id,
1716
+ _request_auth,
1717
+ _content_type,
1718
+ _headers,
1719
+ _host_index,
1720
+ ) -> RequestSerialized:
1721
+
1722
+ _host = None
1723
+
1724
+ _collection_formats: Dict[str, str] = {
1725
+ }
1726
+
1727
+ _path_params: Dict[str, str] = {}
1728
+ _query_params: List[Tuple[str, str]] = []
1729
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1730
+ _form_params: List[Tuple[str, str]] = []
1731
+ _files: Dict[
1732
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1733
+ ] = {}
1734
+ _body_params: Optional[bytes] = None
1735
+
1736
+ # process the path parameters
1737
+ if flow_id is not None:
1738
+ _path_params['flowId'] = flow_id
1739
+ # process the query parameters
1740
+ if token is not None:
1741
+
1742
+ _query_params.append(('token', token))
1743
+
1744
+ if waba_account_id is not None:
1745
+
1746
+ _query_params.append(('wabaAccountId', waba_account_id))
1747
+
1748
+ # process the header parameters
1749
+ # process the form parameters
1750
+ # process the body parameter
1751
+
1752
+
1753
+ # set the HTTP header `Accept`
1754
+ if 'Accept' not in _header_params:
1755
+ _header_params['Accept'] = self.api_client.select_header_accept(
1756
+ [
1757
+ 'application/json'
1758
+ ]
1759
+ )
1760
+
1761
+
1762
+ # authentication setting
1763
+ _auth_settings: List[str] = [
1764
+ 'tokenAuth'
1765
+ ]
1766
+
1767
+ return self.api_client.param_serialize(
1768
+ method='GET',
1769
+ resource_path='/flows/{flowId}/preview',
1770
+ path_params=_path_params,
1771
+ query_params=_query_params,
1772
+ header_params=_header_params,
1773
+ body=_body_params,
1774
+ post_params=_form_params,
1775
+ files=_files,
1776
+ auth_settings=_auth_settings,
1777
+ collection_formats=_collection_formats,
1778
+ _host=_host,
1779
+ _request_auth=_request_auth
1780
+ )
1781
+
1782
+
1783
+
1784
+
1785
+ @validate_call
1786
+ def get_whatsapp_business_encryption(
1787
+ self,
1788
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1789
+ _request_timeout: Union[
1790
+ None,
1791
+ Annotated[StrictFloat, Field(gt=0)],
1792
+ Tuple[
1793
+ Annotated[StrictFloat, Field(gt=0)],
1794
+ Annotated[StrictFloat, Field(gt=0)]
1795
+ ]
1796
+ ] = None,
1797
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1798
+ _content_type: Optional[StrictStr] = None,
1799
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1800
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1801
+ ) -> GetWhatsappBusinessEncryption200Response:
1802
+ """Get business encryption public key
1803
+
1804
+ Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.
1805
+
1806
+ :param token: JWT token or API key for authorization (required)
1807
+ :type token: str
1808
+ :param _request_timeout: timeout setting for this request. If one
1809
+ number provided, it will be total request
1810
+ timeout. It can also be a pair (tuple) of
1811
+ (connection, read) timeouts.
1812
+ :type _request_timeout: int, tuple(int, int), optional
1813
+ :param _request_auth: set to override the auth_settings for an a single
1814
+ request; this effectively ignores the
1815
+ authentication in the spec for a single request.
1816
+ :type _request_auth: dict, optional
1817
+ :param _content_type: force content-type for the request.
1818
+ :type _content_type: str, Optional
1819
+ :param _headers: set to override the headers for a single
1820
+ request; this effectively ignores the headers
1821
+ in the spec for a single request.
1822
+ :type _headers: dict, optional
1823
+ :param _host_index: set to override the host_index for a single
1824
+ request; this effectively ignores the host_index
1825
+ in the spec for a single request.
1826
+ :type _host_index: int, optional
1827
+ :return: Returns the result object.
1828
+ """ # noqa: E501
1829
+
1830
+ _param = self._get_whatsapp_business_encryption_serialize(
1831
+ token=token,
1832
+ _request_auth=_request_auth,
1833
+ _content_type=_content_type,
1834
+ _headers=_headers,
1835
+ _host_index=_host_index
1836
+ )
1837
+
1838
+ _response_types_map: Dict[str, Optional[str]] = {
1839
+ '200': "GetWhatsappBusinessEncryption200Response",
1840
+ '401': "ErrorResponse",
1841
+ '500': "ErrorResponse",
1842
+ }
1843
+ response_data = self.api_client.call_api(
1844
+ *_param,
1845
+ _request_timeout=_request_timeout
1846
+ )
1847
+ response_data.read()
1848
+ return self.api_client.response_deserialize(
1849
+ response_data=response_data,
1850
+ response_types_map=_response_types_map,
1851
+ ).data
1852
+
1853
+
1854
+ @validate_call
1855
+ def get_whatsapp_business_encryption_with_http_info(
1856
+ self,
1857
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1858
+ _request_timeout: Union[
1859
+ None,
1860
+ Annotated[StrictFloat, Field(gt=0)],
1861
+ Tuple[
1862
+ Annotated[StrictFloat, Field(gt=0)],
1863
+ Annotated[StrictFloat, Field(gt=0)]
1864
+ ]
1865
+ ] = None,
1866
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1867
+ _content_type: Optional[StrictStr] = None,
1868
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1869
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1870
+ ) -> ApiResponse[GetWhatsappBusinessEncryption200Response]:
1871
+ """Get business encryption public key
1872
+
1873
+ Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.
1874
+
1875
+ :param token: JWT token or API key for authorization (required)
1876
+ :type token: str
1877
+ :param _request_timeout: timeout setting for this request. If one
1878
+ number provided, it will be total request
1879
+ timeout. It can also be a pair (tuple) of
1880
+ (connection, read) timeouts.
1881
+ :type _request_timeout: int, tuple(int, int), optional
1882
+ :param _request_auth: set to override the auth_settings for an a single
1883
+ request; this effectively ignores the
1884
+ authentication in the spec for a single request.
1885
+ :type _request_auth: dict, optional
1886
+ :param _content_type: force content-type for the request.
1887
+ :type _content_type: str, Optional
1888
+ :param _headers: set to override the headers for a single
1889
+ request; this effectively ignores the headers
1890
+ in the spec for a single request.
1891
+ :type _headers: dict, optional
1892
+ :param _host_index: set to override the host_index for a single
1893
+ request; this effectively ignores the host_index
1894
+ in the spec for a single request.
1895
+ :type _host_index: int, optional
1896
+ :return: Returns the result object.
1897
+ """ # noqa: E501
1898
+
1899
+ _param = self._get_whatsapp_business_encryption_serialize(
1900
+ token=token,
1901
+ _request_auth=_request_auth,
1902
+ _content_type=_content_type,
1903
+ _headers=_headers,
1904
+ _host_index=_host_index
1905
+ )
1906
+
1907
+ _response_types_map: Dict[str, Optional[str]] = {
1908
+ '200': "GetWhatsappBusinessEncryption200Response",
1909
+ '401': "ErrorResponse",
1910
+ '500': "ErrorResponse",
1911
+ }
1912
+ response_data = self.api_client.call_api(
1913
+ *_param,
1914
+ _request_timeout=_request_timeout
1915
+ )
1916
+ response_data.read()
1917
+ return self.api_client.response_deserialize(
1918
+ response_data=response_data,
1919
+ response_types_map=_response_types_map,
1920
+ )
1921
+
1922
+
1923
+ @validate_call
1924
+ def get_whatsapp_business_encryption_without_preload_content(
1925
+ self,
1926
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
1927
+ _request_timeout: Union[
1928
+ None,
1929
+ Annotated[StrictFloat, Field(gt=0)],
1930
+ Tuple[
1931
+ Annotated[StrictFloat, Field(gt=0)],
1932
+ Annotated[StrictFloat, Field(gt=0)]
1933
+ ]
1934
+ ] = None,
1935
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1936
+ _content_type: Optional[StrictStr] = None,
1937
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1938
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1939
+ ) -> RESTResponseType:
1940
+ """Get business encryption public key
1941
+
1942
+ Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption.
1943
+
1944
+ :param token: JWT token or API key for authorization (required)
1945
+ :type token: str
1946
+ :param _request_timeout: timeout setting for this request. If one
1947
+ number provided, it will be total request
1948
+ timeout. It can also be a pair (tuple) of
1949
+ (connection, read) timeouts.
1950
+ :type _request_timeout: int, tuple(int, int), optional
1951
+ :param _request_auth: set to override the auth_settings for an a single
1952
+ request; this effectively ignores the
1953
+ authentication in the spec for a single request.
1954
+ :type _request_auth: dict, optional
1955
+ :param _content_type: force content-type for the request.
1956
+ :type _content_type: str, Optional
1957
+ :param _headers: set to override the headers for a single
1958
+ request; this effectively ignores the headers
1959
+ in the spec for a single request.
1960
+ :type _headers: dict, optional
1961
+ :param _host_index: set to override the host_index for a single
1962
+ request; this effectively ignores the host_index
1963
+ in the spec for a single request.
1964
+ :type _host_index: int, optional
1965
+ :return: Returns the result object.
1966
+ """ # noqa: E501
1967
+
1968
+ _param = self._get_whatsapp_business_encryption_serialize(
1969
+ token=token,
1970
+ _request_auth=_request_auth,
1971
+ _content_type=_content_type,
1972
+ _headers=_headers,
1973
+ _host_index=_host_index
1974
+ )
1975
+
1976
+ _response_types_map: Dict[str, Optional[str]] = {
1977
+ '200': "GetWhatsappBusinessEncryption200Response",
1978
+ '401': "ErrorResponse",
1979
+ '500': "ErrorResponse",
1980
+ }
1981
+ response_data = self.api_client.call_api(
1982
+ *_param,
1983
+ _request_timeout=_request_timeout
1984
+ )
1985
+ return response_data.response
1986
+
1987
+
1988
+ def _get_whatsapp_business_encryption_serialize(
1989
+ self,
1990
+ token,
1991
+ _request_auth,
1992
+ _content_type,
1993
+ _headers,
1994
+ _host_index,
1995
+ ) -> RequestSerialized:
1996
+
1997
+ _host = None
1998
+
1999
+ _collection_formats: Dict[str, str] = {
2000
+ }
2001
+
2002
+ _path_params: Dict[str, str] = {}
2003
+ _query_params: List[Tuple[str, str]] = []
2004
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2005
+ _form_params: List[Tuple[str, str]] = []
2006
+ _files: Dict[
2007
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2008
+ ] = {}
2009
+ _body_params: Optional[bytes] = None
2010
+
2011
+ # process the path parameters
2012
+ # process the query parameters
2013
+ if token is not None:
2014
+
2015
+ _query_params.append(('token', token))
2016
+
2017
+ # process the header parameters
2018
+ # process the form parameters
2019
+ # process the body parameter
2020
+
2021
+
2022
+ # set the HTTP header `Accept`
2023
+ if 'Accept' not in _header_params:
2024
+ _header_params['Accept'] = self.api_client.select_header_accept(
2025
+ [
2026
+ 'application/json'
2027
+ ]
2028
+ )
2029
+
2030
+
2031
+ # authentication setting
2032
+ _auth_settings: List[str] = [
2033
+ 'tokenAuth'
2034
+ ]
2035
+
2036
+ return self.api_client.param_serialize(
2037
+ method='GET',
2038
+ resource_path='/whatsapp_business_encryption',
2039
+ path_params=_path_params,
2040
+ query_params=_query_params,
2041
+ header_params=_header_params,
2042
+ body=_body_params,
2043
+ post_params=_form_params,
2044
+ files=_files,
2045
+ auth_settings=_auth_settings,
2046
+ collection_formats=_collection_formats,
2047
+ _host=_host,
2048
+ _request_auth=_request_auth
2049
+ )
2050
+
2051
+
2052
+
2053
+
2054
+ @validate_call
2055
+ def list_flows(
2056
+ self,
2057
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2058
+ waba_account_id: Optional[StrictStr] = None,
2059
+ _request_timeout: Union[
2060
+ None,
2061
+ Annotated[StrictFloat, Field(gt=0)],
2062
+ Tuple[
2063
+ Annotated[StrictFloat, Field(gt=0)],
2064
+ Annotated[StrictFloat, Field(gt=0)]
2065
+ ]
2066
+ ] = None,
2067
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2068
+ _content_type: Optional[StrictStr] = None,
2069
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2070
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2071
+ ) -> ListFlows200Response:
2072
+ """List Flows
2073
+
2074
+
2075
+ :param token: JWT token or API key for authorization (required)
2076
+ :type token: str
2077
+ :param waba_account_id:
2078
+ :type waba_account_id: str
2079
+ :param _request_timeout: timeout setting for this request. If one
2080
+ number provided, it will be total request
2081
+ timeout. It can also be a pair (tuple) of
2082
+ (connection, read) timeouts.
2083
+ :type _request_timeout: int, tuple(int, int), optional
2084
+ :param _request_auth: set to override the auth_settings for an a single
2085
+ request; this effectively ignores the
2086
+ authentication in the spec for a single request.
2087
+ :type _request_auth: dict, optional
2088
+ :param _content_type: force content-type for the request.
2089
+ :type _content_type: str, Optional
2090
+ :param _headers: set to override the headers for a single
2091
+ request; this effectively ignores the headers
2092
+ in the spec for a single request.
2093
+ :type _headers: dict, optional
2094
+ :param _host_index: set to override the host_index for a single
2095
+ request; this effectively ignores the host_index
2096
+ in the spec for a single request.
2097
+ :type _host_index: int, optional
2098
+ :return: Returns the result object.
2099
+ """ # noqa: E501
2100
+
2101
+ _param = self._list_flows_serialize(
2102
+ token=token,
2103
+ waba_account_id=waba_account_id,
2104
+ _request_auth=_request_auth,
2105
+ _content_type=_content_type,
2106
+ _headers=_headers,
2107
+ _host_index=_host_index
2108
+ )
2109
+
2110
+ _response_types_map: Dict[str, Optional[str]] = {
2111
+ '200': "ListFlows200Response",
2112
+ }
2113
+ response_data = self.api_client.call_api(
2114
+ *_param,
2115
+ _request_timeout=_request_timeout
2116
+ )
2117
+ response_data.read()
2118
+ return self.api_client.response_deserialize(
2119
+ response_data=response_data,
2120
+ response_types_map=_response_types_map,
2121
+ ).data
2122
+
2123
+
2124
+ @validate_call
2125
+ def list_flows_with_http_info(
2126
+ self,
2127
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2128
+ waba_account_id: Optional[StrictStr] = None,
2129
+ _request_timeout: Union[
2130
+ None,
2131
+ Annotated[StrictFloat, Field(gt=0)],
2132
+ Tuple[
2133
+ Annotated[StrictFloat, Field(gt=0)],
2134
+ Annotated[StrictFloat, Field(gt=0)]
2135
+ ]
2136
+ ] = None,
2137
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2138
+ _content_type: Optional[StrictStr] = None,
2139
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2140
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2141
+ ) -> ApiResponse[ListFlows200Response]:
2142
+ """List Flows
2143
+
2144
+
2145
+ :param token: JWT token or API key for authorization (required)
2146
+ :type token: str
2147
+ :param waba_account_id:
2148
+ :type waba_account_id: str
2149
+ :param _request_timeout: timeout setting for this request. If one
2150
+ number provided, it will be total request
2151
+ timeout. It can also be a pair (tuple) of
2152
+ (connection, read) timeouts.
2153
+ :type _request_timeout: int, tuple(int, int), optional
2154
+ :param _request_auth: set to override the auth_settings for an a single
2155
+ request; this effectively ignores the
2156
+ authentication in the spec for a single request.
2157
+ :type _request_auth: dict, optional
2158
+ :param _content_type: force content-type for the request.
2159
+ :type _content_type: str, Optional
2160
+ :param _headers: set to override the headers for a single
2161
+ request; this effectively ignores the headers
2162
+ in the spec for a single request.
2163
+ :type _headers: dict, optional
2164
+ :param _host_index: set to override the host_index for a single
2165
+ request; this effectively ignores the host_index
2166
+ in the spec for a single request.
2167
+ :type _host_index: int, optional
2168
+ :return: Returns the result object.
2169
+ """ # noqa: E501
2170
+
2171
+ _param = self._list_flows_serialize(
2172
+ token=token,
2173
+ waba_account_id=waba_account_id,
2174
+ _request_auth=_request_auth,
2175
+ _content_type=_content_type,
2176
+ _headers=_headers,
2177
+ _host_index=_host_index
2178
+ )
2179
+
2180
+ _response_types_map: Dict[str, Optional[str]] = {
2181
+ '200': "ListFlows200Response",
2182
+ }
2183
+ response_data = self.api_client.call_api(
2184
+ *_param,
2185
+ _request_timeout=_request_timeout
2186
+ )
2187
+ response_data.read()
2188
+ return self.api_client.response_deserialize(
2189
+ response_data=response_data,
2190
+ response_types_map=_response_types_map,
2191
+ )
2192
+
2193
+
2194
+ @validate_call
2195
+ def list_flows_without_preload_content(
2196
+ self,
2197
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2198
+ waba_account_id: Optional[StrictStr] = None,
2199
+ _request_timeout: Union[
2200
+ None,
2201
+ Annotated[StrictFloat, Field(gt=0)],
2202
+ Tuple[
2203
+ Annotated[StrictFloat, Field(gt=0)],
2204
+ Annotated[StrictFloat, Field(gt=0)]
2205
+ ]
2206
+ ] = None,
2207
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2208
+ _content_type: Optional[StrictStr] = None,
2209
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2210
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2211
+ ) -> RESTResponseType:
2212
+ """List Flows
2213
+
2214
+
2215
+ :param token: JWT token or API key for authorization (required)
2216
+ :type token: str
2217
+ :param waba_account_id:
2218
+ :type waba_account_id: str
2219
+ :param _request_timeout: timeout setting for this request. If one
2220
+ number provided, it will be total request
2221
+ timeout. It can also be a pair (tuple) of
2222
+ (connection, read) timeouts.
2223
+ :type _request_timeout: int, tuple(int, int), optional
2224
+ :param _request_auth: set to override the auth_settings for an a single
2225
+ request; this effectively ignores the
2226
+ authentication in the spec for a single request.
2227
+ :type _request_auth: dict, optional
2228
+ :param _content_type: force content-type for the request.
2229
+ :type _content_type: str, Optional
2230
+ :param _headers: set to override the headers for a single
2231
+ request; this effectively ignores the headers
2232
+ in the spec for a single request.
2233
+ :type _headers: dict, optional
2234
+ :param _host_index: set to override the host_index for a single
2235
+ request; this effectively ignores the host_index
2236
+ in the spec for a single request.
2237
+ :type _host_index: int, optional
2238
+ :return: Returns the result object.
2239
+ """ # noqa: E501
2240
+
2241
+ _param = self._list_flows_serialize(
2242
+ token=token,
2243
+ waba_account_id=waba_account_id,
2244
+ _request_auth=_request_auth,
2245
+ _content_type=_content_type,
2246
+ _headers=_headers,
2247
+ _host_index=_host_index
2248
+ )
2249
+
2250
+ _response_types_map: Dict[str, Optional[str]] = {
2251
+ '200': "ListFlows200Response",
2252
+ }
2253
+ response_data = self.api_client.call_api(
2254
+ *_param,
2255
+ _request_timeout=_request_timeout
2256
+ )
2257
+ return response_data.response
2258
+
2259
+
2260
+ def _list_flows_serialize(
2261
+ self,
2262
+ token,
2263
+ waba_account_id,
2264
+ _request_auth,
2265
+ _content_type,
2266
+ _headers,
2267
+ _host_index,
2268
+ ) -> RequestSerialized:
2269
+
2270
+ _host = None
2271
+
2272
+ _collection_formats: Dict[str, str] = {
2273
+ }
2274
+
2275
+ _path_params: Dict[str, str] = {}
2276
+ _query_params: List[Tuple[str, str]] = []
2277
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2278
+ _form_params: List[Tuple[str, str]] = []
2279
+ _files: Dict[
2280
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2281
+ ] = {}
2282
+ _body_params: Optional[bytes] = None
2283
+
2284
+ # process the path parameters
2285
+ # process the query parameters
2286
+ if token is not None:
2287
+
2288
+ _query_params.append(('token', token))
2289
+
2290
+ if waba_account_id is not None:
2291
+
2292
+ _query_params.append(('wabaAccountId', waba_account_id))
2293
+
2294
+ # process the header parameters
2295
+ # process the form parameters
2296
+ # process the body parameter
2297
+
2298
+
2299
+ # set the HTTP header `Accept`
2300
+ if 'Accept' not in _header_params:
2301
+ _header_params['Accept'] = self.api_client.select_header_accept(
2302
+ [
2303
+ 'application/json'
2304
+ ]
2305
+ )
2306
+
2307
+
2308
+ # authentication setting
2309
+ _auth_settings: List[str] = [
2310
+ 'tokenAuth'
2311
+ ]
2312
+
2313
+ return self.api_client.param_serialize(
2314
+ method='GET',
2315
+ resource_path='/flows',
2316
+ path_params=_path_params,
2317
+ query_params=_query_params,
2318
+ header_params=_header_params,
2319
+ body=_body_params,
2320
+ post_params=_form_params,
2321
+ files=_files,
2322
+ auth_settings=_auth_settings,
2323
+ collection_formats=_collection_formats,
2324
+ _host=_host,
2325
+ _request_auth=_request_auth
2326
+ )
2327
+
2328
+
2329
+
2330
+
2331
+ @validate_call
2332
+ def patch_flows_flow_id_assets(
2333
+ self,
2334
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2335
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2336
+ waba_account_id: Optional[StrictStr] = None,
2337
+ _request_timeout: Union[
2338
+ None,
2339
+ Annotated[StrictFloat, Field(gt=0)],
2340
+ Tuple[
2341
+ Annotated[StrictFloat, Field(gt=0)],
2342
+ Annotated[StrictFloat, Field(gt=0)]
2343
+ ]
2344
+ ] = None,
2345
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2346
+ _content_type: Optional[StrictStr] = None,
2347
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2348
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2349
+ ) -> PatchFlowsFlowIdAssets200Response:
2350
+ """Update Flow Structure
2351
+
2352
+
2353
+ :param flow_id: Flow ID (required)
2354
+ :type flow_id: str
2355
+ :param token: JWT token or API key for authorization (required)
2356
+ :type token: str
2357
+ :param waba_account_id:
2358
+ :type waba_account_id: str
2359
+ :param _request_timeout: timeout setting for this request. If one
2360
+ number provided, it will be total request
2361
+ timeout. It can also be a pair (tuple) of
2362
+ (connection, read) timeouts.
2363
+ :type _request_timeout: int, tuple(int, int), optional
2364
+ :param _request_auth: set to override the auth_settings for an a single
2365
+ request; this effectively ignores the
2366
+ authentication in the spec for a single request.
2367
+ :type _request_auth: dict, optional
2368
+ :param _content_type: force content-type for the request.
2369
+ :type _content_type: str, Optional
2370
+ :param _headers: set to override the headers for a single
2371
+ request; this effectively ignores the headers
2372
+ in the spec for a single request.
2373
+ :type _headers: dict, optional
2374
+ :param _host_index: set to override the host_index for a single
2375
+ request; this effectively ignores the host_index
2376
+ in the spec for a single request.
2377
+ :type _host_index: int, optional
2378
+ :return: Returns the result object.
2379
+ """ # noqa: E501
2380
+
2381
+ _param = self._patch_flows_flow_id_assets_serialize(
2382
+ flow_id=flow_id,
2383
+ token=token,
2384
+ waba_account_id=waba_account_id,
2385
+ _request_auth=_request_auth,
2386
+ _content_type=_content_type,
2387
+ _headers=_headers,
2388
+ _host_index=_host_index
2389
+ )
2390
+
2391
+ _response_types_map: Dict[str, Optional[str]] = {
2392
+ '200': "PatchFlowsFlowIdAssets200Response",
2393
+ }
2394
+ response_data = self.api_client.call_api(
2395
+ *_param,
2396
+ _request_timeout=_request_timeout
2397
+ )
2398
+ response_data.read()
2399
+ return self.api_client.response_deserialize(
2400
+ response_data=response_data,
2401
+ response_types_map=_response_types_map,
2402
+ ).data
2403
+
2404
+
2405
+ @validate_call
2406
+ def patch_flows_flow_id_assets_with_http_info(
2407
+ self,
2408
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2409
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2410
+ waba_account_id: Optional[StrictStr] = None,
2411
+ _request_timeout: Union[
2412
+ None,
2413
+ Annotated[StrictFloat, Field(gt=0)],
2414
+ Tuple[
2415
+ Annotated[StrictFloat, Field(gt=0)],
2416
+ Annotated[StrictFloat, Field(gt=0)]
2417
+ ]
2418
+ ] = None,
2419
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2420
+ _content_type: Optional[StrictStr] = None,
2421
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2422
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2423
+ ) -> ApiResponse[PatchFlowsFlowIdAssets200Response]:
2424
+ """Update Flow Structure
2425
+
2426
+
2427
+ :param flow_id: Flow ID (required)
2428
+ :type flow_id: str
2429
+ :param token: JWT token or API key for authorization (required)
2430
+ :type token: str
2431
+ :param waba_account_id:
2432
+ :type waba_account_id: str
2433
+ :param _request_timeout: timeout setting for this request. If one
2434
+ number provided, it will be total request
2435
+ timeout. It can also be a pair (tuple) of
2436
+ (connection, read) timeouts.
2437
+ :type _request_timeout: int, tuple(int, int), optional
2438
+ :param _request_auth: set to override the auth_settings for an a single
2439
+ request; this effectively ignores the
2440
+ authentication in the spec for a single request.
2441
+ :type _request_auth: dict, optional
2442
+ :param _content_type: force content-type for the request.
2443
+ :type _content_type: str, Optional
2444
+ :param _headers: set to override the headers for a single
2445
+ request; this effectively ignores the headers
2446
+ in the spec for a single request.
2447
+ :type _headers: dict, optional
2448
+ :param _host_index: set to override the host_index for a single
2449
+ request; this effectively ignores the host_index
2450
+ in the spec for a single request.
2451
+ :type _host_index: int, optional
2452
+ :return: Returns the result object.
2453
+ """ # noqa: E501
2454
+
2455
+ _param = self._patch_flows_flow_id_assets_serialize(
2456
+ flow_id=flow_id,
2457
+ token=token,
2458
+ waba_account_id=waba_account_id,
2459
+ _request_auth=_request_auth,
2460
+ _content_type=_content_type,
2461
+ _headers=_headers,
2462
+ _host_index=_host_index
2463
+ )
2464
+
2465
+ _response_types_map: Dict[str, Optional[str]] = {
2466
+ '200': "PatchFlowsFlowIdAssets200Response",
2467
+ }
2468
+ response_data = self.api_client.call_api(
2469
+ *_param,
2470
+ _request_timeout=_request_timeout
2471
+ )
2472
+ response_data.read()
2473
+ return self.api_client.response_deserialize(
2474
+ response_data=response_data,
2475
+ response_types_map=_response_types_map,
2476
+ )
2477
+
2478
+
2479
+ @validate_call
2480
+ def patch_flows_flow_id_assets_without_preload_content(
2481
+ self,
2482
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2483
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2484
+ waba_account_id: Optional[StrictStr] = None,
2485
+ _request_timeout: Union[
2486
+ None,
2487
+ Annotated[StrictFloat, Field(gt=0)],
2488
+ Tuple[
2489
+ Annotated[StrictFloat, Field(gt=0)],
2490
+ Annotated[StrictFloat, Field(gt=0)]
2491
+ ]
2492
+ ] = None,
2493
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2494
+ _content_type: Optional[StrictStr] = None,
2495
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2496
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2497
+ ) -> RESTResponseType:
2498
+ """Update Flow Structure
2499
+
2500
+
2501
+ :param flow_id: Flow ID (required)
2502
+ :type flow_id: str
2503
+ :param token: JWT token or API key for authorization (required)
2504
+ :type token: str
2505
+ :param waba_account_id:
2506
+ :type waba_account_id: str
2507
+ :param _request_timeout: timeout setting for this request. If one
2508
+ number provided, it will be total request
2509
+ timeout. It can also be a pair (tuple) of
2510
+ (connection, read) timeouts.
2511
+ :type _request_timeout: int, tuple(int, int), optional
2512
+ :param _request_auth: set to override the auth_settings for an a single
2513
+ request; this effectively ignores the
2514
+ authentication in the spec for a single request.
2515
+ :type _request_auth: dict, optional
2516
+ :param _content_type: force content-type for the request.
2517
+ :type _content_type: str, Optional
2518
+ :param _headers: set to override the headers for a single
2519
+ request; this effectively ignores the headers
2520
+ in the spec for a single request.
2521
+ :type _headers: dict, optional
2522
+ :param _host_index: set to override the host_index for a single
2523
+ request; this effectively ignores the host_index
2524
+ in the spec for a single request.
2525
+ :type _host_index: int, optional
2526
+ :return: Returns the result object.
2527
+ """ # noqa: E501
2528
+
2529
+ _param = self._patch_flows_flow_id_assets_serialize(
2530
+ flow_id=flow_id,
2531
+ token=token,
2532
+ waba_account_id=waba_account_id,
2533
+ _request_auth=_request_auth,
2534
+ _content_type=_content_type,
2535
+ _headers=_headers,
2536
+ _host_index=_host_index
2537
+ )
2538
+
2539
+ _response_types_map: Dict[str, Optional[str]] = {
2540
+ '200': "PatchFlowsFlowIdAssets200Response",
2541
+ }
2542
+ response_data = self.api_client.call_api(
2543
+ *_param,
2544
+ _request_timeout=_request_timeout
2545
+ )
2546
+ return response_data.response
2547
+
2548
+
2549
+ def _patch_flows_flow_id_assets_serialize(
2550
+ self,
2551
+ flow_id,
2552
+ token,
2553
+ waba_account_id,
2554
+ _request_auth,
2555
+ _content_type,
2556
+ _headers,
2557
+ _host_index,
2558
+ ) -> RequestSerialized:
2559
+
2560
+ _host = None
2561
+
2562
+ _collection_formats: Dict[str, str] = {
2563
+ }
2564
+
2565
+ _path_params: Dict[str, str] = {}
2566
+ _query_params: List[Tuple[str, str]] = []
2567
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2568
+ _form_params: List[Tuple[str, str]] = []
2569
+ _files: Dict[
2570
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2571
+ ] = {}
2572
+ _body_params: Optional[bytes] = None
2573
+
2574
+ # process the path parameters
2575
+ if flow_id is not None:
2576
+ _path_params['flowId'] = flow_id
2577
+ # process the query parameters
2578
+ if token is not None:
2579
+
2580
+ _query_params.append(('token', token))
2581
+
2582
+ if waba_account_id is not None:
2583
+
2584
+ _query_params.append(('wabaAccountId', waba_account_id))
2585
+
2586
+ # process the header parameters
2587
+ # process the form parameters
2588
+ # process the body parameter
2589
+
2590
+
2591
+ # set the HTTP header `Accept`
2592
+ if 'Accept' not in _header_params:
2593
+ _header_params['Accept'] = self.api_client.select_header_accept(
2594
+ [
2595
+ 'application/json'
2596
+ ]
2597
+ )
2598
+
2599
+
2600
+ # authentication setting
2601
+ _auth_settings: List[str] = [
2602
+ 'tokenAuth'
2603
+ ]
2604
+
2605
+ return self.api_client.param_serialize(
2606
+ method='PATCH',
2607
+ resource_path='/flows/{flowId}/assets',
2608
+ path_params=_path_params,
2609
+ query_params=_query_params,
2610
+ header_params=_header_params,
2611
+ body=_body_params,
2612
+ post_params=_form_params,
2613
+ files=_files,
2614
+ auth_settings=_auth_settings,
2615
+ collection_formats=_collection_formats,
2616
+ _host=_host,
2617
+ _request_auth=_request_auth
2618
+ )
2619
+
2620
+
2621
+
2622
+
2623
+ @validate_call
2624
+ def patch_flows_flow_id_metadata(
2625
+ self,
2626
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2627
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2628
+ waba_account_id: Optional[StrictStr] = None,
2629
+ _request_timeout: Union[
2630
+ None,
2631
+ Annotated[StrictFloat, Field(gt=0)],
2632
+ Tuple[
2633
+ Annotated[StrictFloat, Field(gt=0)],
2634
+ Annotated[StrictFloat, Field(gt=0)]
2635
+ ]
2636
+ ] = None,
2637
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2638
+ _content_type: Optional[StrictStr] = None,
2639
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2640
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2641
+ ) -> Dict[str, object]:
2642
+ """Update Flow Metadata
2643
+
2644
+
2645
+ :param flow_id: Flow ID (required)
2646
+ :type flow_id: str
2647
+ :param token: JWT token or API key for authorization (required)
2648
+ :type token: str
2649
+ :param waba_account_id:
2650
+ :type waba_account_id: str
2651
+ :param _request_timeout: timeout setting for this request. If one
2652
+ number provided, it will be total request
2653
+ timeout. It can also be a pair (tuple) of
2654
+ (connection, read) timeouts.
2655
+ :type _request_timeout: int, tuple(int, int), optional
2656
+ :param _request_auth: set to override the auth_settings for an a single
2657
+ request; this effectively ignores the
2658
+ authentication in the spec for a single request.
2659
+ :type _request_auth: dict, optional
2660
+ :param _content_type: force content-type for the request.
2661
+ :type _content_type: str, Optional
2662
+ :param _headers: set to override the headers for a single
2663
+ request; this effectively ignores the headers
2664
+ in the spec for a single request.
2665
+ :type _headers: dict, optional
2666
+ :param _host_index: set to override the host_index for a single
2667
+ request; this effectively ignores the host_index
2668
+ in the spec for a single request.
2669
+ :type _host_index: int, optional
2670
+ :return: Returns the result object.
2671
+ """ # noqa: E501
2672
+
2673
+ _param = self._patch_flows_flow_id_metadata_serialize(
2674
+ flow_id=flow_id,
2675
+ token=token,
2676
+ waba_account_id=waba_account_id,
2677
+ _request_auth=_request_auth,
2678
+ _content_type=_content_type,
2679
+ _headers=_headers,
2680
+ _host_index=_host_index
2681
+ )
2682
+
2683
+ _response_types_map: Dict[str, Optional[str]] = {
2684
+ '200': "Dict[str, object]",
2685
+ }
2686
+ response_data = self.api_client.call_api(
2687
+ *_param,
2688
+ _request_timeout=_request_timeout
2689
+ )
2690
+ response_data.read()
2691
+ return self.api_client.response_deserialize(
2692
+ response_data=response_data,
2693
+ response_types_map=_response_types_map,
2694
+ ).data
2695
+
2696
+
2697
+ @validate_call
2698
+ def patch_flows_flow_id_metadata_with_http_info(
2699
+ self,
2700
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2701
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2702
+ waba_account_id: Optional[StrictStr] = None,
2703
+ _request_timeout: Union[
2704
+ None,
2705
+ Annotated[StrictFloat, Field(gt=0)],
2706
+ Tuple[
2707
+ Annotated[StrictFloat, Field(gt=0)],
2708
+ Annotated[StrictFloat, Field(gt=0)]
2709
+ ]
2710
+ ] = None,
2711
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2712
+ _content_type: Optional[StrictStr] = None,
2713
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2714
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2715
+ ) -> ApiResponse[Dict[str, object]]:
2716
+ """Update Flow Metadata
2717
+
2718
+
2719
+ :param flow_id: Flow ID (required)
2720
+ :type flow_id: str
2721
+ :param token: JWT token or API key for authorization (required)
2722
+ :type token: str
2723
+ :param waba_account_id:
2724
+ :type waba_account_id: str
2725
+ :param _request_timeout: timeout setting for this request. If one
2726
+ number provided, it will be total request
2727
+ timeout. It can also be a pair (tuple) of
2728
+ (connection, read) timeouts.
2729
+ :type _request_timeout: int, tuple(int, int), optional
2730
+ :param _request_auth: set to override the auth_settings for an a single
2731
+ request; this effectively ignores the
2732
+ authentication in the spec for a single request.
2733
+ :type _request_auth: dict, optional
2734
+ :param _content_type: force content-type for the request.
2735
+ :type _content_type: str, Optional
2736
+ :param _headers: set to override the headers for a single
2737
+ request; this effectively ignores the headers
2738
+ in the spec for a single request.
2739
+ :type _headers: dict, optional
2740
+ :param _host_index: set to override the host_index for a single
2741
+ request; this effectively ignores the host_index
2742
+ in the spec for a single request.
2743
+ :type _host_index: int, optional
2744
+ :return: Returns the result object.
2745
+ """ # noqa: E501
2746
+
2747
+ _param = self._patch_flows_flow_id_metadata_serialize(
2748
+ flow_id=flow_id,
2749
+ token=token,
2750
+ waba_account_id=waba_account_id,
2751
+ _request_auth=_request_auth,
2752
+ _content_type=_content_type,
2753
+ _headers=_headers,
2754
+ _host_index=_host_index
2755
+ )
2756
+
2757
+ _response_types_map: Dict[str, Optional[str]] = {
2758
+ '200': "Dict[str, object]",
2759
+ }
2760
+ response_data = self.api_client.call_api(
2761
+ *_param,
2762
+ _request_timeout=_request_timeout
2763
+ )
2764
+ response_data.read()
2765
+ return self.api_client.response_deserialize(
2766
+ response_data=response_data,
2767
+ response_types_map=_response_types_map,
2768
+ )
2769
+
2770
+
2771
+ @validate_call
2772
+ def patch_flows_flow_id_metadata_without_preload_content(
2773
+ self,
2774
+ flow_id: Annotated[StrictStr, Field(description="Flow ID")],
2775
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2776
+ waba_account_id: Optional[StrictStr] = None,
2777
+ _request_timeout: Union[
2778
+ None,
2779
+ Annotated[StrictFloat, Field(gt=0)],
2780
+ Tuple[
2781
+ Annotated[StrictFloat, Field(gt=0)],
2782
+ Annotated[StrictFloat, Field(gt=0)]
2783
+ ]
2784
+ ] = None,
2785
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2786
+ _content_type: Optional[StrictStr] = None,
2787
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2788
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2789
+ ) -> RESTResponseType:
2790
+ """Update Flow Metadata
2791
+
2792
+
2793
+ :param flow_id: Flow ID (required)
2794
+ :type flow_id: str
2795
+ :param token: JWT token or API key for authorization (required)
2796
+ :type token: str
2797
+ :param waba_account_id:
2798
+ :type waba_account_id: str
2799
+ :param _request_timeout: timeout setting for this request. If one
2800
+ number provided, it will be total request
2801
+ timeout. It can also be a pair (tuple) of
2802
+ (connection, read) timeouts.
2803
+ :type _request_timeout: int, tuple(int, int), optional
2804
+ :param _request_auth: set to override the auth_settings for an a single
2805
+ request; this effectively ignores the
2806
+ authentication in the spec for a single request.
2807
+ :type _request_auth: dict, optional
2808
+ :param _content_type: force content-type for the request.
2809
+ :type _content_type: str, Optional
2810
+ :param _headers: set to override the headers for a single
2811
+ request; this effectively ignores the headers
2812
+ in the spec for a single request.
2813
+ :type _headers: dict, optional
2814
+ :param _host_index: set to override the host_index for a single
2815
+ request; this effectively ignores the host_index
2816
+ in the spec for a single request.
2817
+ :type _host_index: int, optional
2818
+ :return: Returns the result object.
2819
+ """ # noqa: E501
2820
+
2821
+ _param = self._patch_flows_flow_id_metadata_serialize(
2822
+ flow_id=flow_id,
2823
+ token=token,
2824
+ waba_account_id=waba_account_id,
2825
+ _request_auth=_request_auth,
2826
+ _content_type=_content_type,
2827
+ _headers=_headers,
2828
+ _host_index=_host_index
2829
+ )
2830
+
2831
+ _response_types_map: Dict[str, Optional[str]] = {
2832
+ '200': "Dict[str, object]",
2833
+ }
2834
+ response_data = self.api_client.call_api(
2835
+ *_param,
2836
+ _request_timeout=_request_timeout
2837
+ )
2838
+ return response_data.response
2839
+
2840
+
2841
+ def _patch_flows_flow_id_metadata_serialize(
2842
+ self,
2843
+ flow_id,
2844
+ token,
2845
+ waba_account_id,
2846
+ _request_auth,
2847
+ _content_type,
2848
+ _headers,
2849
+ _host_index,
2850
+ ) -> RequestSerialized:
2851
+
2852
+ _host = None
2853
+
2854
+ _collection_formats: Dict[str, str] = {
2855
+ }
2856
+
2857
+ _path_params: Dict[str, str] = {}
2858
+ _query_params: List[Tuple[str, str]] = []
2859
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2860
+ _form_params: List[Tuple[str, str]] = []
2861
+ _files: Dict[
2862
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2863
+ ] = {}
2864
+ _body_params: Optional[bytes] = None
2865
+
2866
+ # process the path parameters
2867
+ if flow_id is not None:
2868
+ _path_params['flowId'] = flow_id
2869
+ # process the query parameters
2870
+ if token is not None:
2871
+
2872
+ _query_params.append(('token', token))
2873
+
2874
+ if waba_account_id is not None:
2875
+
2876
+ _query_params.append(('wabaAccountId', waba_account_id))
2877
+
2878
+ # process the header parameters
2879
+ # process the form parameters
2880
+ # process the body parameter
2881
+
2882
+
2883
+ # set the HTTP header `Accept`
2884
+ if 'Accept' not in _header_params:
2885
+ _header_params['Accept'] = self.api_client.select_header_accept(
2886
+ [
2887
+ 'application/json'
2888
+ ]
2889
+ )
2890
+
2891
+
2892
+ # authentication setting
2893
+ _auth_settings: List[str] = [
2894
+ 'tokenAuth'
2895
+ ]
2896
+
2897
+ return self.api_client.param_serialize(
2898
+ method='PATCH',
2899
+ resource_path='/flows/{flowId}/metadata',
2900
+ path_params=_path_params,
2901
+ query_params=_query_params,
2902
+ header_params=_header_params,
2903
+ body=_body_params,
2904
+ post_params=_form_params,
2905
+ files=_files,
2906
+ auth_settings=_auth_settings,
2907
+ collection_formats=_collection_formats,
2908
+ _host=_host,
2909
+ _request_auth=_request_auth
2910
+ )
2911
+
2912
+
2913
+
2914
+
2915
+ @validate_call
2916
+ def set_whatsapp_business_encryption(
2917
+ self,
2918
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2919
+ set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest,
2920
+ _request_timeout: Union[
2921
+ None,
2922
+ Annotated[StrictFloat, Field(gt=0)],
2923
+ Tuple[
2924
+ Annotated[StrictFloat, Field(gt=0)],
2925
+ Annotated[StrictFloat, Field(gt=0)]
2926
+ ]
2927
+ ] = None,
2928
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2929
+ _content_type: Optional[StrictStr] = None,
2930
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2931
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2932
+ ) -> CreateCommerce200Response:
2933
+ """Set business encryption public key
2934
+
2935
+ Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.
2936
+
2937
+ :param token: JWT token or API key for authorization (required)
2938
+ :type token: str
2939
+ :param set_whatsapp_business_encryption_request: (required)
2940
+ :type set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest
2941
+ :param _request_timeout: timeout setting for this request. If one
2942
+ number provided, it will be total request
2943
+ timeout. It can also be a pair (tuple) of
2944
+ (connection, read) timeouts.
2945
+ :type _request_timeout: int, tuple(int, int), optional
2946
+ :param _request_auth: set to override the auth_settings for an a single
2947
+ request; this effectively ignores the
2948
+ authentication in the spec for a single request.
2949
+ :type _request_auth: dict, optional
2950
+ :param _content_type: force content-type for the request.
2951
+ :type _content_type: str, Optional
2952
+ :param _headers: set to override the headers for a single
2953
+ request; this effectively ignores the headers
2954
+ in the spec for a single request.
2955
+ :type _headers: dict, optional
2956
+ :param _host_index: set to override the host_index for a single
2957
+ request; this effectively ignores the host_index
2958
+ in the spec for a single request.
2959
+ :type _host_index: int, optional
2960
+ :return: Returns the result object.
2961
+ """ # noqa: E501
2962
+
2963
+ _param = self._set_whatsapp_business_encryption_serialize(
2964
+ token=token,
2965
+ set_whatsapp_business_encryption_request=set_whatsapp_business_encryption_request,
2966
+ _request_auth=_request_auth,
2967
+ _content_type=_content_type,
2968
+ _headers=_headers,
2969
+ _host_index=_host_index
2970
+ )
2971
+
2972
+ _response_types_map: Dict[str, Optional[str]] = {
2973
+ '200': "CreateCommerce200Response",
2974
+ '400': "CreateReadMessage401Response",
2975
+ '401': "ErrorResponse",
2976
+ '500': "ErrorResponse",
2977
+ }
2978
+ response_data = self.api_client.call_api(
2979
+ *_param,
2980
+ _request_timeout=_request_timeout
2981
+ )
2982
+ response_data.read()
2983
+ return self.api_client.response_deserialize(
2984
+ response_data=response_data,
2985
+ response_types_map=_response_types_map,
2986
+ ).data
2987
+
2988
+
2989
+ @validate_call
2990
+ def set_whatsapp_business_encryption_with_http_info(
2991
+ self,
2992
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
2993
+ set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest,
2994
+ _request_timeout: Union[
2995
+ None,
2996
+ Annotated[StrictFloat, Field(gt=0)],
2997
+ Tuple[
2998
+ Annotated[StrictFloat, Field(gt=0)],
2999
+ Annotated[StrictFloat, Field(gt=0)]
3000
+ ]
3001
+ ] = None,
3002
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3003
+ _content_type: Optional[StrictStr] = None,
3004
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3005
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3006
+ ) -> ApiResponse[CreateCommerce200Response]:
3007
+ """Set business encryption public key
3008
+
3009
+ Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.
3010
+
3011
+ :param token: JWT token or API key for authorization (required)
3012
+ :type token: str
3013
+ :param set_whatsapp_business_encryption_request: (required)
3014
+ :type set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest
3015
+ :param _request_timeout: timeout setting for this request. If one
3016
+ number provided, it will be total request
3017
+ timeout. It can also be a pair (tuple) of
3018
+ (connection, read) timeouts.
3019
+ :type _request_timeout: int, tuple(int, int), optional
3020
+ :param _request_auth: set to override the auth_settings for an a single
3021
+ request; this effectively ignores the
3022
+ authentication in the spec for a single request.
3023
+ :type _request_auth: dict, optional
3024
+ :param _content_type: force content-type for the request.
3025
+ :type _content_type: str, Optional
3026
+ :param _headers: set to override the headers for a single
3027
+ request; this effectively ignores the headers
3028
+ in the spec for a single request.
3029
+ :type _headers: dict, optional
3030
+ :param _host_index: set to override the host_index for a single
3031
+ request; this effectively ignores the host_index
3032
+ in the spec for a single request.
3033
+ :type _host_index: int, optional
3034
+ :return: Returns the result object.
3035
+ """ # noqa: E501
3036
+
3037
+ _param = self._set_whatsapp_business_encryption_serialize(
3038
+ token=token,
3039
+ set_whatsapp_business_encryption_request=set_whatsapp_business_encryption_request,
3040
+ _request_auth=_request_auth,
3041
+ _content_type=_content_type,
3042
+ _headers=_headers,
3043
+ _host_index=_host_index
3044
+ )
3045
+
3046
+ _response_types_map: Dict[str, Optional[str]] = {
3047
+ '200': "CreateCommerce200Response",
3048
+ '400': "CreateReadMessage401Response",
3049
+ '401': "ErrorResponse",
3050
+ '500': "ErrorResponse",
3051
+ }
3052
+ response_data = self.api_client.call_api(
3053
+ *_param,
3054
+ _request_timeout=_request_timeout
3055
+ )
3056
+ response_data.read()
3057
+ return self.api_client.response_deserialize(
3058
+ response_data=response_data,
3059
+ response_types_map=_response_types_map,
3060
+ )
3061
+
3062
+
3063
+ @validate_call
3064
+ def set_whatsapp_business_encryption_without_preload_content(
3065
+ self,
3066
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
3067
+ set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest,
3068
+ _request_timeout: Union[
3069
+ None,
3070
+ Annotated[StrictFloat, Field(gt=0)],
3071
+ Tuple[
3072
+ Annotated[StrictFloat, Field(gt=0)],
3073
+ Annotated[StrictFloat, Field(gt=0)]
3074
+ ]
3075
+ ] = None,
3076
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3077
+ _content_type: Optional[StrictStr] = None,
3078
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3079
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3080
+ ) -> RESTResponseType:
3081
+ """Set business encryption public key
3082
+
3083
+ Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key.
3084
+
3085
+ :param token: JWT token or API key for authorization (required)
3086
+ :type token: str
3087
+ :param set_whatsapp_business_encryption_request: (required)
3088
+ :type set_whatsapp_business_encryption_request: SetWhatsappBusinessEncryptionRequest
3089
+ :param _request_timeout: timeout setting for this request. If one
3090
+ number provided, it will be total request
3091
+ timeout. It can also be a pair (tuple) of
3092
+ (connection, read) timeouts.
3093
+ :type _request_timeout: int, tuple(int, int), optional
3094
+ :param _request_auth: set to override the auth_settings for an a single
3095
+ request; this effectively ignores the
3096
+ authentication in the spec for a single request.
3097
+ :type _request_auth: dict, optional
3098
+ :param _content_type: force content-type for the request.
3099
+ :type _content_type: str, Optional
3100
+ :param _headers: set to override the headers for a single
3101
+ request; this effectively ignores the headers
3102
+ in the spec for a single request.
3103
+ :type _headers: dict, optional
3104
+ :param _host_index: set to override the host_index for a single
3105
+ request; this effectively ignores the host_index
3106
+ in the spec for a single request.
3107
+ :type _host_index: int, optional
3108
+ :return: Returns the result object.
3109
+ """ # noqa: E501
3110
+
3111
+ _param = self._set_whatsapp_business_encryption_serialize(
3112
+ token=token,
3113
+ set_whatsapp_business_encryption_request=set_whatsapp_business_encryption_request,
3114
+ _request_auth=_request_auth,
3115
+ _content_type=_content_type,
3116
+ _headers=_headers,
3117
+ _host_index=_host_index
3118
+ )
3119
+
3120
+ _response_types_map: Dict[str, Optional[str]] = {
3121
+ '200': "CreateCommerce200Response",
3122
+ '400': "CreateReadMessage401Response",
3123
+ '401': "ErrorResponse",
3124
+ '500': "ErrorResponse",
3125
+ }
3126
+ response_data = self.api_client.call_api(
3127
+ *_param,
3128
+ _request_timeout=_request_timeout
3129
+ )
3130
+ return response_data.response
3131
+
3132
+
3133
+ def _set_whatsapp_business_encryption_serialize(
3134
+ self,
3135
+ token,
3136
+ set_whatsapp_business_encryption_request,
3137
+ _request_auth,
3138
+ _content_type,
3139
+ _headers,
3140
+ _host_index,
3141
+ ) -> RequestSerialized:
3142
+
3143
+ _host = None
3144
+
3145
+ _collection_formats: Dict[str, str] = {
3146
+ }
3147
+
3148
+ _path_params: Dict[str, str] = {}
3149
+ _query_params: List[Tuple[str, str]] = []
3150
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3151
+ _form_params: List[Tuple[str, str]] = []
3152
+ _files: Dict[
3153
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3154
+ ] = {}
3155
+ _body_params: Optional[bytes] = None
3156
+
3157
+ # process the path parameters
3158
+ # process the query parameters
3159
+ if token is not None:
3160
+
3161
+ _query_params.append(('token', token))
3162
+
3163
+ # process the header parameters
3164
+ # process the form parameters
3165
+ # process the body parameter
3166
+ if set_whatsapp_business_encryption_request is not None:
3167
+ _body_params = set_whatsapp_business_encryption_request
3168
+
3169
+
3170
+ # set the HTTP header `Accept`
3171
+ if 'Accept' not in _header_params:
3172
+ _header_params['Accept'] = self.api_client.select_header_accept(
3173
+ [
3174
+ 'application/json'
3175
+ ]
3176
+ )
3177
+
3178
+ # set the HTTP header `Content-Type`
3179
+ if _content_type:
3180
+ _header_params['Content-Type'] = _content_type
3181
+ else:
3182
+ _default_content_type = (
3183
+ self.api_client.select_header_content_type(
3184
+ [
3185
+ 'application/json'
3186
+ ]
3187
+ )
3188
+ )
3189
+ if _default_content_type is not None:
3190
+ _header_params['Content-Type'] = _default_content_type
3191
+
3192
+ # authentication setting
3193
+ _auth_settings: List[str] = [
3194
+ 'tokenAuth'
3195
+ ]
3196
+
3197
+ return self.api_client.param_serialize(
3198
+ method='POST',
3199
+ resource_path='/whatsapp_business_encryption',
3200
+ path_params=_path_params,
3201
+ query_params=_query_params,
3202
+ header_params=_header_params,
3203
+ body=_body_params,
3204
+ post_params=_form_params,
3205
+ files=_files,
3206
+ auth_settings=_auth_settings,
3207
+ collection_formats=_collection_formats,
3208
+ _host=_host,
3209
+ _request_auth=_request_auth
3210
+ )
3211
+
3212
+