arbi 0.18.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.
- arbi/__init__.py +92 -0
- arbi/_base_client.py +2124 -0
- arbi/_client.py +442 -0
- arbi/_compat.py +219 -0
- arbi/_constants.py +14 -0
- arbi/_exceptions.py +108 -0
- arbi/_files.py +123 -0
- arbi/_models.py +872 -0
- arbi/_qs.py +150 -0
- arbi/_resource.py +43 -0
- arbi/_response.py +830 -0
- arbi/_streaming.py +333 -0
- arbi/_types.py +270 -0
- arbi/_utils/__init__.py +64 -0
- arbi/_utils/_compat.py +45 -0
- arbi/_utils/_datetime_parse.py +136 -0
- arbi/_utils/_logs.py +25 -0
- arbi/_utils/_proxy.py +65 -0
- arbi/_utils/_reflection.py +42 -0
- arbi/_utils/_resources_proxy.py +24 -0
- arbi/_utils/_streams.py +12 -0
- arbi/_utils/_sync.py +58 -0
- arbi/_utils/_transform.py +457 -0
- arbi/_utils/_typing.py +156 -0
- arbi/_utils/_utils.py +421 -0
- arbi/_version.py +4 -0
- arbi/lib/.keep +4 -0
- arbi/py.typed +0 -0
- arbi/resources/__init__.py +19 -0
- arbi/resources/api/__init__.py +145 -0
- arbi/resources/api/api.py +422 -0
- arbi/resources/api/assistant.py +312 -0
- arbi/resources/api/configs.py +533 -0
- arbi/resources/api/conversation/__init__.py +33 -0
- arbi/resources/api/conversation/conversation.py +648 -0
- arbi/resources/api/conversation/user.py +270 -0
- arbi/resources/api/document/__init__.py +33 -0
- arbi/resources/api/document/doctag.py +516 -0
- arbi/resources/api/document/document.py +929 -0
- arbi/resources/api/health.py +253 -0
- arbi/resources/api/notifications.py +478 -0
- arbi/resources/api/tag.py +409 -0
- arbi/resources/api/user/__init__.py +61 -0
- arbi/resources/api/user/contacts.py +322 -0
- arbi/resources/api/user/settings.py +283 -0
- arbi/resources/api/user/subscription.py +230 -0
- arbi/resources/api/user/user.py +943 -0
- arbi/resources/api/workspace.py +1198 -0
- arbi/types/__init__.py +8 -0
- arbi/types/api/__init__.py +94 -0
- arbi/types/api/assistant_query_params.py +95 -0
- arbi/types/api/assistant_retrieve_params.py +95 -0
- arbi/types/api/chunker_config_param.py +9 -0
- arbi/types/api/config_create_params.py +227 -0
- arbi/types/api/config_create_response.py +17 -0
- arbi/types/api/config_delete_response.py +11 -0
- arbi/types/api/config_get_versions_response.py +19 -0
- arbi/types/api/config_retrieve_response.py +234 -0
- arbi/types/api/conversation/__init__.py +8 -0
- arbi/types/api/conversation/user_add_params.py +11 -0
- arbi/types/api/conversation/user_add_response.py +11 -0
- arbi/types/api/conversation/user_remove_params.py +11 -0
- arbi/types/api/conversation/user_remove_response.py +11 -0
- arbi/types/api/conversation_delete_message_response.py +11 -0
- arbi/types/api/conversation_delete_response.py +11 -0
- arbi/types/api/conversation_retrieve_message_response.py +105 -0
- arbi/types/api/conversation_retrieve_threads_response.py +124 -0
- arbi/types/api/conversation_share_response.py +11 -0
- arbi/types/api/conversation_update_title_params.py +16 -0
- arbi/types/api/conversation_update_title_response.py +13 -0
- arbi/types/api/doc_response.py +66 -0
- arbi/types/api/document/__init__.py +11 -0
- arbi/types/api/document/doc_tag_response.py +40 -0
- arbi/types/api/document/doctag_create_params.py +35 -0
- arbi/types/api/document/doctag_create_response.py +10 -0
- arbi/types/api/document/doctag_delete_params.py +15 -0
- arbi/types/api/document/doctag_generate_params.py +22 -0
- arbi/types/api/document/doctag_generate_response.py +20 -0
- arbi/types/api/document/doctag_update_params.py +35 -0
- arbi/types/api/document_date_extractor_llm_config.py +29 -0
- arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
- arbi/types/api/document_delete_params.py +13 -0
- arbi/types/api/document_get_parsed_response.py +26 -0
- arbi/types/api/document_retrieve_params.py +16 -0
- arbi/types/api/document_retrieve_response.py +10 -0
- arbi/types/api/document_update_params.py +42 -0
- arbi/types/api/document_update_response.py +10 -0
- arbi/types/api/document_upload_from_url_params.py +26 -0
- arbi/types/api/document_upload_from_url_response.py +16 -0
- arbi/types/api/document_upload_params.py +26 -0
- arbi/types/api/document_upload_response.py +16 -0
- arbi/types/api/embedder_config.py +30 -0
- arbi/types/api/embedder_config_param.py +29 -0
- arbi/types/api/health_check_models_response.py +21 -0
- arbi/types/api/health_get_models_response.py +19 -0
- arbi/types/api/health_retrieve_status_response.py +49 -0
- arbi/types/api/model_citation_config.py +20 -0
- arbi/types/api/model_citation_config_param.py +20 -0
- arbi/types/api/notification_create_params.py +20 -0
- arbi/types/api/notification_create_response.py +47 -0
- arbi/types/api/notification_delete_params.py +13 -0
- arbi/types/api/notification_get_schemas_response.py +197 -0
- arbi/types/api/notification_list_response.py +47 -0
- arbi/types/api/notification_update_params.py +27 -0
- arbi/types/api/notification_update_response.py +47 -0
- arbi/types/api/parser_config_param.py +9 -0
- arbi/types/api/query_llm_config.py +30 -0
- arbi/types/api/query_llm_config_param.py +29 -0
- arbi/types/api/reranker_config.py +21 -0
- arbi/types/api/reranker_config_param.py +20 -0
- arbi/types/api/retriever_config.py +39 -0
- arbi/types/api/retriever_config_param.py +38 -0
- arbi/types/api/tag_create_params.py +49 -0
- arbi/types/api/tag_create_response.py +57 -0
- arbi/types/api/tag_delete_response.py +9 -0
- arbi/types/api/tag_update_params.py +22 -0
- arbi/types/api/tag_update_response.py +57 -0
- arbi/types/api/title_llm_config.py +29 -0
- arbi/types/api/title_llm_config_param.py +28 -0
- arbi/types/api/user/__init__.py +13 -0
- arbi/types/api/user/contact_create_params.py +13 -0
- arbi/types/api/user/contact_create_response.py +30 -0
- arbi/types/api/user/contact_delete_params.py +13 -0
- arbi/types/api/user/contact_list_response.py +30 -0
- arbi/types/api/user/setting_retrieve_response.py +89 -0
- arbi/types/api/user/setting_update_params.py +60 -0
- arbi/types/api/user/subscription_create_params.py +13 -0
- arbi/types/api/user/subscription_create_response.py +11 -0
- arbi/types/api/user/subscription_retrieve_response.py +48 -0
- arbi/types/api/user_change_password_params.py +18 -0
- arbi/types/api/user_change_password_response.py +11 -0
- arbi/types/api/user_check_sso_status_params.py +20 -0
- arbi/types/api/user_check_sso_status_response.py +25 -0
- arbi/types/api/user_list_products_response.py +37 -0
- arbi/types/api/user_list_workspaces_response.py +10 -0
- arbi/types/api/user_login_params.py +18 -0
- arbi/types/api/user_login_response.py +23 -0
- arbi/types/api/user_logout_response.py +9 -0
- arbi/types/api/user_register_params.py +22 -0
- arbi/types/api/user_response.py +26 -0
- arbi/types/api/user_verify_email_params.py +11 -0
- arbi/types/api/user_verify_email_response.py +9 -0
- arbi/types/api/workspace_copy_params.py +21 -0
- arbi/types/api/workspace_copy_response.py +25 -0
- arbi/types/api/workspace_create_protected_params.py +16 -0
- arbi/types/api/workspace_delete_response.py +9 -0
- arbi/types/api/workspace_get_conversations_response.py +30 -0
- arbi/types/api/workspace_get_documents_response.py +10 -0
- arbi/types/api/workspace_get_stats_response.py +17 -0
- arbi/types/api/workspace_get_tags_response.py +60 -0
- arbi/types/api/workspace_get_users_response.py +10 -0
- arbi/types/api/workspace_remove_user_params.py +11 -0
- arbi/types/api/workspace_remove_user_response.py +11 -0
- arbi/types/api/workspace_response.py +41 -0
- arbi/types/api/workspace_share_params.py +15 -0
- arbi/types/api/workspace_share_response.py +13 -0
- arbi/types/api/workspace_update_params.py +20 -0
- arbi/types/chunk.py +12 -0
- arbi/types/chunk_metadata.py +31 -0
- arbi/types/chunk_metadata_param.py +32 -0
- arbi/types/chunk_param.py +15 -0
- arbi-0.18.0.dist-info/METADATA +410 -0
- arbi-0.18.0.dist-info/RECORD +165 -0
- arbi-0.18.0.dist-info/WHEEL +4 -0
- arbi-0.18.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import Body, Query, Headers, NoneType, NotGiven, SequenceNotStr, not_given
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...types.api import notification_create_params, notification_delete_params, notification_update_params
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.api.notification_list_response import NotificationListResponse
|
|
22
|
+
from ...types.api.notification_create_response import NotificationCreateResponse
|
|
23
|
+
from ...types.api.notification_update_response import NotificationUpdateResponse
|
|
24
|
+
from ...types.api.notification_get_schemas_response import NotificationGetSchemasResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["NotificationsResource", "AsyncNotificationsResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class NotificationsResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> NotificationsResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return NotificationsResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> NotificationsResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return NotificationsResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
*,
|
|
52
|
+
messages: Iterable[notification_create_params.Message],
|
|
53
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
54
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
55
|
+
extra_headers: Headers | None = None,
|
|
56
|
+
extra_query: Query | None = None,
|
|
57
|
+
extra_body: Body | None = None,
|
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
59
|
+
) -> NotificationCreateResponse:
|
|
60
|
+
"""
|
|
61
|
+
Send E2E encrypted messages to one or more users.
|
|
62
|
+
|
|
63
|
+
Each message is encrypted with the recipient's individual shared key. Creates
|
|
64
|
+
bilateral notifications visible to both sender and recipient. If recipient is
|
|
65
|
+
online via WebSocket, delivers in real-time.
|
|
66
|
+
|
|
67
|
+
Returns the created notifications.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
extra_headers: Send extra headers
|
|
71
|
+
|
|
72
|
+
extra_query: Add additional query parameters to the request
|
|
73
|
+
|
|
74
|
+
extra_body: Add additional JSON properties to the request
|
|
75
|
+
|
|
76
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
77
|
+
"""
|
|
78
|
+
return self._post(
|
|
79
|
+
"/api/notifications/",
|
|
80
|
+
body=maybe_transform({"messages": messages}, notification_create_params.NotificationCreateParams),
|
|
81
|
+
options=make_request_options(
|
|
82
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
83
|
+
),
|
|
84
|
+
cast_to=NotificationCreateResponse,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
def update(
|
|
88
|
+
self,
|
|
89
|
+
*,
|
|
90
|
+
updates: Iterable[notification_update_params.Update],
|
|
91
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
92
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
93
|
+
extra_headers: Headers | None = None,
|
|
94
|
+
extra_query: Query | None = None,
|
|
95
|
+
extra_body: Body | None = None,
|
|
96
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
97
|
+
) -> NotificationUpdateResponse:
|
|
98
|
+
"""
|
|
99
|
+
Bulk update notifications.
|
|
100
|
+
|
|
101
|
+
Supports:
|
|
102
|
+
|
|
103
|
+
- content: Re-encrypt content (sender OR recipient can do this)
|
|
104
|
+
- read: Mark as read (only recipient can do this)
|
|
105
|
+
|
|
106
|
+
Returns the updated notifications.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
extra_headers: Send extra headers
|
|
110
|
+
|
|
111
|
+
extra_query: Add additional query parameters to the request
|
|
112
|
+
|
|
113
|
+
extra_body: Add additional JSON properties to the request
|
|
114
|
+
|
|
115
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
116
|
+
"""
|
|
117
|
+
return self._patch(
|
|
118
|
+
"/api/notifications/",
|
|
119
|
+
body=maybe_transform({"updates": updates}, notification_update_params.NotificationUpdateParams),
|
|
120
|
+
options=make_request_options(
|
|
121
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
122
|
+
),
|
|
123
|
+
cast_to=NotificationUpdateResponse,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def list(
|
|
127
|
+
self,
|
|
128
|
+
*,
|
|
129
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
130
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
131
|
+
extra_headers: Headers | None = None,
|
|
132
|
+
extra_query: Query | None = None,
|
|
133
|
+
extra_body: Body | None = None,
|
|
134
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
135
|
+
) -> NotificationListResponse:
|
|
136
|
+
"""
|
|
137
|
+
Retrieve all notifications for the current user.
|
|
138
|
+
|
|
139
|
+
Returns notifications ordered by most recent first. Bilateral model: user sees
|
|
140
|
+
notifications they sent OR received. Use POST /notifications/read to mark
|
|
141
|
+
specific notifications as read.
|
|
142
|
+
"""
|
|
143
|
+
return self._get(
|
|
144
|
+
"/api/notifications/",
|
|
145
|
+
options=make_request_options(
|
|
146
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
147
|
+
),
|
|
148
|
+
cast_to=NotificationListResponse,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
def delete(
|
|
152
|
+
self,
|
|
153
|
+
*,
|
|
154
|
+
external_ids: SequenceNotStr[str],
|
|
155
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
156
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
157
|
+
extra_headers: Headers | None = None,
|
|
158
|
+
extra_query: Query | None = None,
|
|
159
|
+
extra_body: Body | None = None,
|
|
160
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
161
|
+
) -> None:
|
|
162
|
+
"""
|
|
163
|
+
Delete one or more notifications (bilateral - sender or recipient can delete).
|
|
164
|
+
|
|
165
|
+
Args:
|
|
166
|
+
extra_headers: Send extra headers
|
|
167
|
+
|
|
168
|
+
extra_query: Add additional query parameters to the request
|
|
169
|
+
|
|
170
|
+
extra_body: Add additional JSON properties to the request
|
|
171
|
+
|
|
172
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
173
|
+
"""
|
|
174
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
175
|
+
return self._delete(
|
|
176
|
+
"/api/notifications/",
|
|
177
|
+
body=maybe_transform({"external_ids": external_ids}, notification_delete_params.NotificationDeleteParams),
|
|
178
|
+
options=make_request_options(
|
|
179
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
180
|
+
),
|
|
181
|
+
cast_to=NoneType,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
def get_schemas(
|
|
185
|
+
self,
|
|
186
|
+
*,
|
|
187
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
188
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
189
|
+
extra_headers: Headers | None = None,
|
|
190
|
+
extra_query: Query | None = None,
|
|
191
|
+
extra_body: Body | None = None,
|
|
192
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
193
|
+
) -> NotificationGetSchemasResponse:
|
|
194
|
+
"""
|
|
195
|
+
Expose all WebSocket message types in the OpenAPI schema.
|
|
196
|
+
|
|
197
|
+
- server_messages: Messages sent from server to client
|
|
198
|
+
- client_messages: Messages sent from client to server
|
|
199
|
+
|
|
200
|
+
Frontend can autogenerate TypeScript types from OpenAPI schema components.
|
|
201
|
+
"""
|
|
202
|
+
return self._get(
|
|
203
|
+
"/api/notifications/ws-schemas",
|
|
204
|
+
options=make_request_options(
|
|
205
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
206
|
+
),
|
|
207
|
+
cast_to=NotificationGetSchemasResponse,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class AsyncNotificationsResource(AsyncAPIResource):
|
|
212
|
+
@cached_property
|
|
213
|
+
def with_raw_response(self) -> AsyncNotificationsResourceWithRawResponse:
|
|
214
|
+
"""
|
|
215
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
216
|
+
the raw response object instead of the parsed content.
|
|
217
|
+
|
|
218
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
219
|
+
"""
|
|
220
|
+
return AsyncNotificationsResourceWithRawResponse(self)
|
|
221
|
+
|
|
222
|
+
@cached_property
|
|
223
|
+
def with_streaming_response(self) -> AsyncNotificationsResourceWithStreamingResponse:
|
|
224
|
+
"""
|
|
225
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
226
|
+
|
|
227
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
228
|
+
"""
|
|
229
|
+
return AsyncNotificationsResourceWithStreamingResponse(self)
|
|
230
|
+
|
|
231
|
+
async def create(
|
|
232
|
+
self,
|
|
233
|
+
*,
|
|
234
|
+
messages: Iterable[notification_create_params.Message],
|
|
235
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
236
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
237
|
+
extra_headers: Headers | None = None,
|
|
238
|
+
extra_query: Query | None = None,
|
|
239
|
+
extra_body: Body | None = None,
|
|
240
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
241
|
+
) -> NotificationCreateResponse:
|
|
242
|
+
"""
|
|
243
|
+
Send E2E encrypted messages to one or more users.
|
|
244
|
+
|
|
245
|
+
Each message is encrypted with the recipient's individual shared key. Creates
|
|
246
|
+
bilateral notifications visible to both sender and recipient. If recipient is
|
|
247
|
+
online via WebSocket, delivers in real-time.
|
|
248
|
+
|
|
249
|
+
Returns the created notifications.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
extra_headers: Send extra headers
|
|
253
|
+
|
|
254
|
+
extra_query: Add additional query parameters to the request
|
|
255
|
+
|
|
256
|
+
extra_body: Add additional JSON properties to the request
|
|
257
|
+
|
|
258
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
259
|
+
"""
|
|
260
|
+
return await self._post(
|
|
261
|
+
"/api/notifications/",
|
|
262
|
+
body=await async_maybe_transform(
|
|
263
|
+
{"messages": messages}, notification_create_params.NotificationCreateParams
|
|
264
|
+
),
|
|
265
|
+
options=make_request_options(
|
|
266
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
267
|
+
),
|
|
268
|
+
cast_to=NotificationCreateResponse,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
async def update(
|
|
272
|
+
self,
|
|
273
|
+
*,
|
|
274
|
+
updates: Iterable[notification_update_params.Update],
|
|
275
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
276
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
277
|
+
extra_headers: Headers | None = None,
|
|
278
|
+
extra_query: Query | None = None,
|
|
279
|
+
extra_body: Body | None = None,
|
|
280
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
281
|
+
) -> NotificationUpdateResponse:
|
|
282
|
+
"""
|
|
283
|
+
Bulk update notifications.
|
|
284
|
+
|
|
285
|
+
Supports:
|
|
286
|
+
|
|
287
|
+
- content: Re-encrypt content (sender OR recipient can do this)
|
|
288
|
+
- read: Mark as read (only recipient can do this)
|
|
289
|
+
|
|
290
|
+
Returns the updated notifications.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
extra_headers: Send extra headers
|
|
294
|
+
|
|
295
|
+
extra_query: Add additional query parameters to the request
|
|
296
|
+
|
|
297
|
+
extra_body: Add additional JSON properties to the request
|
|
298
|
+
|
|
299
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
300
|
+
"""
|
|
301
|
+
return await self._patch(
|
|
302
|
+
"/api/notifications/",
|
|
303
|
+
body=await async_maybe_transform({"updates": updates}, notification_update_params.NotificationUpdateParams),
|
|
304
|
+
options=make_request_options(
|
|
305
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
306
|
+
),
|
|
307
|
+
cast_to=NotificationUpdateResponse,
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
async def list(
|
|
311
|
+
self,
|
|
312
|
+
*,
|
|
313
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
314
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
315
|
+
extra_headers: Headers | None = None,
|
|
316
|
+
extra_query: Query | None = None,
|
|
317
|
+
extra_body: Body | None = None,
|
|
318
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
319
|
+
) -> NotificationListResponse:
|
|
320
|
+
"""
|
|
321
|
+
Retrieve all notifications for the current user.
|
|
322
|
+
|
|
323
|
+
Returns notifications ordered by most recent first. Bilateral model: user sees
|
|
324
|
+
notifications they sent OR received. Use POST /notifications/read to mark
|
|
325
|
+
specific notifications as read.
|
|
326
|
+
"""
|
|
327
|
+
return await self._get(
|
|
328
|
+
"/api/notifications/",
|
|
329
|
+
options=make_request_options(
|
|
330
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
331
|
+
),
|
|
332
|
+
cast_to=NotificationListResponse,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def delete(
|
|
336
|
+
self,
|
|
337
|
+
*,
|
|
338
|
+
external_ids: SequenceNotStr[str],
|
|
339
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
340
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
341
|
+
extra_headers: Headers | None = None,
|
|
342
|
+
extra_query: Query | None = None,
|
|
343
|
+
extra_body: Body | None = None,
|
|
344
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
345
|
+
) -> None:
|
|
346
|
+
"""
|
|
347
|
+
Delete one or more notifications (bilateral - sender or recipient can delete).
|
|
348
|
+
|
|
349
|
+
Args:
|
|
350
|
+
extra_headers: Send extra headers
|
|
351
|
+
|
|
352
|
+
extra_query: Add additional query parameters to the request
|
|
353
|
+
|
|
354
|
+
extra_body: Add additional JSON properties to the request
|
|
355
|
+
|
|
356
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
357
|
+
"""
|
|
358
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
359
|
+
return await self._delete(
|
|
360
|
+
"/api/notifications/",
|
|
361
|
+
body=await async_maybe_transform(
|
|
362
|
+
{"external_ids": external_ids}, notification_delete_params.NotificationDeleteParams
|
|
363
|
+
),
|
|
364
|
+
options=make_request_options(
|
|
365
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
366
|
+
),
|
|
367
|
+
cast_to=NoneType,
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
async def get_schemas(
|
|
371
|
+
self,
|
|
372
|
+
*,
|
|
373
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
374
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
375
|
+
extra_headers: Headers | None = None,
|
|
376
|
+
extra_query: Query | None = None,
|
|
377
|
+
extra_body: Body | None = None,
|
|
378
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
379
|
+
) -> NotificationGetSchemasResponse:
|
|
380
|
+
"""
|
|
381
|
+
Expose all WebSocket message types in the OpenAPI schema.
|
|
382
|
+
|
|
383
|
+
- server_messages: Messages sent from server to client
|
|
384
|
+
- client_messages: Messages sent from client to server
|
|
385
|
+
|
|
386
|
+
Frontend can autogenerate TypeScript types from OpenAPI schema components.
|
|
387
|
+
"""
|
|
388
|
+
return await self._get(
|
|
389
|
+
"/api/notifications/ws-schemas",
|
|
390
|
+
options=make_request_options(
|
|
391
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
392
|
+
),
|
|
393
|
+
cast_to=NotificationGetSchemasResponse,
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
class NotificationsResourceWithRawResponse:
|
|
398
|
+
def __init__(self, notifications: NotificationsResource) -> None:
|
|
399
|
+
self._notifications = notifications
|
|
400
|
+
|
|
401
|
+
self.create = to_raw_response_wrapper(
|
|
402
|
+
notifications.create,
|
|
403
|
+
)
|
|
404
|
+
self.update = to_raw_response_wrapper(
|
|
405
|
+
notifications.update,
|
|
406
|
+
)
|
|
407
|
+
self.list = to_raw_response_wrapper(
|
|
408
|
+
notifications.list,
|
|
409
|
+
)
|
|
410
|
+
self.delete = to_raw_response_wrapper(
|
|
411
|
+
notifications.delete,
|
|
412
|
+
)
|
|
413
|
+
self.get_schemas = to_raw_response_wrapper(
|
|
414
|
+
notifications.get_schemas,
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
class AsyncNotificationsResourceWithRawResponse:
|
|
419
|
+
def __init__(self, notifications: AsyncNotificationsResource) -> None:
|
|
420
|
+
self._notifications = notifications
|
|
421
|
+
|
|
422
|
+
self.create = async_to_raw_response_wrapper(
|
|
423
|
+
notifications.create,
|
|
424
|
+
)
|
|
425
|
+
self.update = async_to_raw_response_wrapper(
|
|
426
|
+
notifications.update,
|
|
427
|
+
)
|
|
428
|
+
self.list = async_to_raw_response_wrapper(
|
|
429
|
+
notifications.list,
|
|
430
|
+
)
|
|
431
|
+
self.delete = async_to_raw_response_wrapper(
|
|
432
|
+
notifications.delete,
|
|
433
|
+
)
|
|
434
|
+
self.get_schemas = async_to_raw_response_wrapper(
|
|
435
|
+
notifications.get_schemas,
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class NotificationsResourceWithStreamingResponse:
|
|
440
|
+
def __init__(self, notifications: NotificationsResource) -> None:
|
|
441
|
+
self._notifications = notifications
|
|
442
|
+
|
|
443
|
+
self.create = to_streamed_response_wrapper(
|
|
444
|
+
notifications.create,
|
|
445
|
+
)
|
|
446
|
+
self.update = to_streamed_response_wrapper(
|
|
447
|
+
notifications.update,
|
|
448
|
+
)
|
|
449
|
+
self.list = to_streamed_response_wrapper(
|
|
450
|
+
notifications.list,
|
|
451
|
+
)
|
|
452
|
+
self.delete = to_streamed_response_wrapper(
|
|
453
|
+
notifications.delete,
|
|
454
|
+
)
|
|
455
|
+
self.get_schemas = to_streamed_response_wrapper(
|
|
456
|
+
notifications.get_schemas,
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
class AsyncNotificationsResourceWithStreamingResponse:
|
|
461
|
+
def __init__(self, notifications: AsyncNotificationsResource) -> None:
|
|
462
|
+
self._notifications = notifications
|
|
463
|
+
|
|
464
|
+
self.create = async_to_streamed_response_wrapper(
|
|
465
|
+
notifications.create,
|
|
466
|
+
)
|
|
467
|
+
self.update = async_to_streamed_response_wrapper(
|
|
468
|
+
notifications.update,
|
|
469
|
+
)
|
|
470
|
+
self.list = async_to_streamed_response_wrapper(
|
|
471
|
+
notifications.list,
|
|
472
|
+
)
|
|
473
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
474
|
+
notifications.delete,
|
|
475
|
+
)
|
|
476
|
+
self.get_schemas = async_to_streamed_response_wrapper(
|
|
477
|
+
notifications.get_schemas,
|
|
478
|
+
)
|