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,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .upload import (
4
+ UploadResource,
5
+ AsyncUploadResource,
6
+ UploadResourceWithRawResponse,
7
+ AsyncUploadResourceWithRawResponse,
8
+ UploadResourceWithStreamingResponse,
9
+ AsyncUploadResourceWithStreamingResponse,
10
+ )
11
+ from .component import (
12
+ ComponentResource,
13
+ AsyncComponentResource,
14
+ ComponentResourceWithRawResponse,
15
+ AsyncComponentResourceWithRawResponse,
16
+ ComponentResourceWithStreamingResponse,
17
+ AsyncComponentResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "ComponentResource",
22
+ "AsyncComponentResource",
23
+ "ComponentResourceWithRawResponse",
24
+ "AsyncComponentResourceWithRawResponse",
25
+ "ComponentResourceWithStreamingResponse",
26
+ "AsyncComponentResourceWithStreamingResponse",
27
+ "UploadResource",
28
+ "AsyncUploadResource",
29
+ "UploadResourceWithRawResponse",
30
+ "AsyncUploadResourceWithRawResponse",
31
+ "UploadResourceWithStreamingResponse",
32
+ "AsyncUploadResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,388 @@
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__ = ["ComponentResource", "AsyncComponentResource"]
19
+
20
+
21
+ class ComponentResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> ComponentResourceWithRawResponse:
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 ComponentResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> ComponentResourceWithStreamingResponse:
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 ComponentResourceWithStreamingResponse(self)
40
+
41
+ def complete_upload(
42
+ self,
43
+ component_id: 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 component_id:
63
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
64
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
65
+ return self._post(
66
+ f"/api/v1/upload/component/{component_id}/complete",
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
+ def get_presigned_url(
74
+ self,
75
+ component_id: str,
76
+ *,
77
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
78
+ # The extra values given here take precedence over values defined on the client or passed to this method.
79
+ extra_headers: Headers | None = None,
80
+ extra_query: Query | None = None,
81
+ extra_body: Body | None = None,
82
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
83
+ ) -> None:
84
+ """
85
+ Args:
86
+ extra_headers: Send extra headers
87
+
88
+ extra_query: Add additional query parameters to the request
89
+
90
+ extra_body: Add additional JSON properties to the request
91
+
92
+ timeout: Override the client-level default timeout for this request, in seconds
93
+ """
94
+ if not component_id:
95
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
96
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
97
+ return self._post(
98
+ f"/api/v1/upload/component/{component_id}/presigned-url",
99
+ options=make_request_options(
100
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
101
+ ),
102
+ cast_to=NoneType,
103
+ )
104
+
105
+ def upload_file(
106
+ self,
107
+ component_id: str,
108
+ *,
109
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110
+ # The extra values given here take precedence over values defined on the client or passed to this method.
111
+ extra_headers: Headers | None = None,
112
+ extra_query: Query | None = None,
113
+ extra_body: Body | None = None,
114
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
115
+ ) -> None:
116
+ """
117
+ Args:
118
+ extra_headers: Send extra headers
119
+
120
+ extra_query: Add additional query parameters to the request
121
+
122
+ extra_body: Add additional JSON properties to the request
123
+
124
+ timeout: Override the client-level default timeout for this request, in seconds
125
+ """
126
+ if not component_id:
127
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
128
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
129
+ return self._post(
130
+ f"/api/v1/upload/component/{component_id}/file",
131
+ options=make_request_options(
132
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
133
+ ),
134
+ cast_to=NoneType,
135
+ )
136
+
137
+ def upload_url(
138
+ self,
139
+ component_id: str,
140
+ *,
141
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
142
+ # The extra values given here take precedence over values defined on the client or passed to this method.
143
+ extra_headers: Headers | None = None,
144
+ extra_query: Query | None = None,
145
+ extra_body: Body | None = None,
146
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
147
+ ) -> None:
148
+ """
149
+ Args:
150
+ extra_headers: Send extra headers
151
+
152
+ extra_query: Add additional query parameters to the request
153
+
154
+ extra_body: Add additional JSON properties to the request
155
+
156
+ timeout: Override the client-level default timeout for this request, in seconds
157
+ """
158
+ if not component_id:
159
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
160
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
161
+ return self._post(
162
+ f"/api/v1/upload/component/{component_id}/url",
163
+ options=make_request_options(
164
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
165
+ ),
166
+ cast_to=NoneType,
167
+ )
168
+
169
+
170
+ class AsyncComponentResource(AsyncAPIResource):
171
+ @cached_property
172
+ def with_raw_response(self) -> AsyncComponentResourceWithRawResponse:
173
+ """
174
+ This property can be used as a prefix for any HTTP method call to return
175
+ the raw response object instead of the parsed content.
176
+
177
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
178
+ """
179
+ return AsyncComponentResourceWithRawResponse(self)
180
+
181
+ @cached_property
182
+ def with_streaming_response(self) -> AsyncComponentResourceWithStreamingResponse:
183
+ """
184
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
185
+
186
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
187
+ """
188
+ return AsyncComponentResourceWithStreamingResponse(self)
189
+
190
+ async def complete_upload(
191
+ self,
192
+ component_id: str,
193
+ *,
194
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195
+ # The extra values given here take precedence over values defined on the client or passed to this method.
196
+ extra_headers: Headers | None = None,
197
+ extra_query: Query | None = None,
198
+ extra_body: Body | None = None,
199
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
200
+ ) -> None:
201
+ """
202
+ Args:
203
+ extra_headers: Send extra headers
204
+
205
+ extra_query: Add additional query parameters to the request
206
+
207
+ extra_body: Add additional JSON properties to the request
208
+
209
+ timeout: Override the client-level default timeout for this request, in seconds
210
+ """
211
+ if not component_id:
212
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
213
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
214
+ return await self._post(
215
+ f"/api/v1/upload/component/{component_id}/complete",
216
+ options=make_request_options(
217
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
218
+ ),
219
+ cast_to=NoneType,
220
+ )
221
+
222
+ async def get_presigned_url(
223
+ self,
224
+ component_id: str,
225
+ *,
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
+ extra_headers: Send extra headers
236
+
237
+ extra_query: Add additional query parameters to the request
238
+
239
+ extra_body: Add additional JSON properties to the request
240
+
241
+ timeout: Override the client-level default timeout for this request, in seconds
242
+ """
243
+ if not component_id:
244
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
245
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
246
+ return await self._post(
247
+ f"/api/v1/upload/component/{component_id}/presigned-url",
248
+ options=make_request_options(
249
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
250
+ ),
251
+ cast_to=NoneType,
252
+ )
253
+
254
+ async def upload_file(
255
+ self,
256
+ component_id: str,
257
+ *,
258
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
259
+ # The extra values given here take precedence over values defined on the client or passed to this method.
260
+ extra_headers: Headers | None = None,
261
+ extra_query: Query | None = None,
262
+ extra_body: Body | None = None,
263
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
264
+ ) -> None:
265
+ """
266
+ Args:
267
+ extra_headers: Send extra headers
268
+
269
+ extra_query: Add additional query parameters to the request
270
+
271
+ extra_body: Add additional JSON properties to the request
272
+
273
+ timeout: Override the client-level default timeout for this request, in seconds
274
+ """
275
+ if not component_id:
276
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
277
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
278
+ return await self._post(
279
+ f"/api/v1/upload/component/{component_id}/file",
280
+ options=make_request_options(
281
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
282
+ ),
283
+ cast_to=NoneType,
284
+ )
285
+
286
+ async def upload_url(
287
+ self,
288
+ component_id: str,
289
+ *,
290
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
291
+ # The extra values given here take precedence over values defined on the client or passed to this method.
292
+ extra_headers: Headers | None = None,
293
+ extra_query: Query | None = None,
294
+ extra_body: Body | None = None,
295
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
296
+ ) -> None:
297
+ """
298
+ Args:
299
+ extra_headers: Send extra headers
300
+
301
+ extra_query: Add additional query parameters to the request
302
+
303
+ extra_body: Add additional JSON properties to the request
304
+
305
+ timeout: Override the client-level default timeout for this request, in seconds
306
+ """
307
+ if not component_id:
308
+ raise ValueError(f"Expected a non-empty value for `component_id` but received {component_id!r}")
309
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
310
+ return await self._post(
311
+ f"/api/v1/upload/component/{component_id}/url",
312
+ options=make_request_options(
313
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
314
+ ),
315
+ cast_to=NoneType,
316
+ )
317
+
318
+
319
+ class ComponentResourceWithRawResponse:
320
+ def __init__(self, component: ComponentResource) -> None:
321
+ self._component = component
322
+
323
+ self.complete_upload = to_raw_response_wrapper(
324
+ component.complete_upload,
325
+ )
326
+ self.get_presigned_url = to_raw_response_wrapper(
327
+ component.get_presigned_url,
328
+ )
329
+ self.upload_file = to_raw_response_wrapper(
330
+ component.upload_file,
331
+ )
332
+ self.upload_url = to_raw_response_wrapper(
333
+ component.upload_url,
334
+ )
335
+
336
+
337
+ class AsyncComponentResourceWithRawResponse:
338
+ def __init__(self, component: AsyncComponentResource) -> None:
339
+ self._component = component
340
+
341
+ self.complete_upload = async_to_raw_response_wrapper(
342
+ component.complete_upload,
343
+ )
344
+ self.get_presigned_url = async_to_raw_response_wrapper(
345
+ component.get_presigned_url,
346
+ )
347
+ self.upload_file = async_to_raw_response_wrapper(
348
+ component.upload_file,
349
+ )
350
+ self.upload_url = async_to_raw_response_wrapper(
351
+ component.upload_url,
352
+ )
353
+
354
+
355
+ class ComponentResourceWithStreamingResponse:
356
+ def __init__(self, component: ComponentResource) -> None:
357
+ self._component = component
358
+
359
+ self.complete_upload = to_streamed_response_wrapper(
360
+ component.complete_upload,
361
+ )
362
+ self.get_presigned_url = to_streamed_response_wrapper(
363
+ component.get_presigned_url,
364
+ )
365
+ self.upload_file = to_streamed_response_wrapper(
366
+ component.upload_file,
367
+ )
368
+ self.upload_url = to_streamed_response_wrapper(
369
+ component.upload_url,
370
+ )
371
+
372
+
373
+ class AsyncComponentResourceWithStreamingResponse:
374
+ def __init__(self, component: AsyncComponentResource) -> None:
375
+ self._component = component
376
+
377
+ self.complete_upload = async_to_streamed_response_wrapper(
378
+ component.complete_upload,
379
+ )
380
+ self.get_presigned_url = async_to_streamed_response_wrapper(
381
+ component.get_presigned_url,
382
+ )
383
+ self.upload_file = async_to_streamed_response_wrapper(
384
+ component.upload_file,
385
+ )
386
+ self.upload_url = async_to_streamed_response_wrapper(
387
+ component.upload_url,
388
+ )
@@ -0,0 +1,102 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .component import (
6
+ ComponentResource,
7
+ AsyncComponentResource,
8
+ ComponentResourceWithRawResponse,
9
+ AsyncComponentResourceWithRawResponse,
10
+ ComponentResourceWithStreamingResponse,
11
+ AsyncComponentResourceWithStreamingResponse,
12
+ )
13
+ from ...._compat import cached_property
14
+ from ...._resource import SyncAPIResource, AsyncAPIResource
15
+
16
+ __all__ = ["UploadResource", "AsyncUploadResource"]
17
+
18
+
19
+ class UploadResource(SyncAPIResource):
20
+ @cached_property
21
+ def component(self) -> ComponentResource:
22
+ return ComponentResource(self._client)
23
+
24
+ @cached_property
25
+ def with_raw_response(self) -> UploadResourceWithRawResponse:
26
+ """
27
+ This property can be used as a prefix for any HTTP method call to return
28
+ the raw response object instead of the parsed content.
29
+
30
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
31
+ """
32
+ return UploadResourceWithRawResponse(self)
33
+
34
+ @cached_property
35
+ def with_streaming_response(self) -> UploadResourceWithStreamingResponse:
36
+ """
37
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
+
39
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
40
+ """
41
+ return UploadResourceWithStreamingResponse(self)
42
+
43
+
44
+ class AsyncUploadResource(AsyncAPIResource):
45
+ @cached_property
46
+ def component(self) -> AsyncComponentResource:
47
+ return AsyncComponentResource(self._client)
48
+
49
+ @cached_property
50
+ def with_raw_response(self) -> AsyncUploadResourceWithRawResponse:
51
+ """
52
+ This property can be used as a prefix for any HTTP method call to return
53
+ the raw response object instead of the parsed content.
54
+
55
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
56
+ """
57
+ return AsyncUploadResourceWithRawResponse(self)
58
+
59
+ @cached_property
60
+ def with_streaming_response(self) -> AsyncUploadResourceWithStreamingResponse:
61
+ """
62
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63
+
64
+ For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
65
+ """
66
+ return AsyncUploadResourceWithStreamingResponse(self)
67
+
68
+
69
+ class UploadResourceWithRawResponse:
70
+ def __init__(self, upload: UploadResource) -> None:
71
+ self._upload = upload
72
+
73
+ @cached_property
74
+ def component(self) -> ComponentResourceWithRawResponse:
75
+ return ComponentResourceWithRawResponse(self._upload.component)
76
+
77
+
78
+ class AsyncUploadResourceWithRawResponse:
79
+ def __init__(self, upload: AsyncUploadResource) -> None:
80
+ self._upload = upload
81
+
82
+ @cached_property
83
+ def component(self) -> AsyncComponentResourceWithRawResponse:
84
+ return AsyncComponentResourceWithRawResponse(self._upload.component)
85
+
86
+
87
+ class UploadResourceWithStreamingResponse:
88
+ def __init__(self, upload: UploadResource) -> None:
89
+ self._upload = upload
90
+
91
+ @cached_property
92
+ def component(self) -> ComponentResourceWithStreamingResponse:
93
+ return ComponentResourceWithStreamingResponse(self._upload.component)
94
+
95
+
96
+ class AsyncUploadResourceWithStreamingResponse:
97
+ def __init__(self, upload: AsyncUploadResource) -> None:
98
+ self._upload = upload
99
+
100
+ @cached_property
101
+ def component(self) -> AsyncComponentResourceWithStreamingResponse:
102
+ return AsyncComponentResourceWithStreamingResponse(self._upload.component)