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.
- one_msg_sdk/__init__.py +189 -0
- one_msg_sdk/api/__init__.py +14 -0
- one_msg_sdk/api/calling_api.py +901 -0
- one_msg_sdk/api/catalog_api.py +607 -0
- one_msg_sdk/api/channel_api.py +874 -0
- one_msg_sdk/api/flows_api.py +3212 -0
- one_msg_sdk/api/groups_api.py +1935 -0
- one_msg_sdk/api/messaging_api.py +7419 -0
- one_msg_sdk/api/profile_api.py +609 -0
- one_msg_sdk/api/templates_api.py +1180 -0
- one_msg_sdk/api/users_api.py +903 -0
- one_msg_sdk/api/webhooks_api.py +605 -0
- one_msg_sdk/api_client.py +805 -0
- one_msg_sdk/api_response.py +21 -0
- one_msg_sdk/configuration.py +635 -0
- one_msg_sdk/exceptions.py +219 -0
- one_msg_sdk/models/__init__.py +78 -0
- one_msg_sdk/models/add_template_request.py +108 -0
- one_msg_sdk/models/block_user_request.py +102 -0
- one_msg_sdk/models/conversational_automation.py +115 -0
- one_msg_sdk/models/conversational_automation_commands_inner.py +105 -0
- one_msg_sdk/models/create_commerce200_response.py +102 -0
- one_msg_sdk/models/create_commerce_request.py +106 -0
- one_msg_sdk/models/create_commerce_request_params.py +104 -0
- one_msg_sdk/models/create_groups200_response.py +107 -0
- one_msg_sdk/models/create_read_message200_response.py +102 -0
- one_msg_sdk/models/create_read_message401_response.py +89 -0
- one_msg_sdk/models/create_read_message_request.py +93 -0
- one_msg_sdk/models/delete_flows_flow_id200_response.py +109 -0
- one_msg_sdk/models/delete_groups_group_id200_response.py +104 -0
- one_msg_sdk/models/delete_media_legacy_request.py +102 -0
- one_msg_sdk/models/error_response.py +89 -0
- one_msg_sdk/models/get_commerce200_response_inner.py +106 -0
- one_msg_sdk/models/get_mm_lite_status200_response.py +106 -0
- one_msg_sdk/models/get_webhook200_response.py +102 -0
- one_msg_sdk/models/get_whatsapp_business_encryption200_response.py +116 -0
- one_msg_sdk/models/list_blocked_users200_response.py +102 -0
- one_msg_sdk/models/list_flows200_response.py +115 -0
- one_msg_sdk/models/list_messages200_response.py +104 -0
- one_msg_sdk/models/list_templates200_response.py +106 -0
- one_msg_sdk/models/message_sent_response.py +108 -0
- one_msg_sdk/models/patch_flows_flow_id_assets200_response.py +111 -0
- one_msg_sdk/models/profile_info.py +126 -0
- one_msg_sdk/models/retrieve_media200_response.py +110 -0
- one_msg_sdk/models/send_address_message_request.py +126 -0
- one_msg_sdk/models/send_button_request.py +103 -0
- one_msg_sdk/models/send_button_request_sections_inner.py +95 -0
- one_msg_sdk/models/send_button_request_sections_inner_reply.py +91 -0
- one_msg_sdk/models/send_carousel_request1.py +97 -0
- one_msg_sdk/models/send_contact_request.py +99 -0
- one_msg_sdk/models/send_contact_request_contacts_inner.py +117 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_name.py +99 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_org.py +93 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.py +93 -0
- one_msg_sdk/models/send_cta_url_request.py +116 -0
- one_msg_sdk/models/send_file_request.py +129 -0
- one_msg_sdk/models/send_flow_request1.py +141 -0
- one_msg_sdk/models/send_flow_request1_header.py +144 -0
- one_msg_sdk/models/send_flow_request_header.py +144 -0
- one_msg_sdk/models/send_list_request.py +105 -0
- one_msg_sdk/models/send_list_request_sections_inner.py +99 -0
- one_msg_sdk/models/send_list_request_sections_inner_rows_inner.py +93 -0
- one_msg_sdk/models/send_location_request1.py +101 -0
- one_msg_sdk/models/send_location_request_request.py +91 -0
- one_msg_sdk/models/send_message_request.py +122 -0
- one_msg_sdk/models/send_order_details_request.py +128 -0
- one_msg_sdk/models/send_order_details_request_language.py +104 -0
- one_msg_sdk/models/send_order_details_request_order.py +124 -0
- one_msg_sdk/models/send_order_details_request_order_items_inner.py +112 -0
- one_msg_sdk/models/send_order_details_request_order_items_inner_amount.py +104 -0
- one_msg_sdk/models/send_payment_request_request.py +117 -0
- one_msg_sdk/models/send_reaction_request.py +93 -0
- one_msg_sdk/models/send_sticker_request.py +110 -0
- one_msg_sdk/models/send_template_request.py +107 -0
- one_msg_sdk/models/send_template_request_language.py +91 -0
- one_msg_sdk/models/set_whatsapp_business_encryption_request.py +89 -0
- one_msg_sdk/models/success_response.py +102 -0
- one_msg_sdk/models/update_me_request.py +114 -0
- one_msg_sdk/py.typed +0 -0
- one_msg_sdk/rest.py +264 -0
- one_msg_sdk-1.0.0.dist-info/METADATA +19 -0
- one_msg_sdk-1.0.0.dist-info/RECORD +85 -0
- one_msg_sdk-1.0.0.dist-info/WHEEL +5 -0
- one_msg_sdk-1.0.0.dist-info/licenses/LICENSE +21 -0
- one_msg_sdk-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1180 @@
|
|
|
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.add_template_request import AddTemplateRequest
|
|
23
|
+
from one_msg_sdk.models.list_templates200_response import ListTemplates200Response
|
|
24
|
+
from one_msg_sdk.models.send_template_request import SendTemplateRequest
|
|
25
|
+
|
|
26
|
+
from one_msg_sdk.api_client import ApiClient, RequestSerialized
|
|
27
|
+
from one_msg_sdk.api_response import ApiResponse
|
|
28
|
+
from one_msg_sdk.rest import RESTResponseType
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TemplatesApi:
|
|
32
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
33
|
+
Ref: https://openapi-generator.tech
|
|
34
|
+
|
|
35
|
+
Do not edit the class manually.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, api_client=None) -> None:
|
|
39
|
+
if api_client is None:
|
|
40
|
+
api_client = ApiClient.get_default()
|
|
41
|
+
self.api_client = api_client
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@validate_call
|
|
45
|
+
def add_template(
|
|
46
|
+
self,
|
|
47
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
48
|
+
add_template_request: Optional[AddTemplateRequest] = None,
|
|
49
|
+
_request_timeout: Union[
|
|
50
|
+
None,
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
52
|
+
Tuple[
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
55
|
+
]
|
|
56
|
+
] = None,
|
|
57
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
58
|
+
_content_type: Optional[StrictStr] = None,
|
|
59
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
61
|
+
) -> Dict[str, object]:
|
|
62
|
+
"""Create message template
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
:param token: JWT token or API key for authorization (required)
|
|
66
|
+
:type token: str
|
|
67
|
+
:param add_template_request:
|
|
68
|
+
:type add_template_request: AddTemplateRequest
|
|
69
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
70
|
+
number provided, it will be total request
|
|
71
|
+
timeout. It can also be a pair (tuple) of
|
|
72
|
+
(connection, read) timeouts.
|
|
73
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
74
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
75
|
+
request; this effectively ignores the
|
|
76
|
+
authentication in the spec for a single request.
|
|
77
|
+
:type _request_auth: dict, optional
|
|
78
|
+
:param _content_type: force content-type for the request.
|
|
79
|
+
:type _content_type: str, Optional
|
|
80
|
+
:param _headers: set to override the headers for a single
|
|
81
|
+
request; this effectively ignores the headers
|
|
82
|
+
in the spec for a single request.
|
|
83
|
+
:type _headers: dict, optional
|
|
84
|
+
:param _host_index: set to override the host_index for a single
|
|
85
|
+
request; this effectively ignores the host_index
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _host_index: int, optional
|
|
88
|
+
:return: Returns the result object.
|
|
89
|
+
""" # noqa: E501
|
|
90
|
+
|
|
91
|
+
_param = self._add_template_serialize(
|
|
92
|
+
token=token,
|
|
93
|
+
add_template_request=add_template_request,
|
|
94
|
+
_request_auth=_request_auth,
|
|
95
|
+
_content_type=_content_type,
|
|
96
|
+
_headers=_headers,
|
|
97
|
+
_host_index=_host_index
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
101
|
+
'200': "Dict[str, object]",
|
|
102
|
+
'401': "ErrorResponse",
|
|
103
|
+
'500': "ErrorResponse",
|
|
104
|
+
}
|
|
105
|
+
response_data = self.api_client.call_api(
|
|
106
|
+
*_param,
|
|
107
|
+
_request_timeout=_request_timeout
|
|
108
|
+
)
|
|
109
|
+
response_data.read()
|
|
110
|
+
return self.api_client.response_deserialize(
|
|
111
|
+
response_data=response_data,
|
|
112
|
+
response_types_map=_response_types_map,
|
|
113
|
+
).data
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
@validate_call
|
|
117
|
+
def add_template_with_http_info(
|
|
118
|
+
self,
|
|
119
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
120
|
+
add_template_request: Optional[AddTemplateRequest] = None,
|
|
121
|
+
_request_timeout: Union[
|
|
122
|
+
None,
|
|
123
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
124
|
+
Tuple[
|
|
125
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
126
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
127
|
+
]
|
|
128
|
+
] = None,
|
|
129
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
130
|
+
_content_type: Optional[StrictStr] = None,
|
|
131
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
132
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
133
|
+
) -> ApiResponse[Dict[str, object]]:
|
|
134
|
+
"""Create message template
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
:param token: JWT token or API key for authorization (required)
|
|
138
|
+
:type token: str
|
|
139
|
+
:param add_template_request:
|
|
140
|
+
:type add_template_request: AddTemplateRequest
|
|
141
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
142
|
+
number provided, it will be total request
|
|
143
|
+
timeout. It can also be a pair (tuple) of
|
|
144
|
+
(connection, read) timeouts.
|
|
145
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
146
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
147
|
+
request; this effectively ignores the
|
|
148
|
+
authentication in the spec for a single request.
|
|
149
|
+
:type _request_auth: dict, optional
|
|
150
|
+
:param _content_type: force content-type for the request.
|
|
151
|
+
:type _content_type: str, Optional
|
|
152
|
+
:param _headers: set to override the headers for a single
|
|
153
|
+
request; this effectively ignores the headers
|
|
154
|
+
in the spec for a single request.
|
|
155
|
+
:type _headers: dict, optional
|
|
156
|
+
:param _host_index: set to override the host_index for a single
|
|
157
|
+
request; this effectively ignores the host_index
|
|
158
|
+
in the spec for a single request.
|
|
159
|
+
:type _host_index: int, optional
|
|
160
|
+
:return: Returns the result object.
|
|
161
|
+
""" # noqa: E501
|
|
162
|
+
|
|
163
|
+
_param = self._add_template_serialize(
|
|
164
|
+
token=token,
|
|
165
|
+
add_template_request=add_template_request,
|
|
166
|
+
_request_auth=_request_auth,
|
|
167
|
+
_content_type=_content_type,
|
|
168
|
+
_headers=_headers,
|
|
169
|
+
_host_index=_host_index
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
173
|
+
'200': "Dict[str, object]",
|
|
174
|
+
'401': "ErrorResponse",
|
|
175
|
+
'500': "ErrorResponse",
|
|
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 add_template_without_preload_content(
|
|
190
|
+
self,
|
|
191
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
192
|
+
add_template_request: Optional[AddTemplateRequest] = 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 message template
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
:param token: JWT token or API key for authorization (required)
|
|
210
|
+
:type token: str
|
|
211
|
+
:param add_template_request:
|
|
212
|
+
:type add_template_request: AddTemplateRequest
|
|
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._add_template_serialize(
|
|
236
|
+
token=token,
|
|
237
|
+
add_template_request=add_template_request,
|
|
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': "Dict[str, object]",
|
|
246
|
+
'401': "ErrorResponse",
|
|
247
|
+
'500': "ErrorResponse",
|
|
248
|
+
}
|
|
249
|
+
response_data = self.api_client.call_api(
|
|
250
|
+
*_param,
|
|
251
|
+
_request_timeout=_request_timeout
|
|
252
|
+
)
|
|
253
|
+
return response_data.response
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _add_template_serialize(
|
|
257
|
+
self,
|
|
258
|
+
token,
|
|
259
|
+
add_template_request,
|
|
260
|
+
_request_auth,
|
|
261
|
+
_content_type,
|
|
262
|
+
_headers,
|
|
263
|
+
_host_index,
|
|
264
|
+
) -> RequestSerialized:
|
|
265
|
+
|
|
266
|
+
_host = None
|
|
267
|
+
|
|
268
|
+
_collection_formats: Dict[str, str] = {
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
_path_params: Dict[str, str] = {}
|
|
272
|
+
_query_params: List[Tuple[str, str]] = []
|
|
273
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
274
|
+
_form_params: List[Tuple[str, str]] = []
|
|
275
|
+
_files: Dict[
|
|
276
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
277
|
+
] = {}
|
|
278
|
+
_body_params: Optional[bytes] = None
|
|
279
|
+
|
|
280
|
+
# process the path parameters
|
|
281
|
+
# process the query parameters
|
|
282
|
+
if token is not None:
|
|
283
|
+
|
|
284
|
+
_query_params.append(('token', token))
|
|
285
|
+
|
|
286
|
+
# process the header parameters
|
|
287
|
+
# process the form parameters
|
|
288
|
+
# process the body parameter
|
|
289
|
+
if add_template_request is not None:
|
|
290
|
+
_body_params = add_template_request
|
|
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
|
+
# set the HTTP header `Content-Type`
|
|
302
|
+
if _content_type:
|
|
303
|
+
_header_params['Content-Type'] = _content_type
|
|
304
|
+
else:
|
|
305
|
+
_default_content_type = (
|
|
306
|
+
self.api_client.select_header_content_type(
|
|
307
|
+
[
|
|
308
|
+
'application/json'
|
|
309
|
+
]
|
|
310
|
+
)
|
|
311
|
+
)
|
|
312
|
+
if _default_content_type is not None:
|
|
313
|
+
_header_params['Content-Type'] = _default_content_type
|
|
314
|
+
|
|
315
|
+
# authentication setting
|
|
316
|
+
_auth_settings: List[str] = [
|
|
317
|
+
'tokenAuth'
|
|
318
|
+
]
|
|
319
|
+
|
|
320
|
+
return self.api_client.param_serialize(
|
|
321
|
+
method='POST',
|
|
322
|
+
resource_path='/addTemplate',
|
|
323
|
+
path_params=_path_params,
|
|
324
|
+
query_params=_query_params,
|
|
325
|
+
header_params=_header_params,
|
|
326
|
+
body=_body_params,
|
|
327
|
+
post_params=_form_params,
|
|
328
|
+
files=_files,
|
|
329
|
+
auth_settings=_auth_settings,
|
|
330
|
+
collection_formats=_collection_formats,
|
|
331
|
+
_host=_host,
|
|
332
|
+
_request_auth=_request_auth
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
@validate_call
|
|
339
|
+
def list_templates(
|
|
340
|
+
self,
|
|
341
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
342
|
+
_request_timeout: Union[
|
|
343
|
+
None,
|
|
344
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
345
|
+
Tuple[
|
|
346
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
347
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
348
|
+
]
|
|
349
|
+
] = None,
|
|
350
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
351
|
+
_content_type: Optional[StrictStr] = None,
|
|
352
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
353
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
354
|
+
) -> ListTemplates200Response:
|
|
355
|
+
"""Get templates list
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
:param token: JWT token or API key for authorization (required)
|
|
359
|
+
:type token: str
|
|
360
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
361
|
+
number provided, it will be total request
|
|
362
|
+
timeout. It can also be a pair (tuple) of
|
|
363
|
+
(connection, read) timeouts.
|
|
364
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
365
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
366
|
+
request; this effectively ignores the
|
|
367
|
+
authentication in the spec for a single request.
|
|
368
|
+
:type _request_auth: dict, optional
|
|
369
|
+
:param _content_type: force content-type for the request.
|
|
370
|
+
:type _content_type: str, Optional
|
|
371
|
+
:param _headers: set to override the headers for a single
|
|
372
|
+
request; this effectively ignores the headers
|
|
373
|
+
in the spec for a single request.
|
|
374
|
+
:type _headers: dict, optional
|
|
375
|
+
:param _host_index: set to override the host_index for a single
|
|
376
|
+
request; this effectively ignores the host_index
|
|
377
|
+
in the spec for a single request.
|
|
378
|
+
:type _host_index: int, optional
|
|
379
|
+
:return: Returns the result object.
|
|
380
|
+
""" # noqa: E501
|
|
381
|
+
|
|
382
|
+
_param = self._list_templates_serialize(
|
|
383
|
+
token=token,
|
|
384
|
+
_request_auth=_request_auth,
|
|
385
|
+
_content_type=_content_type,
|
|
386
|
+
_headers=_headers,
|
|
387
|
+
_host_index=_host_index
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
391
|
+
'200': "ListTemplates200Response",
|
|
392
|
+
}
|
|
393
|
+
response_data = self.api_client.call_api(
|
|
394
|
+
*_param,
|
|
395
|
+
_request_timeout=_request_timeout
|
|
396
|
+
)
|
|
397
|
+
response_data.read()
|
|
398
|
+
return self.api_client.response_deserialize(
|
|
399
|
+
response_data=response_data,
|
|
400
|
+
response_types_map=_response_types_map,
|
|
401
|
+
).data
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
@validate_call
|
|
405
|
+
def list_templates_with_http_info(
|
|
406
|
+
self,
|
|
407
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
408
|
+
_request_timeout: Union[
|
|
409
|
+
None,
|
|
410
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
411
|
+
Tuple[
|
|
412
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
413
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
414
|
+
]
|
|
415
|
+
] = None,
|
|
416
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
417
|
+
_content_type: Optional[StrictStr] = None,
|
|
418
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
419
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
420
|
+
) -> ApiResponse[ListTemplates200Response]:
|
|
421
|
+
"""Get templates list
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
:param token: JWT token or API key for authorization (required)
|
|
425
|
+
:type token: str
|
|
426
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
427
|
+
number provided, it will be total request
|
|
428
|
+
timeout. It can also be a pair (tuple) of
|
|
429
|
+
(connection, read) timeouts.
|
|
430
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
431
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
432
|
+
request; this effectively ignores the
|
|
433
|
+
authentication in the spec for a single request.
|
|
434
|
+
:type _request_auth: dict, optional
|
|
435
|
+
:param _content_type: force content-type for the request.
|
|
436
|
+
:type _content_type: str, Optional
|
|
437
|
+
:param _headers: set to override the headers for a single
|
|
438
|
+
request; this effectively ignores the headers
|
|
439
|
+
in the spec for a single request.
|
|
440
|
+
:type _headers: dict, optional
|
|
441
|
+
:param _host_index: set to override the host_index for a single
|
|
442
|
+
request; this effectively ignores the host_index
|
|
443
|
+
in the spec for a single request.
|
|
444
|
+
:type _host_index: int, optional
|
|
445
|
+
:return: Returns the result object.
|
|
446
|
+
""" # noqa: E501
|
|
447
|
+
|
|
448
|
+
_param = self._list_templates_serialize(
|
|
449
|
+
token=token,
|
|
450
|
+
_request_auth=_request_auth,
|
|
451
|
+
_content_type=_content_type,
|
|
452
|
+
_headers=_headers,
|
|
453
|
+
_host_index=_host_index
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
457
|
+
'200': "ListTemplates200Response",
|
|
458
|
+
}
|
|
459
|
+
response_data = self.api_client.call_api(
|
|
460
|
+
*_param,
|
|
461
|
+
_request_timeout=_request_timeout
|
|
462
|
+
)
|
|
463
|
+
response_data.read()
|
|
464
|
+
return self.api_client.response_deserialize(
|
|
465
|
+
response_data=response_data,
|
|
466
|
+
response_types_map=_response_types_map,
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
@validate_call
|
|
471
|
+
def list_templates_without_preload_content(
|
|
472
|
+
self,
|
|
473
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
474
|
+
_request_timeout: Union[
|
|
475
|
+
None,
|
|
476
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
477
|
+
Tuple[
|
|
478
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
479
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
480
|
+
]
|
|
481
|
+
] = None,
|
|
482
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
483
|
+
_content_type: Optional[StrictStr] = None,
|
|
484
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
485
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
486
|
+
) -> RESTResponseType:
|
|
487
|
+
"""Get templates list
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
:param token: JWT token or API key for authorization (required)
|
|
491
|
+
:type token: str
|
|
492
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
493
|
+
number provided, it will be total request
|
|
494
|
+
timeout. It can also be a pair (tuple) of
|
|
495
|
+
(connection, read) timeouts.
|
|
496
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
497
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
498
|
+
request; this effectively ignores the
|
|
499
|
+
authentication in the spec for a single request.
|
|
500
|
+
:type _request_auth: dict, optional
|
|
501
|
+
:param _content_type: force content-type for the request.
|
|
502
|
+
:type _content_type: str, Optional
|
|
503
|
+
:param _headers: set to override the headers for a single
|
|
504
|
+
request; this effectively ignores the headers
|
|
505
|
+
in the spec for a single request.
|
|
506
|
+
:type _headers: dict, optional
|
|
507
|
+
:param _host_index: set to override the host_index for a single
|
|
508
|
+
request; this effectively ignores the host_index
|
|
509
|
+
in the spec for a single request.
|
|
510
|
+
:type _host_index: int, optional
|
|
511
|
+
:return: Returns the result object.
|
|
512
|
+
""" # noqa: E501
|
|
513
|
+
|
|
514
|
+
_param = self._list_templates_serialize(
|
|
515
|
+
token=token,
|
|
516
|
+
_request_auth=_request_auth,
|
|
517
|
+
_content_type=_content_type,
|
|
518
|
+
_headers=_headers,
|
|
519
|
+
_host_index=_host_index
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
523
|
+
'200': "ListTemplates200Response",
|
|
524
|
+
}
|
|
525
|
+
response_data = self.api_client.call_api(
|
|
526
|
+
*_param,
|
|
527
|
+
_request_timeout=_request_timeout
|
|
528
|
+
)
|
|
529
|
+
return response_data.response
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
def _list_templates_serialize(
|
|
533
|
+
self,
|
|
534
|
+
token,
|
|
535
|
+
_request_auth,
|
|
536
|
+
_content_type,
|
|
537
|
+
_headers,
|
|
538
|
+
_host_index,
|
|
539
|
+
) -> RequestSerialized:
|
|
540
|
+
|
|
541
|
+
_host = None
|
|
542
|
+
|
|
543
|
+
_collection_formats: Dict[str, str] = {
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
_path_params: Dict[str, str] = {}
|
|
547
|
+
_query_params: List[Tuple[str, str]] = []
|
|
548
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
549
|
+
_form_params: List[Tuple[str, str]] = []
|
|
550
|
+
_files: Dict[
|
|
551
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
552
|
+
] = {}
|
|
553
|
+
_body_params: Optional[bytes] = None
|
|
554
|
+
|
|
555
|
+
# process the path parameters
|
|
556
|
+
# process the query parameters
|
|
557
|
+
if token is not None:
|
|
558
|
+
|
|
559
|
+
_query_params.append(('token', token))
|
|
560
|
+
|
|
561
|
+
# process the header parameters
|
|
562
|
+
# process the form parameters
|
|
563
|
+
# process the body parameter
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
# set the HTTP header `Accept`
|
|
567
|
+
if 'Accept' not in _header_params:
|
|
568
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
569
|
+
[
|
|
570
|
+
'application/json'
|
|
571
|
+
]
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
# authentication setting
|
|
576
|
+
_auth_settings: List[str] = [
|
|
577
|
+
'tokenAuth'
|
|
578
|
+
]
|
|
579
|
+
|
|
580
|
+
return self.api_client.param_serialize(
|
|
581
|
+
method='GET',
|
|
582
|
+
resource_path='/templates',
|
|
583
|
+
path_params=_path_params,
|
|
584
|
+
query_params=_query_params,
|
|
585
|
+
header_params=_header_params,
|
|
586
|
+
body=_body_params,
|
|
587
|
+
post_params=_form_params,
|
|
588
|
+
files=_files,
|
|
589
|
+
auth_settings=_auth_settings,
|
|
590
|
+
collection_formats=_collection_formats,
|
|
591
|
+
_host=_host,
|
|
592
|
+
_request_auth=_request_auth
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
@validate_call
|
|
599
|
+
def remove_template(
|
|
600
|
+
self,
|
|
601
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
602
|
+
request_body: Optional[Dict[str, Any]] = None,
|
|
603
|
+
_request_timeout: Union[
|
|
604
|
+
None,
|
|
605
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
606
|
+
Tuple[
|
|
607
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
608
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
609
|
+
]
|
|
610
|
+
] = None,
|
|
611
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
612
|
+
_content_type: Optional[StrictStr] = None,
|
|
613
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
614
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
615
|
+
) -> Dict[str, object]:
|
|
616
|
+
"""Remove message template
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
:param token: JWT token or API key for authorization (required)
|
|
620
|
+
:type token: str
|
|
621
|
+
:param request_body:
|
|
622
|
+
:type request_body: Dict[str, object]
|
|
623
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
624
|
+
number provided, it will be total request
|
|
625
|
+
timeout. It can also be a pair (tuple) of
|
|
626
|
+
(connection, read) timeouts.
|
|
627
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
628
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
629
|
+
request; this effectively ignores the
|
|
630
|
+
authentication in the spec for a single request.
|
|
631
|
+
:type _request_auth: dict, optional
|
|
632
|
+
:param _content_type: force content-type for the request.
|
|
633
|
+
:type _content_type: str, Optional
|
|
634
|
+
:param _headers: set to override the headers for a single
|
|
635
|
+
request; this effectively ignores the headers
|
|
636
|
+
in the spec for a single request.
|
|
637
|
+
:type _headers: dict, optional
|
|
638
|
+
:param _host_index: set to override the host_index for a single
|
|
639
|
+
request; this effectively ignores the host_index
|
|
640
|
+
in the spec for a single request.
|
|
641
|
+
:type _host_index: int, optional
|
|
642
|
+
:return: Returns the result object.
|
|
643
|
+
""" # noqa: E501
|
|
644
|
+
|
|
645
|
+
_param = self._remove_template_serialize(
|
|
646
|
+
token=token,
|
|
647
|
+
request_body=request_body,
|
|
648
|
+
_request_auth=_request_auth,
|
|
649
|
+
_content_type=_content_type,
|
|
650
|
+
_headers=_headers,
|
|
651
|
+
_host_index=_host_index
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
655
|
+
'200': "Dict[str, object]",
|
|
656
|
+
'401': "ErrorResponse",
|
|
657
|
+
'500': "ErrorResponse",
|
|
658
|
+
}
|
|
659
|
+
response_data = self.api_client.call_api(
|
|
660
|
+
*_param,
|
|
661
|
+
_request_timeout=_request_timeout
|
|
662
|
+
)
|
|
663
|
+
response_data.read()
|
|
664
|
+
return self.api_client.response_deserialize(
|
|
665
|
+
response_data=response_data,
|
|
666
|
+
response_types_map=_response_types_map,
|
|
667
|
+
).data
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
@validate_call
|
|
671
|
+
def remove_template_with_http_info(
|
|
672
|
+
self,
|
|
673
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
674
|
+
request_body: Optional[Dict[str, Any]] = None,
|
|
675
|
+
_request_timeout: Union[
|
|
676
|
+
None,
|
|
677
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
678
|
+
Tuple[
|
|
679
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
680
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
681
|
+
]
|
|
682
|
+
] = None,
|
|
683
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
684
|
+
_content_type: Optional[StrictStr] = None,
|
|
685
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
686
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
687
|
+
) -> ApiResponse[Dict[str, object]]:
|
|
688
|
+
"""Remove message template
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
:param token: JWT token or API key for authorization (required)
|
|
692
|
+
:type token: str
|
|
693
|
+
:param request_body:
|
|
694
|
+
:type request_body: Dict[str, object]
|
|
695
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
696
|
+
number provided, it will be total request
|
|
697
|
+
timeout. It can also be a pair (tuple) of
|
|
698
|
+
(connection, read) timeouts.
|
|
699
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
700
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
701
|
+
request; this effectively ignores the
|
|
702
|
+
authentication in the spec for a single request.
|
|
703
|
+
:type _request_auth: dict, optional
|
|
704
|
+
:param _content_type: force content-type for the request.
|
|
705
|
+
:type _content_type: str, Optional
|
|
706
|
+
:param _headers: set to override the headers for a single
|
|
707
|
+
request; this effectively ignores the headers
|
|
708
|
+
in the spec for a single request.
|
|
709
|
+
:type _headers: dict, optional
|
|
710
|
+
:param _host_index: set to override the host_index for a single
|
|
711
|
+
request; this effectively ignores the host_index
|
|
712
|
+
in the spec for a single request.
|
|
713
|
+
:type _host_index: int, optional
|
|
714
|
+
:return: Returns the result object.
|
|
715
|
+
""" # noqa: E501
|
|
716
|
+
|
|
717
|
+
_param = self._remove_template_serialize(
|
|
718
|
+
token=token,
|
|
719
|
+
request_body=request_body,
|
|
720
|
+
_request_auth=_request_auth,
|
|
721
|
+
_content_type=_content_type,
|
|
722
|
+
_headers=_headers,
|
|
723
|
+
_host_index=_host_index
|
|
724
|
+
)
|
|
725
|
+
|
|
726
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
727
|
+
'200': "Dict[str, object]",
|
|
728
|
+
'401': "ErrorResponse",
|
|
729
|
+
'500': "ErrorResponse",
|
|
730
|
+
}
|
|
731
|
+
response_data = self.api_client.call_api(
|
|
732
|
+
*_param,
|
|
733
|
+
_request_timeout=_request_timeout
|
|
734
|
+
)
|
|
735
|
+
response_data.read()
|
|
736
|
+
return self.api_client.response_deserialize(
|
|
737
|
+
response_data=response_data,
|
|
738
|
+
response_types_map=_response_types_map,
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
@validate_call
|
|
743
|
+
def remove_template_without_preload_content(
|
|
744
|
+
self,
|
|
745
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
746
|
+
request_body: Optional[Dict[str, Any]] = None,
|
|
747
|
+
_request_timeout: Union[
|
|
748
|
+
None,
|
|
749
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
750
|
+
Tuple[
|
|
751
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
752
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
753
|
+
]
|
|
754
|
+
] = None,
|
|
755
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
756
|
+
_content_type: Optional[StrictStr] = None,
|
|
757
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
758
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
759
|
+
) -> RESTResponseType:
|
|
760
|
+
"""Remove message template
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
:param token: JWT token or API key for authorization (required)
|
|
764
|
+
:type token: str
|
|
765
|
+
:param request_body:
|
|
766
|
+
:type request_body: Dict[str, object]
|
|
767
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
768
|
+
number provided, it will be total request
|
|
769
|
+
timeout. It can also be a pair (tuple) of
|
|
770
|
+
(connection, read) timeouts.
|
|
771
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
772
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
773
|
+
request; this effectively ignores the
|
|
774
|
+
authentication in the spec for a single request.
|
|
775
|
+
:type _request_auth: dict, optional
|
|
776
|
+
:param _content_type: force content-type for the request.
|
|
777
|
+
:type _content_type: str, Optional
|
|
778
|
+
:param _headers: set to override the headers for a single
|
|
779
|
+
request; this effectively ignores the headers
|
|
780
|
+
in the spec for a single request.
|
|
781
|
+
:type _headers: dict, optional
|
|
782
|
+
:param _host_index: set to override the host_index for a single
|
|
783
|
+
request; this effectively ignores the host_index
|
|
784
|
+
in the spec for a single request.
|
|
785
|
+
:type _host_index: int, optional
|
|
786
|
+
:return: Returns the result object.
|
|
787
|
+
""" # noqa: E501
|
|
788
|
+
|
|
789
|
+
_param = self._remove_template_serialize(
|
|
790
|
+
token=token,
|
|
791
|
+
request_body=request_body,
|
|
792
|
+
_request_auth=_request_auth,
|
|
793
|
+
_content_type=_content_type,
|
|
794
|
+
_headers=_headers,
|
|
795
|
+
_host_index=_host_index
|
|
796
|
+
)
|
|
797
|
+
|
|
798
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
799
|
+
'200': "Dict[str, object]",
|
|
800
|
+
'401': "ErrorResponse",
|
|
801
|
+
'500': "ErrorResponse",
|
|
802
|
+
}
|
|
803
|
+
response_data = self.api_client.call_api(
|
|
804
|
+
*_param,
|
|
805
|
+
_request_timeout=_request_timeout
|
|
806
|
+
)
|
|
807
|
+
return response_data.response
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
def _remove_template_serialize(
|
|
811
|
+
self,
|
|
812
|
+
token,
|
|
813
|
+
request_body,
|
|
814
|
+
_request_auth,
|
|
815
|
+
_content_type,
|
|
816
|
+
_headers,
|
|
817
|
+
_host_index,
|
|
818
|
+
) -> RequestSerialized:
|
|
819
|
+
|
|
820
|
+
_host = None
|
|
821
|
+
|
|
822
|
+
_collection_formats: Dict[str, str] = {
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
_path_params: Dict[str, str] = {}
|
|
826
|
+
_query_params: List[Tuple[str, str]] = []
|
|
827
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
828
|
+
_form_params: List[Tuple[str, str]] = []
|
|
829
|
+
_files: Dict[
|
|
830
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
831
|
+
] = {}
|
|
832
|
+
_body_params: Optional[bytes] = None
|
|
833
|
+
|
|
834
|
+
# process the path parameters
|
|
835
|
+
# process the query parameters
|
|
836
|
+
if token is not None:
|
|
837
|
+
|
|
838
|
+
_query_params.append(('token', token))
|
|
839
|
+
|
|
840
|
+
# process the header parameters
|
|
841
|
+
# process the form parameters
|
|
842
|
+
# process the body parameter
|
|
843
|
+
if request_body is not None:
|
|
844
|
+
_body_params = request_body
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
# set the HTTP header `Accept`
|
|
848
|
+
if 'Accept' not in _header_params:
|
|
849
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
850
|
+
[
|
|
851
|
+
'application/json'
|
|
852
|
+
]
|
|
853
|
+
)
|
|
854
|
+
|
|
855
|
+
# set the HTTP header `Content-Type`
|
|
856
|
+
if _content_type:
|
|
857
|
+
_header_params['Content-Type'] = _content_type
|
|
858
|
+
else:
|
|
859
|
+
_default_content_type = (
|
|
860
|
+
self.api_client.select_header_content_type(
|
|
861
|
+
[
|
|
862
|
+
'application/json'
|
|
863
|
+
]
|
|
864
|
+
)
|
|
865
|
+
)
|
|
866
|
+
if _default_content_type is not None:
|
|
867
|
+
_header_params['Content-Type'] = _default_content_type
|
|
868
|
+
|
|
869
|
+
# authentication setting
|
|
870
|
+
_auth_settings: List[str] = [
|
|
871
|
+
'tokenAuth'
|
|
872
|
+
]
|
|
873
|
+
|
|
874
|
+
return self.api_client.param_serialize(
|
|
875
|
+
method='POST',
|
|
876
|
+
resource_path='/removeTemplate',
|
|
877
|
+
path_params=_path_params,
|
|
878
|
+
query_params=_query_params,
|
|
879
|
+
header_params=_header_params,
|
|
880
|
+
body=_body_params,
|
|
881
|
+
post_params=_form_params,
|
|
882
|
+
files=_files,
|
|
883
|
+
auth_settings=_auth_settings,
|
|
884
|
+
collection_formats=_collection_formats,
|
|
885
|
+
_host=_host,
|
|
886
|
+
_request_auth=_request_auth
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
@validate_call
|
|
893
|
+
def send_template(
|
|
894
|
+
self,
|
|
895
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
896
|
+
send_template_request: Optional[SendTemplateRequest] = None,
|
|
897
|
+
_request_timeout: Union[
|
|
898
|
+
None,
|
|
899
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
900
|
+
Tuple[
|
|
901
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
902
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
903
|
+
]
|
|
904
|
+
] = None,
|
|
905
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
906
|
+
_content_type: Optional[StrictStr] = None,
|
|
907
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
908
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
909
|
+
) -> Dict[str, object]:
|
|
910
|
+
"""Send Template Message
|
|
911
|
+
|
|
912
|
+
Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). For India order/invoice payments outside 24h, include a button component: ```json { \"type\": \"button\", \"sub_type\": \"order_details\", \"index\": 0, \"parameters\": [{ \"type\": \"action\", \"action\": { \"order_details\": { \"reference_id\": \"...\", \"currency\": \"INR\", \"order\": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`.
|
|
913
|
+
|
|
914
|
+
:param token: JWT token or API key for authorization (required)
|
|
915
|
+
:type token: str
|
|
916
|
+
:param send_template_request:
|
|
917
|
+
:type send_template_request: SendTemplateRequest
|
|
918
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
919
|
+
number provided, it will be total request
|
|
920
|
+
timeout. It can also be a pair (tuple) of
|
|
921
|
+
(connection, read) timeouts.
|
|
922
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
923
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
924
|
+
request; this effectively ignores the
|
|
925
|
+
authentication in the spec for a single request.
|
|
926
|
+
:type _request_auth: dict, optional
|
|
927
|
+
:param _content_type: force content-type for the request.
|
|
928
|
+
:type _content_type: str, Optional
|
|
929
|
+
:param _headers: set to override the headers for a single
|
|
930
|
+
request; this effectively ignores the headers
|
|
931
|
+
in the spec for a single request.
|
|
932
|
+
:type _headers: dict, optional
|
|
933
|
+
:param _host_index: set to override the host_index for a single
|
|
934
|
+
request; this effectively ignores the host_index
|
|
935
|
+
in the spec for a single request.
|
|
936
|
+
:type _host_index: int, optional
|
|
937
|
+
:return: Returns the result object.
|
|
938
|
+
""" # noqa: E501
|
|
939
|
+
|
|
940
|
+
_param = self._send_template_serialize(
|
|
941
|
+
token=token,
|
|
942
|
+
send_template_request=send_template_request,
|
|
943
|
+
_request_auth=_request_auth,
|
|
944
|
+
_content_type=_content_type,
|
|
945
|
+
_headers=_headers,
|
|
946
|
+
_host_index=_host_index
|
|
947
|
+
)
|
|
948
|
+
|
|
949
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
950
|
+
'200': "Dict[str, object]",
|
|
951
|
+
}
|
|
952
|
+
response_data = self.api_client.call_api(
|
|
953
|
+
*_param,
|
|
954
|
+
_request_timeout=_request_timeout
|
|
955
|
+
)
|
|
956
|
+
response_data.read()
|
|
957
|
+
return self.api_client.response_deserialize(
|
|
958
|
+
response_data=response_data,
|
|
959
|
+
response_types_map=_response_types_map,
|
|
960
|
+
).data
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
@validate_call
|
|
964
|
+
def send_template_with_http_info(
|
|
965
|
+
self,
|
|
966
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
967
|
+
send_template_request: Optional[SendTemplateRequest] = None,
|
|
968
|
+
_request_timeout: Union[
|
|
969
|
+
None,
|
|
970
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
971
|
+
Tuple[
|
|
972
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
973
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
974
|
+
]
|
|
975
|
+
] = None,
|
|
976
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
977
|
+
_content_type: Optional[StrictStr] = None,
|
|
978
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
979
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
980
|
+
) -> ApiResponse[Dict[str, object]]:
|
|
981
|
+
"""Send Template Message
|
|
982
|
+
|
|
983
|
+
Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). For India order/invoice payments outside 24h, include a button component: ```json { \"type\": \"button\", \"sub_type\": \"order_details\", \"index\": 0, \"parameters\": [{ \"type\": \"action\", \"action\": { \"order_details\": { \"reference_id\": \"...\", \"currency\": \"INR\", \"order\": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`.
|
|
984
|
+
|
|
985
|
+
:param token: JWT token or API key for authorization (required)
|
|
986
|
+
:type token: str
|
|
987
|
+
:param send_template_request:
|
|
988
|
+
:type send_template_request: SendTemplateRequest
|
|
989
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
990
|
+
number provided, it will be total request
|
|
991
|
+
timeout. It can also be a pair (tuple) of
|
|
992
|
+
(connection, read) timeouts.
|
|
993
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
994
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
995
|
+
request; this effectively ignores the
|
|
996
|
+
authentication in the spec for a single request.
|
|
997
|
+
:type _request_auth: dict, optional
|
|
998
|
+
:param _content_type: force content-type for the request.
|
|
999
|
+
:type _content_type: str, Optional
|
|
1000
|
+
:param _headers: set to override the headers for a single
|
|
1001
|
+
request; this effectively ignores the headers
|
|
1002
|
+
in the spec for a single request.
|
|
1003
|
+
:type _headers: dict, optional
|
|
1004
|
+
:param _host_index: set to override the host_index for a single
|
|
1005
|
+
request; this effectively ignores the host_index
|
|
1006
|
+
in the spec for a single request.
|
|
1007
|
+
:type _host_index: int, optional
|
|
1008
|
+
:return: Returns the result object.
|
|
1009
|
+
""" # noqa: E501
|
|
1010
|
+
|
|
1011
|
+
_param = self._send_template_serialize(
|
|
1012
|
+
token=token,
|
|
1013
|
+
send_template_request=send_template_request,
|
|
1014
|
+
_request_auth=_request_auth,
|
|
1015
|
+
_content_type=_content_type,
|
|
1016
|
+
_headers=_headers,
|
|
1017
|
+
_host_index=_host_index
|
|
1018
|
+
)
|
|
1019
|
+
|
|
1020
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1021
|
+
'200': "Dict[str, object]",
|
|
1022
|
+
}
|
|
1023
|
+
response_data = self.api_client.call_api(
|
|
1024
|
+
*_param,
|
|
1025
|
+
_request_timeout=_request_timeout
|
|
1026
|
+
)
|
|
1027
|
+
response_data.read()
|
|
1028
|
+
return self.api_client.response_deserialize(
|
|
1029
|
+
response_data=response_data,
|
|
1030
|
+
response_types_map=_response_types_map,
|
|
1031
|
+
)
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
@validate_call
|
|
1035
|
+
def send_template_without_preload_content(
|
|
1036
|
+
self,
|
|
1037
|
+
token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
|
|
1038
|
+
send_template_request: Optional[SendTemplateRequest] = None,
|
|
1039
|
+
_request_timeout: Union[
|
|
1040
|
+
None,
|
|
1041
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1042
|
+
Tuple[
|
|
1043
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1044
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1045
|
+
]
|
|
1046
|
+
] = None,
|
|
1047
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1048
|
+
_content_type: Optional[StrictStr] = None,
|
|
1049
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1050
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1051
|
+
) -> RESTResponseType:
|
|
1052
|
+
"""Send Template Message
|
|
1053
|
+
|
|
1054
|
+
Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). For India order/invoice payments outside 24h, include a button component: ```json { \"type\": \"button\", \"sub_type\": \"order_details\", \"index\": 0, \"parameters\": [{ \"type\": \"action\", \"action\": { \"order_details\": { \"reference_id\": \"...\", \"currency\": \"INR\", \"order\": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`.
|
|
1055
|
+
|
|
1056
|
+
:param token: JWT token or API key for authorization (required)
|
|
1057
|
+
:type token: str
|
|
1058
|
+
:param send_template_request:
|
|
1059
|
+
:type send_template_request: SendTemplateRequest
|
|
1060
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1061
|
+
number provided, it will be total request
|
|
1062
|
+
timeout. It can also be a pair (tuple) of
|
|
1063
|
+
(connection, read) timeouts.
|
|
1064
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1065
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1066
|
+
request; this effectively ignores the
|
|
1067
|
+
authentication in the spec for a single request.
|
|
1068
|
+
:type _request_auth: dict, optional
|
|
1069
|
+
:param _content_type: force content-type for the request.
|
|
1070
|
+
:type _content_type: str, Optional
|
|
1071
|
+
:param _headers: set to override the headers for a single
|
|
1072
|
+
request; this effectively ignores the headers
|
|
1073
|
+
in the spec for a single request.
|
|
1074
|
+
:type _headers: dict, optional
|
|
1075
|
+
:param _host_index: set to override the host_index for a single
|
|
1076
|
+
request; this effectively ignores the host_index
|
|
1077
|
+
in the spec for a single request.
|
|
1078
|
+
:type _host_index: int, optional
|
|
1079
|
+
:return: Returns the result object.
|
|
1080
|
+
""" # noqa: E501
|
|
1081
|
+
|
|
1082
|
+
_param = self._send_template_serialize(
|
|
1083
|
+
token=token,
|
|
1084
|
+
send_template_request=send_template_request,
|
|
1085
|
+
_request_auth=_request_auth,
|
|
1086
|
+
_content_type=_content_type,
|
|
1087
|
+
_headers=_headers,
|
|
1088
|
+
_host_index=_host_index
|
|
1089
|
+
)
|
|
1090
|
+
|
|
1091
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1092
|
+
'200': "Dict[str, object]",
|
|
1093
|
+
}
|
|
1094
|
+
response_data = self.api_client.call_api(
|
|
1095
|
+
*_param,
|
|
1096
|
+
_request_timeout=_request_timeout
|
|
1097
|
+
)
|
|
1098
|
+
return response_data.response
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
def _send_template_serialize(
|
|
1102
|
+
self,
|
|
1103
|
+
token,
|
|
1104
|
+
send_template_request,
|
|
1105
|
+
_request_auth,
|
|
1106
|
+
_content_type,
|
|
1107
|
+
_headers,
|
|
1108
|
+
_host_index,
|
|
1109
|
+
) -> RequestSerialized:
|
|
1110
|
+
|
|
1111
|
+
_host = None
|
|
1112
|
+
|
|
1113
|
+
_collection_formats: Dict[str, str] = {
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
_path_params: Dict[str, str] = {}
|
|
1117
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1118
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1119
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1120
|
+
_files: Dict[
|
|
1121
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1122
|
+
] = {}
|
|
1123
|
+
_body_params: Optional[bytes] = None
|
|
1124
|
+
|
|
1125
|
+
# process the path parameters
|
|
1126
|
+
# process the query parameters
|
|
1127
|
+
if token is not None:
|
|
1128
|
+
|
|
1129
|
+
_query_params.append(('token', token))
|
|
1130
|
+
|
|
1131
|
+
# process the header parameters
|
|
1132
|
+
# process the form parameters
|
|
1133
|
+
# process the body parameter
|
|
1134
|
+
if send_template_request is not None:
|
|
1135
|
+
_body_params = send_template_request
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
# set the HTTP header `Accept`
|
|
1139
|
+
if 'Accept' not in _header_params:
|
|
1140
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1141
|
+
[
|
|
1142
|
+
'application/json'
|
|
1143
|
+
]
|
|
1144
|
+
)
|
|
1145
|
+
|
|
1146
|
+
# set the HTTP header `Content-Type`
|
|
1147
|
+
if _content_type:
|
|
1148
|
+
_header_params['Content-Type'] = _content_type
|
|
1149
|
+
else:
|
|
1150
|
+
_default_content_type = (
|
|
1151
|
+
self.api_client.select_header_content_type(
|
|
1152
|
+
[
|
|
1153
|
+
'application/json'
|
|
1154
|
+
]
|
|
1155
|
+
)
|
|
1156
|
+
)
|
|
1157
|
+
if _default_content_type is not None:
|
|
1158
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1159
|
+
|
|
1160
|
+
# authentication setting
|
|
1161
|
+
_auth_settings: List[str] = [
|
|
1162
|
+
'tokenAuth'
|
|
1163
|
+
]
|
|
1164
|
+
|
|
1165
|
+
return self.api_client.param_serialize(
|
|
1166
|
+
method='POST',
|
|
1167
|
+
resource_path='/sendTemplate',
|
|
1168
|
+
path_params=_path_params,
|
|
1169
|
+
query_params=_query_params,
|
|
1170
|
+
header_params=_header_params,
|
|
1171
|
+
body=_body_params,
|
|
1172
|
+
post_params=_form_params,
|
|
1173
|
+
files=_files,
|
|
1174
|
+
auth_settings=_auth_settings,
|
|
1175
|
+
collection_formats=_collection_formats,
|
|
1176
|
+
_host=_host,
|
|
1177
|
+
_request_auth=_request_auth
|
|
1178
|
+
)
|
|
1179
|
+
|
|
1180
|
+
|