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,607 @@
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 List
21
+ from typing_extensions import Annotated
22
+ from one_msg_sdk.models.create_commerce200_response import CreateCommerce200Response
23
+ from one_msg_sdk.models.create_commerce_request import CreateCommerceRequest
24
+ from one_msg_sdk.models.get_commerce200_response_inner import GetCommerce200ResponseInner
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 CatalogApi:
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 create_commerce(
46
+ self,
47
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
48
+ create_commerce_request: CreateCommerceRequest,
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
+ ) -> CreateCommerce200Response:
62
+ """Set Commerce Settings
63
+
64
+ Update catalog/cart commerce settings via the `params` object. - `params.is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `params.is_cart_enabled` — enable cart (`true`) or disable it (`false`). Blocked when the channel subscription limit is exceeded. Requires a commerce-capable channel (Cloud Functions `/commerceWAV2`).
65
+
66
+ :param token: JWT token or API key for authorization (required)
67
+ :type token: str
68
+ :param create_commerce_request: (required)
69
+ :type create_commerce_request: CreateCommerceRequest
70
+ :param _request_timeout: timeout setting for this request. If one
71
+ number provided, it will be total request
72
+ timeout. It can also be a pair (tuple) of
73
+ (connection, read) timeouts.
74
+ :type _request_timeout: int, tuple(int, int), optional
75
+ :param _request_auth: set to override the auth_settings for an a single
76
+ request; this effectively ignores the
77
+ authentication in the spec for a single request.
78
+ :type _request_auth: dict, optional
79
+ :param _content_type: force content-type for the request.
80
+ :type _content_type: str, Optional
81
+ :param _headers: set to override the headers for a single
82
+ request; this effectively ignores the headers
83
+ in the spec for a single request.
84
+ :type _headers: dict, optional
85
+ :param _host_index: set to override the host_index for a single
86
+ request; this effectively ignores the host_index
87
+ in the spec for a single request.
88
+ :type _host_index: int, optional
89
+ :return: Returns the result object.
90
+ """ # noqa: E501
91
+
92
+ _param = self._create_commerce_serialize(
93
+ token=token,
94
+ create_commerce_request=create_commerce_request,
95
+ _request_auth=_request_auth,
96
+ _content_type=_content_type,
97
+ _headers=_headers,
98
+ _host_index=_host_index
99
+ )
100
+
101
+ _response_types_map: Dict[str, Optional[str]] = {
102
+ '200': "CreateCommerce200Response",
103
+ '401': "ErrorResponse",
104
+ '500': "ErrorResponse",
105
+ }
106
+ response_data = self.api_client.call_api(
107
+ *_param,
108
+ _request_timeout=_request_timeout
109
+ )
110
+ response_data.read()
111
+ return self.api_client.response_deserialize(
112
+ response_data=response_data,
113
+ response_types_map=_response_types_map,
114
+ ).data
115
+
116
+
117
+ @validate_call
118
+ def create_commerce_with_http_info(
119
+ self,
120
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
121
+ create_commerce_request: CreateCommerceRequest,
122
+ _request_timeout: Union[
123
+ None,
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Tuple[
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Annotated[StrictFloat, Field(gt=0)]
128
+ ]
129
+ ] = None,
130
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
+ _content_type: Optional[StrictStr] = None,
132
+ _headers: Optional[Dict[StrictStr, Any]] = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[CreateCommerce200Response]:
135
+ """Set Commerce Settings
136
+
137
+ Update catalog/cart commerce settings via the `params` object. - `params.is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `params.is_cart_enabled` — enable cart (`true`) or disable it (`false`). Blocked when the channel subscription limit is exceeded. Requires a commerce-capable channel (Cloud Functions `/commerceWAV2`).
138
+
139
+ :param token: JWT token or API key for authorization (required)
140
+ :type token: str
141
+ :param create_commerce_request: (required)
142
+ :type create_commerce_request: CreateCommerceRequest
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_commerce_serialize(
166
+ token=token,
167
+ create_commerce_request=create_commerce_request,
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': "CreateCommerce200Response",
176
+ '401': "ErrorResponse",
177
+ '500': "ErrorResponse",
178
+ }
179
+ response_data = self.api_client.call_api(
180
+ *_param,
181
+ _request_timeout=_request_timeout
182
+ )
183
+ response_data.read()
184
+ return self.api_client.response_deserialize(
185
+ response_data=response_data,
186
+ response_types_map=_response_types_map,
187
+ )
188
+
189
+
190
+ @validate_call
191
+ def create_commerce_without_preload_content(
192
+ self,
193
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
194
+ create_commerce_request: CreateCommerceRequest,
195
+ _request_timeout: Union[
196
+ None,
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Tuple[
199
+ Annotated[StrictFloat, Field(gt=0)],
200
+ Annotated[StrictFloat, Field(gt=0)]
201
+ ]
202
+ ] = None,
203
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
204
+ _content_type: Optional[StrictStr] = None,
205
+ _headers: Optional[Dict[StrictStr, Any]] = None,
206
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
207
+ ) -> RESTResponseType:
208
+ """Set Commerce Settings
209
+
210
+ Update catalog/cart commerce settings via the `params` object. - `params.is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `params.is_cart_enabled` — enable cart (`true`) or disable it (`false`). Blocked when the channel subscription limit is exceeded. Requires a commerce-capable channel (Cloud Functions `/commerceWAV2`).
211
+
212
+ :param token: JWT token or API key for authorization (required)
213
+ :type token: str
214
+ :param create_commerce_request: (required)
215
+ :type create_commerce_request: CreateCommerceRequest
216
+ :param _request_timeout: timeout setting for this request. If one
217
+ number provided, it will be total request
218
+ timeout. It can also be a pair (tuple) of
219
+ (connection, read) timeouts.
220
+ :type _request_timeout: int, tuple(int, int), optional
221
+ :param _request_auth: set to override the auth_settings for an a single
222
+ request; this effectively ignores the
223
+ authentication in the spec for a single request.
224
+ :type _request_auth: dict, optional
225
+ :param _content_type: force content-type for the request.
226
+ :type _content_type: str, Optional
227
+ :param _headers: set to override the headers for a single
228
+ request; this effectively ignores the headers
229
+ in the spec for a single request.
230
+ :type _headers: dict, optional
231
+ :param _host_index: set to override the host_index for a single
232
+ request; this effectively ignores the host_index
233
+ in the spec for a single request.
234
+ :type _host_index: int, optional
235
+ :return: Returns the result object.
236
+ """ # noqa: E501
237
+
238
+ _param = self._create_commerce_serialize(
239
+ token=token,
240
+ create_commerce_request=create_commerce_request,
241
+ _request_auth=_request_auth,
242
+ _content_type=_content_type,
243
+ _headers=_headers,
244
+ _host_index=_host_index
245
+ )
246
+
247
+ _response_types_map: Dict[str, Optional[str]] = {
248
+ '200': "CreateCommerce200Response",
249
+ '401': "ErrorResponse",
250
+ '500': "ErrorResponse",
251
+ }
252
+ response_data = self.api_client.call_api(
253
+ *_param,
254
+ _request_timeout=_request_timeout
255
+ )
256
+ return response_data.response
257
+
258
+
259
+ def _create_commerce_serialize(
260
+ self,
261
+ token,
262
+ create_commerce_request,
263
+ _request_auth,
264
+ _content_type,
265
+ _headers,
266
+ _host_index,
267
+ ) -> RequestSerialized:
268
+
269
+ _host = None
270
+
271
+ _collection_formats: Dict[str, str] = {
272
+ }
273
+
274
+ _path_params: Dict[str, str] = {}
275
+ _query_params: List[Tuple[str, str]] = []
276
+ _header_params: Dict[str, Optional[str]] = _headers or {}
277
+ _form_params: List[Tuple[str, str]] = []
278
+ _files: Dict[
279
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
280
+ ] = {}
281
+ _body_params: Optional[bytes] = None
282
+
283
+ # process the path parameters
284
+ # process the query parameters
285
+ if token is not None:
286
+
287
+ _query_params.append(('token', token))
288
+
289
+ # process the header parameters
290
+ # process the form parameters
291
+ # process the body parameter
292
+ if create_commerce_request is not None:
293
+ _body_params = create_commerce_request
294
+
295
+
296
+ # set the HTTP header `Accept`
297
+ if 'Accept' not in _header_params:
298
+ _header_params['Accept'] = self.api_client.select_header_accept(
299
+ [
300
+ 'application/json'
301
+ ]
302
+ )
303
+
304
+ # set the HTTP header `Content-Type`
305
+ if _content_type:
306
+ _header_params['Content-Type'] = _content_type
307
+ else:
308
+ _default_content_type = (
309
+ self.api_client.select_header_content_type(
310
+ [
311
+ 'application/json'
312
+ ]
313
+ )
314
+ )
315
+ if _default_content_type is not None:
316
+ _header_params['Content-Type'] = _default_content_type
317
+
318
+ # authentication setting
319
+ _auth_settings: List[str] = [
320
+ 'tokenAuth'
321
+ ]
322
+
323
+ return self.api_client.param_serialize(
324
+ method='POST',
325
+ resource_path='/commerce',
326
+ path_params=_path_params,
327
+ query_params=_query_params,
328
+ header_params=_header_params,
329
+ body=_body_params,
330
+ post_params=_form_params,
331
+ files=_files,
332
+ auth_settings=_auth_settings,
333
+ collection_formats=_collection_formats,
334
+ _host=_host,
335
+ _request_auth=_request_auth
336
+ )
337
+
338
+
339
+
340
+
341
+ @validate_call
342
+ def get_commerce(
343
+ self,
344
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
345
+ _request_timeout: Union[
346
+ None,
347
+ Annotated[StrictFloat, Field(gt=0)],
348
+ Tuple[
349
+ Annotated[StrictFloat, Field(gt=0)],
350
+ Annotated[StrictFloat, Field(gt=0)]
351
+ ]
352
+ ] = None,
353
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
354
+ _content_type: Optional[StrictStr] = None,
355
+ _headers: Optional[Dict[StrictStr, Any]] = None,
356
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
357
+ ) -> List[GetCommerce200ResponseInner]:
358
+ """Get Commerce Settings
359
+
360
+ Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
361
+
362
+ :param token: JWT token or API key for authorization (required)
363
+ :type token: str
364
+ :param _request_timeout: timeout setting for this request. If one
365
+ number provided, it will be total request
366
+ timeout. It can also be a pair (tuple) of
367
+ (connection, read) timeouts.
368
+ :type _request_timeout: int, tuple(int, int), optional
369
+ :param _request_auth: set to override the auth_settings for an a single
370
+ request; this effectively ignores the
371
+ authentication in the spec for a single request.
372
+ :type _request_auth: dict, optional
373
+ :param _content_type: force content-type for the request.
374
+ :type _content_type: str, Optional
375
+ :param _headers: set to override the headers for a single
376
+ request; this effectively ignores the headers
377
+ in the spec for a single request.
378
+ :type _headers: dict, optional
379
+ :param _host_index: set to override the host_index for a single
380
+ request; this effectively ignores the host_index
381
+ in the spec for a single request.
382
+ :type _host_index: int, optional
383
+ :return: Returns the result object.
384
+ """ # noqa: E501
385
+
386
+ _param = self._get_commerce_serialize(
387
+ token=token,
388
+ _request_auth=_request_auth,
389
+ _content_type=_content_type,
390
+ _headers=_headers,
391
+ _host_index=_host_index
392
+ )
393
+
394
+ _response_types_map: Dict[str, Optional[str]] = {
395
+ '200': "List[GetCommerce200ResponseInner]",
396
+ '401': "ErrorResponse",
397
+ '500': "ErrorResponse",
398
+ }
399
+ response_data = self.api_client.call_api(
400
+ *_param,
401
+ _request_timeout=_request_timeout
402
+ )
403
+ response_data.read()
404
+ return self.api_client.response_deserialize(
405
+ response_data=response_data,
406
+ response_types_map=_response_types_map,
407
+ ).data
408
+
409
+
410
+ @validate_call
411
+ def get_commerce_with_http_info(
412
+ self,
413
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
414
+ _request_timeout: Union[
415
+ None,
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Tuple[
418
+ Annotated[StrictFloat, Field(gt=0)],
419
+ Annotated[StrictFloat, Field(gt=0)]
420
+ ]
421
+ ] = None,
422
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
423
+ _content_type: Optional[StrictStr] = None,
424
+ _headers: Optional[Dict[StrictStr, Any]] = None,
425
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
426
+ ) -> ApiResponse[List[GetCommerce200ResponseInner]]:
427
+ """Get Commerce Settings
428
+
429
+ Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
430
+
431
+ :param token: JWT token or API key for authorization (required)
432
+ :type token: str
433
+ :param _request_timeout: timeout setting for this request. If one
434
+ number provided, it will be total request
435
+ timeout. It can also be a pair (tuple) of
436
+ (connection, read) timeouts.
437
+ :type _request_timeout: int, tuple(int, int), optional
438
+ :param _request_auth: set to override the auth_settings for an a single
439
+ request; this effectively ignores the
440
+ authentication in the spec for a single request.
441
+ :type _request_auth: dict, optional
442
+ :param _content_type: force content-type for the request.
443
+ :type _content_type: str, Optional
444
+ :param _headers: set to override the headers for a single
445
+ request; this effectively ignores the headers
446
+ in the spec for a single request.
447
+ :type _headers: dict, optional
448
+ :param _host_index: set to override the host_index for a single
449
+ request; this effectively ignores the host_index
450
+ in the spec for a single request.
451
+ :type _host_index: int, optional
452
+ :return: Returns the result object.
453
+ """ # noqa: E501
454
+
455
+ _param = self._get_commerce_serialize(
456
+ token=token,
457
+ _request_auth=_request_auth,
458
+ _content_type=_content_type,
459
+ _headers=_headers,
460
+ _host_index=_host_index
461
+ )
462
+
463
+ _response_types_map: Dict[str, Optional[str]] = {
464
+ '200': "List[GetCommerce200ResponseInner]",
465
+ '401': "ErrorResponse",
466
+ '500': "ErrorResponse",
467
+ }
468
+ response_data = self.api_client.call_api(
469
+ *_param,
470
+ _request_timeout=_request_timeout
471
+ )
472
+ response_data.read()
473
+ return self.api_client.response_deserialize(
474
+ response_data=response_data,
475
+ response_types_map=_response_types_map,
476
+ )
477
+
478
+
479
+ @validate_call
480
+ def get_commerce_without_preload_content(
481
+ self,
482
+ token: Annotated[StrictStr, Field(description="JWT token or API key for authorization")],
483
+ _request_timeout: Union[
484
+ None,
485
+ Annotated[StrictFloat, Field(gt=0)],
486
+ Tuple[
487
+ Annotated[StrictFloat, Field(gt=0)],
488
+ Annotated[StrictFloat, Field(gt=0)]
489
+ ]
490
+ ] = None,
491
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
492
+ _content_type: Optional[StrictStr] = None,
493
+ _headers: Optional[Dict[StrictStr, Any]] = None,
494
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
495
+ ) -> RESTResponseType:
496
+ """Get Commerce Settings
497
+
498
+ Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
499
+
500
+ :param token: JWT token or API key for authorization (required)
501
+ :type token: str
502
+ :param _request_timeout: timeout setting for this request. If one
503
+ number provided, it will be total request
504
+ timeout. It can also be a pair (tuple) of
505
+ (connection, read) timeouts.
506
+ :type _request_timeout: int, tuple(int, int), optional
507
+ :param _request_auth: set to override the auth_settings for an a single
508
+ request; this effectively ignores the
509
+ authentication in the spec for a single request.
510
+ :type _request_auth: dict, optional
511
+ :param _content_type: force content-type for the request.
512
+ :type _content_type: str, Optional
513
+ :param _headers: set to override the headers for a single
514
+ request; this effectively ignores the headers
515
+ in the spec for a single request.
516
+ :type _headers: dict, optional
517
+ :param _host_index: set to override the host_index for a single
518
+ request; this effectively ignores the host_index
519
+ in the spec for a single request.
520
+ :type _host_index: int, optional
521
+ :return: Returns the result object.
522
+ """ # noqa: E501
523
+
524
+ _param = self._get_commerce_serialize(
525
+ token=token,
526
+ _request_auth=_request_auth,
527
+ _content_type=_content_type,
528
+ _headers=_headers,
529
+ _host_index=_host_index
530
+ )
531
+
532
+ _response_types_map: Dict[str, Optional[str]] = {
533
+ '200': "List[GetCommerce200ResponseInner]",
534
+ '401': "ErrorResponse",
535
+ '500': "ErrorResponse",
536
+ }
537
+ response_data = self.api_client.call_api(
538
+ *_param,
539
+ _request_timeout=_request_timeout
540
+ )
541
+ return response_data.response
542
+
543
+
544
+ def _get_commerce_serialize(
545
+ self,
546
+ token,
547
+ _request_auth,
548
+ _content_type,
549
+ _headers,
550
+ _host_index,
551
+ ) -> RequestSerialized:
552
+
553
+ _host = None
554
+
555
+ _collection_formats: Dict[str, str] = {
556
+ }
557
+
558
+ _path_params: Dict[str, str] = {}
559
+ _query_params: List[Tuple[str, str]] = []
560
+ _header_params: Dict[str, Optional[str]] = _headers or {}
561
+ _form_params: List[Tuple[str, str]] = []
562
+ _files: Dict[
563
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
564
+ ] = {}
565
+ _body_params: Optional[bytes] = None
566
+
567
+ # process the path parameters
568
+ # process the query parameters
569
+ if token is not None:
570
+
571
+ _query_params.append(('token', token))
572
+
573
+ # process the header parameters
574
+ # process the form parameters
575
+ # process the body parameter
576
+
577
+
578
+ # set the HTTP header `Accept`
579
+ if 'Accept' not in _header_params:
580
+ _header_params['Accept'] = self.api_client.select_header_accept(
581
+ [
582
+ 'application/json'
583
+ ]
584
+ )
585
+
586
+
587
+ # authentication setting
588
+ _auth_settings: List[str] = [
589
+ 'tokenAuth'
590
+ ]
591
+
592
+ return self.api_client.param_serialize(
593
+ method='GET',
594
+ resource_path='/commerce',
595
+ path_params=_path_params,
596
+ query_params=_query_params,
597
+ header_params=_header_params,
598
+ body=_body_params,
599
+ post_params=_form_params,
600
+ files=_files,
601
+ auth_settings=_auth_settings,
602
+ collection_formats=_collection_formats,
603
+ _host=_host,
604
+ _request_auth=_request_auth
605
+ )
606
+
607
+