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.
- studyfetch_sdk/__init__.py +100 -0
- studyfetch_sdk/_base_client.py +1992 -0
- studyfetch_sdk/_client.py +403 -0
- studyfetch_sdk/_compat.py +219 -0
- studyfetch_sdk/_constants.py +14 -0
- studyfetch_sdk/_exceptions.py +108 -0
- studyfetch_sdk/_files.py +123 -0
- studyfetch_sdk/_models.py +808 -0
- studyfetch_sdk/_qs.py +150 -0
- studyfetch_sdk/_resource.py +43 -0
- studyfetch_sdk/_response.py +832 -0
- studyfetch_sdk/_streaming.py +333 -0
- studyfetch_sdk/_types.py +219 -0
- studyfetch_sdk/_utils/__init__.py +57 -0
- studyfetch_sdk/_utils/_logs.py +25 -0
- studyfetch_sdk/_utils/_proxy.py +65 -0
- studyfetch_sdk/_utils/_reflection.py +42 -0
- studyfetch_sdk/_utils/_resources_proxy.py +24 -0
- studyfetch_sdk/_utils/_streams.py +12 -0
- studyfetch_sdk/_utils/_sync.py +86 -0
- studyfetch_sdk/_utils/_transform.py +447 -0
- studyfetch_sdk/_utils/_typing.py +151 -0
- studyfetch_sdk/_utils/_utils.py +422 -0
- studyfetch_sdk/_version.py +4 -0
- studyfetch_sdk/lib/.keep +4 -0
- studyfetch_sdk/py.typed +0 -0
- studyfetch_sdk/resources/__init__.py +19 -0
- studyfetch_sdk/resources/v1/__init__.py +215 -0
- studyfetch_sdk/resources/v1/audio_recaps/__init__.py +33 -0
- studyfetch_sdk/resources/v1/audio_recaps/audio_recaps.py +328 -0
- studyfetch_sdk/resources/v1/audio_recaps/sections.py +250 -0
- studyfetch_sdk/resources/v1/auth/__init__.py +61 -0
- studyfetch_sdk/resources/v1/auth/auth.py +620 -0
- studyfetch_sdk/resources/v1/auth/login.py +374 -0
- studyfetch_sdk/resources/v1/auth/number_2fa.py +457 -0
- studyfetch_sdk/resources/v1/auth/organization_invites.py +160 -0
- studyfetch_sdk/resources/v1/chat/__init__.py +47 -0
- studyfetch_sdk/resources/v1/chat/chat.py +576 -0
- studyfetch_sdk/resources/v1/chat/sessions.py +222 -0
- studyfetch_sdk/resources/v1/chat/test.py +190 -0
- studyfetch_sdk/resources/v1/components.py +943 -0
- studyfetch_sdk/resources/v1/embed/__init__.py +33 -0
- studyfetch_sdk/resources/v1/embed/component.py +278 -0
- studyfetch_sdk/resources/v1/embed/embed.py +346 -0
- studyfetch_sdk/resources/v1/explainers.py +216 -0
- studyfetch_sdk/resources/v1/flashcards.py +783 -0
- studyfetch_sdk/resources/v1/folders.py +744 -0
- studyfetch_sdk/resources/v1/materials/__init__.py +61 -0
- studyfetch_sdk/resources/v1/materials/bulk.py +134 -0
- studyfetch_sdk/resources/v1/materials/materials.py +1029 -0
- studyfetch_sdk/resources/v1/materials/test.py +290 -0
- studyfetch_sdk/resources/v1/materials/upload.py +410 -0
- studyfetch_sdk/resources/v1/organizations/__init__.py +103 -0
- studyfetch_sdk/resources/v1/organizations/api_keys.py +260 -0
- studyfetch_sdk/resources/v1/organizations/logo/__init__.py +33 -0
- studyfetch_sdk/resources/v1/organizations/logo/logo.py +166 -0
- studyfetch_sdk/resources/v1/organizations/logo/upload.py +184 -0
- studyfetch_sdk/resources/v1/organizations/organizations.py +428 -0
- studyfetch_sdk/resources/v1/organizations/profile/__init__.py +47 -0
- studyfetch_sdk/resources/v1/organizations/profile/models.py +134 -0
- studyfetch_sdk/resources/v1/organizations/profile/profile.py +248 -0
- studyfetch_sdk/resources/v1/organizations/profile/team.py +462 -0
- studyfetch_sdk/resources/v1/organizations/team/__init__.py +33 -0
- studyfetch_sdk/resources/v1/organizations/team/invite.py +236 -0
- studyfetch_sdk/resources/v1/organizations/team/team.py +564 -0
- studyfetch_sdk/resources/v1/organizations/theme.py +184 -0
- studyfetch_sdk/resources/v1/organizations/usage.py +160 -0
- studyfetch_sdk/resources/v1/scenarios/__init__.py +61 -0
- studyfetch_sdk/resources/v1/scenarios/component.py +330 -0
- studyfetch_sdk/resources/v1/scenarios/scenarios.py +708 -0
- studyfetch_sdk/resources/v1/scenarios/sessions.py +236 -0
- studyfetch_sdk/resources/v1/scenarios/submissions/__init__.py +33 -0
- studyfetch_sdk/resources/v1/scenarios/submissions/submissions.py +102 -0
- studyfetch_sdk/resources/v1/scenarios/submissions/user.py +210 -0
- studyfetch_sdk/resources/v1/tests/__init__.py +33 -0
- studyfetch_sdk/resources/v1/tests/component.py +160 -0
- studyfetch_sdk/resources/v1/tests/tests.py +682 -0
- studyfetch_sdk/resources/v1/upload/__init__.py +33 -0
- studyfetch_sdk/resources/v1/upload/component.py +388 -0
- studyfetch_sdk/resources/v1/upload/upload.py +102 -0
- studyfetch_sdk/resources/v1/usage.py +1126 -0
- studyfetch_sdk/resources/v1/v1.py +518 -0
- studyfetch_sdk/types/__init__.py +3 -0
- studyfetch_sdk/types/v1/__init__.py +52 -0
- studyfetch_sdk/types/v1/admin/__init__.py +3 -0
- studyfetch_sdk/types/v1/admin/organizations/__init__.py +3 -0
- studyfetch_sdk/types/v1/admin/organizations/models/__init__.py +3 -0
- studyfetch_sdk/types/v1/audio_recaps/__init__.py +3 -0
- studyfetch_sdk/types/v1/auth/__init__.py +13 -0
- studyfetch_sdk/types/v1/auth/login_authenticate_params.py +15 -0
- studyfetch_sdk/types/v1/auth/login_verify_2fa_params.py +15 -0
- studyfetch_sdk/types/v1/auth/login_verify_backup_code_params.py +17 -0
- studyfetch_sdk/types/v1/auth/number_2fa_disable_params.py +12 -0
- studyfetch_sdk/types/v1/auth/number_2fa_enable_params.py +12 -0
- studyfetch_sdk/types/v1/auth/number_2fa_regenerate_backup_codes_params.py +12 -0
- studyfetch_sdk/types/v1/auth/number_2fa_send_code_params.py +12 -0
- studyfetch_sdk/types/v1/auth_register_new_user_params.py +23 -0
- studyfetch_sdk/types/v1/auth_request_password_reset_params.py +12 -0
- studyfetch_sdk/types/v1/auth_reset_password_params.py +17 -0
- studyfetch_sdk/types/v1/chat/__init__.py +5 -0
- studyfetch_sdk/types/v1/chat/session_retrieve_params.py +11 -0
- studyfetch_sdk/types/v1/chat_retrieve_session_params.py +13 -0
- studyfetch_sdk/types/v1/chat_send_message_params.py +54 -0
- studyfetch_sdk/types/v1/chat_stream_params.py +28 -0
- studyfetch_sdk/types/v1/component_create_params.py +29 -0
- studyfetch_sdk/types/v1/component_create_response.py +46 -0
- studyfetch_sdk/types/v1/component_embed_params.py +99 -0
- studyfetch_sdk/types/v1/component_embed_response.py +38 -0
- studyfetch_sdk/types/v1/component_list_params.py +14 -0
- studyfetch_sdk/types/v1/component_list_response.py +49 -0
- studyfetch_sdk/types/v1/component_retrieve_response.py +46 -0
- studyfetch_sdk/types/v1/component_update_params.py +12 -0
- studyfetch_sdk/types/v1/component_update_response.py +46 -0
- studyfetch_sdk/types/v1/embed/__init__.py +6 -0
- studyfetch_sdk/types/v1/embed/component_interact_params.py +14 -0
- studyfetch_sdk/types/v1/embed/component_retrieve_params.py +12 -0
- studyfetch_sdk/types/v1/embed_get_theme_params.py +12 -0
- studyfetch_sdk/types/v1/embed_verify_params.py +12 -0
- studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +11 -0
- studyfetch_sdk/types/v1/flashcard_batch_process_params.py +36 -0
- studyfetch_sdk/types/v1/flashcard_batch_process_response.py +39 -0
- studyfetch_sdk/types/v1/flashcard_get_algorithm_info_response.py +37 -0
- studyfetch_sdk/types/v1/flashcard_get_all_params.py +23 -0
- studyfetch_sdk/types/v1/flashcard_get_due_params.py +19 -0
- studyfetch_sdk/types/v1/flashcard_get_stats_params.py +17 -0
- studyfetch_sdk/types/v1/flashcard_get_types_response.py +14 -0
- studyfetch_sdk/types/v1/flashcard_rate_params.py +23 -0
- studyfetch_sdk/types/v1/folder_create_params.py +17 -0
- studyfetch_sdk/types/v1/folder_list_params.py +14 -0
- studyfetch_sdk/types/v1/folder_update_params.py +17 -0
- studyfetch_sdk/types/v1/material_create_params.py +34 -0
- studyfetch_sdk/types/v1/material_create_response.py +62 -0
- studyfetch_sdk/types/v1/material_get_download_url_params.py +13 -0
- studyfetch_sdk/types/v1/material_list_params.py +14 -0
- studyfetch_sdk/types/v1/material_list_response.py +65 -0
- studyfetch_sdk/types/v1/material_retrieve_response.py +62 -0
- studyfetch_sdk/types/v1/materials/__init__.py +8 -0
- studyfetch_sdk/types/v1/materials/upload_upload_file_params.py +20 -0
- studyfetch_sdk/types/v1/materials/upload_upload_file_response.py +62 -0
- studyfetch_sdk/types/v1/materials/upload_upload_from_url_params.py +20 -0
- studyfetch_sdk/types/v1/materials/upload_upload_from_url_response.py +62 -0
- studyfetch_sdk/types/v1/organizations/__init__.py +3 -0
- studyfetch_sdk/types/v1/organizations/logo/__init__.py +3 -0
- studyfetch_sdk/types/v1/organizations/profile/__init__.py +3 -0
- studyfetch_sdk/types/v1/organizations/team/__init__.py +3 -0
- studyfetch_sdk/types/v1/scenario_create_params.py +11 -0
- studyfetch_sdk/types/v1/scenario_update_params.py +11 -0
- studyfetch_sdk/types/v1/scenarios/__init__.py +5 -0
- studyfetch_sdk/types/v1/scenarios/component_update_params.py +11 -0
- studyfetch_sdk/types/v1/scenarios/submissions/__init__.py +3 -0
- studyfetch_sdk/types/v1/test_create_params.py +20 -0
- studyfetch_sdk/types/v1/test_retake_params.py +14 -0
- studyfetch_sdk/types/v1/test_submit_answer_params.py +20 -0
- studyfetch_sdk/types/v1/test_submit_params.py +14 -0
- studyfetch_sdk/types/v1/tests/__init__.py +3 -0
- studyfetch_sdk/types/v1/upload/__init__.py +3 -0
- studyfetch_sdk/types/v1/usage_get_stats_params.py +23 -0
- studyfetch_sdk/types/v1/usage_get_summary_params.py +23 -0
- studyfetch_sdk/types/v1/usage_list_events_params.py +61 -0
- studyfetch_sdk/types/v1/usage_track_chat_params.py +54 -0
- studyfetch_sdk/types/v1/usage_track_event_params.py +128 -0
- studyfetch_sdk-0.1.0a1.dist-info/METADATA +453 -0
- studyfetch_sdk-0.1.0a1.dist-info/RECORD +165 -0
- studyfetch_sdk-0.1.0a1.dist-info/WHEEL +4 -0
- studyfetch_sdk-0.1.0a1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,943 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing_extensions import Literal
|
6
|
+
|
7
|
+
import httpx
|
8
|
+
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
11
|
+
from ..._compat import cached_property
|
12
|
+
from ...types.v1 import component_list_params, component_embed_params, component_create_params, component_update_params
|
13
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
14
|
+
from ..._response import (
|
15
|
+
to_raw_response_wrapper,
|
16
|
+
to_streamed_response_wrapper,
|
17
|
+
async_to_raw_response_wrapper,
|
18
|
+
async_to_streamed_response_wrapper,
|
19
|
+
)
|
20
|
+
from ..._base_client import make_request_options
|
21
|
+
from ...types.v1.component_list_response import ComponentListResponse
|
22
|
+
from ...types.v1.component_embed_response import ComponentEmbedResponse
|
23
|
+
from ...types.v1.component_create_response import ComponentCreateResponse
|
24
|
+
from ...types.v1.component_update_response import ComponentUpdateResponse
|
25
|
+
from ...types.v1.component_retrieve_response import ComponentRetrieveResponse
|
26
|
+
|
27
|
+
__all__ = ["ComponentsResource", "AsyncComponentsResource"]
|
28
|
+
|
29
|
+
|
30
|
+
class ComponentsResource(SyncAPIResource):
|
31
|
+
@cached_property
|
32
|
+
def with_raw_response(self) -> ComponentsResourceWithRawResponse:
|
33
|
+
"""
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
35
|
+
the raw response object instead of the parsed content.
|
36
|
+
|
37
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
38
|
+
"""
|
39
|
+
return ComponentsResourceWithRawResponse(self)
|
40
|
+
|
41
|
+
@cached_property
|
42
|
+
def with_streaming_response(self) -> ComponentsResourceWithStreamingResponse:
|
43
|
+
"""
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
45
|
+
|
46
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
47
|
+
"""
|
48
|
+
return ComponentsResourceWithStreamingResponse(self)
|
49
|
+
|
50
|
+
def create(
|
51
|
+
self,
|
52
|
+
*,
|
53
|
+
config: object,
|
54
|
+
name: str,
|
55
|
+
origin: Literal["chat", "classroom", "upload", "console", "api"],
|
56
|
+
type: Literal[
|
57
|
+
"chat", "flashcards", "scenarios", "practice_test", "audio_recap", "tutor_me", "explainers", "uploads"
|
58
|
+
],
|
59
|
+
description: str | NotGiven = NOT_GIVEN,
|
60
|
+
metadata: object | NotGiven = NOT_GIVEN,
|
61
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
62
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
63
|
+
extra_headers: Headers | None = None,
|
64
|
+
extra_query: Query | None = None,
|
65
|
+
extra_body: Body | None = None,
|
66
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
67
|
+
) -> ComponentCreateResponse:
|
68
|
+
"""
|
69
|
+
Create a new component
|
70
|
+
|
71
|
+
Args:
|
72
|
+
config: Component-specific configuration
|
73
|
+
|
74
|
+
name: Name of the component
|
75
|
+
|
76
|
+
origin: Origin of the component
|
77
|
+
|
78
|
+
type: Type of component to create
|
79
|
+
|
80
|
+
description: Component description
|
81
|
+
|
82
|
+
metadata: Additional metadata
|
83
|
+
|
84
|
+
extra_headers: Send extra headers
|
85
|
+
|
86
|
+
extra_query: Add additional query parameters to the request
|
87
|
+
|
88
|
+
extra_body: Add additional JSON properties to the request
|
89
|
+
|
90
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
91
|
+
"""
|
92
|
+
return self._post(
|
93
|
+
"/api/v1/components",
|
94
|
+
body=maybe_transform(
|
95
|
+
{
|
96
|
+
"config": config,
|
97
|
+
"name": name,
|
98
|
+
"origin": origin,
|
99
|
+
"type": type,
|
100
|
+
"description": description,
|
101
|
+
"metadata": metadata,
|
102
|
+
},
|
103
|
+
component_create_params.ComponentCreateParams,
|
104
|
+
),
|
105
|
+
options=make_request_options(
|
106
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
107
|
+
),
|
108
|
+
cast_to=ComponentCreateResponse,
|
109
|
+
)
|
110
|
+
|
111
|
+
def retrieve(
|
112
|
+
self,
|
113
|
+
id: str,
|
114
|
+
*,
|
115
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
116
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
117
|
+
extra_headers: Headers | None = None,
|
118
|
+
extra_query: Query | None = None,
|
119
|
+
extra_body: Body | None = None,
|
120
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
121
|
+
) -> ComponentRetrieveResponse:
|
122
|
+
"""
|
123
|
+
Get component by ID
|
124
|
+
|
125
|
+
Args:
|
126
|
+
extra_headers: Send extra headers
|
127
|
+
|
128
|
+
extra_query: Add additional query parameters to the request
|
129
|
+
|
130
|
+
extra_body: Add additional JSON properties to the request
|
131
|
+
|
132
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
133
|
+
"""
|
134
|
+
if not id:
|
135
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
136
|
+
return self._get(
|
137
|
+
f"/api/v1/components/{id}",
|
138
|
+
options=make_request_options(
|
139
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
140
|
+
),
|
141
|
+
cast_to=ComponentRetrieveResponse,
|
142
|
+
)
|
143
|
+
|
144
|
+
def update(
|
145
|
+
self,
|
146
|
+
id: str,
|
147
|
+
*,
|
148
|
+
status: Literal["draft", "active", "inactive", "processing", "error"] | NotGiven = NOT_GIVEN,
|
149
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
150
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
151
|
+
extra_headers: Headers | None = None,
|
152
|
+
extra_query: Query | None = None,
|
153
|
+
extra_body: Body | None = None,
|
154
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
155
|
+
) -> ComponentUpdateResponse:
|
156
|
+
"""
|
157
|
+
Update component
|
158
|
+
|
159
|
+
Args:
|
160
|
+
status: Component status
|
161
|
+
|
162
|
+
extra_headers: Send extra headers
|
163
|
+
|
164
|
+
extra_query: Add additional query parameters to the request
|
165
|
+
|
166
|
+
extra_body: Add additional JSON properties to the request
|
167
|
+
|
168
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
169
|
+
"""
|
170
|
+
if not id:
|
171
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
172
|
+
return self._patch(
|
173
|
+
f"/api/v1/components/{id}",
|
174
|
+
body=maybe_transform({"status": status}, component_update_params.ComponentUpdateParams),
|
175
|
+
options=make_request_options(
|
176
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
177
|
+
),
|
178
|
+
cast_to=ComponentUpdateResponse,
|
179
|
+
)
|
180
|
+
|
181
|
+
def list(
|
182
|
+
self,
|
183
|
+
*,
|
184
|
+
type: Literal[
|
185
|
+
"chat", "flashcards", "scenarios", "practice_test", "audio_recap", "tutor_me", "explainers", "uploads"
|
186
|
+
]
|
187
|
+
| NotGiven = NOT_GIVEN,
|
188
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
189
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
190
|
+
extra_headers: Headers | None = None,
|
191
|
+
extra_query: Query | None = None,
|
192
|
+
extra_body: Body | None = None,
|
193
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
194
|
+
) -> ComponentListResponse:
|
195
|
+
"""
|
196
|
+
Get all components
|
197
|
+
|
198
|
+
Args:
|
199
|
+
type: Filter by component type
|
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
|
+
return self._get(
|
210
|
+
"/api/v1/components",
|
211
|
+
options=make_request_options(
|
212
|
+
extra_headers=extra_headers,
|
213
|
+
extra_query=extra_query,
|
214
|
+
extra_body=extra_body,
|
215
|
+
timeout=timeout,
|
216
|
+
query=maybe_transform({"type": type}, component_list_params.ComponentListParams),
|
217
|
+
),
|
218
|
+
cast_to=ComponentListResponse,
|
219
|
+
)
|
220
|
+
|
221
|
+
def delete(
|
222
|
+
self,
|
223
|
+
id: str,
|
224
|
+
*,
|
225
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
226
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
227
|
+
extra_headers: Headers | None = None,
|
228
|
+
extra_query: Query | None = None,
|
229
|
+
extra_body: Body | None = None,
|
230
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
231
|
+
) -> None:
|
232
|
+
"""
|
233
|
+
Delete component
|
234
|
+
|
235
|
+
Args:
|
236
|
+
extra_headers: Send extra headers
|
237
|
+
|
238
|
+
extra_query: Add additional query parameters to the request
|
239
|
+
|
240
|
+
extra_body: Add additional JSON properties to the request
|
241
|
+
|
242
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
243
|
+
"""
|
244
|
+
if not id:
|
245
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
246
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
247
|
+
return self._delete(
|
248
|
+
f"/api/v1/components/{id}",
|
249
|
+
options=make_request_options(
|
250
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
251
|
+
),
|
252
|
+
cast_to=NoneType,
|
253
|
+
)
|
254
|
+
|
255
|
+
def activate(
|
256
|
+
self,
|
257
|
+
id: str,
|
258
|
+
*,
|
259
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
260
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
261
|
+
extra_headers: Headers | None = None,
|
262
|
+
extra_query: Query | None = None,
|
263
|
+
extra_body: Body | None = None,
|
264
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
265
|
+
) -> None:
|
266
|
+
"""
|
267
|
+
Args:
|
268
|
+
extra_headers: Send extra headers
|
269
|
+
|
270
|
+
extra_query: Add additional query parameters to the request
|
271
|
+
|
272
|
+
extra_body: Add additional JSON properties to the request
|
273
|
+
|
274
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
275
|
+
"""
|
276
|
+
if not id:
|
277
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
278
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
279
|
+
return self._post(
|
280
|
+
f"/api/v1/components/{id}/activate",
|
281
|
+
options=make_request_options(
|
282
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
283
|
+
),
|
284
|
+
cast_to=NoneType,
|
285
|
+
)
|
286
|
+
|
287
|
+
def deactivate(
|
288
|
+
self,
|
289
|
+
id: str,
|
290
|
+
*,
|
291
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
292
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
293
|
+
extra_headers: Headers | None = None,
|
294
|
+
extra_query: Query | None = None,
|
295
|
+
extra_body: Body | None = None,
|
296
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
297
|
+
) -> None:
|
298
|
+
"""
|
299
|
+
Args:
|
300
|
+
extra_headers: Send extra headers
|
301
|
+
|
302
|
+
extra_query: Add additional query parameters to the request
|
303
|
+
|
304
|
+
extra_body: Add additional JSON properties to the request
|
305
|
+
|
306
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
307
|
+
"""
|
308
|
+
if not id:
|
309
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
310
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
311
|
+
return self._post(
|
312
|
+
f"/api/v1/components/{id}/deactivate",
|
313
|
+
options=make_request_options(
|
314
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
315
|
+
),
|
316
|
+
cast_to=NoneType,
|
317
|
+
)
|
318
|
+
|
319
|
+
def embed(
|
320
|
+
self,
|
321
|
+
id: str,
|
322
|
+
*,
|
323
|
+
expiry_hours: float | NotGiven = NOT_GIVEN,
|
324
|
+
features: component_embed_params.Features | NotGiven = NOT_GIVEN,
|
325
|
+
group_id: str | NotGiven = NOT_GIVEN,
|
326
|
+
height: str | NotGiven = NOT_GIVEN,
|
327
|
+
session_id: str | NotGiven = NOT_GIVEN,
|
328
|
+
theme: component_embed_params.Theme | NotGiven = NOT_GIVEN,
|
329
|
+
user_id: str | NotGiven = NOT_GIVEN,
|
330
|
+
width: str | NotGiven = NOT_GIVEN,
|
331
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
332
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
333
|
+
extra_headers: Headers | None = None,
|
334
|
+
extra_query: Query | None = None,
|
335
|
+
extra_body: Body | None = None,
|
336
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
337
|
+
) -> ComponentEmbedResponse:
|
338
|
+
"""
|
339
|
+
Generate embed code for component
|
340
|
+
|
341
|
+
Args:
|
342
|
+
expiry_hours: Token expiry time in hours
|
343
|
+
|
344
|
+
features: Feature toggles
|
345
|
+
|
346
|
+
group_id: Group ID for collaboration
|
347
|
+
|
348
|
+
height: Embed height (e.g., "400px", "100vh")
|
349
|
+
|
350
|
+
session_id: Session ID for continuity
|
351
|
+
|
352
|
+
theme: Theme customization
|
353
|
+
|
354
|
+
user_id: User ID for tracking
|
355
|
+
|
356
|
+
width: Embed width (e.g., "100%", "600px")
|
357
|
+
|
358
|
+
extra_headers: Send extra headers
|
359
|
+
|
360
|
+
extra_query: Add additional query parameters to the request
|
361
|
+
|
362
|
+
extra_body: Add additional JSON properties to the request
|
363
|
+
|
364
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
365
|
+
"""
|
366
|
+
if not id:
|
367
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
368
|
+
return self._post(
|
369
|
+
f"/api/v1/components/{id}/embed",
|
370
|
+
body=maybe_transform(
|
371
|
+
{
|
372
|
+
"expiry_hours": expiry_hours,
|
373
|
+
"features": features,
|
374
|
+
"group_id": group_id,
|
375
|
+
"height": height,
|
376
|
+
"session_id": session_id,
|
377
|
+
"theme": theme,
|
378
|
+
"user_id": user_id,
|
379
|
+
"width": width,
|
380
|
+
},
|
381
|
+
component_embed_params.ComponentEmbedParams,
|
382
|
+
),
|
383
|
+
options=make_request_options(
|
384
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
385
|
+
),
|
386
|
+
cast_to=ComponentEmbedResponse,
|
387
|
+
)
|
388
|
+
|
389
|
+
def interact(
|
390
|
+
self,
|
391
|
+
id: str,
|
392
|
+
*,
|
393
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
394
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
395
|
+
extra_headers: Headers | None = None,
|
396
|
+
extra_query: Query | None = None,
|
397
|
+
extra_body: Body | None = None,
|
398
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
399
|
+
) -> None:
|
400
|
+
"""
|
401
|
+
Args:
|
402
|
+
extra_headers: Send extra headers
|
403
|
+
|
404
|
+
extra_query: Add additional query parameters to the request
|
405
|
+
|
406
|
+
extra_body: Add additional JSON properties to the request
|
407
|
+
|
408
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
409
|
+
"""
|
410
|
+
if not id:
|
411
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
412
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
413
|
+
return self._post(
|
414
|
+
f"/api/v1/components/{id}/interact",
|
415
|
+
options=make_request_options(
|
416
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
417
|
+
),
|
418
|
+
cast_to=NoneType,
|
419
|
+
)
|
420
|
+
|
421
|
+
|
422
|
+
class AsyncComponentsResource(AsyncAPIResource):
|
423
|
+
@cached_property
|
424
|
+
def with_raw_response(self) -> AsyncComponentsResourceWithRawResponse:
|
425
|
+
"""
|
426
|
+
This property can be used as a prefix for any HTTP method call to return
|
427
|
+
the raw response object instead of the parsed content.
|
428
|
+
|
429
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
430
|
+
"""
|
431
|
+
return AsyncComponentsResourceWithRawResponse(self)
|
432
|
+
|
433
|
+
@cached_property
|
434
|
+
def with_streaming_response(self) -> AsyncComponentsResourceWithStreamingResponse:
|
435
|
+
"""
|
436
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
437
|
+
|
438
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
439
|
+
"""
|
440
|
+
return AsyncComponentsResourceWithStreamingResponse(self)
|
441
|
+
|
442
|
+
async def create(
|
443
|
+
self,
|
444
|
+
*,
|
445
|
+
config: object,
|
446
|
+
name: str,
|
447
|
+
origin: Literal["chat", "classroom", "upload", "console", "api"],
|
448
|
+
type: Literal[
|
449
|
+
"chat", "flashcards", "scenarios", "practice_test", "audio_recap", "tutor_me", "explainers", "uploads"
|
450
|
+
],
|
451
|
+
description: str | NotGiven = NOT_GIVEN,
|
452
|
+
metadata: object | NotGiven = NOT_GIVEN,
|
453
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
454
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
455
|
+
extra_headers: Headers | None = None,
|
456
|
+
extra_query: Query | None = None,
|
457
|
+
extra_body: Body | None = None,
|
458
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
459
|
+
) -> ComponentCreateResponse:
|
460
|
+
"""
|
461
|
+
Create a new component
|
462
|
+
|
463
|
+
Args:
|
464
|
+
config: Component-specific configuration
|
465
|
+
|
466
|
+
name: Name of the component
|
467
|
+
|
468
|
+
origin: Origin of the component
|
469
|
+
|
470
|
+
type: Type of component to create
|
471
|
+
|
472
|
+
description: Component description
|
473
|
+
|
474
|
+
metadata: Additional metadata
|
475
|
+
|
476
|
+
extra_headers: Send extra headers
|
477
|
+
|
478
|
+
extra_query: Add additional query parameters to the request
|
479
|
+
|
480
|
+
extra_body: Add additional JSON properties to the request
|
481
|
+
|
482
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
483
|
+
"""
|
484
|
+
return await self._post(
|
485
|
+
"/api/v1/components",
|
486
|
+
body=await async_maybe_transform(
|
487
|
+
{
|
488
|
+
"config": config,
|
489
|
+
"name": name,
|
490
|
+
"origin": origin,
|
491
|
+
"type": type,
|
492
|
+
"description": description,
|
493
|
+
"metadata": metadata,
|
494
|
+
},
|
495
|
+
component_create_params.ComponentCreateParams,
|
496
|
+
),
|
497
|
+
options=make_request_options(
|
498
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
499
|
+
),
|
500
|
+
cast_to=ComponentCreateResponse,
|
501
|
+
)
|
502
|
+
|
503
|
+
async def retrieve(
|
504
|
+
self,
|
505
|
+
id: str,
|
506
|
+
*,
|
507
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
508
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
509
|
+
extra_headers: Headers | None = None,
|
510
|
+
extra_query: Query | None = None,
|
511
|
+
extra_body: Body | None = None,
|
512
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
513
|
+
) -> ComponentRetrieveResponse:
|
514
|
+
"""
|
515
|
+
Get component by ID
|
516
|
+
|
517
|
+
Args:
|
518
|
+
extra_headers: Send extra headers
|
519
|
+
|
520
|
+
extra_query: Add additional query parameters to the request
|
521
|
+
|
522
|
+
extra_body: Add additional JSON properties to the request
|
523
|
+
|
524
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
525
|
+
"""
|
526
|
+
if not id:
|
527
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
528
|
+
return await self._get(
|
529
|
+
f"/api/v1/components/{id}",
|
530
|
+
options=make_request_options(
|
531
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
532
|
+
),
|
533
|
+
cast_to=ComponentRetrieveResponse,
|
534
|
+
)
|
535
|
+
|
536
|
+
async def update(
|
537
|
+
self,
|
538
|
+
id: str,
|
539
|
+
*,
|
540
|
+
status: Literal["draft", "active", "inactive", "processing", "error"] | NotGiven = NOT_GIVEN,
|
541
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
542
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
543
|
+
extra_headers: Headers | None = None,
|
544
|
+
extra_query: Query | None = None,
|
545
|
+
extra_body: Body | None = None,
|
546
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
547
|
+
) -> ComponentUpdateResponse:
|
548
|
+
"""
|
549
|
+
Update component
|
550
|
+
|
551
|
+
Args:
|
552
|
+
status: Component status
|
553
|
+
|
554
|
+
extra_headers: Send extra headers
|
555
|
+
|
556
|
+
extra_query: Add additional query parameters to the request
|
557
|
+
|
558
|
+
extra_body: Add additional JSON properties to the request
|
559
|
+
|
560
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
561
|
+
"""
|
562
|
+
if not id:
|
563
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
564
|
+
return await self._patch(
|
565
|
+
f"/api/v1/components/{id}",
|
566
|
+
body=await async_maybe_transform({"status": status}, component_update_params.ComponentUpdateParams),
|
567
|
+
options=make_request_options(
|
568
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
569
|
+
),
|
570
|
+
cast_to=ComponentUpdateResponse,
|
571
|
+
)
|
572
|
+
|
573
|
+
async def list(
|
574
|
+
self,
|
575
|
+
*,
|
576
|
+
type: Literal[
|
577
|
+
"chat", "flashcards", "scenarios", "practice_test", "audio_recap", "tutor_me", "explainers", "uploads"
|
578
|
+
]
|
579
|
+
| NotGiven = NOT_GIVEN,
|
580
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
581
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
582
|
+
extra_headers: Headers | None = None,
|
583
|
+
extra_query: Query | None = None,
|
584
|
+
extra_body: Body | None = None,
|
585
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
586
|
+
) -> ComponentListResponse:
|
587
|
+
"""
|
588
|
+
Get all components
|
589
|
+
|
590
|
+
Args:
|
591
|
+
type: Filter by component type
|
592
|
+
|
593
|
+
extra_headers: Send extra headers
|
594
|
+
|
595
|
+
extra_query: Add additional query parameters to the request
|
596
|
+
|
597
|
+
extra_body: Add additional JSON properties to the request
|
598
|
+
|
599
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
600
|
+
"""
|
601
|
+
return await self._get(
|
602
|
+
"/api/v1/components",
|
603
|
+
options=make_request_options(
|
604
|
+
extra_headers=extra_headers,
|
605
|
+
extra_query=extra_query,
|
606
|
+
extra_body=extra_body,
|
607
|
+
timeout=timeout,
|
608
|
+
query=await async_maybe_transform({"type": type}, component_list_params.ComponentListParams),
|
609
|
+
),
|
610
|
+
cast_to=ComponentListResponse,
|
611
|
+
)
|
612
|
+
|
613
|
+
async def delete(
|
614
|
+
self,
|
615
|
+
id: str,
|
616
|
+
*,
|
617
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
618
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
619
|
+
extra_headers: Headers | None = None,
|
620
|
+
extra_query: Query | None = None,
|
621
|
+
extra_body: Body | None = None,
|
622
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
623
|
+
) -> None:
|
624
|
+
"""
|
625
|
+
Delete component
|
626
|
+
|
627
|
+
Args:
|
628
|
+
extra_headers: Send extra headers
|
629
|
+
|
630
|
+
extra_query: Add additional query parameters to the request
|
631
|
+
|
632
|
+
extra_body: Add additional JSON properties to the request
|
633
|
+
|
634
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
635
|
+
"""
|
636
|
+
if not id:
|
637
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
638
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
639
|
+
return await self._delete(
|
640
|
+
f"/api/v1/components/{id}",
|
641
|
+
options=make_request_options(
|
642
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
643
|
+
),
|
644
|
+
cast_to=NoneType,
|
645
|
+
)
|
646
|
+
|
647
|
+
async def activate(
|
648
|
+
self,
|
649
|
+
id: str,
|
650
|
+
*,
|
651
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
652
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
653
|
+
extra_headers: Headers | None = None,
|
654
|
+
extra_query: Query | None = None,
|
655
|
+
extra_body: Body | None = None,
|
656
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
657
|
+
) -> None:
|
658
|
+
"""
|
659
|
+
Args:
|
660
|
+
extra_headers: Send extra headers
|
661
|
+
|
662
|
+
extra_query: Add additional query parameters to the request
|
663
|
+
|
664
|
+
extra_body: Add additional JSON properties to the request
|
665
|
+
|
666
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
667
|
+
"""
|
668
|
+
if not id:
|
669
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
670
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
671
|
+
return await self._post(
|
672
|
+
f"/api/v1/components/{id}/activate",
|
673
|
+
options=make_request_options(
|
674
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
675
|
+
),
|
676
|
+
cast_to=NoneType,
|
677
|
+
)
|
678
|
+
|
679
|
+
async def deactivate(
|
680
|
+
self,
|
681
|
+
id: str,
|
682
|
+
*,
|
683
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
684
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
685
|
+
extra_headers: Headers | None = None,
|
686
|
+
extra_query: Query | None = None,
|
687
|
+
extra_body: Body | None = None,
|
688
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
689
|
+
) -> None:
|
690
|
+
"""
|
691
|
+
Args:
|
692
|
+
extra_headers: Send extra headers
|
693
|
+
|
694
|
+
extra_query: Add additional query parameters to the request
|
695
|
+
|
696
|
+
extra_body: Add additional JSON properties to the request
|
697
|
+
|
698
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
699
|
+
"""
|
700
|
+
if not id:
|
701
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
702
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
703
|
+
return await self._post(
|
704
|
+
f"/api/v1/components/{id}/deactivate",
|
705
|
+
options=make_request_options(
|
706
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
707
|
+
),
|
708
|
+
cast_to=NoneType,
|
709
|
+
)
|
710
|
+
|
711
|
+
async def embed(
|
712
|
+
self,
|
713
|
+
id: str,
|
714
|
+
*,
|
715
|
+
expiry_hours: float | NotGiven = NOT_GIVEN,
|
716
|
+
features: component_embed_params.Features | NotGiven = NOT_GIVEN,
|
717
|
+
group_id: str | NotGiven = NOT_GIVEN,
|
718
|
+
height: str | NotGiven = NOT_GIVEN,
|
719
|
+
session_id: str | NotGiven = NOT_GIVEN,
|
720
|
+
theme: component_embed_params.Theme | NotGiven = NOT_GIVEN,
|
721
|
+
user_id: str | NotGiven = NOT_GIVEN,
|
722
|
+
width: str | NotGiven = NOT_GIVEN,
|
723
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
724
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
725
|
+
extra_headers: Headers | None = None,
|
726
|
+
extra_query: Query | None = None,
|
727
|
+
extra_body: Body | None = None,
|
728
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
729
|
+
) -> ComponentEmbedResponse:
|
730
|
+
"""
|
731
|
+
Generate embed code for component
|
732
|
+
|
733
|
+
Args:
|
734
|
+
expiry_hours: Token expiry time in hours
|
735
|
+
|
736
|
+
features: Feature toggles
|
737
|
+
|
738
|
+
group_id: Group ID for collaboration
|
739
|
+
|
740
|
+
height: Embed height (e.g., "400px", "100vh")
|
741
|
+
|
742
|
+
session_id: Session ID for continuity
|
743
|
+
|
744
|
+
theme: Theme customization
|
745
|
+
|
746
|
+
user_id: User ID for tracking
|
747
|
+
|
748
|
+
width: Embed width (e.g., "100%", "600px")
|
749
|
+
|
750
|
+
extra_headers: Send extra headers
|
751
|
+
|
752
|
+
extra_query: Add additional query parameters to the request
|
753
|
+
|
754
|
+
extra_body: Add additional JSON properties to the request
|
755
|
+
|
756
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
757
|
+
"""
|
758
|
+
if not id:
|
759
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
760
|
+
return await self._post(
|
761
|
+
f"/api/v1/components/{id}/embed",
|
762
|
+
body=await async_maybe_transform(
|
763
|
+
{
|
764
|
+
"expiry_hours": expiry_hours,
|
765
|
+
"features": features,
|
766
|
+
"group_id": group_id,
|
767
|
+
"height": height,
|
768
|
+
"session_id": session_id,
|
769
|
+
"theme": theme,
|
770
|
+
"user_id": user_id,
|
771
|
+
"width": width,
|
772
|
+
},
|
773
|
+
component_embed_params.ComponentEmbedParams,
|
774
|
+
),
|
775
|
+
options=make_request_options(
|
776
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
777
|
+
),
|
778
|
+
cast_to=ComponentEmbedResponse,
|
779
|
+
)
|
780
|
+
|
781
|
+
async def interact(
|
782
|
+
self,
|
783
|
+
id: str,
|
784
|
+
*,
|
785
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
786
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
787
|
+
extra_headers: Headers | None = None,
|
788
|
+
extra_query: Query | None = None,
|
789
|
+
extra_body: Body | None = None,
|
790
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
791
|
+
) -> None:
|
792
|
+
"""
|
793
|
+
Args:
|
794
|
+
extra_headers: Send extra headers
|
795
|
+
|
796
|
+
extra_query: Add additional query parameters to the request
|
797
|
+
|
798
|
+
extra_body: Add additional JSON properties to the request
|
799
|
+
|
800
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
801
|
+
"""
|
802
|
+
if not id:
|
803
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
804
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
805
|
+
return await self._post(
|
806
|
+
f"/api/v1/components/{id}/interact",
|
807
|
+
options=make_request_options(
|
808
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
809
|
+
),
|
810
|
+
cast_to=NoneType,
|
811
|
+
)
|
812
|
+
|
813
|
+
|
814
|
+
class ComponentsResourceWithRawResponse:
|
815
|
+
def __init__(self, components: ComponentsResource) -> None:
|
816
|
+
self._components = components
|
817
|
+
|
818
|
+
self.create = to_raw_response_wrapper(
|
819
|
+
components.create,
|
820
|
+
)
|
821
|
+
self.retrieve = to_raw_response_wrapper(
|
822
|
+
components.retrieve,
|
823
|
+
)
|
824
|
+
self.update = to_raw_response_wrapper(
|
825
|
+
components.update,
|
826
|
+
)
|
827
|
+
self.list = to_raw_response_wrapper(
|
828
|
+
components.list,
|
829
|
+
)
|
830
|
+
self.delete = to_raw_response_wrapper(
|
831
|
+
components.delete,
|
832
|
+
)
|
833
|
+
self.activate = to_raw_response_wrapper(
|
834
|
+
components.activate,
|
835
|
+
)
|
836
|
+
self.deactivate = to_raw_response_wrapper(
|
837
|
+
components.deactivate,
|
838
|
+
)
|
839
|
+
self.embed = to_raw_response_wrapper(
|
840
|
+
components.embed,
|
841
|
+
)
|
842
|
+
self.interact = to_raw_response_wrapper(
|
843
|
+
components.interact,
|
844
|
+
)
|
845
|
+
|
846
|
+
|
847
|
+
class AsyncComponentsResourceWithRawResponse:
|
848
|
+
def __init__(self, components: AsyncComponentsResource) -> None:
|
849
|
+
self._components = components
|
850
|
+
|
851
|
+
self.create = async_to_raw_response_wrapper(
|
852
|
+
components.create,
|
853
|
+
)
|
854
|
+
self.retrieve = async_to_raw_response_wrapper(
|
855
|
+
components.retrieve,
|
856
|
+
)
|
857
|
+
self.update = async_to_raw_response_wrapper(
|
858
|
+
components.update,
|
859
|
+
)
|
860
|
+
self.list = async_to_raw_response_wrapper(
|
861
|
+
components.list,
|
862
|
+
)
|
863
|
+
self.delete = async_to_raw_response_wrapper(
|
864
|
+
components.delete,
|
865
|
+
)
|
866
|
+
self.activate = async_to_raw_response_wrapper(
|
867
|
+
components.activate,
|
868
|
+
)
|
869
|
+
self.deactivate = async_to_raw_response_wrapper(
|
870
|
+
components.deactivate,
|
871
|
+
)
|
872
|
+
self.embed = async_to_raw_response_wrapper(
|
873
|
+
components.embed,
|
874
|
+
)
|
875
|
+
self.interact = async_to_raw_response_wrapper(
|
876
|
+
components.interact,
|
877
|
+
)
|
878
|
+
|
879
|
+
|
880
|
+
class ComponentsResourceWithStreamingResponse:
|
881
|
+
def __init__(self, components: ComponentsResource) -> None:
|
882
|
+
self._components = components
|
883
|
+
|
884
|
+
self.create = to_streamed_response_wrapper(
|
885
|
+
components.create,
|
886
|
+
)
|
887
|
+
self.retrieve = to_streamed_response_wrapper(
|
888
|
+
components.retrieve,
|
889
|
+
)
|
890
|
+
self.update = to_streamed_response_wrapper(
|
891
|
+
components.update,
|
892
|
+
)
|
893
|
+
self.list = to_streamed_response_wrapper(
|
894
|
+
components.list,
|
895
|
+
)
|
896
|
+
self.delete = to_streamed_response_wrapper(
|
897
|
+
components.delete,
|
898
|
+
)
|
899
|
+
self.activate = to_streamed_response_wrapper(
|
900
|
+
components.activate,
|
901
|
+
)
|
902
|
+
self.deactivate = to_streamed_response_wrapper(
|
903
|
+
components.deactivate,
|
904
|
+
)
|
905
|
+
self.embed = to_streamed_response_wrapper(
|
906
|
+
components.embed,
|
907
|
+
)
|
908
|
+
self.interact = to_streamed_response_wrapper(
|
909
|
+
components.interact,
|
910
|
+
)
|
911
|
+
|
912
|
+
|
913
|
+
class AsyncComponentsResourceWithStreamingResponse:
|
914
|
+
def __init__(self, components: AsyncComponentsResource) -> None:
|
915
|
+
self._components = components
|
916
|
+
|
917
|
+
self.create = async_to_streamed_response_wrapper(
|
918
|
+
components.create,
|
919
|
+
)
|
920
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
921
|
+
components.retrieve,
|
922
|
+
)
|
923
|
+
self.update = async_to_streamed_response_wrapper(
|
924
|
+
components.update,
|
925
|
+
)
|
926
|
+
self.list = async_to_streamed_response_wrapper(
|
927
|
+
components.list,
|
928
|
+
)
|
929
|
+
self.delete = async_to_streamed_response_wrapper(
|
930
|
+
components.delete,
|
931
|
+
)
|
932
|
+
self.activate = async_to_streamed_response_wrapper(
|
933
|
+
components.activate,
|
934
|
+
)
|
935
|
+
self.deactivate = async_to_streamed_response_wrapper(
|
936
|
+
components.deactivate,
|
937
|
+
)
|
938
|
+
self.embed = async_to_streamed_response_wrapper(
|
939
|
+
components.embed,
|
940
|
+
)
|
941
|
+
self.interact = async_to_streamed_response_wrapper(
|
942
|
+
components.interact,
|
943
|
+
)
|