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