studyfetch-sdk 0.1.0a1__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. studyfetch_sdk/__init__.py +100 -0
  2. studyfetch_sdk/_base_client.py +1992 -0
  3. studyfetch_sdk/_client.py +403 -0
  4. studyfetch_sdk/_compat.py +219 -0
  5. studyfetch_sdk/_constants.py +14 -0
  6. studyfetch_sdk/_exceptions.py +108 -0
  7. studyfetch_sdk/_files.py +123 -0
  8. studyfetch_sdk/_models.py +808 -0
  9. studyfetch_sdk/_qs.py +150 -0
  10. studyfetch_sdk/_resource.py +43 -0
  11. studyfetch_sdk/_response.py +832 -0
  12. studyfetch_sdk/_streaming.py +333 -0
  13. studyfetch_sdk/_types.py +219 -0
  14. studyfetch_sdk/_utils/__init__.py +57 -0
  15. studyfetch_sdk/_utils/_logs.py +25 -0
  16. studyfetch_sdk/_utils/_proxy.py +65 -0
  17. studyfetch_sdk/_utils/_reflection.py +42 -0
  18. studyfetch_sdk/_utils/_resources_proxy.py +24 -0
  19. studyfetch_sdk/_utils/_streams.py +12 -0
  20. studyfetch_sdk/_utils/_sync.py +86 -0
  21. studyfetch_sdk/_utils/_transform.py +447 -0
  22. studyfetch_sdk/_utils/_typing.py +151 -0
  23. studyfetch_sdk/_utils/_utils.py +422 -0
  24. studyfetch_sdk/_version.py +4 -0
  25. studyfetch_sdk/lib/.keep +4 -0
  26. studyfetch_sdk/py.typed +0 -0
  27. studyfetch_sdk/resources/__init__.py +19 -0
  28. studyfetch_sdk/resources/v1/__init__.py +215 -0
  29. studyfetch_sdk/resources/v1/audio_recaps/__init__.py +33 -0
  30. studyfetch_sdk/resources/v1/audio_recaps/audio_recaps.py +328 -0
  31. studyfetch_sdk/resources/v1/audio_recaps/sections.py +250 -0
  32. studyfetch_sdk/resources/v1/auth/__init__.py +61 -0
  33. studyfetch_sdk/resources/v1/auth/auth.py +620 -0
  34. studyfetch_sdk/resources/v1/auth/login.py +374 -0
  35. studyfetch_sdk/resources/v1/auth/number_2fa.py +457 -0
  36. studyfetch_sdk/resources/v1/auth/organization_invites.py +160 -0
  37. studyfetch_sdk/resources/v1/chat/__init__.py +47 -0
  38. studyfetch_sdk/resources/v1/chat/chat.py +576 -0
  39. studyfetch_sdk/resources/v1/chat/sessions.py +222 -0
  40. studyfetch_sdk/resources/v1/chat/test.py +190 -0
  41. studyfetch_sdk/resources/v1/components.py +943 -0
  42. studyfetch_sdk/resources/v1/embed/__init__.py +33 -0
  43. studyfetch_sdk/resources/v1/embed/component.py +278 -0
  44. studyfetch_sdk/resources/v1/embed/embed.py +346 -0
  45. studyfetch_sdk/resources/v1/explainers.py +216 -0
  46. studyfetch_sdk/resources/v1/flashcards.py +783 -0
  47. studyfetch_sdk/resources/v1/folders.py +744 -0
  48. studyfetch_sdk/resources/v1/materials/__init__.py +61 -0
  49. studyfetch_sdk/resources/v1/materials/bulk.py +134 -0
  50. studyfetch_sdk/resources/v1/materials/materials.py +1029 -0
  51. studyfetch_sdk/resources/v1/materials/test.py +290 -0
  52. studyfetch_sdk/resources/v1/materials/upload.py +410 -0
  53. studyfetch_sdk/resources/v1/organizations/__init__.py +103 -0
  54. studyfetch_sdk/resources/v1/organizations/api_keys.py +260 -0
  55. studyfetch_sdk/resources/v1/organizations/logo/__init__.py +33 -0
  56. studyfetch_sdk/resources/v1/organizations/logo/logo.py +166 -0
  57. studyfetch_sdk/resources/v1/organizations/logo/upload.py +184 -0
  58. studyfetch_sdk/resources/v1/organizations/organizations.py +428 -0
  59. studyfetch_sdk/resources/v1/organizations/profile/__init__.py +47 -0
  60. studyfetch_sdk/resources/v1/organizations/profile/models.py +134 -0
  61. studyfetch_sdk/resources/v1/organizations/profile/profile.py +248 -0
  62. studyfetch_sdk/resources/v1/organizations/profile/team.py +462 -0
  63. studyfetch_sdk/resources/v1/organizations/team/__init__.py +33 -0
  64. studyfetch_sdk/resources/v1/organizations/team/invite.py +236 -0
  65. studyfetch_sdk/resources/v1/organizations/team/team.py +564 -0
  66. studyfetch_sdk/resources/v1/organizations/theme.py +184 -0
  67. studyfetch_sdk/resources/v1/organizations/usage.py +160 -0
  68. studyfetch_sdk/resources/v1/scenarios/__init__.py +61 -0
  69. studyfetch_sdk/resources/v1/scenarios/component.py +330 -0
  70. studyfetch_sdk/resources/v1/scenarios/scenarios.py +708 -0
  71. studyfetch_sdk/resources/v1/scenarios/sessions.py +236 -0
  72. studyfetch_sdk/resources/v1/scenarios/submissions/__init__.py +33 -0
  73. studyfetch_sdk/resources/v1/scenarios/submissions/submissions.py +102 -0
  74. studyfetch_sdk/resources/v1/scenarios/submissions/user.py +210 -0
  75. studyfetch_sdk/resources/v1/tests/__init__.py +33 -0
  76. studyfetch_sdk/resources/v1/tests/component.py +160 -0
  77. studyfetch_sdk/resources/v1/tests/tests.py +682 -0
  78. studyfetch_sdk/resources/v1/upload/__init__.py +33 -0
  79. studyfetch_sdk/resources/v1/upload/component.py +388 -0
  80. studyfetch_sdk/resources/v1/upload/upload.py +102 -0
  81. studyfetch_sdk/resources/v1/usage.py +1126 -0
  82. studyfetch_sdk/resources/v1/v1.py +518 -0
  83. studyfetch_sdk/types/__init__.py +3 -0
  84. studyfetch_sdk/types/v1/__init__.py +52 -0
  85. studyfetch_sdk/types/v1/admin/__init__.py +3 -0
  86. studyfetch_sdk/types/v1/admin/organizations/__init__.py +3 -0
  87. studyfetch_sdk/types/v1/admin/organizations/models/__init__.py +3 -0
  88. studyfetch_sdk/types/v1/audio_recaps/__init__.py +3 -0
  89. studyfetch_sdk/types/v1/auth/__init__.py +13 -0
  90. studyfetch_sdk/types/v1/auth/login_authenticate_params.py +15 -0
  91. studyfetch_sdk/types/v1/auth/login_verify_2fa_params.py +15 -0
  92. studyfetch_sdk/types/v1/auth/login_verify_backup_code_params.py +17 -0
  93. studyfetch_sdk/types/v1/auth/number_2fa_disable_params.py +12 -0
  94. studyfetch_sdk/types/v1/auth/number_2fa_enable_params.py +12 -0
  95. studyfetch_sdk/types/v1/auth/number_2fa_regenerate_backup_codes_params.py +12 -0
  96. studyfetch_sdk/types/v1/auth/number_2fa_send_code_params.py +12 -0
  97. studyfetch_sdk/types/v1/auth_register_new_user_params.py +23 -0
  98. studyfetch_sdk/types/v1/auth_request_password_reset_params.py +12 -0
  99. studyfetch_sdk/types/v1/auth_reset_password_params.py +17 -0
  100. studyfetch_sdk/types/v1/chat/__init__.py +5 -0
  101. studyfetch_sdk/types/v1/chat/session_retrieve_params.py +11 -0
  102. studyfetch_sdk/types/v1/chat_retrieve_session_params.py +13 -0
  103. studyfetch_sdk/types/v1/chat_send_message_params.py +54 -0
  104. studyfetch_sdk/types/v1/chat_stream_params.py +28 -0
  105. studyfetch_sdk/types/v1/component_create_params.py +29 -0
  106. studyfetch_sdk/types/v1/component_create_response.py +46 -0
  107. studyfetch_sdk/types/v1/component_embed_params.py +99 -0
  108. studyfetch_sdk/types/v1/component_embed_response.py +38 -0
  109. studyfetch_sdk/types/v1/component_list_params.py +14 -0
  110. studyfetch_sdk/types/v1/component_list_response.py +49 -0
  111. studyfetch_sdk/types/v1/component_retrieve_response.py +46 -0
  112. studyfetch_sdk/types/v1/component_update_params.py +12 -0
  113. studyfetch_sdk/types/v1/component_update_response.py +46 -0
  114. studyfetch_sdk/types/v1/embed/__init__.py +6 -0
  115. studyfetch_sdk/types/v1/embed/component_interact_params.py +14 -0
  116. studyfetch_sdk/types/v1/embed/component_retrieve_params.py +12 -0
  117. studyfetch_sdk/types/v1/embed_get_theme_params.py +12 -0
  118. studyfetch_sdk/types/v1/embed_verify_params.py +12 -0
  119. studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +11 -0
  120. studyfetch_sdk/types/v1/flashcard_batch_process_params.py +36 -0
  121. studyfetch_sdk/types/v1/flashcard_batch_process_response.py +39 -0
  122. studyfetch_sdk/types/v1/flashcard_get_algorithm_info_response.py +37 -0
  123. studyfetch_sdk/types/v1/flashcard_get_all_params.py +23 -0
  124. studyfetch_sdk/types/v1/flashcard_get_due_params.py +19 -0
  125. studyfetch_sdk/types/v1/flashcard_get_stats_params.py +17 -0
  126. studyfetch_sdk/types/v1/flashcard_get_types_response.py +14 -0
  127. studyfetch_sdk/types/v1/flashcard_rate_params.py +23 -0
  128. studyfetch_sdk/types/v1/folder_create_params.py +17 -0
  129. studyfetch_sdk/types/v1/folder_list_params.py +14 -0
  130. studyfetch_sdk/types/v1/folder_update_params.py +17 -0
  131. studyfetch_sdk/types/v1/material_create_params.py +34 -0
  132. studyfetch_sdk/types/v1/material_create_response.py +62 -0
  133. studyfetch_sdk/types/v1/material_get_download_url_params.py +13 -0
  134. studyfetch_sdk/types/v1/material_list_params.py +14 -0
  135. studyfetch_sdk/types/v1/material_list_response.py +65 -0
  136. studyfetch_sdk/types/v1/material_retrieve_response.py +62 -0
  137. studyfetch_sdk/types/v1/materials/__init__.py +8 -0
  138. studyfetch_sdk/types/v1/materials/upload_upload_file_params.py +20 -0
  139. studyfetch_sdk/types/v1/materials/upload_upload_file_response.py +62 -0
  140. studyfetch_sdk/types/v1/materials/upload_upload_from_url_params.py +20 -0
  141. studyfetch_sdk/types/v1/materials/upload_upload_from_url_response.py +62 -0
  142. studyfetch_sdk/types/v1/organizations/__init__.py +3 -0
  143. studyfetch_sdk/types/v1/organizations/logo/__init__.py +3 -0
  144. studyfetch_sdk/types/v1/organizations/profile/__init__.py +3 -0
  145. studyfetch_sdk/types/v1/organizations/team/__init__.py +3 -0
  146. studyfetch_sdk/types/v1/scenario_create_params.py +11 -0
  147. studyfetch_sdk/types/v1/scenario_update_params.py +11 -0
  148. studyfetch_sdk/types/v1/scenarios/__init__.py +5 -0
  149. studyfetch_sdk/types/v1/scenarios/component_update_params.py +11 -0
  150. studyfetch_sdk/types/v1/scenarios/submissions/__init__.py +3 -0
  151. studyfetch_sdk/types/v1/test_create_params.py +20 -0
  152. studyfetch_sdk/types/v1/test_retake_params.py +14 -0
  153. studyfetch_sdk/types/v1/test_submit_answer_params.py +20 -0
  154. studyfetch_sdk/types/v1/test_submit_params.py +14 -0
  155. studyfetch_sdk/types/v1/tests/__init__.py +3 -0
  156. studyfetch_sdk/types/v1/upload/__init__.py +3 -0
  157. studyfetch_sdk/types/v1/usage_get_stats_params.py +23 -0
  158. studyfetch_sdk/types/v1/usage_get_summary_params.py +23 -0
  159. studyfetch_sdk/types/v1/usage_list_events_params.py +61 -0
  160. studyfetch_sdk/types/v1/usage_track_chat_params.py +54 -0
  161. studyfetch_sdk/types/v1/usage_track_event_params.py +128 -0
  162. studyfetch_sdk-0.1.0a1.dist-info/METADATA +453 -0
  163. studyfetch_sdk-0.1.0a1.dist-info/RECORD +165 -0
  164. studyfetch_sdk-0.1.0a1.dist-info/WHEEL +4 -0
  165. studyfetch_sdk-0.1.0a1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,457 @@
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 NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
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.v1.auth import (
19
+ number_2fa_enable_params,
20
+ number_2fa_disable_params,
21
+ number_2fa_send_code_params,
22
+ number_2fa_regenerate_backup_codes_params,
23
+ )
24
+
25
+ __all__ = ["Number2faResource", "AsyncNumber2faResource"]
26
+
27
+
28
+ class Number2faResource(SyncAPIResource):
29
+ @cached_property
30
+ def with_raw_response(self) -> Number2faResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
36
+ """
37
+ return Number2faResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> Number2faResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
45
+ """
46
+ return Number2faResourceWithStreamingResponse(self)
47
+
48
+ def disable(
49
+ self,
50
+ *,
51
+ password: str,
52
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53
+ # The extra values given here take precedence over values defined on the client or passed to this method.
54
+ extra_headers: Headers | None = None,
55
+ extra_query: Query | None = None,
56
+ extra_body: Body | None = None,
57
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58
+ ) -> None:
59
+ """
60
+ Args:
61
+ password: User password for verification
62
+
63
+ extra_headers: Send extra headers
64
+
65
+ extra_query: Add additional query parameters to the request
66
+
67
+ extra_body: Add additional JSON properties to the request
68
+
69
+ timeout: Override the client-level default timeout for this request, in seconds
70
+ """
71
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
72
+ return self._post(
73
+ "/api/v1/auth/2fa/disable",
74
+ body=maybe_transform({"password": password}, number_2fa_disable_params.Number2faDisableParams),
75
+ options=make_request_options(
76
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
+ ),
78
+ cast_to=NoneType,
79
+ )
80
+
81
+ def enable(
82
+ self,
83
+ *,
84
+ password: str,
85
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
+ # The extra values given here take precedence over values defined on the client or passed to this method.
87
+ extra_headers: Headers | None = None,
88
+ extra_query: Query | None = None,
89
+ extra_body: Body | None = None,
90
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91
+ ) -> None:
92
+ """
93
+ Args:
94
+ password: User password for verification
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._post(
106
+ "/api/v1/auth/2fa/enable",
107
+ body=maybe_transform({"password": password}, number_2fa_enable_params.Number2faEnableParams),
108
+ options=make_request_options(
109
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
110
+ ),
111
+ cast_to=NoneType,
112
+ )
113
+
114
+ def get_status(
115
+ self,
116
+ *,
117
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
118
+ # The extra values given here take precedence over values defined on the client or passed to this method.
119
+ extra_headers: Headers | None = None,
120
+ extra_query: Query | None = None,
121
+ extra_body: Body | None = None,
122
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
123
+ ) -> None:
124
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
125
+ return self._get(
126
+ "/api/v1/auth/2fa/status",
127
+ options=make_request_options(
128
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
129
+ ),
130
+ cast_to=NoneType,
131
+ )
132
+
133
+ def regenerate_backup_codes(
134
+ self,
135
+ *,
136
+ password: str,
137
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
138
+ # The extra values given here take precedence over values defined on the client or passed to this method.
139
+ extra_headers: Headers | None = None,
140
+ extra_query: Query | None = None,
141
+ extra_body: Body | None = None,
142
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
143
+ ) -> None:
144
+ """
145
+ Args:
146
+ password: User password for verification
147
+
148
+ extra_headers: Send extra headers
149
+
150
+ extra_query: Add additional query parameters to the request
151
+
152
+ extra_body: Add additional JSON properties to the request
153
+
154
+ timeout: Override the client-level default timeout for this request, in seconds
155
+ """
156
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
157
+ return self._post(
158
+ "/api/v1/auth/2fa/regenerate-backup-codes",
159
+ body=maybe_transform(
160
+ {"password": password}, number_2fa_regenerate_backup_codes_params.Number2faRegenerateBackupCodesParams
161
+ ),
162
+ options=make_request_options(
163
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
164
+ ),
165
+ cast_to=NoneType,
166
+ )
167
+
168
+ def send_code(
169
+ self,
170
+ *,
171
+ email: str,
172
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
173
+ # The extra values given here take precedence over values defined on the client or passed to this method.
174
+ extra_headers: Headers | None = None,
175
+ extra_query: Query | None = None,
176
+ extra_body: Body | None = None,
177
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
178
+ ) -> None:
179
+ """
180
+ Args:
181
+ email: Email to send verification code
182
+
183
+ extra_headers: Send extra headers
184
+
185
+ extra_query: Add additional query parameters to the request
186
+
187
+ extra_body: Add additional JSON properties to the request
188
+
189
+ timeout: Override the client-level default timeout for this request, in seconds
190
+ """
191
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
192
+ return self._post(
193
+ "/api/v1/auth/2fa/send-code",
194
+ body=maybe_transform({"email": email}, number_2fa_send_code_params.Number2faSendCodeParams),
195
+ options=make_request_options(
196
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
197
+ ),
198
+ cast_to=NoneType,
199
+ )
200
+
201
+
202
+ class AsyncNumber2faResource(AsyncAPIResource):
203
+ @cached_property
204
+ def with_raw_response(self) -> AsyncNumber2faResourceWithRawResponse:
205
+ """
206
+ This property can be used as a prefix for any HTTP method call to return
207
+ the raw response object instead of the parsed content.
208
+
209
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
210
+ """
211
+ return AsyncNumber2faResourceWithRawResponse(self)
212
+
213
+ @cached_property
214
+ def with_streaming_response(self) -> AsyncNumber2faResourceWithStreamingResponse:
215
+ """
216
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
217
+
218
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
219
+ """
220
+ return AsyncNumber2faResourceWithStreamingResponse(self)
221
+
222
+ async def disable(
223
+ self,
224
+ *,
225
+ password: str,
226
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
227
+ # The extra values given here take precedence over values defined on the client or passed to this method.
228
+ extra_headers: Headers | None = None,
229
+ extra_query: Query | None = None,
230
+ extra_body: Body | None = None,
231
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
232
+ ) -> None:
233
+ """
234
+ Args:
235
+ password: User password for verification
236
+
237
+ extra_headers: Send extra headers
238
+
239
+ extra_query: Add additional query parameters to the request
240
+
241
+ extra_body: Add additional JSON properties to the request
242
+
243
+ timeout: Override the client-level default timeout for this request, in seconds
244
+ """
245
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
246
+ return await self._post(
247
+ "/api/v1/auth/2fa/disable",
248
+ body=await async_maybe_transform({"password": password}, number_2fa_disable_params.Number2faDisableParams),
249
+ options=make_request_options(
250
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
251
+ ),
252
+ cast_to=NoneType,
253
+ )
254
+
255
+ async def enable(
256
+ self,
257
+ *,
258
+ password: str,
259
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
260
+ # The extra values given here take precedence over values defined on the client or passed to this method.
261
+ extra_headers: Headers | None = None,
262
+ extra_query: Query | None = None,
263
+ extra_body: Body | None = None,
264
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
265
+ ) -> None:
266
+ """
267
+ Args:
268
+ password: User password for verification
269
+
270
+ extra_headers: Send extra headers
271
+
272
+ extra_query: Add additional query parameters to the request
273
+
274
+ extra_body: Add additional JSON properties to the request
275
+
276
+ timeout: Override the client-level default timeout for this request, in seconds
277
+ """
278
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
279
+ return await self._post(
280
+ "/api/v1/auth/2fa/enable",
281
+ body=await async_maybe_transform({"password": password}, number_2fa_enable_params.Number2faEnableParams),
282
+ options=make_request_options(
283
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
284
+ ),
285
+ cast_to=NoneType,
286
+ )
287
+
288
+ async def get_status(
289
+ self,
290
+ *,
291
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
292
+ # The extra values given here take precedence over values defined on the client or passed to this method.
293
+ extra_headers: Headers | None = None,
294
+ extra_query: Query | None = None,
295
+ extra_body: Body | None = None,
296
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
297
+ ) -> None:
298
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
299
+ return await self._get(
300
+ "/api/v1/auth/2fa/status",
301
+ options=make_request_options(
302
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
303
+ ),
304
+ cast_to=NoneType,
305
+ )
306
+
307
+ async def regenerate_backup_codes(
308
+ self,
309
+ *,
310
+ password: str,
311
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
312
+ # The extra values given here take precedence over values defined on the client or passed to this method.
313
+ extra_headers: Headers | None = None,
314
+ extra_query: Query | None = None,
315
+ extra_body: Body | None = None,
316
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
317
+ ) -> None:
318
+ """
319
+ Args:
320
+ password: User password for verification
321
+
322
+ extra_headers: Send extra headers
323
+
324
+ extra_query: Add additional query parameters to the request
325
+
326
+ extra_body: Add additional JSON properties to the request
327
+
328
+ timeout: Override the client-level default timeout for this request, in seconds
329
+ """
330
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
331
+ return await self._post(
332
+ "/api/v1/auth/2fa/regenerate-backup-codes",
333
+ body=await async_maybe_transform(
334
+ {"password": password}, number_2fa_regenerate_backup_codes_params.Number2faRegenerateBackupCodesParams
335
+ ),
336
+ options=make_request_options(
337
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
338
+ ),
339
+ cast_to=NoneType,
340
+ )
341
+
342
+ async def send_code(
343
+ self,
344
+ *,
345
+ email: str,
346
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
347
+ # The extra values given here take precedence over values defined on the client or passed to this method.
348
+ extra_headers: Headers | None = None,
349
+ extra_query: Query | None = None,
350
+ extra_body: Body | None = None,
351
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
352
+ ) -> None:
353
+ """
354
+ Args:
355
+ email: Email to send verification code
356
+
357
+ extra_headers: Send extra headers
358
+
359
+ extra_query: Add additional query parameters to the request
360
+
361
+ extra_body: Add additional JSON properties to the request
362
+
363
+ timeout: Override the client-level default timeout for this request, in seconds
364
+ """
365
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
366
+ return await self._post(
367
+ "/api/v1/auth/2fa/send-code",
368
+ body=await async_maybe_transform({"email": email}, number_2fa_send_code_params.Number2faSendCodeParams),
369
+ options=make_request_options(
370
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
371
+ ),
372
+ cast_to=NoneType,
373
+ )
374
+
375
+
376
+ class Number2faResourceWithRawResponse:
377
+ def __init__(self, number_2fa: Number2faResource) -> None:
378
+ self._number_2fa = number_2fa
379
+
380
+ self.disable = to_raw_response_wrapper(
381
+ number_2fa.disable,
382
+ )
383
+ self.enable = to_raw_response_wrapper(
384
+ number_2fa.enable,
385
+ )
386
+ self.get_status = to_raw_response_wrapper(
387
+ number_2fa.get_status,
388
+ )
389
+ self.regenerate_backup_codes = to_raw_response_wrapper(
390
+ number_2fa.regenerate_backup_codes,
391
+ )
392
+ self.send_code = to_raw_response_wrapper(
393
+ number_2fa.send_code,
394
+ )
395
+
396
+
397
+ class AsyncNumber2faResourceWithRawResponse:
398
+ def __init__(self, number_2fa: AsyncNumber2faResource) -> None:
399
+ self._number_2fa = number_2fa
400
+
401
+ self.disable = async_to_raw_response_wrapper(
402
+ number_2fa.disable,
403
+ )
404
+ self.enable = async_to_raw_response_wrapper(
405
+ number_2fa.enable,
406
+ )
407
+ self.get_status = async_to_raw_response_wrapper(
408
+ number_2fa.get_status,
409
+ )
410
+ self.regenerate_backup_codes = async_to_raw_response_wrapper(
411
+ number_2fa.regenerate_backup_codes,
412
+ )
413
+ self.send_code = async_to_raw_response_wrapper(
414
+ number_2fa.send_code,
415
+ )
416
+
417
+
418
+ class Number2faResourceWithStreamingResponse:
419
+ def __init__(self, number_2fa: Number2faResource) -> None:
420
+ self._number_2fa = number_2fa
421
+
422
+ self.disable = to_streamed_response_wrapper(
423
+ number_2fa.disable,
424
+ )
425
+ self.enable = to_streamed_response_wrapper(
426
+ number_2fa.enable,
427
+ )
428
+ self.get_status = to_streamed_response_wrapper(
429
+ number_2fa.get_status,
430
+ )
431
+ self.regenerate_backup_codes = to_streamed_response_wrapper(
432
+ number_2fa.regenerate_backup_codes,
433
+ )
434
+ self.send_code = to_streamed_response_wrapper(
435
+ number_2fa.send_code,
436
+ )
437
+
438
+
439
+ class AsyncNumber2faResourceWithStreamingResponse:
440
+ def __init__(self, number_2fa: AsyncNumber2faResource) -> None:
441
+ self._number_2fa = number_2fa
442
+
443
+ self.disable = async_to_streamed_response_wrapper(
444
+ number_2fa.disable,
445
+ )
446
+ self.enable = async_to_streamed_response_wrapper(
447
+ number_2fa.enable,
448
+ )
449
+ self.get_status = async_to_streamed_response_wrapper(
450
+ number_2fa.get_status,
451
+ )
452
+ self.regenerate_backup_codes = async_to_streamed_response_wrapper(
453
+ number_2fa.regenerate_backup_codes,
454
+ )
455
+ self.send_code = async_to_streamed_response_wrapper(
456
+ number_2fa.send_code,
457
+ )
@@ -0,0 +1,160 @@
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 NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
8
+ from ...._compat import cached_property
9
+ from ...._resource import SyncAPIResource, AsyncAPIResource
10
+ from ...._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from ...._base_client import make_request_options
17
+
18
+ __all__ = ["OrganizationInvitesResource", "AsyncOrganizationInvitesResource"]
19
+
20
+
21
+ class OrganizationInvitesResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> OrganizationInvitesResourceWithRawResponse:
24
+ """
25
+ This property can be used as a prefix for any HTTP method call to return
26
+ the raw response object instead of the parsed content.
27
+
28
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
29
+ """
30
+ return OrganizationInvitesResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> OrganizationInvitesResourceWithStreamingResponse:
34
+ """
35
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
+
37
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
38
+ """
39
+ return OrganizationInvitesResourceWithStreamingResponse(self)
40
+
41
+ def preview(
42
+ self,
43
+ token: str,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ ) -> None:
52
+ """
53
+ Args:
54
+ extra_headers: Send extra headers
55
+
56
+ extra_query: Add additional query parameters to the request
57
+
58
+ extra_body: Add additional JSON properties to the request
59
+
60
+ timeout: Override the client-level default timeout for this request, in seconds
61
+ """
62
+ if not token:
63
+ raise ValueError(f"Expected a non-empty value for `token` but received {token!r}")
64
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
65
+ return self._get(
66
+ f"/api/v1/auth/organization-invites/preview/{token}",
67
+ options=make_request_options(
68
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
69
+ ),
70
+ cast_to=NoneType,
71
+ )
72
+
73
+
74
+ class AsyncOrganizationInvitesResource(AsyncAPIResource):
75
+ @cached_property
76
+ def with_raw_response(self) -> AsyncOrganizationInvitesResourceWithRawResponse:
77
+ """
78
+ This property can be used as a prefix for any HTTP method call to return
79
+ the raw response object instead of the parsed content.
80
+
81
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
82
+ """
83
+ return AsyncOrganizationInvitesResourceWithRawResponse(self)
84
+
85
+ @cached_property
86
+ def with_streaming_response(self) -> AsyncOrganizationInvitesResourceWithStreamingResponse:
87
+ """
88
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
89
+
90
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
91
+ """
92
+ return AsyncOrganizationInvitesResourceWithStreamingResponse(self)
93
+
94
+ async def preview(
95
+ self,
96
+ token: str,
97
+ *,
98
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99
+ # The extra values given here take precedence over values defined on the client or passed to this method.
100
+ extra_headers: Headers | None = None,
101
+ extra_query: Query | None = None,
102
+ extra_body: Body | None = None,
103
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
104
+ ) -> None:
105
+ """
106
+ Args:
107
+ extra_headers: Send extra headers
108
+
109
+ extra_query: Add additional query parameters to the request
110
+
111
+ extra_body: Add additional JSON properties to the request
112
+
113
+ timeout: Override the client-level default timeout for this request, in seconds
114
+ """
115
+ if not token:
116
+ raise ValueError(f"Expected a non-empty value for `token` but received {token!r}")
117
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
118
+ return await self._get(
119
+ f"/api/v1/auth/organization-invites/preview/{token}",
120
+ options=make_request_options(
121
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
122
+ ),
123
+ cast_to=NoneType,
124
+ )
125
+
126
+
127
+ class OrganizationInvitesResourceWithRawResponse:
128
+ def __init__(self, organization_invites: OrganizationInvitesResource) -> None:
129
+ self._organization_invites = organization_invites
130
+
131
+ self.preview = to_raw_response_wrapper(
132
+ organization_invites.preview,
133
+ )
134
+
135
+
136
+ class AsyncOrganizationInvitesResourceWithRawResponse:
137
+ def __init__(self, organization_invites: AsyncOrganizationInvitesResource) -> None:
138
+ self._organization_invites = organization_invites
139
+
140
+ self.preview = async_to_raw_response_wrapper(
141
+ organization_invites.preview,
142
+ )
143
+
144
+
145
+ class OrganizationInvitesResourceWithStreamingResponse:
146
+ def __init__(self, organization_invites: OrganizationInvitesResource) -> None:
147
+ self._organization_invites = organization_invites
148
+
149
+ self.preview = to_streamed_response_wrapper(
150
+ organization_invites.preview,
151
+ )
152
+
153
+
154
+ class AsyncOrganizationInvitesResourceWithStreamingResponse:
155
+ def __init__(self, organization_invites: AsyncOrganizationInvitesResource) -> None:
156
+ self._organization_invites = organization_invites
157
+
158
+ self.preview = async_to_streamed_response_wrapper(
159
+ organization_invites.preview,
160
+ )
@@ -0,0 +1,47 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .chat import (
4
+ ChatResource,
5
+ AsyncChatResource,
6
+ ChatResourceWithRawResponse,
7
+ AsyncChatResourceWithRawResponse,
8
+ ChatResourceWithStreamingResponse,
9
+ AsyncChatResourceWithStreamingResponse,
10
+ )
11
+ from .test import (
12
+ TestResource,
13
+ AsyncTestResource,
14
+ TestResourceWithRawResponse,
15
+ AsyncTestResourceWithRawResponse,
16
+ TestResourceWithStreamingResponse,
17
+ AsyncTestResourceWithStreamingResponse,
18
+ )
19
+ from .sessions import (
20
+ SessionsResource,
21
+ AsyncSessionsResource,
22
+ SessionsResourceWithRawResponse,
23
+ AsyncSessionsResourceWithRawResponse,
24
+ SessionsResourceWithStreamingResponse,
25
+ AsyncSessionsResourceWithStreamingResponse,
26
+ )
27
+
28
+ __all__ = [
29
+ "SessionsResource",
30
+ "AsyncSessionsResource",
31
+ "SessionsResourceWithRawResponse",
32
+ "AsyncSessionsResourceWithRawResponse",
33
+ "SessionsResourceWithStreamingResponse",
34
+ "AsyncSessionsResourceWithStreamingResponse",
35
+ "TestResource",
36
+ "AsyncTestResource",
37
+ "TestResourceWithRawResponse",
38
+ "AsyncTestResourceWithRawResponse",
39
+ "TestResourceWithStreamingResponse",
40
+ "AsyncTestResourceWithStreamingResponse",
41
+ "ChatResource",
42
+ "AsyncChatResource",
43
+ "ChatResourceWithRawResponse",
44
+ "AsyncChatResourceWithRawResponse",
45
+ "ChatResourceWithStreamingResponse",
46
+ "AsyncChatResourceWithStreamingResponse",
47
+ ]