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.
Files changed (165) hide show
  1. arbi/__init__.py +92 -0
  2. arbi/_base_client.py +2124 -0
  3. arbi/_client.py +442 -0
  4. arbi/_compat.py +219 -0
  5. arbi/_constants.py +14 -0
  6. arbi/_exceptions.py +108 -0
  7. arbi/_files.py +123 -0
  8. arbi/_models.py +872 -0
  9. arbi/_qs.py +150 -0
  10. arbi/_resource.py +43 -0
  11. arbi/_response.py +830 -0
  12. arbi/_streaming.py +333 -0
  13. arbi/_types.py +270 -0
  14. arbi/_utils/__init__.py +64 -0
  15. arbi/_utils/_compat.py +45 -0
  16. arbi/_utils/_datetime_parse.py +136 -0
  17. arbi/_utils/_logs.py +25 -0
  18. arbi/_utils/_proxy.py +65 -0
  19. arbi/_utils/_reflection.py +42 -0
  20. arbi/_utils/_resources_proxy.py +24 -0
  21. arbi/_utils/_streams.py +12 -0
  22. arbi/_utils/_sync.py +58 -0
  23. arbi/_utils/_transform.py +457 -0
  24. arbi/_utils/_typing.py +156 -0
  25. arbi/_utils/_utils.py +421 -0
  26. arbi/_version.py +4 -0
  27. arbi/lib/.keep +4 -0
  28. arbi/py.typed +0 -0
  29. arbi/resources/__init__.py +19 -0
  30. arbi/resources/api/__init__.py +145 -0
  31. arbi/resources/api/api.py +422 -0
  32. arbi/resources/api/assistant.py +312 -0
  33. arbi/resources/api/configs.py +533 -0
  34. arbi/resources/api/conversation/__init__.py +33 -0
  35. arbi/resources/api/conversation/conversation.py +648 -0
  36. arbi/resources/api/conversation/user.py +270 -0
  37. arbi/resources/api/document/__init__.py +33 -0
  38. arbi/resources/api/document/doctag.py +516 -0
  39. arbi/resources/api/document/document.py +929 -0
  40. arbi/resources/api/health.py +253 -0
  41. arbi/resources/api/notifications.py +478 -0
  42. arbi/resources/api/tag.py +409 -0
  43. arbi/resources/api/user/__init__.py +61 -0
  44. arbi/resources/api/user/contacts.py +322 -0
  45. arbi/resources/api/user/settings.py +283 -0
  46. arbi/resources/api/user/subscription.py +230 -0
  47. arbi/resources/api/user/user.py +943 -0
  48. arbi/resources/api/workspace.py +1198 -0
  49. arbi/types/__init__.py +8 -0
  50. arbi/types/api/__init__.py +94 -0
  51. arbi/types/api/assistant_query_params.py +95 -0
  52. arbi/types/api/assistant_retrieve_params.py +95 -0
  53. arbi/types/api/chunker_config_param.py +9 -0
  54. arbi/types/api/config_create_params.py +227 -0
  55. arbi/types/api/config_create_response.py +17 -0
  56. arbi/types/api/config_delete_response.py +11 -0
  57. arbi/types/api/config_get_versions_response.py +19 -0
  58. arbi/types/api/config_retrieve_response.py +234 -0
  59. arbi/types/api/conversation/__init__.py +8 -0
  60. arbi/types/api/conversation/user_add_params.py +11 -0
  61. arbi/types/api/conversation/user_add_response.py +11 -0
  62. arbi/types/api/conversation/user_remove_params.py +11 -0
  63. arbi/types/api/conversation/user_remove_response.py +11 -0
  64. arbi/types/api/conversation_delete_message_response.py +11 -0
  65. arbi/types/api/conversation_delete_response.py +11 -0
  66. arbi/types/api/conversation_retrieve_message_response.py +105 -0
  67. arbi/types/api/conversation_retrieve_threads_response.py +124 -0
  68. arbi/types/api/conversation_share_response.py +11 -0
  69. arbi/types/api/conversation_update_title_params.py +16 -0
  70. arbi/types/api/conversation_update_title_response.py +13 -0
  71. arbi/types/api/doc_response.py +66 -0
  72. arbi/types/api/document/__init__.py +11 -0
  73. arbi/types/api/document/doc_tag_response.py +40 -0
  74. arbi/types/api/document/doctag_create_params.py +35 -0
  75. arbi/types/api/document/doctag_create_response.py +10 -0
  76. arbi/types/api/document/doctag_delete_params.py +15 -0
  77. arbi/types/api/document/doctag_generate_params.py +22 -0
  78. arbi/types/api/document/doctag_generate_response.py +20 -0
  79. arbi/types/api/document/doctag_update_params.py +35 -0
  80. arbi/types/api/document_date_extractor_llm_config.py +29 -0
  81. arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
  82. arbi/types/api/document_delete_params.py +13 -0
  83. arbi/types/api/document_get_parsed_response.py +26 -0
  84. arbi/types/api/document_retrieve_params.py +16 -0
  85. arbi/types/api/document_retrieve_response.py +10 -0
  86. arbi/types/api/document_update_params.py +42 -0
  87. arbi/types/api/document_update_response.py +10 -0
  88. arbi/types/api/document_upload_from_url_params.py +26 -0
  89. arbi/types/api/document_upload_from_url_response.py +16 -0
  90. arbi/types/api/document_upload_params.py +26 -0
  91. arbi/types/api/document_upload_response.py +16 -0
  92. arbi/types/api/embedder_config.py +30 -0
  93. arbi/types/api/embedder_config_param.py +29 -0
  94. arbi/types/api/health_check_models_response.py +21 -0
  95. arbi/types/api/health_get_models_response.py +19 -0
  96. arbi/types/api/health_retrieve_status_response.py +49 -0
  97. arbi/types/api/model_citation_config.py +20 -0
  98. arbi/types/api/model_citation_config_param.py +20 -0
  99. arbi/types/api/notification_create_params.py +20 -0
  100. arbi/types/api/notification_create_response.py +47 -0
  101. arbi/types/api/notification_delete_params.py +13 -0
  102. arbi/types/api/notification_get_schemas_response.py +197 -0
  103. arbi/types/api/notification_list_response.py +47 -0
  104. arbi/types/api/notification_update_params.py +27 -0
  105. arbi/types/api/notification_update_response.py +47 -0
  106. arbi/types/api/parser_config_param.py +9 -0
  107. arbi/types/api/query_llm_config.py +30 -0
  108. arbi/types/api/query_llm_config_param.py +29 -0
  109. arbi/types/api/reranker_config.py +21 -0
  110. arbi/types/api/reranker_config_param.py +20 -0
  111. arbi/types/api/retriever_config.py +39 -0
  112. arbi/types/api/retriever_config_param.py +38 -0
  113. arbi/types/api/tag_create_params.py +49 -0
  114. arbi/types/api/tag_create_response.py +57 -0
  115. arbi/types/api/tag_delete_response.py +9 -0
  116. arbi/types/api/tag_update_params.py +22 -0
  117. arbi/types/api/tag_update_response.py +57 -0
  118. arbi/types/api/title_llm_config.py +29 -0
  119. arbi/types/api/title_llm_config_param.py +28 -0
  120. arbi/types/api/user/__init__.py +13 -0
  121. arbi/types/api/user/contact_create_params.py +13 -0
  122. arbi/types/api/user/contact_create_response.py +30 -0
  123. arbi/types/api/user/contact_delete_params.py +13 -0
  124. arbi/types/api/user/contact_list_response.py +30 -0
  125. arbi/types/api/user/setting_retrieve_response.py +89 -0
  126. arbi/types/api/user/setting_update_params.py +60 -0
  127. arbi/types/api/user/subscription_create_params.py +13 -0
  128. arbi/types/api/user/subscription_create_response.py +11 -0
  129. arbi/types/api/user/subscription_retrieve_response.py +48 -0
  130. arbi/types/api/user_change_password_params.py +18 -0
  131. arbi/types/api/user_change_password_response.py +11 -0
  132. arbi/types/api/user_check_sso_status_params.py +20 -0
  133. arbi/types/api/user_check_sso_status_response.py +25 -0
  134. arbi/types/api/user_list_products_response.py +37 -0
  135. arbi/types/api/user_list_workspaces_response.py +10 -0
  136. arbi/types/api/user_login_params.py +18 -0
  137. arbi/types/api/user_login_response.py +23 -0
  138. arbi/types/api/user_logout_response.py +9 -0
  139. arbi/types/api/user_register_params.py +22 -0
  140. arbi/types/api/user_response.py +26 -0
  141. arbi/types/api/user_verify_email_params.py +11 -0
  142. arbi/types/api/user_verify_email_response.py +9 -0
  143. arbi/types/api/workspace_copy_params.py +21 -0
  144. arbi/types/api/workspace_copy_response.py +25 -0
  145. arbi/types/api/workspace_create_protected_params.py +16 -0
  146. arbi/types/api/workspace_delete_response.py +9 -0
  147. arbi/types/api/workspace_get_conversations_response.py +30 -0
  148. arbi/types/api/workspace_get_documents_response.py +10 -0
  149. arbi/types/api/workspace_get_stats_response.py +17 -0
  150. arbi/types/api/workspace_get_tags_response.py +60 -0
  151. arbi/types/api/workspace_get_users_response.py +10 -0
  152. arbi/types/api/workspace_remove_user_params.py +11 -0
  153. arbi/types/api/workspace_remove_user_response.py +11 -0
  154. arbi/types/api/workspace_response.py +41 -0
  155. arbi/types/api/workspace_share_params.py +15 -0
  156. arbi/types/api/workspace_share_response.py +13 -0
  157. arbi/types/api/workspace_update_params.py +20 -0
  158. arbi/types/chunk.py +12 -0
  159. arbi/types/chunk_metadata.py +31 -0
  160. arbi/types/chunk_metadata_param.py +32 -0
  161. arbi/types/chunk_param.py +15 -0
  162. arbi-0.18.0.dist-info/METADATA +410 -0
  163. arbi-0.18.0.dist-info/RECORD +165 -0
  164. arbi-0.18.0.dist-info/WHEEL +4 -0
  165. arbi-0.18.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,322 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ...._types import Body, Query, Headers, NoneType, NotGiven, SequenceNotStr, not_given
8
+ from ...._utils import maybe_transform, async_maybe_transform
9
+ from ...._compat import cached_property
10
+ from ...._resource import SyncAPIResource, AsyncAPIResource
11
+ from ...._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ...._base_client import make_request_options
18
+ from ....types.api.user import contact_create_params, contact_delete_params
19
+ from ....types.api.user.contact_list_response import ContactListResponse
20
+ from ....types.api.user.contact_create_response import ContactCreateResponse
21
+
22
+ __all__ = ["ContactsResource", "AsyncContactsResource"]
23
+
24
+
25
+ class ContactsResource(SyncAPIResource):
26
+ @cached_property
27
+ def with_raw_response(self) -> ContactsResourceWithRawResponse:
28
+ """
29
+ This property can be used as a prefix for any HTTP method call to return
30
+ the raw response object instead of the parsed content.
31
+
32
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
33
+ """
34
+ return ContactsResourceWithRawResponse(self)
35
+
36
+ @cached_property
37
+ def with_streaming_response(self) -> ContactsResourceWithStreamingResponse:
38
+ """
39
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
40
+
41
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
42
+ """
43
+ return ContactsResourceWithStreamingResponse(self)
44
+
45
+ def create(
46
+ self,
47
+ *,
48
+ emails: SequenceNotStr[str],
49
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50
+ # The extra values given here take precedence over values defined on the client or passed to this method.
51
+ extra_headers: Headers | None = None,
52
+ extra_query: Query | None = None,
53
+ extra_body: Body | None = None,
54
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
55
+ ) -> ContactCreateResponse:
56
+ """
57
+ Add multiple contacts by email addresses.
58
+
59
+ For each email:
60
+
61
+ - If user already exists: Adds them to contacts with status="registered"
62
+ - If user doesn't exist: Sends invitation email and creates contact with
63
+ status="invited"
64
+
65
+ Protected endpoint - requires authentication. Returns list of created contact
66
+ records.
67
+
68
+ Args:
69
+ extra_headers: Send extra headers
70
+
71
+ extra_query: Add additional query parameters to the request
72
+
73
+ extra_body: Add additional JSON properties to the request
74
+
75
+ timeout: Override the client-level default timeout for this request, in seconds
76
+ """
77
+ return self._post(
78
+ "/api/user/contacts",
79
+ body=maybe_transform({"emails": emails}, contact_create_params.ContactCreateParams),
80
+ options=make_request_options(
81
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
82
+ ),
83
+ cast_to=ContactCreateResponse,
84
+ )
85
+
86
+ def list(
87
+ self,
88
+ *,
89
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
90
+ # The extra values given here take precedence over values defined on the client or passed to this method.
91
+ extra_headers: Headers | None = None,
92
+ extra_query: Query | None = None,
93
+ extra_body: Body | None = None,
94
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
95
+ ) -> ContactListResponse:
96
+ """Get all contacts created by the current user.
97
+
98
+ Uses RLS to enforce that users can
99
+ only see their own contacts. Includes registered user info when available.
100
+ """
101
+ return self._get(
102
+ "/api/user/contacts",
103
+ options=make_request_options(
104
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
105
+ ),
106
+ cast_to=ContactListResponse,
107
+ )
108
+
109
+ def delete(
110
+ self,
111
+ *,
112
+ contact_ids: SequenceNotStr[str],
113
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
114
+ # The extra values given here take precedence over values defined on the client or passed to this method.
115
+ extra_headers: Headers | None = None,
116
+ extra_query: Query | None = None,
117
+ extra_body: Body | None = None,
118
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
119
+ ) -> None:
120
+ """Delete specific contacts by their external IDs.
121
+
122
+ Users can only delete their own
123
+ contacts (enforced by RLS).
124
+
125
+ Args:
126
+ extra_headers: Send extra headers
127
+
128
+ extra_query: Add additional query parameters to the request
129
+
130
+ extra_body: Add additional JSON properties to the request
131
+
132
+ timeout: Override the client-level default timeout for this request, in seconds
133
+ """
134
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
135
+ return self._delete(
136
+ "/api/user/contacts",
137
+ body=maybe_transform({"contact_ids": contact_ids}, contact_delete_params.ContactDeleteParams),
138
+ options=make_request_options(
139
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
140
+ ),
141
+ cast_to=NoneType,
142
+ )
143
+
144
+
145
+ class AsyncContactsResource(AsyncAPIResource):
146
+ @cached_property
147
+ def with_raw_response(self) -> AsyncContactsResourceWithRawResponse:
148
+ """
149
+ This property can be used as a prefix for any HTTP method call to return
150
+ the raw response object instead of the parsed content.
151
+
152
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
153
+ """
154
+ return AsyncContactsResourceWithRawResponse(self)
155
+
156
+ @cached_property
157
+ def with_streaming_response(self) -> AsyncContactsResourceWithStreamingResponse:
158
+ """
159
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
160
+
161
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
162
+ """
163
+ return AsyncContactsResourceWithStreamingResponse(self)
164
+
165
+ async def create(
166
+ self,
167
+ *,
168
+ emails: SequenceNotStr[str],
169
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
170
+ # The extra values given here take precedence over values defined on the client or passed to this method.
171
+ extra_headers: Headers | None = None,
172
+ extra_query: Query | None = None,
173
+ extra_body: Body | None = None,
174
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
175
+ ) -> ContactCreateResponse:
176
+ """
177
+ Add multiple contacts by email addresses.
178
+
179
+ For each email:
180
+
181
+ - If user already exists: Adds them to contacts with status="registered"
182
+ - If user doesn't exist: Sends invitation email and creates contact with
183
+ status="invited"
184
+
185
+ Protected endpoint - requires authentication. Returns list of created contact
186
+ records.
187
+
188
+ Args:
189
+ extra_headers: Send extra headers
190
+
191
+ extra_query: Add additional query parameters to the request
192
+
193
+ extra_body: Add additional JSON properties to the request
194
+
195
+ timeout: Override the client-level default timeout for this request, in seconds
196
+ """
197
+ return await self._post(
198
+ "/api/user/contacts",
199
+ body=await async_maybe_transform({"emails": emails}, contact_create_params.ContactCreateParams),
200
+ options=make_request_options(
201
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
202
+ ),
203
+ cast_to=ContactCreateResponse,
204
+ )
205
+
206
+ async def list(
207
+ self,
208
+ *,
209
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
210
+ # The extra values given here take precedence over values defined on the client or passed to this method.
211
+ extra_headers: Headers | None = None,
212
+ extra_query: Query | None = None,
213
+ extra_body: Body | None = None,
214
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
215
+ ) -> ContactListResponse:
216
+ """Get all contacts created by the current user.
217
+
218
+ Uses RLS to enforce that users can
219
+ only see their own contacts. Includes registered user info when available.
220
+ """
221
+ return await self._get(
222
+ "/api/user/contacts",
223
+ options=make_request_options(
224
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
225
+ ),
226
+ cast_to=ContactListResponse,
227
+ )
228
+
229
+ async def delete(
230
+ self,
231
+ *,
232
+ contact_ids: SequenceNotStr[str],
233
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
234
+ # The extra values given here take precedence over values defined on the client or passed to this method.
235
+ extra_headers: Headers | None = None,
236
+ extra_query: Query | None = None,
237
+ extra_body: Body | None = None,
238
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
239
+ ) -> None:
240
+ """Delete specific contacts by their external IDs.
241
+
242
+ Users can only delete their own
243
+ contacts (enforced by RLS).
244
+
245
+ Args:
246
+ extra_headers: Send extra headers
247
+
248
+ extra_query: Add additional query parameters to the request
249
+
250
+ extra_body: Add additional JSON properties to the request
251
+
252
+ timeout: Override the client-level default timeout for this request, in seconds
253
+ """
254
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
255
+ return await self._delete(
256
+ "/api/user/contacts",
257
+ body=await async_maybe_transform({"contact_ids": contact_ids}, contact_delete_params.ContactDeleteParams),
258
+ options=make_request_options(
259
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
260
+ ),
261
+ cast_to=NoneType,
262
+ )
263
+
264
+
265
+ class ContactsResourceWithRawResponse:
266
+ def __init__(self, contacts: ContactsResource) -> None:
267
+ self._contacts = contacts
268
+
269
+ self.create = to_raw_response_wrapper(
270
+ contacts.create,
271
+ )
272
+ self.list = to_raw_response_wrapper(
273
+ contacts.list,
274
+ )
275
+ self.delete = to_raw_response_wrapper(
276
+ contacts.delete,
277
+ )
278
+
279
+
280
+ class AsyncContactsResourceWithRawResponse:
281
+ def __init__(self, contacts: AsyncContactsResource) -> None:
282
+ self._contacts = contacts
283
+
284
+ self.create = async_to_raw_response_wrapper(
285
+ contacts.create,
286
+ )
287
+ self.list = async_to_raw_response_wrapper(
288
+ contacts.list,
289
+ )
290
+ self.delete = async_to_raw_response_wrapper(
291
+ contacts.delete,
292
+ )
293
+
294
+
295
+ class ContactsResourceWithStreamingResponse:
296
+ def __init__(self, contacts: ContactsResource) -> None:
297
+ self._contacts = contacts
298
+
299
+ self.create = to_streamed_response_wrapper(
300
+ contacts.create,
301
+ )
302
+ self.list = to_streamed_response_wrapper(
303
+ contacts.list,
304
+ )
305
+ self.delete = to_streamed_response_wrapper(
306
+ contacts.delete,
307
+ )
308
+
309
+
310
+ class AsyncContactsResourceWithStreamingResponse:
311
+ def __init__(self, contacts: AsyncContactsResource) -> None:
312
+ self._contacts = contacts
313
+
314
+ self.create = async_to_streamed_response_wrapper(
315
+ contacts.create,
316
+ )
317
+ self.list = async_to_streamed_response_wrapper(
318
+ contacts.list,
319
+ )
320
+ self.delete = async_to_streamed_response_wrapper(
321
+ contacts.delete,
322
+ )
@@ -0,0 +1,283 @@
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, Optional
6
+
7
+ import httpx
8
+
9
+ from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, 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 ...._base_client import make_request_options
20
+ from ....types.api.user import setting_update_params
21
+ from ....types.api.user.setting_retrieve_response import SettingRetrieveResponse
22
+
23
+ __all__ = ["SettingsResource", "AsyncSettingsResource"]
24
+
25
+
26
+ class SettingsResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> SettingsResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
34
+ """
35
+ return SettingsResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
43
+ """
44
+ return SettingsResourceWithStreamingResponse(self)
45
+
46
+ def retrieve(
47
+ self,
48
+ *,
49
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50
+ # The extra values given here take precedence over values defined on the client or passed to this method.
51
+ extra_headers: Headers | None = None,
52
+ extra_query: Query | None = None,
53
+ extra_body: Body | None = None,
54
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
55
+ ) -> SettingRetrieveResponse:
56
+ """Get current user's settings."""
57
+ return self._get(
58
+ "/api/user/settings",
59
+ options=make_request_options(
60
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
61
+ ),
62
+ cast_to=SettingRetrieveResponse,
63
+ )
64
+
65
+ def update(
66
+ self,
67
+ *,
68
+ ai_mode: Optional[str] | Omit = omit,
69
+ hide_online_status: Optional[bool] | Omit = omit,
70
+ muted_users: Optional[SequenceNotStr[str]] | Omit = omit,
71
+ pinned_workspaces: Optional[SequenceNotStr[str]] | Omit = omit,
72
+ show_document_navigator: Optional[bool] | Omit = omit,
73
+ show_help_page: Optional[bool] | Omit = omit,
74
+ show_invite_tab: Optional[bool] | Omit = omit,
75
+ show_security_settings: Optional[bool] | Omit = omit,
76
+ show_smart_search: Optional[bool] | Omit = omit,
77
+ show_templates: Optional[bool] | Omit = omit,
78
+ show_thread_visualization: Optional[bool] | Omit = omit,
79
+ subscription: Optional[setting_update_params.Subscription] | Omit = omit,
80
+ tableviews: Optional[Iterable[setting_update_params.Tableview]] | Omit = omit,
81
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
82
+ # The extra values given here take precedence over values defined on the client or passed to this method.
83
+ extra_headers: Headers | None = None,
84
+ extra_query: Query | None = None,
85
+ extra_body: Body | None = None,
86
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
87
+ ) -> None:
88
+ """
89
+ Update user's settings (merge with existing).
90
+
91
+ Note: subscription fields are managed automatically and cannot be patched.
92
+
93
+ Args:
94
+ subscription: Trial update - only trial_expires can be set, and only if currently null.
95
+
96
+ extra_headers: Send extra headers
97
+
98
+ extra_query: Add additional query parameters to the request
99
+
100
+ extra_body: Add additional JSON properties to the request
101
+
102
+ timeout: Override the client-level default timeout for this request, in seconds
103
+ """
104
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
105
+ return self._patch(
106
+ "/api/user/settings",
107
+ body=maybe_transform(
108
+ {
109
+ "ai_mode": ai_mode,
110
+ "hide_online_status": hide_online_status,
111
+ "muted_users": muted_users,
112
+ "pinned_workspaces": pinned_workspaces,
113
+ "show_document_navigator": show_document_navigator,
114
+ "show_help_page": show_help_page,
115
+ "show_invite_tab": show_invite_tab,
116
+ "show_security_settings": show_security_settings,
117
+ "show_smart_search": show_smart_search,
118
+ "show_templates": show_templates,
119
+ "show_thread_visualization": show_thread_visualization,
120
+ "subscription": subscription,
121
+ "tableviews": tableviews,
122
+ },
123
+ setting_update_params.SettingUpdateParams,
124
+ ),
125
+ options=make_request_options(
126
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
127
+ ),
128
+ cast_to=NoneType,
129
+ )
130
+
131
+
132
+ class AsyncSettingsResource(AsyncAPIResource):
133
+ @cached_property
134
+ def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
135
+ """
136
+ This property can be used as a prefix for any HTTP method call to return
137
+ the raw response object instead of the parsed content.
138
+
139
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
140
+ """
141
+ return AsyncSettingsResourceWithRawResponse(self)
142
+
143
+ @cached_property
144
+ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
145
+ """
146
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
147
+
148
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
149
+ """
150
+ return AsyncSettingsResourceWithStreamingResponse(self)
151
+
152
+ async def retrieve(
153
+ self,
154
+ *,
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
+ ) -> SettingRetrieveResponse:
162
+ """Get current user's settings."""
163
+ return await self._get(
164
+ "/api/user/settings",
165
+ options=make_request_options(
166
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
167
+ ),
168
+ cast_to=SettingRetrieveResponse,
169
+ )
170
+
171
+ async def update(
172
+ self,
173
+ *,
174
+ ai_mode: Optional[str] | Omit = omit,
175
+ hide_online_status: Optional[bool] | Omit = omit,
176
+ muted_users: Optional[SequenceNotStr[str]] | Omit = omit,
177
+ pinned_workspaces: Optional[SequenceNotStr[str]] | Omit = omit,
178
+ show_document_navigator: Optional[bool] | Omit = omit,
179
+ show_help_page: Optional[bool] | Omit = omit,
180
+ show_invite_tab: Optional[bool] | Omit = omit,
181
+ show_security_settings: Optional[bool] | Omit = omit,
182
+ show_smart_search: Optional[bool] | Omit = omit,
183
+ show_templates: Optional[bool] | Omit = omit,
184
+ show_thread_visualization: Optional[bool] | Omit = omit,
185
+ subscription: Optional[setting_update_params.Subscription] | Omit = omit,
186
+ tableviews: Optional[Iterable[setting_update_params.Tableview]] | Omit = omit,
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
+ ) -> None:
194
+ """
195
+ Update user's settings (merge with existing).
196
+
197
+ Note: subscription fields are managed automatically and cannot be patched.
198
+
199
+ Args:
200
+ subscription: Trial update - only trial_expires can be set, and only if currently null.
201
+
202
+ extra_headers: Send extra headers
203
+
204
+ extra_query: Add additional query parameters to the request
205
+
206
+ extra_body: Add additional JSON properties to the request
207
+
208
+ timeout: Override the client-level default timeout for this request, in seconds
209
+ """
210
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
211
+ return await self._patch(
212
+ "/api/user/settings",
213
+ body=await async_maybe_transform(
214
+ {
215
+ "ai_mode": ai_mode,
216
+ "hide_online_status": hide_online_status,
217
+ "muted_users": muted_users,
218
+ "pinned_workspaces": pinned_workspaces,
219
+ "show_document_navigator": show_document_navigator,
220
+ "show_help_page": show_help_page,
221
+ "show_invite_tab": show_invite_tab,
222
+ "show_security_settings": show_security_settings,
223
+ "show_smart_search": show_smart_search,
224
+ "show_templates": show_templates,
225
+ "show_thread_visualization": show_thread_visualization,
226
+ "subscription": subscription,
227
+ "tableviews": tableviews,
228
+ },
229
+ setting_update_params.SettingUpdateParams,
230
+ ),
231
+ options=make_request_options(
232
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
233
+ ),
234
+ cast_to=NoneType,
235
+ )
236
+
237
+
238
+ class SettingsResourceWithRawResponse:
239
+ def __init__(self, settings: SettingsResource) -> None:
240
+ self._settings = settings
241
+
242
+ self.retrieve = to_raw_response_wrapper(
243
+ settings.retrieve,
244
+ )
245
+ self.update = to_raw_response_wrapper(
246
+ settings.update,
247
+ )
248
+
249
+
250
+ class AsyncSettingsResourceWithRawResponse:
251
+ def __init__(self, settings: AsyncSettingsResource) -> None:
252
+ self._settings = settings
253
+
254
+ self.retrieve = async_to_raw_response_wrapper(
255
+ settings.retrieve,
256
+ )
257
+ self.update = async_to_raw_response_wrapper(
258
+ settings.update,
259
+ )
260
+
261
+
262
+ class SettingsResourceWithStreamingResponse:
263
+ def __init__(self, settings: SettingsResource) -> None:
264
+ self._settings = settings
265
+
266
+ self.retrieve = to_streamed_response_wrapper(
267
+ settings.retrieve,
268
+ )
269
+ self.update = to_streamed_response_wrapper(
270
+ settings.update,
271
+ )
272
+
273
+
274
+ class AsyncSettingsResourceWithStreamingResponse:
275
+ def __init__(self, settings: AsyncSettingsResource) -> None:
276
+ self._settings = settings
277
+
278
+ self.retrieve = async_to_streamed_response_wrapper(
279
+ settings.retrieve,
280
+ )
281
+ self.update = async_to_streamed_response_wrapper(
282
+ settings.update,
283
+ )