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,620 @@
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 .login import (
8
+ LoginResource,
9
+ AsyncLoginResource,
10
+ LoginResourceWithRawResponse,
11
+ AsyncLoginResourceWithRawResponse,
12
+ LoginResourceWithStreamingResponse,
13
+ AsyncLoginResourceWithStreamingResponse,
14
+ )
15
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
16
+ from ...._utils import maybe_transform, async_maybe_transform
17
+ from ...._compat import cached_property
18
+ from .number_2fa import (
19
+ Number2faResource,
20
+ AsyncNumber2faResource,
21
+ Number2faResourceWithRawResponse,
22
+ AsyncNumber2faResourceWithRawResponse,
23
+ Number2faResourceWithStreamingResponse,
24
+ AsyncNumber2faResourceWithStreamingResponse,
25
+ )
26
+ from ....types.v1 import auth_reset_password_params, auth_register_new_user_params, auth_request_password_reset_params
27
+ from ...._resource import SyncAPIResource, AsyncAPIResource
28
+ from ...._response import (
29
+ to_raw_response_wrapper,
30
+ to_streamed_response_wrapper,
31
+ async_to_raw_response_wrapper,
32
+ async_to_streamed_response_wrapper,
33
+ )
34
+ from ...._base_client import make_request_options
35
+ from .organization_invites import (
36
+ OrganizationInvitesResource,
37
+ AsyncOrganizationInvitesResource,
38
+ OrganizationInvitesResourceWithRawResponse,
39
+ AsyncOrganizationInvitesResourceWithRawResponse,
40
+ OrganizationInvitesResourceWithStreamingResponse,
41
+ AsyncOrganizationInvitesResourceWithStreamingResponse,
42
+ )
43
+
44
+ __all__ = ["AuthResource", "AsyncAuthResource"]
45
+
46
+
47
+ class AuthResource(SyncAPIResource):
48
+ @cached_property
49
+ def login(self) -> LoginResource:
50
+ return LoginResource(self._client)
51
+
52
+ @cached_property
53
+ def number_2fa(self) -> Number2faResource:
54
+ return Number2faResource(self._client)
55
+
56
+ @cached_property
57
+ def organization_invites(self) -> OrganizationInvitesResource:
58
+ return OrganizationInvitesResource(self._client)
59
+
60
+ @cached_property
61
+ def with_raw_response(self) -> AuthResourceWithRawResponse:
62
+ """
63
+ This property can be used as a prefix for any HTTP method call to return
64
+ the raw response object instead of the parsed content.
65
+
66
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
67
+ """
68
+ return AuthResourceWithRawResponse(self)
69
+
70
+ @cached_property
71
+ def with_streaming_response(self) -> AuthResourceWithStreamingResponse:
72
+ """
73
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
74
+
75
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
76
+ """
77
+ return AuthResourceWithStreamingResponse(self)
78
+
79
+ def get_profile(
80
+ self,
81
+ *,
82
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
83
+ # The extra values given here take precedence over values defined on the client or passed to this method.
84
+ extra_headers: Headers | None = None,
85
+ extra_query: Query | None = None,
86
+ extra_body: Body | None = None,
87
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
88
+ ) -> None:
89
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
90
+ return self._get(
91
+ "/api/v1/auth/profile",
92
+ options=make_request_options(
93
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
94
+ ),
95
+ cast_to=NoneType,
96
+ )
97
+
98
+ def register_new_user(
99
+ self,
100
+ *,
101
+ email: str,
102
+ name: str,
103
+ organization_name: str,
104
+ password: str,
105
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
106
+ # The extra values given here take precedence over values defined on the client or passed to this method.
107
+ extra_headers: Headers | None = None,
108
+ extra_query: Query | None = None,
109
+ extra_body: Body | None = None,
110
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
111
+ ) -> None:
112
+ """
113
+ Args:
114
+ email: User email address
115
+
116
+ name: User full name
117
+
118
+ organization_name: Organization name
119
+
120
+ password: User password
121
+
122
+ extra_headers: Send extra headers
123
+
124
+ extra_query: Add additional query parameters to the request
125
+
126
+ extra_body: Add additional JSON properties to the request
127
+
128
+ timeout: Override the client-level default timeout for this request, in seconds
129
+ """
130
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
131
+ return self._post(
132
+ "/api/v1/auth/register",
133
+ body=maybe_transform(
134
+ {
135
+ "email": email,
136
+ "name": name,
137
+ "organization_name": organization_name,
138
+ "password": password,
139
+ },
140
+ auth_register_new_user_params.AuthRegisterNewUserParams,
141
+ ),
142
+ options=make_request_options(
143
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
144
+ ),
145
+ cast_to=NoneType,
146
+ )
147
+
148
+ def register_organization(
149
+ self,
150
+ *,
151
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
152
+ # The extra values given here take precedence over values defined on the client or passed to this method.
153
+ extra_headers: Headers | None = None,
154
+ extra_query: Query | None = None,
155
+ extra_body: Body | None = None,
156
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
157
+ ) -> None:
158
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
159
+ return self._post(
160
+ "/api/v1/auth/register-organization",
161
+ options=make_request_options(
162
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163
+ ),
164
+ cast_to=NoneType,
165
+ )
166
+
167
+ def register_with_invite(
168
+ self,
169
+ *,
170
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
171
+ # The extra values given here take precedence over values defined on the client or passed to this method.
172
+ extra_headers: Headers | None = None,
173
+ extra_query: Query | None = None,
174
+ extra_body: Body | None = None,
175
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
+ ) -> None:
177
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
178
+ return self._post(
179
+ "/api/v1/auth/register-with-invite",
180
+ options=make_request_options(
181
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
182
+ ),
183
+ cast_to=NoneType,
184
+ )
185
+
186
+ def request_password_reset(
187
+ self,
188
+ *,
189
+ email: str,
190
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
191
+ # The extra values given here take precedence over values defined on the client or passed to this method.
192
+ extra_headers: Headers | None = None,
193
+ extra_query: Query | None = None,
194
+ extra_body: Body | None = None,
195
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
196
+ ) -> None:
197
+ """
198
+ Args:
199
+ email: Email address to send reset link
200
+
201
+ extra_headers: Send extra headers
202
+
203
+ extra_query: Add additional query parameters to the request
204
+
205
+ extra_body: Add additional JSON properties to the request
206
+
207
+ timeout: Override the client-level default timeout for this request, in seconds
208
+ """
209
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
210
+ return self._post(
211
+ "/api/v1/auth/forgot-password",
212
+ body=maybe_transform({"email": email}, auth_request_password_reset_params.AuthRequestPasswordResetParams),
213
+ options=make_request_options(
214
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
215
+ ),
216
+ cast_to=NoneType,
217
+ )
218
+
219
+ def reset_password(
220
+ self,
221
+ *,
222
+ token: str,
223
+ new_password: str,
224
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
225
+ # The extra values given here take precedence over values defined on the client or passed to this method.
226
+ extra_headers: Headers | None = None,
227
+ extra_query: Query | None = None,
228
+ extra_body: Body | None = None,
229
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
230
+ ) -> None:
231
+ """
232
+ Args:
233
+ token: Password reset token from email
234
+
235
+ new_password: New password
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 self._post(
247
+ "/api/v1/auth/reset-password",
248
+ body=maybe_transform(
249
+ {
250
+ "token": token,
251
+ "new_password": new_password,
252
+ },
253
+ auth_reset_password_params.AuthResetPasswordParams,
254
+ ),
255
+ options=make_request_options(
256
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
257
+ ),
258
+ cast_to=NoneType,
259
+ )
260
+
261
+
262
+ class AsyncAuthResource(AsyncAPIResource):
263
+ @cached_property
264
+ def login(self) -> AsyncLoginResource:
265
+ return AsyncLoginResource(self._client)
266
+
267
+ @cached_property
268
+ def number_2fa(self) -> AsyncNumber2faResource:
269
+ return AsyncNumber2faResource(self._client)
270
+
271
+ @cached_property
272
+ def organization_invites(self) -> AsyncOrganizationInvitesResource:
273
+ return AsyncOrganizationInvitesResource(self._client)
274
+
275
+ @cached_property
276
+ def with_raw_response(self) -> AsyncAuthResourceWithRawResponse:
277
+ """
278
+ This property can be used as a prefix for any HTTP method call to return
279
+ the raw response object instead of the parsed content.
280
+
281
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
282
+ """
283
+ return AsyncAuthResourceWithRawResponse(self)
284
+
285
+ @cached_property
286
+ def with_streaming_response(self) -> AsyncAuthResourceWithStreamingResponse:
287
+ """
288
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
289
+
290
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
291
+ """
292
+ return AsyncAuthResourceWithStreamingResponse(self)
293
+
294
+ async def get_profile(
295
+ self,
296
+ *,
297
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
298
+ # The extra values given here take precedence over values defined on the client or passed to this method.
299
+ extra_headers: Headers | None = None,
300
+ extra_query: Query | None = None,
301
+ extra_body: Body | None = None,
302
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
303
+ ) -> None:
304
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
305
+ return await self._get(
306
+ "/api/v1/auth/profile",
307
+ options=make_request_options(
308
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
309
+ ),
310
+ cast_to=NoneType,
311
+ )
312
+
313
+ async def register_new_user(
314
+ self,
315
+ *,
316
+ email: str,
317
+ name: str,
318
+ organization_name: str,
319
+ password: str,
320
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
321
+ # The extra values given here take precedence over values defined on the client or passed to this method.
322
+ extra_headers: Headers | None = None,
323
+ extra_query: Query | None = None,
324
+ extra_body: Body | None = None,
325
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
326
+ ) -> None:
327
+ """
328
+ Args:
329
+ email: User email address
330
+
331
+ name: User full name
332
+
333
+ organization_name: Organization name
334
+
335
+ password: User password
336
+
337
+ extra_headers: Send extra headers
338
+
339
+ extra_query: Add additional query parameters to the request
340
+
341
+ extra_body: Add additional JSON properties to the request
342
+
343
+ timeout: Override the client-level default timeout for this request, in seconds
344
+ """
345
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
346
+ return await self._post(
347
+ "/api/v1/auth/register",
348
+ body=await async_maybe_transform(
349
+ {
350
+ "email": email,
351
+ "name": name,
352
+ "organization_name": organization_name,
353
+ "password": password,
354
+ },
355
+ auth_register_new_user_params.AuthRegisterNewUserParams,
356
+ ),
357
+ options=make_request_options(
358
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
359
+ ),
360
+ cast_to=NoneType,
361
+ )
362
+
363
+ async def register_organization(
364
+ self,
365
+ *,
366
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
367
+ # The extra values given here take precedence over values defined on the client or passed to this method.
368
+ extra_headers: Headers | None = None,
369
+ extra_query: Query | None = None,
370
+ extra_body: Body | None = None,
371
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
372
+ ) -> None:
373
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
374
+ return await self._post(
375
+ "/api/v1/auth/register-organization",
376
+ options=make_request_options(
377
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
378
+ ),
379
+ cast_to=NoneType,
380
+ )
381
+
382
+ async def register_with_invite(
383
+ self,
384
+ *,
385
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
386
+ # The extra values given here take precedence over values defined on the client or passed to this method.
387
+ extra_headers: Headers | None = None,
388
+ extra_query: Query | None = None,
389
+ extra_body: Body | None = None,
390
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
391
+ ) -> None:
392
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
393
+ return await self._post(
394
+ "/api/v1/auth/register-with-invite",
395
+ options=make_request_options(
396
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
397
+ ),
398
+ cast_to=NoneType,
399
+ )
400
+
401
+ async def request_password_reset(
402
+ self,
403
+ *,
404
+ email: str,
405
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
406
+ # The extra values given here take precedence over values defined on the client or passed to this method.
407
+ extra_headers: Headers | None = None,
408
+ extra_query: Query | None = None,
409
+ extra_body: Body | None = None,
410
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
411
+ ) -> None:
412
+ """
413
+ Args:
414
+ email: Email address to send reset link
415
+
416
+ extra_headers: Send extra headers
417
+
418
+ extra_query: Add additional query parameters to the request
419
+
420
+ extra_body: Add additional JSON properties to the request
421
+
422
+ timeout: Override the client-level default timeout for this request, in seconds
423
+ """
424
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
425
+ return await self._post(
426
+ "/api/v1/auth/forgot-password",
427
+ body=await async_maybe_transform(
428
+ {"email": email}, auth_request_password_reset_params.AuthRequestPasswordResetParams
429
+ ),
430
+ options=make_request_options(
431
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
432
+ ),
433
+ cast_to=NoneType,
434
+ )
435
+
436
+ async def reset_password(
437
+ self,
438
+ *,
439
+ token: str,
440
+ new_password: str,
441
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
442
+ # The extra values given here take precedence over values defined on the client or passed to this method.
443
+ extra_headers: Headers | None = None,
444
+ extra_query: Query | None = None,
445
+ extra_body: Body | None = None,
446
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
447
+ ) -> None:
448
+ """
449
+ Args:
450
+ token: Password reset token from email
451
+
452
+ new_password: New password
453
+
454
+ extra_headers: Send extra headers
455
+
456
+ extra_query: Add additional query parameters to the request
457
+
458
+ extra_body: Add additional JSON properties to the request
459
+
460
+ timeout: Override the client-level default timeout for this request, in seconds
461
+ """
462
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
463
+ return await self._post(
464
+ "/api/v1/auth/reset-password",
465
+ body=await async_maybe_transform(
466
+ {
467
+ "token": token,
468
+ "new_password": new_password,
469
+ },
470
+ auth_reset_password_params.AuthResetPasswordParams,
471
+ ),
472
+ options=make_request_options(
473
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
474
+ ),
475
+ cast_to=NoneType,
476
+ )
477
+
478
+
479
+ class AuthResourceWithRawResponse:
480
+ def __init__(self, auth: AuthResource) -> None:
481
+ self._auth = auth
482
+
483
+ self.get_profile = to_raw_response_wrapper(
484
+ auth.get_profile,
485
+ )
486
+ self.register_new_user = to_raw_response_wrapper(
487
+ auth.register_new_user,
488
+ )
489
+ self.register_organization = to_raw_response_wrapper(
490
+ auth.register_organization,
491
+ )
492
+ self.register_with_invite = to_raw_response_wrapper(
493
+ auth.register_with_invite,
494
+ )
495
+ self.request_password_reset = to_raw_response_wrapper(
496
+ auth.request_password_reset,
497
+ )
498
+ self.reset_password = to_raw_response_wrapper(
499
+ auth.reset_password,
500
+ )
501
+
502
+ @cached_property
503
+ def login(self) -> LoginResourceWithRawResponse:
504
+ return LoginResourceWithRawResponse(self._auth.login)
505
+
506
+ @cached_property
507
+ def number_2fa(self) -> Number2faResourceWithRawResponse:
508
+ return Number2faResourceWithRawResponse(self._auth.number_2fa)
509
+
510
+ @cached_property
511
+ def organization_invites(self) -> OrganizationInvitesResourceWithRawResponse:
512
+ return OrganizationInvitesResourceWithRawResponse(self._auth.organization_invites)
513
+
514
+
515
+ class AsyncAuthResourceWithRawResponse:
516
+ def __init__(self, auth: AsyncAuthResource) -> None:
517
+ self._auth = auth
518
+
519
+ self.get_profile = async_to_raw_response_wrapper(
520
+ auth.get_profile,
521
+ )
522
+ self.register_new_user = async_to_raw_response_wrapper(
523
+ auth.register_new_user,
524
+ )
525
+ self.register_organization = async_to_raw_response_wrapper(
526
+ auth.register_organization,
527
+ )
528
+ self.register_with_invite = async_to_raw_response_wrapper(
529
+ auth.register_with_invite,
530
+ )
531
+ self.request_password_reset = async_to_raw_response_wrapper(
532
+ auth.request_password_reset,
533
+ )
534
+ self.reset_password = async_to_raw_response_wrapper(
535
+ auth.reset_password,
536
+ )
537
+
538
+ @cached_property
539
+ def login(self) -> AsyncLoginResourceWithRawResponse:
540
+ return AsyncLoginResourceWithRawResponse(self._auth.login)
541
+
542
+ @cached_property
543
+ def number_2fa(self) -> AsyncNumber2faResourceWithRawResponse:
544
+ return AsyncNumber2faResourceWithRawResponse(self._auth.number_2fa)
545
+
546
+ @cached_property
547
+ def organization_invites(self) -> AsyncOrganizationInvitesResourceWithRawResponse:
548
+ return AsyncOrganizationInvitesResourceWithRawResponse(self._auth.organization_invites)
549
+
550
+
551
+ class AuthResourceWithStreamingResponse:
552
+ def __init__(self, auth: AuthResource) -> None:
553
+ self._auth = auth
554
+
555
+ self.get_profile = to_streamed_response_wrapper(
556
+ auth.get_profile,
557
+ )
558
+ self.register_new_user = to_streamed_response_wrapper(
559
+ auth.register_new_user,
560
+ )
561
+ self.register_organization = to_streamed_response_wrapper(
562
+ auth.register_organization,
563
+ )
564
+ self.register_with_invite = to_streamed_response_wrapper(
565
+ auth.register_with_invite,
566
+ )
567
+ self.request_password_reset = to_streamed_response_wrapper(
568
+ auth.request_password_reset,
569
+ )
570
+ self.reset_password = to_streamed_response_wrapper(
571
+ auth.reset_password,
572
+ )
573
+
574
+ @cached_property
575
+ def login(self) -> LoginResourceWithStreamingResponse:
576
+ return LoginResourceWithStreamingResponse(self._auth.login)
577
+
578
+ @cached_property
579
+ def number_2fa(self) -> Number2faResourceWithStreamingResponse:
580
+ return Number2faResourceWithStreamingResponse(self._auth.number_2fa)
581
+
582
+ @cached_property
583
+ def organization_invites(self) -> OrganizationInvitesResourceWithStreamingResponse:
584
+ return OrganizationInvitesResourceWithStreamingResponse(self._auth.organization_invites)
585
+
586
+
587
+ class AsyncAuthResourceWithStreamingResponse:
588
+ def __init__(self, auth: AsyncAuthResource) -> None:
589
+ self._auth = auth
590
+
591
+ self.get_profile = async_to_streamed_response_wrapper(
592
+ auth.get_profile,
593
+ )
594
+ self.register_new_user = async_to_streamed_response_wrapper(
595
+ auth.register_new_user,
596
+ )
597
+ self.register_organization = async_to_streamed_response_wrapper(
598
+ auth.register_organization,
599
+ )
600
+ self.register_with_invite = async_to_streamed_response_wrapper(
601
+ auth.register_with_invite,
602
+ )
603
+ self.request_password_reset = async_to_streamed_response_wrapper(
604
+ auth.request_password_reset,
605
+ )
606
+ self.reset_password = async_to_streamed_response_wrapper(
607
+ auth.reset_password,
608
+ )
609
+
610
+ @cached_property
611
+ def login(self) -> AsyncLoginResourceWithStreamingResponse:
612
+ return AsyncLoginResourceWithStreamingResponse(self._auth.login)
613
+
614
+ @cached_property
615
+ def number_2fa(self) -> AsyncNumber2faResourceWithStreamingResponse:
616
+ return AsyncNumber2faResourceWithStreamingResponse(self._auth.number_2fa)
617
+
618
+ @cached_property
619
+ def organization_invites(self) -> AsyncOrganizationInvitesResourceWithStreamingResponse:
620
+ return AsyncOrganizationInvitesResourceWithStreamingResponse(self._auth.organization_invites)