pingram-python 0.1.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 (189) hide show
  1. pingram/__init__.py +395 -0
  2. pingram/api/__init__.py +21 -0
  3. pingram/api/account_api.py +2198 -0
  4. pingram/api/addresses_api.py +860 -0
  5. pingram/api/components_api.py +1681 -0
  6. pingram/api/default_api.py +320 -0
  7. pingram/api/domains_api.py +849 -0
  8. pingram/api/editor_api.py +320 -0
  9. pingram/api/environments_api.py +878 -0
  10. pingram/api/health_api.py +287 -0
  11. pingram/api/insights_api.py +321 -0
  12. pingram/api/keys_api.py +849 -0
  13. pingram/api/logs_api.py +1632 -0
  14. pingram/api/members_api.py +1780 -0
  15. pingram/api/sender_api.py +892 -0
  16. pingram/api/templates_api.py +1889 -0
  17. pingram/api/types_api.py +1411 -0
  18. pingram/api/user_api.py +2534 -0
  19. pingram/api/users_api.py +936 -0
  20. pingram/api_client.py +807 -0
  21. pingram/api_response.py +21 -0
  22. pingram/client_wrapper.py +357 -0
  23. pingram/configuration.py +623 -0
  24. pingram/exceptions.py +219 -0
  25. pingram/models/__init__.py +173 -0
  26. pingram/models/account_addresses_response.py +95 -0
  27. pingram/models/account_addresses_response_addresses_inner.py +104 -0
  28. pingram/models/account_get_response.py +143 -0
  29. pingram/models/account_get_response_pending_downgrade_usage_limit.py +99 -0
  30. pingram/models/address_response.py +91 -0
  31. pingram/models/auto_join_get_response.py +89 -0
  32. pingram/models/auto_join_post_response.py +89 -0
  33. pingram/models/auto_join_request_body.py +87 -0
  34. pingram/models/bee_token_v2.py +89 -0
  35. pingram/models/billing_post_request_body.py +91 -0
  36. pingram/models/billing_post_response_body.py +149 -0
  37. pingram/models/billing_post_response_body_pending_downgrade_usage_limit.py +99 -0
  38. pingram/models/channels_enum.py +42 -0
  39. pingram/models/create_account_request_body.py +87 -0
  40. pingram/models/create_account_response.py +89 -0
  41. pingram/models/create_address_request.py +91 -0
  42. pingram/models/create_key_request.py +98 -0
  43. pingram/models/create_key_response.py +104 -0
  44. pingram/models/delete_key_response.py +87 -0
  45. pingram/models/delete_user_response.py +87 -0
  46. pingram/models/email_auth_token_post_request.py +87 -0
  47. pingram/models/email_component_patch_request.py +93 -0
  48. pingram/models/email_component_post_request.py +95 -0
  49. pingram/models/email_component_response.py +120 -0
  50. pingram/models/email_component_response_referenced_by_inner.py +92 -0
  51. pingram/models/environment.py +96 -0
  52. pingram/models/environment_create_request.py +87 -0
  53. pingram/models/environment_patch_request.py +94 -0
  54. pingram/models/get_account_metadata_response.py +91 -0
  55. pingram/models/get_account_metadata_response_user_account_metadata.py +91 -0
  56. pingram/models/get_email_components_response_inner.py +120 -0
  57. pingram/models/get_environments_response_inner.py +96 -0
  58. pingram/models/get_inapp_notifications_response.py +95 -0
  59. pingram/models/get_inapp_notifications_response_notifications_inner.py +137 -0
  60. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.py +106 -0
  61. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.py +93 -0
  62. pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.py +87 -0
  63. pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.py +89 -0
  64. pingram/models/get_inapp_notifications_response_notifications_inner_template.py +136 -0
  65. pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.py +98 -0
  66. pingram/models/get_keys_response.py +95 -0
  67. pingram/models/get_keys_response_keys_inner.py +110 -0
  68. pingram/models/get_logs_response.py +97 -0
  69. pingram/models/get_logs_response_messages_inner.py +141 -0
  70. pingram/models/get_logs_response_messages_inner_attachments_inner.py +93 -0
  71. pingram/models/get_members_response_inner.py +95 -0
  72. pingram/models/get_metrics_response_inner.py +116 -0
  73. pingram/models/get_metrics_response_inner_messages_inner.py +89 -0
  74. pingram/models/get_notifications_response_inner.py +126 -0
  75. pingram/models/get_notifications_response_inner_deduplication.py +87 -0
  76. pingram/models/get_notifications_response_inner_options.py +122 -0
  77. pingram/models/get_notifications_response_inner_options_email.py +128 -0
  78. pingram/models/get_notifications_response_inner_options_email_daily.py +89 -0
  79. pingram/models/get_notifications_response_inner_options_email_monthly.py +101 -0
  80. pingram/models/get_notifications_response_inner_options_email_weekly.py +91 -0
  81. pingram/models/get_notifications_response_inner_templates_inner.py +90 -0
  82. pingram/models/get_notifications_response_inner_throttling.py +111 -0
  83. pingram/models/get_senders_response_inner.py +128 -0
  84. pingram/models/get_templates_response.py +136 -0
  85. pingram/models/get_users_response.py +99 -0
  86. pingram/models/get_users_response_users_inner.py +133 -0
  87. pingram/models/get_users_response_users_inner_email_suppression_status.py +96 -0
  88. pingram/models/get_users_response_users_inner_push_tokens_inner.py +104 -0
  89. pingram/models/get_users_response_users_inner_push_tokens_inner_device.py +97 -0
  90. pingram/models/get_users_response_users_inner_slack_token.py +140 -0
  91. pingram/models/get_users_response_users_inner_slack_token_authed_user.py +97 -0
  92. pingram/models/get_users_response_users_inner_slack_token_enterprise.py +89 -0
  93. pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.py +93 -0
  94. pingram/models/get_users_response_users_inner_slack_token_response_metadata.py +97 -0
  95. pingram/models/get_users_response_users_inner_web_push_tokens_inner.py +91 -0
  96. pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.py +93 -0
  97. pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.py +89 -0
  98. pingram/models/in_app_notification_patch_request.py +112 -0
  99. pingram/models/in_app_notification_unread_clear_request.py +89 -0
  100. pingram/models/inapp_unread_count_response.py +87 -0
  101. pingram/models/inbound_request_body.py +138 -0
  102. pingram/models/inbound_response_body.py +104 -0
  103. pingram/models/inbound_response_body_results_inner.py +103 -0
  104. pingram/models/ingishts_post_request.py +121 -0
  105. pingram/models/ingishts_post_request_label_options.py +87 -0
  106. pingram/models/ingishts_post_request_metric_data_queries_inner.py +103 -0
  107. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.py +107 -0
  108. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.py +99 -0
  109. pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.py +89 -0
  110. pingram/models/intercom_webhook.py +106 -0
  111. pingram/models/intercom_webhook_data.py +91 -0
  112. pingram/models/intercom_webhook_data_item.py +136 -0
  113. pingram/models/intercom_webhook_data_item_any_of.py +140 -0
  114. pingram/models/intercom_webhook_data_item_any_of_contacts.py +104 -0
  115. pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.py +91 -0
  116. pingram/models/intercom_webhook_data_item_any_of_source.py +101 -0
  117. pingram/models/intercom_webhook_data_item_any_of_source_author.py +93 -0
  118. pingram/models/invite_post_response.py +89 -0
  119. pingram/models/log_query_post_body.py +109 -0
  120. pingram/models/logs_bulk_request.py +87 -0
  121. pingram/models/logs_get_response.py +95 -0
  122. pingram/models/logs_get_response_logs_inner.py +627 -0
  123. pingram/models/logs_query_response.py +87 -0
  124. pingram/models/logs_query_result_response.py +101 -0
  125. pingram/models/logs_retention_response.py +87 -0
  126. pingram/models/logs_tail_response.py +95 -0
  127. pingram/models/member_invite_request.py +89 -0
  128. pingram/models/member_update_request.py +87 -0
  129. pingram/models/message_response.py +87 -0
  130. pingram/models/notification.py +126 -0
  131. pingram/models/notification_create_request.py +97 -0
  132. pingram/models/notification_patch_request.py +112 -0
  133. pingram/models/post_email_test_request.py +99 -0
  134. pingram/models/post_email_test_response.py +89 -0
  135. pingram/models/post_senders_request_body.py +87 -0
  136. pingram/models/post_user_request.py +121 -0
  137. pingram/models/sender_post_body.py +166 -0
  138. pingram/models/sender_post_body_email.py +95 -0
  139. pingram/models/sender_post_body_inapp.py +91 -0
  140. pingram/models/sender_post_body_mobile_push.py +89 -0
  141. pingram/models/sender_post_body_options.py +103 -0
  142. pingram/models/sender_post_body_options_apn.py +99 -0
  143. pingram/models/sender_post_body_options_email.py +107 -0
  144. pingram/models/sender_post_body_options_email_attachments_inner.py +134 -0
  145. pingram/models/sender_post_body_options_email_attachments_inner_any_of.py +89 -0
  146. pingram/models/sender_post_body_options_email_attachments_inner_any_of1.py +91 -0
  147. pingram/models/sender_post_body_options_fcm.py +91 -0
  148. pingram/models/sender_post_body_options_fcm_android.py +103 -0
  149. pingram/models/sender_post_body_slack.py +123 -0
  150. pingram/models/sender_post_body_slack_metadata.py +99 -0
  151. pingram/models/sender_post_body_slack_metadata_entities_inner.py +99 -0
  152. pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.py +89 -0
  153. pingram/models/sender_post_body_sms.py +93 -0
  154. pingram/models/sender_post_body_sms_auto_reply.py +87 -0
  155. pingram/models/sender_post_body_to.py +133 -0
  156. pingram/models/sender_post_body_user.py +133 -0
  157. pingram/models/sender_post_body_web_push.py +93 -0
  158. pingram/models/sender_post_response.py +89 -0
  159. pingram/models/set_default_template_request.py +97 -0
  160. pingram/models/slack_interactivity_response.py +87 -0
  161. pingram/models/slack_oauth_request.py +89 -0
  162. pingram/models/success_response.py +87 -0
  163. pingram/models/supabase_configure_request.py +93 -0
  164. pingram/models/supabase_configure_response.py +89 -0
  165. pingram/models/supabase_o_auth_request.py +91 -0
  166. pingram/models/supabase_o_auth_response.py +89 -0
  167. pingram/models/supabase_projects_response.py +95 -0
  168. pingram/models/supabase_projects_response_projects_inner.py +95 -0
  169. pingram/models/supabase_status_response.py +93 -0
  170. pingram/models/template.py +98 -0
  171. pingram/models/template_patch_request.py +134 -0
  172. pingram/models/template_patch_request_any_of.py +97 -0
  173. pingram/models/template_patch_request_any_of1.py +103 -0
  174. pingram/models/template_patch_request_any_of1_batch.py +91 -0
  175. pingram/models/template_patch_request_any_of1_instant.py +91 -0
  176. pingram/models/template_post_request.py +131 -0
  177. pingram/models/template_post_request_batch.py +91 -0
  178. pingram/models/template_post_request_instant.py +91 -0
  179. pingram/models/update_address_request.py +91 -0
  180. pingram/models/user.py +133 -0
  181. pingram/models/user_suppression_delete_response.py +91 -0
  182. pingram/models/webhook_response.py +104 -0
  183. pingram/py.typed +0 -0
  184. pingram/rest.py +199 -0
  185. pingram_python-0.1.0.dist-info/METADATA +69 -0
  186. pingram_python-0.1.0.dist-info/RECORD +189 -0
  187. pingram_python-0.1.0.dist-info/WHEEL +5 -0
  188. pingram_python-0.1.0.dist-info/licenses/LICENSE +21 -0
  189. pingram_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2534 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NotificationAPI
5
+
6
+ Internal API for notification delivery and management
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
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, StrictFloat, StrictInt, StrictStr
20
+ from typing import Optional, Union
21
+ from typing_extensions import Annotated
22
+ from pingram.models.get_account_metadata_response import GetAccountMetadataResponse
23
+ from pingram.models.get_inapp_notifications_response import GetInappNotificationsResponse
24
+ from pingram.models.in_app_notification_patch_request import InAppNotificationPatchRequest
25
+ from pingram.models.in_app_notification_unread_clear_request import InAppNotificationUnreadClearRequest
26
+ from pingram.models.inapp_unread_count_response import InappUnreadCountResponse
27
+ from pingram.models.post_user_request import PostUserRequest
28
+ from pingram.models.slack_oauth_request import SlackOauthRequest
29
+ from pingram.models.success_response import SuccessResponse
30
+ from pingram.models.user import User
31
+
32
+ from pingram.api_client import ApiClient, RequestSerialized
33
+ from pingram.api_response import ApiResponse
34
+ from pingram.rest import RESTResponseType
35
+
36
+
37
+ class UserApi:
38
+ """NOTE: This class is auto generated by OpenAPI Generator
39
+ Ref: https://openapi-generator.tech
40
+
41
+ Do not edit the class manually.
42
+ """
43
+
44
+ def __init__(self, api_client=None) -> None:
45
+ if api_client is None:
46
+ api_client = ApiClient.get_default()
47
+ self.api_client = api_client
48
+
49
+
50
+ @validate_call
51
+ async def user_generate_slack_oauth_path(
52
+ self,
53
+ user_id: Annotated[StrictStr, Field(description="User ID")],
54
+ slack_oauth_request: SlackOauthRequest,
55
+ _request_timeout: Union[
56
+ None,
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Tuple[
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Annotated[StrictFloat, Field(gt=0)]
61
+ ]
62
+ ] = None,
63
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
64
+ _content_type: Optional[StrictStr] = None,
65
+ _headers: Optional[Dict[StrictStr, Any]] = None,
66
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
67
+ ) -> None:
68
+ """Complete Slack OAuth flow and store access token for user
69
+
70
+
71
+ :param user_id: User ID (required)
72
+ :type user_id: str
73
+ :param slack_oauth_request: (required)
74
+ :type slack_oauth_request: SlackOauthRequest
75
+ :param _request_timeout: timeout setting for this request. If one
76
+ number provided, it will be total request
77
+ timeout. It can also be a pair (tuple) of
78
+ (connection, read) timeouts.
79
+ :type _request_timeout: int, tuple(int, int), optional
80
+ :param _request_auth: set to override the auth_settings for an a single
81
+ request; this effectively ignores the
82
+ authentication in the spec for a single request.
83
+ :type _request_auth: dict, optional
84
+ :param _content_type: force content-type for the request.
85
+ :type _content_type: str, Optional
86
+ :param _headers: set to override the headers for a single
87
+ request; this effectively ignores the headers
88
+ in the spec for a single request.
89
+ :type _headers: dict, optional
90
+ :param _host_index: set to override the host_index for a single
91
+ request; this effectively ignores the host_index
92
+ in the spec for a single request.
93
+ :type _host_index: int, optional
94
+ :return: Returns the result object.
95
+ """ # noqa: E501
96
+
97
+ _param = self._user_generate_slack_oauth_path_serialize(
98
+ user_id=user_id,
99
+ slack_oauth_request=slack_oauth_request,
100
+ _request_auth=_request_auth,
101
+ _content_type=_content_type,
102
+ _headers=_headers,
103
+ _host_index=_host_index
104
+ )
105
+
106
+ _response_types_map: Dict[str, Optional[str]] = {
107
+ '204': None,
108
+ '400': None,
109
+ '401': None,
110
+ '500': None,
111
+ }
112
+ response_data = await self.api_client.call_api(
113
+ *_param,
114
+ _request_timeout=_request_timeout
115
+ )
116
+ await response_data.read()
117
+ return self.api_client.response_deserialize(
118
+ response_data=response_data,
119
+ response_types_map=_response_types_map,
120
+ ).data
121
+
122
+
123
+ @validate_call
124
+ async def user_generate_slack_oauth_path_with_http_info(
125
+ self,
126
+ user_id: Annotated[StrictStr, Field(description="User ID")],
127
+ slack_oauth_request: SlackOauthRequest,
128
+ _request_timeout: Union[
129
+ None,
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Tuple[
132
+ Annotated[StrictFloat, Field(gt=0)],
133
+ Annotated[StrictFloat, Field(gt=0)]
134
+ ]
135
+ ] = None,
136
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
137
+ _content_type: Optional[StrictStr] = None,
138
+ _headers: Optional[Dict[StrictStr, Any]] = None,
139
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
140
+ ) -> ApiResponse[None]:
141
+ """Complete Slack OAuth flow and store access token for user
142
+
143
+
144
+ :param user_id: User ID (required)
145
+ :type user_id: str
146
+ :param slack_oauth_request: (required)
147
+ :type slack_oauth_request: SlackOauthRequest
148
+ :param _request_timeout: timeout setting for this request. If one
149
+ number provided, it will be total request
150
+ timeout. It can also be a pair (tuple) of
151
+ (connection, read) timeouts.
152
+ :type _request_timeout: int, tuple(int, int), optional
153
+ :param _request_auth: set to override the auth_settings for an a single
154
+ request; this effectively ignores the
155
+ authentication in the spec for a single request.
156
+ :type _request_auth: dict, optional
157
+ :param _content_type: force content-type for the request.
158
+ :type _content_type: str, Optional
159
+ :param _headers: set to override the headers for a single
160
+ request; this effectively ignores the headers
161
+ in the spec for a single request.
162
+ :type _headers: dict, optional
163
+ :param _host_index: set to override the host_index for a single
164
+ request; this effectively ignores the host_index
165
+ in the spec for a single request.
166
+ :type _host_index: int, optional
167
+ :return: Returns the result object.
168
+ """ # noqa: E501
169
+
170
+ _param = self._user_generate_slack_oauth_path_serialize(
171
+ user_id=user_id,
172
+ slack_oauth_request=slack_oauth_request,
173
+ _request_auth=_request_auth,
174
+ _content_type=_content_type,
175
+ _headers=_headers,
176
+ _host_index=_host_index
177
+ )
178
+
179
+ _response_types_map: Dict[str, Optional[str]] = {
180
+ '204': None,
181
+ '400': None,
182
+ '401': None,
183
+ '500': None,
184
+ }
185
+ response_data = await self.api_client.call_api(
186
+ *_param,
187
+ _request_timeout=_request_timeout
188
+ )
189
+ await response_data.read()
190
+ return self.api_client.response_deserialize(
191
+ response_data=response_data,
192
+ response_types_map=_response_types_map,
193
+ )
194
+
195
+
196
+ @validate_call
197
+ async def user_generate_slack_oauth_path_without_preload_content(
198
+ self,
199
+ user_id: Annotated[StrictStr, Field(description="User ID")],
200
+ slack_oauth_request: SlackOauthRequest,
201
+ _request_timeout: Union[
202
+ None,
203
+ Annotated[StrictFloat, Field(gt=0)],
204
+ Tuple[
205
+ Annotated[StrictFloat, Field(gt=0)],
206
+ Annotated[StrictFloat, Field(gt=0)]
207
+ ]
208
+ ] = None,
209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
210
+ _content_type: Optional[StrictStr] = None,
211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
213
+ ) -> RESTResponseType:
214
+ """Complete Slack OAuth flow and store access token for user
215
+
216
+
217
+ :param user_id: User ID (required)
218
+ :type user_id: str
219
+ :param slack_oauth_request: (required)
220
+ :type slack_oauth_request: SlackOauthRequest
221
+ :param _request_timeout: timeout setting for this request. If one
222
+ number provided, it will be total request
223
+ timeout. It can also be a pair (tuple) of
224
+ (connection, read) timeouts.
225
+ :type _request_timeout: int, tuple(int, int), optional
226
+ :param _request_auth: set to override the auth_settings for an a single
227
+ request; this effectively ignores the
228
+ authentication in the spec for a single request.
229
+ :type _request_auth: dict, optional
230
+ :param _content_type: force content-type for the request.
231
+ :type _content_type: str, Optional
232
+ :param _headers: set to override the headers for a single
233
+ request; this effectively ignores the headers
234
+ in the spec for a single request.
235
+ :type _headers: dict, optional
236
+ :param _host_index: set to override the host_index for a single
237
+ request; this effectively ignores the host_index
238
+ in the spec for a single request.
239
+ :type _host_index: int, optional
240
+ :return: Returns the result object.
241
+ """ # noqa: E501
242
+
243
+ _param = self._user_generate_slack_oauth_path_serialize(
244
+ user_id=user_id,
245
+ slack_oauth_request=slack_oauth_request,
246
+ _request_auth=_request_auth,
247
+ _content_type=_content_type,
248
+ _headers=_headers,
249
+ _host_index=_host_index
250
+ )
251
+
252
+ _response_types_map: Dict[str, Optional[str]] = {
253
+ '204': None,
254
+ '400': None,
255
+ '401': None,
256
+ '500': None,
257
+ }
258
+ response_data = await self.api_client.call_api(
259
+ *_param,
260
+ _request_timeout=_request_timeout
261
+ )
262
+ return response_data.response
263
+
264
+
265
+ def _user_generate_slack_oauth_path_serialize(
266
+ self,
267
+ user_id,
268
+ slack_oauth_request,
269
+ _request_auth,
270
+ _content_type,
271
+ _headers,
272
+ _host_index,
273
+ ) -> RequestSerialized:
274
+
275
+ _host = None
276
+
277
+ _collection_formats: Dict[str, str] = {
278
+ }
279
+
280
+ _path_params: Dict[str, str] = {}
281
+ _query_params: List[Tuple[str, str]] = []
282
+ _header_params: Dict[str, Optional[str]] = _headers or {}
283
+ _form_params: List[Tuple[str, str]] = []
284
+ _files: Dict[
285
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
286
+ ] = {}
287
+ _body_params: Optional[bytes] = None
288
+
289
+ # process the path parameters
290
+ if user_id is not None:
291
+ _path_params['userId'] = user_id
292
+ # process the query parameters
293
+ # process the header parameters
294
+ # process the form parameters
295
+ # process the body parameter
296
+ if slack_oauth_request is not None:
297
+ _body_params = slack_oauth_request
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
+ 'endUserHashed',
318
+ 'endUser',
319
+ 'apiKey',
320
+ 'clientCredentials'
321
+ ]
322
+
323
+ return self.api_client.param_serialize(
324
+ method='POST',
325
+ resource_path='/users/{userId}/slack-oauth',
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
+ async def user_get_account_metadata(
343
+ self,
344
+ _request_timeout: Union[
345
+ None,
346
+ Annotated[StrictFloat, Field(gt=0)],
347
+ Tuple[
348
+ Annotated[StrictFloat, Field(gt=0)],
349
+ Annotated[StrictFloat, Field(gt=0)]
350
+ ]
351
+ ] = None,
352
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
353
+ _content_type: Optional[StrictStr] = None,
354
+ _headers: Optional[Dict[StrictStr, Any]] = None,
355
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
356
+ ) -> GetAccountMetadataResponse:
357
+ """Get account-level metadata including logo, VAPID key, and web push status
358
+
359
+
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._user_get_account_metadata_serialize(
383
+ _request_auth=_request_auth,
384
+ _content_type=_content_type,
385
+ _headers=_headers,
386
+ _host_index=_host_index
387
+ )
388
+
389
+ _response_types_map: Dict[str, Optional[str]] = {
390
+ '200': "GetAccountMetadataResponse",
391
+ '400': None,
392
+ '401': None,
393
+ '500': None,
394
+ }
395
+ response_data = await self.api_client.call_api(
396
+ *_param,
397
+ _request_timeout=_request_timeout
398
+ )
399
+ await response_data.read()
400
+ return self.api_client.response_deserialize(
401
+ response_data=response_data,
402
+ response_types_map=_response_types_map,
403
+ ).data
404
+
405
+
406
+ @validate_call
407
+ async def user_get_account_metadata_with_http_info(
408
+ self,
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Annotated[StrictFloat, Field(gt=0)]
415
+ ]
416
+ ] = None,
417
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
418
+ _content_type: Optional[StrictStr] = None,
419
+ _headers: Optional[Dict[StrictStr, Any]] = None,
420
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
421
+ ) -> ApiResponse[GetAccountMetadataResponse]:
422
+ """Get account-level metadata including logo, VAPID key, and web push status
423
+
424
+
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501
446
+
447
+ _param = self._user_get_account_metadata_serialize(
448
+ _request_auth=_request_auth,
449
+ _content_type=_content_type,
450
+ _headers=_headers,
451
+ _host_index=_host_index
452
+ )
453
+
454
+ _response_types_map: Dict[str, Optional[str]] = {
455
+ '200': "GetAccountMetadataResponse",
456
+ '400': None,
457
+ '401': None,
458
+ '500': None,
459
+ }
460
+ response_data = await self.api_client.call_api(
461
+ *_param,
462
+ _request_timeout=_request_timeout
463
+ )
464
+ await response_data.read()
465
+ return self.api_client.response_deserialize(
466
+ response_data=response_data,
467
+ response_types_map=_response_types_map,
468
+ )
469
+
470
+
471
+ @validate_call
472
+ async def user_get_account_metadata_without_preload_content(
473
+ self,
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 account-level metadata including logo, VAPID key, and web push status
488
+
489
+
490
+ :param _request_timeout: timeout setting for this request. If one
491
+ number provided, it will be total request
492
+ timeout. It can also be a pair (tuple) of
493
+ (connection, read) timeouts.
494
+ :type _request_timeout: int, tuple(int, int), optional
495
+ :param _request_auth: set to override the auth_settings for an a single
496
+ request; this effectively ignores the
497
+ authentication in the spec for a single request.
498
+ :type _request_auth: dict, optional
499
+ :param _content_type: force content-type for the request.
500
+ :type _content_type: str, Optional
501
+ :param _headers: set to override the headers for a single
502
+ request; this effectively ignores the headers
503
+ in the spec for a single request.
504
+ :type _headers: dict, optional
505
+ :param _host_index: set to override the host_index for a single
506
+ request; this effectively ignores the host_index
507
+ in the spec for a single request.
508
+ :type _host_index: int, optional
509
+ :return: Returns the result object.
510
+ """ # noqa: E501
511
+
512
+ _param = self._user_get_account_metadata_serialize(
513
+ _request_auth=_request_auth,
514
+ _content_type=_content_type,
515
+ _headers=_headers,
516
+ _host_index=_host_index
517
+ )
518
+
519
+ _response_types_map: Dict[str, Optional[str]] = {
520
+ '200': "GetAccountMetadataResponse",
521
+ '400': None,
522
+ '401': None,
523
+ '500': None,
524
+ }
525
+ response_data = await self.api_client.call_api(
526
+ *_param,
527
+ _request_timeout=_request_timeout
528
+ )
529
+ return response_data.response
530
+
531
+
532
+ def _user_get_account_metadata_serialize(
533
+ self,
534
+ _request_auth,
535
+ _content_type,
536
+ _headers,
537
+ _host_index,
538
+ ) -> RequestSerialized:
539
+
540
+ _host = None
541
+
542
+ _collection_formats: Dict[str, str] = {
543
+ }
544
+
545
+ _path_params: Dict[str, str] = {}
546
+ _query_params: List[Tuple[str, str]] = []
547
+ _header_params: Dict[str, Optional[str]] = _headers or {}
548
+ _form_params: List[Tuple[str, str]] = []
549
+ _files: Dict[
550
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
551
+ ] = {}
552
+ _body_params: Optional[bytes] = None
553
+
554
+ # process the path parameters
555
+ # process the query parameters
556
+ # process the header parameters
557
+ # process the form parameters
558
+ # process the body parameter
559
+
560
+
561
+ # set the HTTP header `Accept`
562
+ if 'Accept' not in _header_params:
563
+ _header_params['Accept'] = self.api_client.select_header_accept(
564
+ [
565
+ 'application/json'
566
+ ]
567
+ )
568
+
569
+
570
+ # authentication setting
571
+ _auth_settings: List[str] = [
572
+ 'endUserHashed',
573
+ 'endUser',
574
+ 'apiKey',
575
+ 'clientCredentials'
576
+ ]
577
+
578
+ return self.api_client.param_serialize(
579
+ method='GET',
580
+ resource_path='/users/account-metadata',
581
+ path_params=_path_params,
582
+ query_params=_query_params,
583
+ header_params=_header_params,
584
+ body=_body_params,
585
+ post_params=_form_params,
586
+ files=_files,
587
+ auth_settings=_auth_settings,
588
+ collection_formats=_collection_formats,
589
+ _host=_host,
590
+ _request_auth=_request_auth
591
+ )
592
+
593
+
594
+
595
+
596
+ @validate_call
597
+ async def user_get_available_slack_channels(
598
+ self,
599
+ user_id: Annotated[StrictStr, Field(description="User ID")],
600
+ _request_timeout: Union[
601
+ None,
602
+ Annotated[StrictFloat, Field(gt=0)],
603
+ Tuple[
604
+ Annotated[StrictFloat, Field(gt=0)],
605
+ Annotated[StrictFloat, Field(gt=0)]
606
+ ]
607
+ ] = None,
608
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
609
+ _content_type: Optional[StrictStr] = None,
610
+ _headers: Optional[Dict[StrictStr, Any]] = None,
611
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
612
+ ) -> None:
613
+ """Get list of Slack channels and users for the authenticated user
614
+
615
+
616
+ :param user_id: User ID (required)
617
+ :type user_id: str
618
+ :param _request_timeout: timeout setting for this request. If one
619
+ number provided, it will be total request
620
+ timeout. It can also be a pair (tuple) of
621
+ (connection, read) timeouts.
622
+ :type _request_timeout: int, tuple(int, int), optional
623
+ :param _request_auth: set to override the auth_settings for an a single
624
+ request; this effectively ignores the
625
+ authentication in the spec for a single request.
626
+ :type _request_auth: dict, optional
627
+ :param _content_type: force content-type for the request.
628
+ :type _content_type: str, Optional
629
+ :param _headers: set to override the headers for a single
630
+ request; this effectively ignores the headers
631
+ in the spec for a single request.
632
+ :type _headers: dict, optional
633
+ :param _host_index: set to override the host_index for a single
634
+ request; this effectively ignores the host_index
635
+ in the spec for a single request.
636
+ :type _host_index: int, optional
637
+ :return: Returns the result object.
638
+ """ # noqa: E501
639
+
640
+ _param = self._user_get_available_slack_channels_serialize(
641
+ user_id=user_id,
642
+ _request_auth=_request_auth,
643
+ _content_type=_content_type,
644
+ _headers=_headers,
645
+ _host_index=_host_index
646
+ )
647
+
648
+ _response_types_map: Dict[str, Optional[str]] = {
649
+ '204': None,
650
+ '400': None,
651
+ '401': None,
652
+ '500': None,
653
+ }
654
+ response_data = await self.api_client.call_api(
655
+ *_param,
656
+ _request_timeout=_request_timeout
657
+ )
658
+ await response_data.read()
659
+ return self.api_client.response_deserialize(
660
+ response_data=response_data,
661
+ response_types_map=_response_types_map,
662
+ ).data
663
+
664
+
665
+ @validate_call
666
+ async def user_get_available_slack_channels_with_http_info(
667
+ self,
668
+ user_id: Annotated[StrictStr, Field(description="User ID")],
669
+ _request_timeout: Union[
670
+ None,
671
+ Annotated[StrictFloat, Field(gt=0)],
672
+ Tuple[
673
+ Annotated[StrictFloat, Field(gt=0)],
674
+ Annotated[StrictFloat, Field(gt=0)]
675
+ ]
676
+ ] = None,
677
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
678
+ _content_type: Optional[StrictStr] = None,
679
+ _headers: Optional[Dict[StrictStr, Any]] = None,
680
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
681
+ ) -> ApiResponse[None]:
682
+ """Get list of Slack channels and users for the authenticated user
683
+
684
+
685
+ :param user_id: User ID (required)
686
+ :type user_id: str
687
+ :param _request_timeout: timeout setting for this request. If one
688
+ number provided, it will be total request
689
+ timeout. It can also be a pair (tuple) of
690
+ (connection, read) timeouts.
691
+ :type _request_timeout: int, tuple(int, int), optional
692
+ :param _request_auth: set to override the auth_settings for an a single
693
+ request; this effectively ignores the
694
+ authentication in the spec for a single request.
695
+ :type _request_auth: dict, optional
696
+ :param _content_type: force content-type for the request.
697
+ :type _content_type: str, Optional
698
+ :param _headers: set to override the headers for a single
699
+ request; this effectively ignores the headers
700
+ in the spec for a single request.
701
+ :type _headers: dict, optional
702
+ :param _host_index: set to override the host_index for a single
703
+ request; this effectively ignores the host_index
704
+ in the spec for a single request.
705
+ :type _host_index: int, optional
706
+ :return: Returns the result object.
707
+ """ # noqa: E501
708
+
709
+ _param = self._user_get_available_slack_channels_serialize(
710
+ user_id=user_id,
711
+ _request_auth=_request_auth,
712
+ _content_type=_content_type,
713
+ _headers=_headers,
714
+ _host_index=_host_index
715
+ )
716
+
717
+ _response_types_map: Dict[str, Optional[str]] = {
718
+ '204': None,
719
+ '400': None,
720
+ '401': None,
721
+ '500': None,
722
+ }
723
+ response_data = await self.api_client.call_api(
724
+ *_param,
725
+ _request_timeout=_request_timeout
726
+ )
727
+ await response_data.read()
728
+ return self.api_client.response_deserialize(
729
+ response_data=response_data,
730
+ response_types_map=_response_types_map,
731
+ )
732
+
733
+
734
+ @validate_call
735
+ async def user_get_available_slack_channels_without_preload_content(
736
+ self,
737
+ user_id: Annotated[StrictStr, Field(description="User ID")],
738
+ _request_timeout: Union[
739
+ None,
740
+ Annotated[StrictFloat, Field(gt=0)],
741
+ Tuple[
742
+ Annotated[StrictFloat, Field(gt=0)],
743
+ Annotated[StrictFloat, Field(gt=0)]
744
+ ]
745
+ ] = None,
746
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
747
+ _content_type: Optional[StrictStr] = None,
748
+ _headers: Optional[Dict[StrictStr, Any]] = None,
749
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
750
+ ) -> RESTResponseType:
751
+ """Get list of Slack channels and users for the authenticated user
752
+
753
+
754
+ :param user_id: User ID (required)
755
+ :type user_id: str
756
+ :param _request_timeout: timeout setting for this request. If one
757
+ number provided, it will be total request
758
+ timeout. It can also be a pair (tuple) of
759
+ (connection, read) timeouts.
760
+ :type _request_timeout: int, tuple(int, int), optional
761
+ :param _request_auth: set to override the auth_settings for an a single
762
+ request; this effectively ignores the
763
+ authentication in the spec for a single request.
764
+ :type _request_auth: dict, optional
765
+ :param _content_type: force content-type for the request.
766
+ :type _content_type: str, Optional
767
+ :param _headers: set to override the headers for a single
768
+ request; this effectively ignores the headers
769
+ in the spec for a single request.
770
+ :type _headers: dict, optional
771
+ :param _host_index: set to override the host_index for a single
772
+ request; this effectively ignores the host_index
773
+ in the spec for a single request.
774
+ :type _host_index: int, optional
775
+ :return: Returns the result object.
776
+ """ # noqa: E501
777
+
778
+ _param = self._user_get_available_slack_channels_serialize(
779
+ user_id=user_id,
780
+ _request_auth=_request_auth,
781
+ _content_type=_content_type,
782
+ _headers=_headers,
783
+ _host_index=_host_index
784
+ )
785
+
786
+ _response_types_map: Dict[str, Optional[str]] = {
787
+ '204': None,
788
+ '400': None,
789
+ '401': None,
790
+ '500': None,
791
+ }
792
+ response_data = await self.api_client.call_api(
793
+ *_param,
794
+ _request_timeout=_request_timeout
795
+ )
796
+ return response_data.response
797
+
798
+
799
+ def _user_get_available_slack_channels_serialize(
800
+ self,
801
+ user_id,
802
+ _request_auth,
803
+ _content_type,
804
+ _headers,
805
+ _host_index,
806
+ ) -> RequestSerialized:
807
+
808
+ _host = None
809
+
810
+ _collection_formats: Dict[str, str] = {
811
+ }
812
+
813
+ _path_params: Dict[str, str] = {}
814
+ _query_params: List[Tuple[str, str]] = []
815
+ _header_params: Dict[str, Optional[str]] = _headers or {}
816
+ _form_params: List[Tuple[str, str]] = []
817
+ _files: Dict[
818
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
819
+ ] = {}
820
+ _body_params: Optional[bytes] = None
821
+
822
+ # process the path parameters
823
+ if user_id is not None:
824
+ _path_params['userId'] = user_id
825
+ # process the query parameters
826
+ # process the header parameters
827
+ # process the form parameters
828
+ # process the body parameter
829
+
830
+
831
+
832
+
833
+ # authentication setting
834
+ _auth_settings: List[str] = [
835
+ 'endUserHashed',
836
+ 'endUser',
837
+ 'apiKey',
838
+ 'clientCredentials'
839
+ ]
840
+
841
+ return self.api_client.param_serialize(
842
+ method='GET',
843
+ resource_path='/users/{userId}/slack-channels',
844
+ path_params=_path_params,
845
+ query_params=_query_params,
846
+ header_params=_header_params,
847
+ body=_body_params,
848
+ post_params=_form_params,
849
+ files=_files,
850
+ auth_settings=_auth_settings,
851
+ collection_formats=_collection_formats,
852
+ _host=_host,
853
+ _request_auth=_request_auth
854
+ )
855
+
856
+
857
+
858
+
859
+ @validate_call
860
+ async def user_get_in_app_notifications(
861
+ self,
862
+ before: Annotated[Optional[StrictStr], Field(description="Timestamp or ISO date to fetch notifications before")] = None,
863
+ count: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of notifications to return (default 10)")] = None,
864
+ _request_timeout: Union[
865
+ None,
866
+ Annotated[StrictFloat, Field(gt=0)],
867
+ Tuple[
868
+ Annotated[StrictFloat, Field(gt=0)],
869
+ Annotated[StrictFloat, Field(gt=0)]
870
+ ]
871
+ ] = None,
872
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
873
+ _content_type: Optional[StrictStr] = None,
874
+ _headers: Optional[Dict[StrictStr, Any]] = None,
875
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
876
+ ) -> GetInappNotificationsResponse:
877
+ """Get in-app notifications for a user
878
+
879
+
880
+ :param before: Timestamp or ISO date to fetch notifications before
881
+ :type before: str
882
+ :param count: Number of notifications to return (default 10)
883
+ :type count: float
884
+ :param _request_timeout: timeout setting for this request. If one
885
+ number provided, it will be total request
886
+ timeout. It can also be a pair (tuple) of
887
+ (connection, read) timeouts.
888
+ :type _request_timeout: int, tuple(int, int), optional
889
+ :param _request_auth: set to override the auth_settings for an a single
890
+ request; this effectively ignores the
891
+ authentication in the spec for a single request.
892
+ :type _request_auth: dict, optional
893
+ :param _content_type: force content-type for the request.
894
+ :type _content_type: str, Optional
895
+ :param _headers: set to override the headers for a single
896
+ request; this effectively ignores the headers
897
+ in the spec for a single request.
898
+ :type _headers: dict, optional
899
+ :param _host_index: set to override the host_index for a single
900
+ request; this effectively ignores the host_index
901
+ in the spec for a single request.
902
+ :type _host_index: int, optional
903
+ :return: Returns the result object.
904
+ """ # noqa: E501
905
+
906
+ _param = self._user_get_in_app_notifications_serialize(
907
+ before=before,
908
+ count=count,
909
+ _request_auth=_request_auth,
910
+ _content_type=_content_type,
911
+ _headers=_headers,
912
+ _host_index=_host_index
913
+ )
914
+
915
+ _response_types_map: Dict[str, Optional[str]] = {
916
+ '200': "GetInappNotificationsResponse",
917
+ '400': None,
918
+ '401': None,
919
+ '500': None,
920
+ }
921
+ response_data = await self.api_client.call_api(
922
+ *_param,
923
+ _request_timeout=_request_timeout
924
+ )
925
+ await response_data.read()
926
+ return self.api_client.response_deserialize(
927
+ response_data=response_data,
928
+ response_types_map=_response_types_map,
929
+ ).data
930
+
931
+
932
+ @validate_call
933
+ async def user_get_in_app_notifications_with_http_info(
934
+ self,
935
+ before: Annotated[Optional[StrictStr], Field(description="Timestamp or ISO date to fetch notifications before")] = None,
936
+ count: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of notifications to return (default 10)")] = None,
937
+ _request_timeout: Union[
938
+ None,
939
+ Annotated[StrictFloat, Field(gt=0)],
940
+ Tuple[
941
+ Annotated[StrictFloat, Field(gt=0)],
942
+ Annotated[StrictFloat, Field(gt=0)]
943
+ ]
944
+ ] = None,
945
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
946
+ _content_type: Optional[StrictStr] = None,
947
+ _headers: Optional[Dict[StrictStr, Any]] = None,
948
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
949
+ ) -> ApiResponse[GetInappNotificationsResponse]:
950
+ """Get in-app notifications for a user
951
+
952
+
953
+ :param before: Timestamp or ISO date to fetch notifications before
954
+ :type before: str
955
+ :param count: Number of notifications to return (default 10)
956
+ :type count: float
957
+ :param _request_timeout: timeout setting for this request. If one
958
+ number provided, it will be total request
959
+ timeout. It can also be a pair (tuple) of
960
+ (connection, read) timeouts.
961
+ :type _request_timeout: int, tuple(int, int), optional
962
+ :param _request_auth: set to override the auth_settings for an a single
963
+ request; this effectively ignores the
964
+ authentication in the spec for a single request.
965
+ :type _request_auth: dict, optional
966
+ :param _content_type: force content-type for the request.
967
+ :type _content_type: str, Optional
968
+ :param _headers: set to override the headers for a single
969
+ request; this effectively ignores the headers
970
+ in the spec for a single request.
971
+ :type _headers: dict, optional
972
+ :param _host_index: set to override the host_index for a single
973
+ request; this effectively ignores the host_index
974
+ in the spec for a single request.
975
+ :type _host_index: int, optional
976
+ :return: Returns the result object.
977
+ """ # noqa: E501
978
+
979
+ _param = self._user_get_in_app_notifications_serialize(
980
+ before=before,
981
+ count=count,
982
+ _request_auth=_request_auth,
983
+ _content_type=_content_type,
984
+ _headers=_headers,
985
+ _host_index=_host_index
986
+ )
987
+
988
+ _response_types_map: Dict[str, Optional[str]] = {
989
+ '200': "GetInappNotificationsResponse",
990
+ '400': None,
991
+ '401': None,
992
+ '500': None,
993
+ }
994
+ response_data = await self.api_client.call_api(
995
+ *_param,
996
+ _request_timeout=_request_timeout
997
+ )
998
+ await response_data.read()
999
+ return self.api_client.response_deserialize(
1000
+ response_data=response_data,
1001
+ response_types_map=_response_types_map,
1002
+ )
1003
+
1004
+
1005
+ @validate_call
1006
+ async def user_get_in_app_notifications_without_preload_content(
1007
+ self,
1008
+ before: Annotated[Optional[StrictStr], Field(description="Timestamp or ISO date to fetch notifications before")] = None,
1009
+ count: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of notifications to return (default 10)")] = None,
1010
+ _request_timeout: Union[
1011
+ None,
1012
+ Annotated[StrictFloat, Field(gt=0)],
1013
+ Tuple[
1014
+ Annotated[StrictFloat, Field(gt=0)],
1015
+ Annotated[StrictFloat, Field(gt=0)]
1016
+ ]
1017
+ ] = None,
1018
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1019
+ _content_type: Optional[StrictStr] = None,
1020
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1021
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1022
+ ) -> RESTResponseType:
1023
+ """Get in-app notifications for a user
1024
+
1025
+
1026
+ :param before: Timestamp or ISO date to fetch notifications before
1027
+ :type before: str
1028
+ :param count: Number of notifications to return (default 10)
1029
+ :type count: float
1030
+ :param _request_timeout: timeout setting for this request. If one
1031
+ number provided, it will be total request
1032
+ timeout. It can also be a pair (tuple) of
1033
+ (connection, read) timeouts.
1034
+ :type _request_timeout: int, tuple(int, int), optional
1035
+ :param _request_auth: set to override the auth_settings for an a single
1036
+ request; this effectively ignores the
1037
+ authentication in the spec for a single request.
1038
+ :type _request_auth: dict, optional
1039
+ :param _content_type: force content-type for the request.
1040
+ :type _content_type: str, Optional
1041
+ :param _headers: set to override the headers for a single
1042
+ request; this effectively ignores the headers
1043
+ in the spec for a single request.
1044
+ :type _headers: dict, optional
1045
+ :param _host_index: set to override the host_index for a single
1046
+ request; this effectively ignores the host_index
1047
+ in the spec for a single request.
1048
+ :type _host_index: int, optional
1049
+ :return: Returns the result object.
1050
+ """ # noqa: E501
1051
+
1052
+ _param = self._user_get_in_app_notifications_serialize(
1053
+ before=before,
1054
+ count=count,
1055
+ _request_auth=_request_auth,
1056
+ _content_type=_content_type,
1057
+ _headers=_headers,
1058
+ _host_index=_host_index
1059
+ )
1060
+
1061
+ _response_types_map: Dict[str, Optional[str]] = {
1062
+ '200': "GetInappNotificationsResponse",
1063
+ '400': None,
1064
+ '401': None,
1065
+ '500': None,
1066
+ }
1067
+ response_data = await self.api_client.call_api(
1068
+ *_param,
1069
+ _request_timeout=_request_timeout
1070
+ )
1071
+ return response_data.response
1072
+
1073
+
1074
+ def _user_get_in_app_notifications_serialize(
1075
+ self,
1076
+ before,
1077
+ count,
1078
+ _request_auth,
1079
+ _content_type,
1080
+ _headers,
1081
+ _host_index,
1082
+ ) -> RequestSerialized:
1083
+
1084
+ _host = None
1085
+
1086
+ _collection_formats: Dict[str, str] = {
1087
+ }
1088
+
1089
+ _path_params: Dict[str, str] = {}
1090
+ _query_params: List[Tuple[str, str]] = []
1091
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1092
+ _form_params: List[Tuple[str, str]] = []
1093
+ _files: Dict[
1094
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1095
+ ] = {}
1096
+ _body_params: Optional[bytes] = None
1097
+
1098
+ # process the path parameters
1099
+ # process the query parameters
1100
+ if before is not None:
1101
+
1102
+ _query_params.append(('before', before))
1103
+
1104
+ if count is not None:
1105
+
1106
+ _query_params.append(('count', count))
1107
+
1108
+ # process the header parameters
1109
+ # process the form parameters
1110
+ # process the body parameter
1111
+
1112
+
1113
+ # set the HTTP header `Accept`
1114
+ if 'Accept' not in _header_params:
1115
+ _header_params['Accept'] = self.api_client.select_header_accept(
1116
+ [
1117
+ 'application/json'
1118
+ ]
1119
+ )
1120
+
1121
+
1122
+ # authentication setting
1123
+ _auth_settings: List[str] = [
1124
+ 'endUserHashed',
1125
+ 'endUser',
1126
+ 'apiKey',
1127
+ 'clientCredentials'
1128
+ ]
1129
+
1130
+ return self.api_client.param_serialize(
1131
+ method='GET',
1132
+ resource_path='/user/inapp',
1133
+ path_params=_path_params,
1134
+ query_params=_query_params,
1135
+ header_params=_header_params,
1136
+ body=_body_params,
1137
+ post_params=_form_params,
1138
+ files=_files,
1139
+ auth_settings=_auth_settings,
1140
+ collection_formats=_collection_formats,
1141
+ _host=_host,
1142
+ _request_auth=_request_auth
1143
+ )
1144
+
1145
+
1146
+
1147
+
1148
+ @validate_call
1149
+ async def user_get_in_app_unread_count(
1150
+ self,
1151
+ _request_timeout: Union[
1152
+ None,
1153
+ Annotated[StrictFloat, Field(gt=0)],
1154
+ Tuple[
1155
+ Annotated[StrictFloat, Field(gt=0)],
1156
+ Annotated[StrictFloat, Field(gt=0)]
1157
+ ]
1158
+ ] = None,
1159
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1160
+ _content_type: Optional[StrictStr] = None,
1161
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1162
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1163
+ ) -> InappUnreadCountResponse:
1164
+ """Get the count of unread in-app notifications for a user
1165
+
1166
+
1167
+ :param _request_timeout: timeout setting for this request. If one
1168
+ number provided, it will be total request
1169
+ timeout. It can also be a pair (tuple) of
1170
+ (connection, read) timeouts.
1171
+ :type _request_timeout: int, tuple(int, int), optional
1172
+ :param _request_auth: set to override the auth_settings for an a single
1173
+ request; this effectively ignores the
1174
+ authentication in the spec for a single request.
1175
+ :type _request_auth: dict, optional
1176
+ :param _content_type: force content-type for the request.
1177
+ :type _content_type: str, Optional
1178
+ :param _headers: set to override the headers for a single
1179
+ request; this effectively ignores the headers
1180
+ in the spec for a single request.
1181
+ :type _headers: dict, optional
1182
+ :param _host_index: set to override the host_index for a single
1183
+ request; this effectively ignores the host_index
1184
+ in the spec for a single request.
1185
+ :type _host_index: int, optional
1186
+ :return: Returns the result object.
1187
+ """ # noqa: E501
1188
+
1189
+ _param = self._user_get_in_app_unread_count_serialize(
1190
+ _request_auth=_request_auth,
1191
+ _content_type=_content_type,
1192
+ _headers=_headers,
1193
+ _host_index=_host_index
1194
+ )
1195
+
1196
+ _response_types_map: Dict[str, Optional[str]] = {
1197
+ '200': "InappUnreadCountResponse",
1198
+ '400': None,
1199
+ '401': None,
1200
+ '500': None,
1201
+ }
1202
+ response_data = await self.api_client.call_api(
1203
+ *_param,
1204
+ _request_timeout=_request_timeout
1205
+ )
1206
+ await response_data.read()
1207
+ return self.api_client.response_deserialize(
1208
+ response_data=response_data,
1209
+ response_types_map=_response_types_map,
1210
+ ).data
1211
+
1212
+
1213
+ @validate_call
1214
+ async def user_get_in_app_unread_count_with_http_info(
1215
+ self,
1216
+ _request_timeout: Union[
1217
+ None,
1218
+ Annotated[StrictFloat, Field(gt=0)],
1219
+ Tuple[
1220
+ Annotated[StrictFloat, Field(gt=0)],
1221
+ Annotated[StrictFloat, Field(gt=0)]
1222
+ ]
1223
+ ] = None,
1224
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1225
+ _content_type: Optional[StrictStr] = None,
1226
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1227
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1228
+ ) -> ApiResponse[InappUnreadCountResponse]:
1229
+ """Get the count of unread in-app notifications for a user
1230
+
1231
+
1232
+ :param _request_timeout: timeout setting for this request. If one
1233
+ number provided, it will be total request
1234
+ timeout. It can also be a pair (tuple) of
1235
+ (connection, read) timeouts.
1236
+ :type _request_timeout: int, tuple(int, int), optional
1237
+ :param _request_auth: set to override the auth_settings for an a single
1238
+ request; this effectively ignores the
1239
+ authentication in the spec for a single request.
1240
+ :type _request_auth: dict, optional
1241
+ :param _content_type: force content-type for the request.
1242
+ :type _content_type: str, Optional
1243
+ :param _headers: set to override the headers for a single
1244
+ request; this effectively ignores the headers
1245
+ in the spec for a single request.
1246
+ :type _headers: dict, optional
1247
+ :param _host_index: set to override the host_index for a single
1248
+ request; this effectively ignores the host_index
1249
+ in the spec for a single request.
1250
+ :type _host_index: int, optional
1251
+ :return: Returns the result object.
1252
+ """ # noqa: E501
1253
+
1254
+ _param = self._user_get_in_app_unread_count_serialize(
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': "InappUnreadCountResponse",
1263
+ '400': None,
1264
+ '401': None,
1265
+ '500': None,
1266
+ }
1267
+ response_data = await self.api_client.call_api(
1268
+ *_param,
1269
+ _request_timeout=_request_timeout
1270
+ )
1271
+ await response_data.read()
1272
+ return self.api_client.response_deserialize(
1273
+ response_data=response_data,
1274
+ response_types_map=_response_types_map,
1275
+ )
1276
+
1277
+
1278
+ @validate_call
1279
+ async def user_get_in_app_unread_count_without_preload_content(
1280
+ self,
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
+ ) -> RESTResponseType:
1294
+ """Get the count of unread in-app notifications for a user
1295
+
1296
+
1297
+ :param _request_timeout: timeout setting for this request. If one
1298
+ number provided, it will be total request
1299
+ timeout. It can also be a pair (tuple) of
1300
+ (connection, read) timeouts.
1301
+ :type _request_timeout: int, tuple(int, int), optional
1302
+ :param _request_auth: set to override the auth_settings for an a single
1303
+ request; this effectively ignores the
1304
+ authentication in the spec for a single request.
1305
+ :type _request_auth: dict, optional
1306
+ :param _content_type: force content-type for the request.
1307
+ :type _content_type: str, Optional
1308
+ :param _headers: set to override the headers for a single
1309
+ request; this effectively ignores the headers
1310
+ in the spec for a single request.
1311
+ :type _headers: dict, optional
1312
+ :param _host_index: set to override the host_index for a single
1313
+ request; this effectively ignores the host_index
1314
+ in the spec for a single request.
1315
+ :type _host_index: int, optional
1316
+ :return: Returns the result object.
1317
+ """ # noqa: E501
1318
+
1319
+ _param = self._user_get_in_app_unread_count_serialize(
1320
+ _request_auth=_request_auth,
1321
+ _content_type=_content_type,
1322
+ _headers=_headers,
1323
+ _host_index=_host_index
1324
+ )
1325
+
1326
+ _response_types_map: Dict[str, Optional[str]] = {
1327
+ '200': "InappUnreadCountResponse",
1328
+ '400': None,
1329
+ '401': None,
1330
+ '500': None,
1331
+ }
1332
+ response_data = await self.api_client.call_api(
1333
+ *_param,
1334
+ _request_timeout=_request_timeout
1335
+ )
1336
+ return response_data.response
1337
+
1338
+
1339
+ def _user_get_in_app_unread_count_serialize(
1340
+ self,
1341
+ _request_auth,
1342
+ _content_type,
1343
+ _headers,
1344
+ _host_index,
1345
+ ) -> RequestSerialized:
1346
+
1347
+ _host = None
1348
+
1349
+ _collection_formats: Dict[str, str] = {
1350
+ }
1351
+
1352
+ _path_params: Dict[str, str] = {}
1353
+ _query_params: List[Tuple[str, str]] = []
1354
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1355
+ _form_params: List[Tuple[str, str]] = []
1356
+ _files: Dict[
1357
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1358
+ ] = {}
1359
+ _body_params: Optional[bytes] = None
1360
+
1361
+ # process the path parameters
1362
+ # process the query parameters
1363
+ # process the header parameters
1364
+ # process the form parameters
1365
+ # process the body parameter
1366
+
1367
+
1368
+ # set the HTTP header `Accept`
1369
+ if 'Accept' not in _header_params:
1370
+ _header_params['Accept'] = self.api_client.select_header_accept(
1371
+ [
1372
+ 'application/json'
1373
+ ]
1374
+ )
1375
+
1376
+
1377
+ # authentication setting
1378
+ _auth_settings: List[str] = [
1379
+ 'endUserHashed',
1380
+ 'endUser',
1381
+ 'apiKey',
1382
+ 'clientCredentials'
1383
+ ]
1384
+
1385
+ return self.api_client.param_serialize(
1386
+ method='GET',
1387
+ resource_path='/user/inapp/unread',
1388
+ path_params=_path_params,
1389
+ query_params=_query_params,
1390
+ header_params=_header_params,
1391
+ body=_body_params,
1392
+ post_params=_form_params,
1393
+ files=_files,
1394
+ auth_settings=_auth_settings,
1395
+ collection_formats=_collection_formats,
1396
+ _host=_host,
1397
+ _request_auth=_request_auth
1398
+ )
1399
+
1400
+
1401
+
1402
+
1403
+ @validate_call
1404
+ async def user_get_user(
1405
+ self,
1406
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1407
+ _request_timeout: Union[
1408
+ None,
1409
+ Annotated[StrictFloat, Field(gt=0)],
1410
+ Tuple[
1411
+ Annotated[StrictFloat, Field(gt=0)],
1412
+ Annotated[StrictFloat, Field(gt=0)]
1413
+ ]
1414
+ ] = None,
1415
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1416
+ _content_type: Optional[StrictStr] = None,
1417
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1418
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1419
+ ) -> User:
1420
+ """Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
1421
+
1422
+
1423
+ :param user_id: User ID (required)
1424
+ :type user_id: str
1425
+ :param _request_timeout: timeout setting for this request. If one
1426
+ number provided, it will be total request
1427
+ timeout. It can also be a pair (tuple) of
1428
+ (connection, read) timeouts.
1429
+ :type _request_timeout: int, tuple(int, int), optional
1430
+ :param _request_auth: set to override the auth_settings for an a single
1431
+ request; this effectively ignores the
1432
+ authentication in the spec for a single request.
1433
+ :type _request_auth: dict, optional
1434
+ :param _content_type: force content-type for the request.
1435
+ :type _content_type: str, Optional
1436
+ :param _headers: set to override the headers for a single
1437
+ request; this effectively ignores the headers
1438
+ in the spec for a single request.
1439
+ :type _headers: dict, optional
1440
+ :param _host_index: set to override the host_index for a single
1441
+ request; this effectively ignores the host_index
1442
+ in the spec for a single request.
1443
+ :type _host_index: int, optional
1444
+ :return: Returns the result object.
1445
+ """ # noqa: E501
1446
+
1447
+ _param = self._user_get_user_serialize(
1448
+ user_id=user_id,
1449
+ _request_auth=_request_auth,
1450
+ _content_type=_content_type,
1451
+ _headers=_headers,
1452
+ _host_index=_host_index
1453
+ )
1454
+
1455
+ _response_types_map: Dict[str, Optional[str]] = {
1456
+ '200': "User",
1457
+ '400': None,
1458
+ '401': None,
1459
+ '500': None,
1460
+ }
1461
+ response_data = await self.api_client.call_api(
1462
+ *_param,
1463
+ _request_timeout=_request_timeout
1464
+ )
1465
+ await response_data.read()
1466
+ return self.api_client.response_deserialize(
1467
+ response_data=response_data,
1468
+ response_types_map=_response_types_map,
1469
+ ).data
1470
+
1471
+
1472
+ @validate_call
1473
+ async def user_get_user_with_http_info(
1474
+ self,
1475
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1476
+ _request_timeout: Union[
1477
+ None,
1478
+ Annotated[StrictFloat, Field(gt=0)],
1479
+ Tuple[
1480
+ Annotated[StrictFloat, Field(gt=0)],
1481
+ Annotated[StrictFloat, Field(gt=0)]
1482
+ ]
1483
+ ] = None,
1484
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1485
+ _content_type: Optional[StrictStr] = None,
1486
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1487
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1488
+ ) -> ApiResponse[User]:
1489
+ """Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
1490
+
1491
+
1492
+ :param user_id: User ID (required)
1493
+ :type user_id: str
1494
+ :param _request_timeout: timeout setting for this request. If one
1495
+ number provided, it will be total request
1496
+ timeout. It can also be a pair (tuple) of
1497
+ (connection, read) timeouts.
1498
+ :type _request_timeout: int, tuple(int, int), optional
1499
+ :param _request_auth: set to override the auth_settings for an a single
1500
+ request; this effectively ignores the
1501
+ authentication in the spec for a single request.
1502
+ :type _request_auth: dict, optional
1503
+ :param _content_type: force content-type for the request.
1504
+ :type _content_type: str, Optional
1505
+ :param _headers: set to override the headers for a single
1506
+ request; this effectively ignores the headers
1507
+ in the spec for a single request.
1508
+ :type _headers: dict, optional
1509
+ :param _host_index: set to override the host_index for a single
1510
+ request; this effectively ignores the host_index
1511
+ in the spec for a single request.
1512
+ :type _host_index: int, optional
1513
+ :return: Returns the result object.
1514
+ """ # noqa: E501
1515
+
1516
+ _param = self._user_get_user_serialize(
1517
+ user_id=user_id,
1518
+ _request_auth=_request_auth,
1519
+ _content_type=_content_type,
1520
+ _headers=_headers,
1521
+ _host_index=_host_index
1522
+ )
1523
+
1524
+ _response_types_map: Dict[str, Optional[str]] = {
1525
+ '200': "User",
1526
+ '400': None,
1527
+ '401': None,
1528
+ '500': None,
1529
+ }
1530
+ response_data = await self.api_client.call_api(
1531
+ *_param,
1532
+ _request_timeout=_request_timeout
1533
+ )
1534
+ await response_data.read()
1535
+ return self.api_client.response_deserialize(
1536
+ response_data=response_data,
1537
+ response_types_map=_response_types_map,
1538
+ )
1539
+
1540
+
1541
+ @validate_call
1542
+ async def user_get_user_without_preload_content(
1543
+ self,
1544
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1545
+ _request_timeout: Union[
1546
+ None,
1547
+ Annotated[StrictFloat, Field(gt=0)],
1548
+ Tuple[
1549
+ Annotated[StrictFloat, Field(gt=0)],
1550
+ Annotated[StrictFloat, Field(gt=0)]
1551
+ ]
1552
+ ] = None,
1553
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1554
+ _content_type: Optional[StrictStr] = None,
1555
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1556
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1557
+ ) -> RESTResponseType:
1558
+ """Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
1559
+
1560
+
1561
+ :param user_id: User ID (required)
1562
+ :type user_id: str
1563
+ :param _request_timeout: timeout setting for this request. If one
1564
+ number provided, it will be total request
1565
+ timeout. It can also be a pair (tuple) of
1566
+ (connection, read) timeouts.
1567
+ :type _request_timeout: int, tuple(int, int), optional
1568
+ :param _request_auth: set to override the auth_settings for an a single
1569
+ request; this effectively ignores the
1570
+ authentication in the spec for a single request.
1571
+ :type _request_auth: dict, optional
1572
+ :param _content_type: force content-type for the request.
1573
+ :type _content_type: str, Optional
1574
+ :param _headers: set to override the headers for a single
1575
+ request; this effectively ignores the headers
1576
+ in the spec for a single request.
1577
+ :type _headers: dict, optional
1578
+ :param _host_index: set to override the host_index for a single
1579
+ request; this effectively ignores the host_index
1580
+ in the spec for a single request.
1581
+ :type _host_index: int, optional
1582
+ :return: Returns the result object.
1583
+ """ # noqa: E501
1584
+
1585
+ _param = self._user_get_user_serialize(
1586
+ user_id=user_id,
1587
+ _request_auth=_request_auth,
1588
+ _content_type=_content_type,
1589
+ _headers=_headers,
1590
+ _host_index=_host_index
1591
+ )
1592
+
1593
+ _response_types_map: Dict[str, Optional[str]] = {
1594
+ '200': "User",
1595
+ '400': None,
1596
+ '401': None,
1597
+ '500': None,
1598
+ }
1599
+ response_data = await self.api_client.call_api(
1600
+ *_param,
1601
+ _request_timeout=_request_timeout
1602
+ )
1603
+ return response_data.response
1604
+
1605
+
1606
+ def _user_get_user_serialize(
1607
+ self,
1608
+ user_id,
1609
+ _request_auth,
1610
+ _content_type,
1611
+ _headers,
1612
+ _host_index,
1613
+ ) -> RequestSerialized:
1614
+
1615
+ _host = None
1616
+
1617
+ _collection_formats: Dict[str, str] = {
1618
+ }
1619
+
1620
+ _path_params: Dict[str, str] = {}
1621
+ _query_params: List[Tuple[str, str]] = []
1622
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1623
+ _form_params: List[Tuple[str, str]] = []
1624
+ _files: Dict[
1625
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1626
+ ] = {}
1627
+ _body_params: Optional[bytes] = None
1628
+
1629
+ # process the path parameters
1630
+ if user_id is not None:
1631
+ _path_params['userId'] = user_id
1632
+ # process the query parameters
1633
+ # process the header parameters
1634
+ # process the form parameters
1635
+ # process the body parameter
1636
+
1637
+
1638
+ # set the HTTP header `Accept`
1639
+ if 'Accept' not in _header_params:
1640
+ _header_params['Accept'] = self.api_client.select_header_accept(
1641
+ [
1642
+ 'application/json'
1643
+ ]
1644
+ )
1645
+
1646
+
1647
+ # authentication setting
1648
+ _auth_settings: List[str] = [
1649
+ 'endUserHashed',
1650
+ 'endUser',
1651
+ 'apiKey',
1652
+ 'clientCredentials'
1653
+ ]
1654
+
1655
+ return self.api_client.param_serialize(
1656
+ method='GET',
1657
+ resource_path='/users/{userId}',
1658
+ path_params=_path_params,
1659
+ query_params=_query_params,
1660
+ header_params=_header_params,
1661
+ body=_body_params,
1662
+ post_params=_form_params,
1663
+ files=_files,
1664
+ auth_settings=_auth_settings,
1665
+ collection_formats=_collection_formats,
1666
+ _host=_host,
1667
+ _request_auth=_request_auth
1668
+ )
1669
+
1670
+
1671
+
1672
+
1673
+ @validate_call
1674
+ async def user_identify(
1675
+ self,
1676
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1677
+ post_user_request: PostUserRequest,
1678
+ _request_timeout: Union[
1679
+ None,
1680
+ Annotated[StrictFloat, Field(gt=0)],
1681
+ Tuple[
1682
+ Annotated[StrictFloat, Field(gt=0)],
1683
+ Annotated[StrictFloat, Field(gt=0)]
1684
+ ]
1685
+ ] = None,
1686
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1687
+ _content_type: Optional[StrictStr] = None,
1688
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1689
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1690
+ ) -> User:
1691
+ """Create or update a user with the given ID. Updates lastSeenTime automatically.
1692
+
1693
+
1694
+ :param user_id: User ID (required)
1695
+ :type user_id: str
1696
+ :param post_user_request: (required)
1697
+ :type post_user_request: PostUserRequest
1698
+ :param _request_timeout: timeout setting for this request. If one
1699
+ number provided, it will be total request
1700
+ timeout. It can also be a pair (tuple) of
1701
+ (connection, read) timeouts.
1702
+ :type _request_timeout: int, tuple(int, int), optional
1703
+ :param _request_auth: set to override the auth_settings for an a single
1704
+ request; this effectively ignores the
1705
+ authentication in the spec for a single request.
1706
+ :type _request_auth: dict, optional
1707
+ :param _content_type: force content-type for the request.
1708
+ :type _content_type: str, Optional
1709
+ :param _headers: set to override the headers for a single
1710
+ request; this effectively ignores the headers
1711
+ in the spec for a single request.
1712
+ :type _headers: dict, optional
1713
+ :param _host_index: set to override the host_index for a single
1714
+ request; this effectively ignores the host_index
1715
+ in the spec for a single request.
1716
+ :type _host_index: int, optional
1717
+ :return: Returns the result object.
1718
+ """ # noqa: E501
1719
+
1720
+ _param = self._user_identify_serialize(
1721
+ user_id=user_id,
1722
+ post_user_request=post_user_request,
1723
+ _request_auth=_request_auth,
1724
+ _content_type=_content_type,
1725
+ _headers=_headers,
1726
+ _host_index=_host_index
1727
+ )
1728
+
1729
+ _response_types_map: Dict[str, Optional[str]] = {
1730
+ '200': "User",
1731
+ '400': None,
1732
+ '401': None,
1733
+ '500': None,
1734
+ }
1735
+ response_data = await self.api_client.call_api(
1736
+ *_param,
1737
+ _request_timeout=_request_timeout
1738
+ )
1739
+ await response_data.read()
1740
+ return self.api_client.response_deserialize(
1741
+ response_data=response_data,
1742
+ response_types_map=_response_types_map,
1743
+ ).data
1744
+
1745
+
1746
+ @validate_call
1747
+ async def user_identify_with_http_info(
1748
+ self,
1749
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1750
+ post_user_request: PostUserRequest,
1751
+ _request_timeout: Union[
1752
+ None,
1753
+ Annotated[StrictFloat, Field(gt=0)],
1754
+ Tuple[
1755
+ Annotated[StrictFloat, Field(gt=0)],
1756
+ Annotated[StrictFloat, Field(gt=0)]
1757
+ ]
1758
+ ] = None,
1759
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1760
+ _content_type: Optional[StrictStr] = None,
1761
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1762
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1763
+ ) -> ApiResponse[User]:
1764
+ """Create or update a user with the given ID. Updates lastSeenTime automatically.
1765
+
1766
+
1767
+ :param user_id: User ID (required)
1768
+ :type user_id: str
1769
+ :param post_user_request: (required)
1770
+ :type post_user_request: PostUserRequest
1771
+ :param _request_timeout: timeout setting for this request. If one
1772
+ number provided, it will be total request
1773
+ timeout. It can also be a pair (tuple) of
1774
+ (connection, read) timeouts.
1775
+ :type _request_timeout: int, tuple(int, int), optional
1776
+ :param _request_auth: set to override the auth_settings for an a single
1777
+ request; this effectively ignores the
1778
+ authentication in the spec for a single request.
1779
+ :type _request_auth: dict, optional
1780
+ :param _content_type: force content-type for the request.
1781
+ :type _content_type: str, Optional
1782
+ :param _headers: set to override the headers for a single
1783
+ request; this effectively ignores the headers
1784
+ in the spec for a single request.
1785
+ :type _headers: dict, optional
1786
+ :param _host_index: set to override the host_index for a single
1787
+ request; this effectively ignores the host_index
1788
+ in the spec for a single request.
1789
+ :type _host_index: int, optional
1790
+ :return: Returns the result object.
1791
+ """ # noqa: E501
1792
+
1793
+ _param = self._user_identify_serialize(
1794
+ user_id=user_id,
1795
+ post_user_request=post_user_request,
1796
+ _request_auth=_request_auth,
1797
+ _content_type=_content_type,
1798
+ _headers=_headers,
1799
+ _host_index=_host_index
1800
+ )
1801
+
1802
+ _response_types_map: Dict[str, Optional[str]] = {
1803
+ '200': "User",
1804
+ '400': None,
1805
+ '401': None,
1806
+ '500': None,
1807
+ }
1808
+ response_data = await self.api_client.call_api(
1809
+ *_param,
1810
+ _request_timeout=_request_timeout
1811
+ )
1812
+ await response_data.read()
1813
+ return self.api_client.response_deserialize(
1814
+ response_data=response_data,
1815
+ response_types_map=_response_types_map,
1816
+ )
1817
+
1818
+
1819
+ @validate_call
1820
+ async def user_identify_without_preload_content(
1821
+ self,
1822
+ user_id: Annotated[StrictStr, Field(description="User ID")],
1823
+ post_user_request: PostUserRequest,
1824
+ _request_timeout: Union[
1825
+ None,
1826
+ Annotated[StrictFloat, Field(gt=0)],
1827
+ Tuple[
1828
+ Annotated[StrictFloat, Field(gt=0)],
1829
+ Annotated[StrictFloat, Field(gt=0)]
1830
+ ]
1831
+ ] = None,
1832
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1833
+ _content_type: Optional[StrictStr] = None,
1834
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1835
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1836
+ ) -> RESTResponseType:
1837
+ """Create or update a user with the given ID. Updates lastSeenTime automatically.
1838
+
1839
+
1840
+ :param user_id: User ID (required)
1841
+ :type user_id: str
1842
+ :param post_user_request: (required)
1843
+ :type post_user_request: PostUserRequest
1844
+ :param _request_timeout: timeout setting for this request. If one
1845
+ number provided, it will be total request
1846
+ timeout. It can also be a pair (tuple) of
1847
+ (connection, read) timeouts.
1848
+ :type _request_timeout: int, tuple(int, int), optional
1849
+ :param _request_auth: set to override the auth_settings for an a single
1850
+ request; this effectively ignores the
1851
+ authentication in the spec for a single request.
1852
+ :type _request_auth: dict, optional
1853
+ :param _content_type: force content-type for the request.
1854
+ :type _content_type: str, Optional
1855
+ :param _headers: set to override the headers for a single
1856
+ request; this effectively ignores the headers
1857
+ in the spec for a single request.
1858
+ :type _headers: dict, optional
1859
+ :param _host_index: set to override the host_index for a single
1860
+ request; this effectively ignores the host_index
1861
+ in the spec for a single request.
1862
+ :type _host_index: int, optional
1863
+ :return: Returns the result object.
1864
+ """ # noqa: E501
1865
+
1866
+ _param = self._user_identify_serialize(
1867
+ user_id=user_id,
1868
+ post_user_request=post_user_request,
1869
+ _request_auth=_request_auth,
1870
+ _content_type=_content_type,
1871
+ _headers=_headers,
1872
+ _host_index=_host_index
1873
+ )
1874
+
1875
+ _response_types_map: Dict[str, Optional[str]] = {
1876
+ '200': "User",
1877
+ '400': None,
1878
+ '401': None,
1879
+ '500': None,
1880
+ }
1881
+ response_data = await self.api_client.call_api(
1882
+ *_param,
1883
+ _request_timeout=_request_timeout
1884
+ )
1885
+ return response_data.response
1886
+
1887
+
1888
+ def _user_identify_serialize(
1889
+ self,
1890
+ user_id,
1891
+ post_user_request,
1892
+ _request_auth,
1893
+ _content_type,
1894
+ _headers,
1895
+ _host_index,
1896
+ ) -> RequestSerialized:
1897
+
1898
+ _host = None
1899
+
1900
+ _collection_formats: Dict[str, str] = {
1901
+ }
1902
+
1903
+ _path_params: Dict[str, str] = {}
1904
+ _query_params: List[Tuple[str, str]] = []
1905
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1906
+ _form_params: List[Tuple[str, str]] = []
1907
+ _files: Dict[
1908
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1909
+ ] = {}
1910
+ _body_params: Optional[bytes] = None
1911
+
1912
+ # process the path parameters
1913
+ if user_id is not None:
1914
+ _path_params['userId'] = user_id
1915
+ # process the query parameters
1916
+ # process the header parameters
1917
+ # process the form parameters
1918
+ # process the body parameter
1919
+ if post_user_request is not None:
1920
+ _body_params = post_user_request
1921
+
1922
+
1923
+ # set the HTTP header `Accept`
1924
+ if 'Accept' not in _header_params:
1925
+ _header_params['Accept'] = self.api_client.select_header_accept(
1926
+ [
1927
+ 'application/json'
1928
+ ]
1929
+ )
1930
+
1931
+ # set the HTTP header `Content-Type`
1932
+ if _content_type:
1933
+ _header_params['Content-Type'] = _content_type
1934
+ else:
1935
+ _default_content_type = (
1936
+ self.api_client.select_header_content_type(
1937
+ [
1938
+ 'application/json'
1939
+ ]
1940
+ )
1941
+ )
1942
+ if _default_content_type is not None:
1943
+ _header_params['Content-Type'] = _default_content_type
1944
+
1945
+ # authentication setting
1946
+ _auth_settings: List[str] = [
1947
+ 'endUserHashed',
1948
+ 'endUser',
1949
+ 'apiKey',
1950
+ 'clientCredentials'
1951
+ ]
1952
+
1953
+ return self.api_client.param_serialize(
1954
+ method='POST',
1955
+ resource_path='/users/{userId}',
1956
+ path_params=_path_params,
1957
+ query_params=_query_params,
1958
+ header_params=_header_params,
1959
+ body=_body_params,
1960
+ post_params=_form_params,
1961
+ files=_files,
1962
+ auth_settings=_auth_settings,
1963
+ collection_formats=_collection_formats,
1964
+ _host=_host,
1965
+ _request_auth=_request_auth
1966
+ )
1967
+
1968
+
1969
+
1970
+
1971
+ @validate_call
1972
+ async def user_mark_in_app_notifications_as_seen(
1973
+ self,
1974
+ in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest,
1975
+ _request_timeout: Union[
1976
+ None,
1977
+ Annotated[StrictFloat, Field(gt=0)],
1978
+ Tuple[
1979
+ Annotated[StrictFloat, Field(gt=0)],
1980
+ Annotated[StrictFloat, Field(gt=0)]
1981
+ ]
1982
+ ] = None,
1983
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1984
+ _content_type: Optional[StrictStr] = None,
1985
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1986
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1987
+ ) -> SuccessResponse:
1988
+ """Mark in-app web notifications as seen/read for a user
1989
+
1990
+
1991
+ :param in_app_notification_unread_clear_request: (required)
1992
+ :type in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest
1993
+ :param _request_timeout: timeout setting for this request. If one
1994
+ number provided, it will be total request
1995
+ timeout. It can also be a pair (tuple) of
1996
+ (connection, read) timeouts.
1997
+ :type _request_timeout: int, tuple(int, int), optional
1998
+ :param _request_auth: set to override the auth_settings for an a single
1999
+ request; this effectively ignores the
2000
+ authentication in the spec for a single request.
2001
+ :type _request_auth: dict, optional
2002
+ :param _content_type: force content-type for the request.
2003
+ :type _content_type: str, Optional
2004
+ :param _headers: set to override the headers for a single
2005
+ request; this effectively ignores the headers
2006
+ in the spec for a single request.
2007
+ :type _headers: dict, optional
2008
+ :param _host_index: set to override the host_index for a single
2009
+ request; this effectively ignores the host_index
2010
+ in the spec for a single request.
2011
+ :type _host_index: int, optional
2012
+ :return: Returns the result object.
2013
+ """ # noqa: E501
2014
+
2015
+ _param = self._user_mark_in_app_notifications_as_seen_serialize(
2016
+ in_app_notification_unread_clear_request=in_app_notification_unread_clear_request,
2017
+ _request_auth=_request_auth,
2018
+ _content_type=_content_type,
2019
+ _headers=_headers,
2020
+ _host_index=_host_index
2021
+ )
2022
+
2023
+ _response_types_map: Dict[str, Optional[str]] = {
2024
+ '200': "SuccessResponse",
2025
+ '400': None,
2026
+ '401': None,
2027
+ '500': None,
2028
+ }
2029
+ response_data = await self.api_client.call_api(
2030
+ *_param,
2031
+ _request_timeout=_request_timeout
2032
+ )
2033
+ await response_data.read()
2034
+ return self.api_client.response_deserialize(
2035
+ response_data=response_data,
2036
+ response_types_map=_response_types_map,
2037
+ ).data
2038
+
2039
+
2040
+ @validate_call
2041
+ async def user_mark_in_app_notifications_as_seen_with_http_info(
2042
+ self,
2043
+ in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest,
2044
+ _request_timeout: Union[
2045
+ None,
2046
+ Annotated[StrictFloat, Field(gt=0)],
2047
+ Tuple[
2048
+ Annotated[StrictFloat, Field(gt=0)],
2049
+ Annotated[StrictFloat, Field(gt=0)]
2050
+ ]
2051
+ ] = None,
2052
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2053
+ _content_type: Optional[StrictStr] = None,
2054
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2055
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2056
+ ) -> ApiResponse[SuccessResponse]:
2057
+ """Mark in-app web notifications as seen/read for a user
2058
+
2059
+
2060
+ :param in_app_notification_unread_clear_request: (required)
2061
+ :type in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest
2062
+ :param _request_timeout: timeout setting for this request. If one
2063
+ number provided, it will be total request
2064
+ timeout. It can also be a pair (tuple) of
2065
+ (connection, read) timeouts.
2066
+ :type _request_timeout: int, tuple(int, int), optional
2067
+ :param _request_auth: set to override the auth_settings for an a single
2068
+ request; this effectively ignores the
2069
+ authentication in the spec for a single request.
2070
+ :type _request_auth: dict, optional
2071
+ :param _content_type: force content-type for the request.
2072
+ :type _content_type: str, Optional
2073
+ :param _headers: set to override the headers for a single
2074
+ request; this effectively ignores the headers
2075
+ in the spec for a single request.
2076
+ :type _headers: dict, optional
2077
+ :param _host_index: set to override the host_index for a single
2078
+ request; this effectively ignores the host_index
2079
+ in the spec for a single request.
2080
+ :type _host_index: int, optional
2081
+ :return: Returns the result object.
2082
+ """ # noqa: E501
2083
+
2084
+ _param = self._user_mark_in_app_notifications_as_seen_serialize(
2085
+ in_app_notification_unread_clear_request=in_app_notification_unread_clear_request,
2086
+ _request_auth=_request_auth,
2087
+ _content_type=_content_type,
2088
+ _headers=_headers,
2089
+ _host_index=_host_index
2090
+ )
2091
+
2092
+ _response_types_map: Dict[str, Optional[str]] = {
2093
+ '200': "SuccessResponse",
2094
+ '400': None,
2095
+ '401': None,
2096
+ '500': None,
2097
+ }
2098
+ response_data = await self.api_client.call_api(
2099
+ *_param,
2100
+ _request_timeout=_request_timeout
2101
+ )
2102
+ await response_data.read()
2103
+ return self.api_client.response_deserialize(
2104
+ response_data=response_data,
2105
+ response_types_map=_response_types_map,
2106
+ )
2107
+
2108
+
2109
+ @validate_call
2110
+ async def user_mark_in_app_notifications_as_seen_without_preload_content(
2111
+ self,
2112
+ in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest,
2113
+ _request_timeout: Union[
2114
+ None,
2115
+ Annotated[StrictFloat, Field(gt=0)],
2116
+ Tuple[
2117
+ Annotated[StrictFloat, Field(gt=0)],
2118
+ Annotated[StrictFloat, Field(gt=0)]
2119
+ ]
2120
+ ] = None,
2121
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2122
+ _content_type: Optional[StrictStr] = None,
2123
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2124
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2125
+ ) -> RESTResponseType:
2126
+ """Mark in-app web notifications as seen/read for a user
2127
+
2128
+
2129
+ :param in_app_notification_unread_clear_request: (required)
2130
+ :type in_app_notification_unread_clear_request: InAppNotificationUnreadClearRequest
2131
+ :param _request_timeout: timeout setting for this request. If one
2132
+ number provided, it will be total request
2133
+ timeout. It can also be a pair (tuple) of
2134
+ (connection, read) timeouts.
2135
+ :type _request_timeout: int, tuple(int, int), optional
2136
+ :param _request_auth: set to override the auth_settings for an a single
2137
+ request; this effectively ignores the
2138
+ authentication in the spec for a single request.
2139
+ :type _request_auth: dict, optional
2140
+ :param _content_type: force content-type for the request.
2141
+ :type _content_type: str, Optional
2142
+ :param _headers: set to override the headers for a single
2143
+ request; this effectively ignores the headers
2144
+ in the spec for a single request.
2145
+ :type _headers: dict, optional
2146
+ :param _host_index: set to override the host_index for a single
2147
+ request; this effectively ignores the host_index
2148
+ in the spec for a single request.
2149
+ :type _host_index: int, optional
2150
+ :return: Returns the result object.
2151
+ """ # noqa: E501
2152
+
2153
+ _param = self._user_mark_in_app_notifications_as_seen_serialize(
2154
+ in_app_notification_unread_clear_request=in_app_notification_unread_clear_request,
2155
+ _request_auth=_request_auth,
2156
+ _content_type=_content_type,
2157
+ _headers=_headers,
2158
+ _host_index=_host_index
2159
+ )
2160
+
2161
+ _response_types_map: Dict[str, Optional[str]] = {
2162
+ '200': "SuccessResponse",
2163
+ '400': None,
2164
+ '401': None,
2165
+ '500': None,
2166
+ }
2167
+ response_data = await self.api_client.call_api(
2168
+ *_param,
2169
+ _request_timeout=_request_timeout
2170
+ )
2171
+ return response_data.response
2172
+
2173
+
2174
+ def _user_mark_in_app_notifications_as_seen_serialize(
2175
+ self,
2176
+ in_app_notification_unread_clear_request,
2177
+ _request_auth,
2178
+ _content_type,
2179
+ _headers,
2180
+ _host_index,
2181
+ ) -> RequestSerialized:
2182
+
2183
+ _host = None
2184
+
2185
+ _collection_formats: Dict[str, str] = {
2186
+ }
2187
+
2188
+ _path_params: Dict[str, str] = {}
2189
+ _query_params: List[Tuple[str, str]] = []
2190
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2191
+ _form_params: List[Tuple[str, str]] = []
2192
+ _files: Dict[
2193
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2194
+ ] = {}
2195
+ _body_params: Optional[bytes] = None
2196
+
2197
+ # process the path parameters
2198
+ # process the query parameters
2199
+ # process the header parameters
2200
+ # process the form parameters
2201
+ # process the body parameter
2202
+ if in_app_notification_unread_clear_request is not None:
2203
+ _body_params = in_app_notification_unread_clear_request
2204
+
2205
+
2206
+ # set the HTTP header `Accept`
2207
+ if 'Accept' not in _header_params:
2208
+ _header_params['Accept'] = self.api_client.select_header_accept(
2209
+ [
2210
+ 'application/json'
2211
+ ]
2212
+ )
2213
+
2214
+ # set the HTTP header `Content-Type`
2215
+ if _content_type:
2216
+ _header_params['Content-Type'] = _content_type
2217
+ else:
2218
+ _default_content_type = (
2219
+ self.api_client.select_header_content_type(
2220
+ [
2221
+ 'application/json'
2222
+ ]
2223
+ )
2224
+ )
2225
+ if _default_content_type is not None:
2226
+ _header_params['Content-Type'] = _default_content_type
2227
+
2228
+ # authentication setting
2229
+ _auth_settings: List[str] = [
2230
+ 'endUserHashed',
2231
+ 'endUser',
2232
+ 'apiKey',
2233
+ 'clientCredentials'
2234
+ ]
2235
+
2236
+ return self.api_client.param_serialize(
2237
+ method='PATCH',
2238
+ resource_path='/user/inapp/unread',
2239
+ path_params=_path_params,
2240
+ query_params=_query_params,
2241
+ header_params=_header_params,
2242
+ body=_body_params,
2243
+ post_params=_form_params,
2244
+ files=_files,
2245
+ auth_settings=_auth_settings,
2246
+ collection_formats=_collection_formats,
2247
+ _host=_host,
2248
+ _request_auth=_request_auth
2249
+ )
2250
+
2251
+
2252
+
2253
+
2254
+ @validate_call
2255
+ async def user_update_in_app_notification_status(
2256
+ self,
2257
+ in_app_notification_patch_request: InAppNotificationPatchRequest,
2258
+ _request_timeout: Union[
2259
+ None,
2260
+ Annotated[StrictFloat, Field(gt=0)],
2261
+ Tuple[
2262
+ Annotated[StrictFloat, Field(gt=0)],
2263
+ Annotated[StrictFloat, Field(gt=0)]
2264
+ ]
2265
+ ] = None,
2266
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2267
+ _content_type: Optional[StrictStr] = None,
2268
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2269
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2270
+ ) -> SuccessResponse:
2271
+ """Update in-app web notification status (opened, archived, clicked, etc.)
2272
+
2273
+
2274
+ :param in_app_notification_patch_request: (required)
2275
+ :type in_app_notification_patch_request: InAppNotificationPatchRequest
2276
+ :param _request_timeout: timeout setting for this request. If one
2277
+ number provided, it will be total request
2278
+ timeout. It can also be a pair (tuple) of
2279
+ (connection, read) timeouts.
2280
+ :type _request_timeout: int, tuple(int, int), optional
2281
+ :param _request_auth: set to override the auth_settings for an a single
2282
+ request; this effectively ignores the
2283
+ authentication in the spec for a single request.
2284
+ :type _request_auth: dict, optional
2285
+ :param _content_type: force content-type for the request.
2286
+ :type _content_type: str, Optional
2287
+ :param _headers: set to override the headers for a single
2288
+ request; this effectively ignores the headers
2289
+ in the spec for a single request.
2290
+ :type _headers: dict, optional
2291
+ :param _host_index: set to override the host_index for a single
2292
+ request; this effectively ignores the host_index
2293
+ in the spec for a single request.
2294
+ :type _host_index: int, optional
2295
+ :return: Returns the result object.
2296
+ """ # noqa: E501
2297
+
2298
+ _param = self._user_update_in_app_notification_status_serialize(
2299
+ in_app_notification_patch_request=in_app_notification_patch_request,
2300
+ _request_auth=_request_auth,
2301
+ _content_type=_content_type,
2302
+ _headers=_headers,
2303
+ _host_index=_host_index
2304
+ )
2305
+
2306
+ _response_types_map: Dict[str, Optional[str]] = {
2307
+ '200': "SuccessResponse",
2308
+ '400': None,
2309
+ '401': None,
2310
+ '500': None,
2311
+ }
2312
+ response_data = await self.api_client.call_api(
2313
+ *_param,
2314
+ _request_timeout=_request_timeout
2315
+ )
2316
+ await response_data.read()
2317
+ return self.api_client.response_deserialize(
2318
+ response_data=response_data,
2319
+ response_types_map=_response_types_map,
2320
+ ).data
2321
+
2322
+
2323
+ @validate_call
2324
+ async def user_update_in_app_notification_status_with_http_info(
2325
+ self,
2326
+ in_app_notification_patch_request: InAppNotificationPatchRequest,
2327
+ _request_timeout: Union[
2328
+ None,
2329
+ Annotated[StrictFloat, Field(gt=0)],
2330
+ Tuple[
2331
+ Annotated[StrictFloat, Field(gt=0)],
2332
+ Annotated[StrictFloat, Field(gt=0)]
2333
+ ]
2334
+ ] = None,
2335
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2336
+ _content_type: Optional[StrictStr] = None,
2337
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2338
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2339
+ ) -> ApiResponse[SuccessResponse]:
2340
+ """Update in-app web notification status (opened, archived, clicked, etc.)
2341
+
2342
+
2343
+ :param in_app_notification_patch_request: (required)
2344
+ :type in_app_notification_patch_request: InAppNotificationPatchRequest
2345
+ :param _request_timeout: timeout setting for this request. If one
2346
+ number provided, it will be total request
2347
+ timeout. It can also be a pair (tuple) of
2348
+ (connection, read) timeouts.
2349
+ :type _request_timeout: int, tuple(int, int), optional
2350
+ :param _request_auth: set to override the auth_settings for an a single
2351
+ request; this effectively ignores the
2352
+ authentication in the spec for a single request.
2353
+ :type _request_auth: dict, optional
2354
+ :param _content_type: force content-type for the request.
2355
+ :type _content_type: str, Optional
2356
+ :param _headers: set to override the headers for a single
2357
+ request; this effectively ignores the headers
2358
+ in the spec for a single request.
2359
+ :type _headers: dict, optional
2360
+ :param _host_index: set to override the host_index for a single
2361
+ request; this effectively ignores the host_index
2362
+ in the spec for a single request.
2363
+ :type _host_index: int, optional
2364
+ :return: Returns the result object.
2365
+ """ # noqa: E501
2366
+
2367
+ _param = self._user_update_in_app_notification_status_serialize(
2368
+ in_app_notification_patch_request=in_app_notification_patch_request,
2369
+ _request_auth=_request_auth,
2370
+ _content_type=_content_type,
2371
+ _headers=_headers,
2372
+ _host_index=_host_index
2373
+ )
2374
+
2375
+ _response_types_map: Dict[str, Optional[str]] = {
2376
+ '200': "SuccessResponse",
2377
+ '400': None,
2378
+ '401': None,
2379
+ '500': None,
2380
+ }
2381
+ response_data = await self.api_client.call_api(
2382
+ *_param,
2383
+ _request_timeout=_request_timeout
2384
+ )
2385
+ await response_data.read()
2386
+ return self.api_client.response_deserialize(
2387
+ response_data=response_data,
2388
+ response_types_map=_response_types_map,
2389
+ )
2390
+
2391
+
2392
+ @validate_call
2393
+ async def user_update_in_app_notification_status_without_preload_content(
2394
+ self,
2395
+ in_app_notification_patch_request: InAppNotificationPatchRequest,
2396
+ _request_timeout: Union[
2397
+ None,
2398
+ Annotated[StrictFloat, Field(gt=0)],
2399
+ Tuple[
2400
+ Annotated[StrictFloat, Field(gt=0)],
2401
+ Annotated[StrictFloat, Field(gt=0)]
2402
+ ]
2403
+ ] = None,
2404
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2405
+ _content_type: Optional[StrictStr] = None,
2406
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2407
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2408
+ ) -> RESTResponseType:
2409
+ """Update in-app web notification status (opened, archived, clicked, etc.)
2410
+
2411
+
2412
+ :param in_app_notification_patch_request: (required)
2413
+ :type in_app_notification_patch_request: InAppNotificationPatchRequest
2414
+ :param _request_timeout: timeout setting for this request. If one
2415
+ number provided, it will be total request
2416
+ timeout. It can also be a pair (tuple) of
2417
+ (connection, read) timeouts.
2418
+ :type _request_timeout: int, tuple(int, int), optional
2419
+ :param _request_auth: set to override the auth_settings for an a single
2420
+ request; this effectively ignores the
2421
+ authentication in the spec for a single request.
2422
+ :type _request_auth: dict, optional
2423
+ :param _content_type: force content-type for the request.
2424
+ :type _content_type: str, Optional
2425
+ :param _headers: set to override the headers for a single
2426
+ request; this effectively ignores the headers
2427
+ in the spec for a single request.
2428
+ :type _headers: dict, optional
2429
+ :param _host_index: set to override the host_index for a single
2430
+ request; this effectively ignores the host_index
2431
+ in the spec for a single request.
2432
+ :type _host_index: int, optional
2433
+ :return: Returns the result object.
2434
+ """ # noqa: E501
2435
+
2436
+ _param = self._user_update_in_app_notification_status_serialize(
2437
+ in_app_notification_patch_request=in_app_notification_patch_request,
2438
+ _request_auth=_request_auth,
2439
+ _content_type=_content_type,
2440
+ _headers=_headers,
2441
+ _host_index=_host_index
2442
+ )
2443
+
2444
+ _response_types_map: Dict[str, Optional[str]] = {
2445
+ '200': "SuccessResponse",
2446
+ '400': None,
2447
+ '401': None,
2448
+ '500': None,
2449
+ }
2450
+ response_data = await self.api_client.call_api(
2451
+ *_param,
2452
+ _request_timeout=_request_timeout
2453
+ )
2454
+ return response_data.response
2455
+
2456
+
2457
+ def _user_update_in_app_notification_status_serialize(
2458
+ self,
2459
+ in_app_notification_patch_request,
2460
+ _request_auth,
2461
+ _content_type,
2462
+ _headers,
2463
+ _host_index,
2464
+ ) -> RequestSerialized:
2465
+
2466
+ _host = None
2467
+
2468
+ _collection_formats: Dict[str, str] = {
2469
+ }
2470
+
2471
+ _path_params: Dict[str, str] = {}
2472
+ _query_params: List[Tuple[str, str]] = []
2473
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2474
+ _form_params: List[Tuple[str, str]] = []
2475
+ _files: Dict[
2476
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2477
+ ] = {}
2478
+ _body_params: Optional[bytes] = None
2479
+
2480
+ # process the path parameters
2481
+ # process the query parameters
2482
+ # process the header parameters
2483
+ # process the form parameters
2484
+ # process the body parameter
2485
+ if in_app_notification_patch_request is not None:
2486
+ _body_params = in_app_notification_patch_request
2487
+
2488
+
2489
+ # set the HTTP header `Accept`
2490
+ if 'Accept' not in _header_params:
2491
+ _header_params['Accept'] = self.api_client.select_header_accept(
2492
+ [
2493
+ 'application/json'
2494
+ ]
2495
+ )
2496
+
2497
+ # set the HTTP header `Content-Type`
2498
+ if _content_type:
2499
+ _header_params['Content-Type'] = _content_type
2500
+ else:
2501
+ _default_content_type = (
2502
+ self.api_client.select_header_content_type(
2503
+ [
2504
+ 'application/json'
2505
+ ]
2506
+ )
2507
+ )
2508
+ if _default_content_type is not None:
2509
+ _header_params['Content-Type'] = _default_content_type
2510
+
2511
+ # authentication setting
2512
+ _auth_settings: List[str] = [
2513
+ 'endUserHashed',
2514
+ 'endUser',
2515
+ 'apiKey',
2516
+ 'clientCredentials'
2517
+ ]
2518
+
2519
+ return self.api_client.param_serialize(
2520
+ method='PATCH',
2521
+ resource_path='/user/inapp',
2522
+ path_params=_path_params,
2523
+ query_params=_query_params,
2524
+ header_params=_header_params,
2525
+ body=_body_params,
2526
+ post_params=_form_params,
2527
+ files=_files,
2528
+ auth_settings=_auth_settings,
2529
+ collection_formats=_collection_formats,
2530
+ _host=_host,
2531
+ _request_auth=_request_auth
2532
+ )
2533
+
2534
+