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,1029 @@
|
|
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 .bulk import (
|
8
|
+
BulkResource,
|
9
|
+
AsyncBulkResource,
|
10
|
+
BulkResourceWithRawResponse,
|
11
|
+
AsyncBulkResourceWithRawResponse,
|
12
|
+
BulkResourceWithStreamingResponse,
|
13
|
+
AsyncBulkResourceWithStreamingResponse,
|
14
|
+
)
|
15
|
+
from .test import (
|
16
|
+
TestResource,
|
17
|
+
AsyncTestResource,
|
18
|
+
TestResourceWithRawResponse,
|
19
|
+
AsyncTestResourceWithRawResponse,
|
20
|
+
TestResourceWithStreamingResponse,
|
21
|
+
AsyncTestResourceWithStreamingResponse,
|
22
|
+
)
|
23
|
+
from .upload import (
|
24
|
+
UploadResource,
|
25
|
+
AsyncUploadResource,
|
26
|
+
UploadResourceWithRawResponse,
|
27
|
+
AsyncUploadResourceWithRawResponse,
|
28
|
+
UploadResourceWithStreamingResponse,
|
29
|
+
AsyncUploadResourceWithStreamingResponse,
|
30
|
+
)
|
31
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
32
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
33
|
+
from ...._compat import cached_property
|
34
|
+
from ....types.v1 import material_list_params, material_create_params, material_get_download_url_params
|
35
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
36
|
+
from ...._response import (
|
37
|
+
to_raw_response_wrapper,
|
38
|
+
to_streamed_response_wrapper,
|
39
|
+
async_to_raw_response_wrapper,
|
40
|
+
async_to_streamed_response_wrapper,
|
41
|
+
)
|
42
|
+
from ...._base_client import make_request_options
|
43
|
+
from ....types.v1.material_list_response import MaterialListResponse
|
44
|
+
from ....types.v1.material_create_response import MaterialCreateResponse
|
45
|
+
from ....types.v1.material_retrieve_response import MaterialRetrieveResponse
|
46
|
+
|
47
|
+
__all__ = ["MaterialsResource", "AsyncMaterialsResource"]
|
48
|
+
|
49
|
+
|
50
|
+
class MaterialsResource(SyncAPIResource):
|
51
|
+
@cached_property
|
52
|
+
def upload(self) -> UploadResource:
|
53
|
+
return UploadResource(self._client)
|
54
|
+
|
55
|
+
@cached_property
|
56
|
+
def bulk(self) -> BulkResource:
|
57
|
+
return BulkResource(self._client)
|
58
|
+
|
59
|
+
@cached_property
|
60
|
+
def test(self) -> TestResource:
|
61
|
+
return TestResource(self._client)
|
62
|
+
|
63
|
+
@cached_property
|
64
|
+
def with_raw_response(self) -> MaterialsResourceWithRawResponse:
|
65
|
+
"""
|
66
|
+
This property can be used as a prefix for any HTTP method call to return
|
67
|
+
the raw response object instead of the parsed content.
|
68
|
+
|
69
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
70
|
+
"""
|
71
|
+
return MaterialsResourceWithRawResponse(self)
|
72
|
+
|
73
|
+
@cached_property
|
74
|
+
def with_streaming_response(self) -> MaterialsResourceWithStreamingResponse:
|
75
|
+
"""
|
76
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
77
|
+
|
78
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
79
|
+
"""
|
80
|
+
return MaterialsResourceWithStreamingResponse(self)
|
81
|
+
|
82
|
+
def create(
|
83
|
+
self,
|
84
|
+
*,
|
85
|
+
content: material_create_params.Content,
|
86
|
+
name: str,
|
87
|
+
folder_id: str | NotGiven = NOT_GIVEN,
|
88
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
89
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
90
|
+
extra_headers: Headers | None = None,
|
91
|
+
extra_query: Query | None = None,
|
92
|
+
extra_body: Body | None = None,
|
93
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
94
|
+
) -> MaterialCreateResponse:
|
95
|
+
"""
|
96
|
+
Create a new material
|
97
|
+
|
98
|
+
Args:
|
99
|
+
content: Content details
|
100
|
+
|
101
|
+
name: Name of the material
|
102
|
+
|
103
|
+
folder_id: Folder ID to place the material in
|
104
|
+
|
105
|
+
extra_headers: Send extra headers
|
106
|
+
|
107
|
+
extra_query: Add additional query parameters to the request
|
108
|
+
|
109
|
+
extra_body: Add additional JSON properties to the request
|
110
|
+
|
111
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
112
|
+
"""
|
113
|
+
return self._post(
|
114
|
+
"/api/v1/materials",
|
115
|
+
body=maybe_transform(
|
116
|
+
{
|
117
|
+
"content": content,
|
118
|
+
"name": name,
|
119
|
+
"folder_id": folder_id,
|
120
|
+
},
|
121
|
+
material_create_params.MaterialCreateParams,
|
122
|
+
),
|
123
|
+
options=make_request_options(
|
124
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
125
|
+
),
|
126
|
+
cast_to=MaterialCreateResponse,
|
127
|
+
)
|
128
|
+
|
129
|
+
def retrieve(
|
130
|
+
self,
|
131
|
+
id: str,
|
132
|
+
*,
|
133
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
134
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
135
|
+
extra_headers: Headers | None = None,
|
136
|
+
extra_query: Query | None = None,
|
137
|
+
extra_body: Body | None = None,
|
138
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
139
|
+
) -> MaterialRetrieveResponse:
|
140
|
+
"""
|
141
|
+
Get material by ID
|
142
|
+
|
143
|
+
Args:
|
144
|
+
extra_headers: Send extra headers
|
145
|
+
|
146
|
+
extra_query: Add additional query parameters to the request
|
147
|
+
|
148
|
+
extra_body: Add additional JSON properties to the request
|
149
|
+
|
150
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
151
|
+
"""
|
152
|
+
if not id:
|
153
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
154
|
+
return self._get(
|
155
|
+
f"/api/v1/materials/{id}",
|
156
|
+
options=make_request_options(
|
157
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
158
|
+
),
|
159
|
+
cast_to=MaterialRetrieveResponse,
|
160
|
+
)
|
161
|
+
|
162
|
+
def list(
|
163
|
+
self,
|
164
|
+
*,
|
165
|
+
folder_id: str | NotGiven = NOT_GIVEN,
|
166
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
167
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
168
|
+
extra_headers: Headers | None = None,
|
169
|
+
extra_query: Query | None = None,
|
170
|
+
extra_body: Body | None = None,
|
171
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
172
|
+
) -> MaterialListResponse:
|
173
|
+
"""
|
174
|
+
Get all materials for organization
|
175
|
+
|
176
|
+
Args:
|
177
|
+
folder_id: Filter by folder ID
|
178
|
+
|
179
|
+
extra_headers: Send extra headers
|
180
|
+
|
181
|
+
extra_query: Add additional query parameters to the request
|
182
|
+
|
183
|
+
extra_body: Add additional JSON properties to the request
|
184
|
+
|
185
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
186
|
+
"""
|
187
|
+
return self._get(
|
188
|
+
"/api/v1/materials",
|
189
|
+
options=make_request_options(
|
190
|
+
extra_headers=extra_headers,
|
191
|
+
extra_query=extra_query,
|
192
|
+
extra_body=extra_body,
|
193
|
+
timeout=timeout,
|
194
|
+
query=maybe_transform({"folder_id": folder_id}, material_list_params.MaterialListParams),
|
195
|
+
),
|
196
|
+
cast_to=MaterialListResponse,
|
197
|
+
)
|
198
|
+
|
199
|
+
def delete(
|
200
|
+
self,
|
201
|
+
id: str,
|
202
|
+
*,
|
203
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
204
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
205
|
+
extra_headers: Headers | None = None,
|
206
|
+
extra_query: Query | None = None,
|
207
|
+
extra_body: Body | None = None,
|
208
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
209
|
+
) -> None:
|
210
|
+
"""
|
211
|
+
Delete material
|
212
|
+
|
213
|
+
Args:
|
214
|
+
extra_headers: Send extra headers
|
215
|
+
|
216
|
+
extra_query: Add additional query parameters to the request
|
217
|
+
|
218
|
+
extra_body: Add additional JSON properties to the request
|
219
|
+
|
220
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
221
|
+
"""
|
222
|
+
if not id:
|
223
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
224
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
225
|
+
return self._delete(
|
226
|
+
f"/api/v1/materials/{id}",
|
227
|
+
options=make_request_options(
|
228
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
229
|
+
),
|
230
|
+
cast_to=NoneType,
|
231
|
+
)
|
232
|
+
|
233
|
+
def create_batch(
|
234
|
+
self,
|
235
|
+
*,
|
236
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
237
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
238
|
+
extra_headers: Headers | None = None,
|
239
|
+
extra_query: Query | None = None,
|
240
|
+
extra_body: Body | None = None,
|
241
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
242
|
+
) -> None:
|
243
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
244
|
+
return self._post(
|
245
|
+
"/api/v1/materials/batch",
|
246
|
+
options=make_request_options(
|
247
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
248
|
+
),
|
249
|
+
cast_to=NoneType,
|
250
|
+
)
|
251
|
+
|
252
|
+
def debug(
|
253
|
+
self,
|
254
|
+
id: str,
|
255
|
+
*,
|
256
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
257
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
258
|
+
extra_headers: Headers | None = None,
|
259
|
+
extra_query: Query | None = None,
|
260
|
+
extra_body: Body | None = None,
|
261
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
262
|
+
) -> None:
|
263
|
+
"""
|
264
|
+
Args:
|
265
|
+
extra_headers: Send extra headers
|
266
|
+
|
267
|
+
extra_query: Add additional query parameters to the request
|
268
|
+
|
269
|
+
extra_body: Add additional JSON properties to the request
|
270
|
+
|
271
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
272
|
+
"""
|
273
|
+
if not id:
|
274
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
275
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
276
|
+
return self._get(
|
277
|
+
f"/api/v1/materials/{id}/debug",
|
278
|
+
options=make_request_options(
|
279
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
280
|
+
),
|
281
|
+
cast_to=NoneType,
|
282
|
+
)
|
283
|
+
|
284
|
+
def get_download_url(
|
285
|
+
self,
|
286
|
+
id: str,
|
287
|
+
*,
|
288
|
+
expires_in: str,
|
289
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
290
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
291
|
+
extra_headers: Headers | None = None,
|
292
|
+
extra_query: Query | None = None,
|
293
|
+
extra_body: Body | None = None,
|
294
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
295
|
+
) -> None:
|
296
|
+
"""
|
297
|
+
Args:
|
298
|
+
extra_headers: Send extra headers
|
299
|
+
|
300
|
+
extra_query: Add additional query parameters to the request
|
301
|
+
|
302
|
+
extra_body: Add additional JSON properties to the request
|
303
|
+
|
304
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
305
|
+
"""
|
306
|
+
if not id:
|
307
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
308
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
309
|
+
return self._get(
|
310
|
+
f"/api/v1/materials/{id}/download-url",
|
311
|
+
options=make_request_options(
|
312
|
+
extra_headers=extra_headers,
|
313
|
+
extra_query=extra_query,
|
314
|
+
extra_body=extra_body,
|
315
|
+
timeout=timeout,
|
316
|
+
query=maybe_transform(
|
317
|
+
{"expires_in": expires_in}, material_get_download_url_params.MaterialGetDownloadURLParams
|
318
|
+
),
|
319
|
+
),
|
320
|
+
cast_to=NoneType,
|
321
|
+
)
|
322
|
+
|
323
|
+
def move(
|
324
|
+
self,
|
325
|
+
id: str,
|
326
|
+
*,
|
327
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
328
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
329
|
+
extra_headers: Headers | None = None,
|
330
|
+
extra_query: Query | None = None,
|
331
|
+
extra_body: Body | None = None,
|
332
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
333
|
+
) -> None:
|
334
|
+
"""
|
335
|
+
Args:
|
336
|
+
extra_headers: Send extra headers
|
337
|
+
|
338
|
+
extra_query: Add additional query parameters to the request
|
339
|
+
|
340
|
+
extra_body: Add additional JSON properties to the request
|
341
|
+
|
342
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
343
|
+
"""
|
344
|
+
if not id:
|
345
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
346
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
347
|
+
return self._post(
|
348
|
+
f"/api/v1/materials/{id}/move",
|
349
|
+
options=make_request_options(
|
350
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
351
|
+
),
|
352
|
+
cast_to=NoneType,
|
353
|
+
)
|
354
|
+
|
355
|
+
def rename(
|
356
|
+
self,
|
357
|
+
id: str,
|
358
|
+
*,
|
359
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
360
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
361
|
+
extra_headers: Headers | None = None,
|
362
|
+
extra_query: Query | None = None,
|
363
|
+
extra_body: Body | None = None,
|
364
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
365
|
+
) -> None:
|
366
|
+
"""
|
367
|
+
Args:
|
368
|
+
extra_headers: Send extra headers
|
369
|
+
|
370
|
+
extra_query: Add additional query parameters to the request
|
371
|
+
|
372
|
+
extra_body: Add additional JSON properties to the request
|
373
|
+
|
374
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
375
|
+
"""
|
376
|
+
if not id:
|
377
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
378
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
379
|
+
return self._post(
|
380
|
+
f"/api/v1/materials/{id}/rename",
|
381
|
+
options=make_request_options(
|
382
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
383
|
+
),
|
384
|
+
cast_to=NoneType,
|
385
|
+
)
|
386
|
+
|
387
|
+
def reprocess(
|
388
|
+
self,
|
389
|
+
id: str,
|
390
|
+
*,
|
391
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
392
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
393
|
+
extra_headers: Headers | None = None,
|
394
|
+
extra_query: Query | None = None,
|
395
|
+
extra_body: Body | None = None,
|
396
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
397
|
+
) -> None:
|
398
|
+
"""
|
399
|
+
Args:
|
400
|
+
extra_headers: Send extra headers
|
401
|
+
|
402
|
+
extra_query: Add additional query parameters to the request
|
403
|
+
|
404
|
+
extra_body: Add additional JSON properties to the request
|
405
|
+
|
406
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
407
|
+
"""
|
408
|
+
if not id:
|
409
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
410
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
411
|
+
return self._post(
|
412
|
+
f"/api/v1/materials/{id}/reprocess",
|
413
|
+
options=make_request_options(
|
414
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
415
|
+
),
|
416
|
+
cast_to=NoneType,
|
417
|
+
)
|
418
|
+
|
419
|
+
def search(
|
420
|
+
self,
|
421
|
+
*,
|
422
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
423
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
424
|
+
extra_headers: Headers | None = None,
|
425
|
+
extra_query: Query | None = None,
|
426
|
+
extra_body: Body | None = None,
|
427
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
428
|
+
) -> None:
|
429
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
430
|
+
return self._post(
|
431
|
+
"/api/v1/materials/search",
|
432
|
+
options=make_request_options(
|
433
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
434
|
+
),
|
435
|
+
cast_to=NoneType,
|
436
|
+
)
|
437
|
+
|
438
|
+
|
439
|
+
class AsyncMaterialsResource(AsyncAPIResource):
|
440
|
+
@cached_property
|
441
|
+
def upload(self) -> AsyncUploadResource:
|
442
|
+
return AsyncUploadResource(self._client)
|
443
|
+
|
444
|
+
@cached_property
|
445
|
+
def bulk(self) -> AsyncBulkResource:
|
446
|
+
return AsyncBulkResource(self._client)
|
447
|
+
|
448
|
+
@cached_property
|
449
|
+
def test(self) -> AsyncTestResource:
|
450
|
+
return AsyncTestResource(self._client)
|
451
|
+
|
452
|
+
@cached_property
|
453
|
+
def with_raw_response(self) -> AsyncMaterialsResourceWithRawResponse:
|
454
|
+
"""
|
455
|
+
This property can be used as a prefix for any HTTP method call to return
|
456
|
+
the raw response object instead of the parsed content.
|
457
|
+
|
458
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
459
|
+
"""
|
460
|
+
return AsyncMaterialsResourceWithRawResponse(self)
|
461
|
+
|
462
|
+
@cached_property
|
463
|
+
def with_streaming_response(self) -> AsyncMaterialsResourceWithStreamingResponse:
|
464
|
+
"""
|
465
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
466
|
+
|
467
|
+
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
468
|
+
"""
|
469
|
+
return AsyncMaterialsResourceWithStreamingResponse(self)
|
470
|
+
|
471
|
+
async def create(
|
472
|
+
self,
|
473
|
+
*,
|
474
|
+
content: material_create_params.Content,
|
475
|
+
name: str,
|
476
|
+
folder_id: str | NotGiven = NOT_GIVEN,
|
477
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
478
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
479
|
+
extra_headers: Headers | None = None,
|
480
|
+
extra_query: Query | None = None,
|
481
|
+
extra_body: Body | None = None,
|
482
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
483
|
+
) -> MaterialCreateResponse:
|
484
|
+
"""
|
485
|
+
Create a new material
|
486
|
+
|
487
|
+
Args:
|
488
|
+
content: Content details
|
489
|
+
|
490
|
+
name: Name of the material
|
491
|
+
|
492
|
+
folder_id: Folder ID to place the material in
|
493
|
+
|
494
|
+
extra_headers: Send extra headers
|
495
|
+
|
496
|
+
extra_query: Add additional query parameters to the request
|
497
|
+
|
498
|
+
extra_body: Add additional JSON properties to the request
|
499
|
+
|
500
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
501
|
+
"""
|
502
|
+
return await self._post(
|
503
|
+
"/api/v1/materials",
|
504
|
+
body=await async_maybe_transform(
|
505
|
+
{
|
506
|
+
"content": content,
|
507
|
+
"name": name,
|
508
|
+
"folder_id": folder_id,
|
509
|
+
},
|
510
|
+
material_create_params.MaterialCreateParams,
|
511
|
+
),
|
512
|
+
options=make_request_options(
|
513
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
514
|
+
),
|
515
|
+
cast_to=MaterialCreateResponse,
|
516
|
+
)
|
517
|
+
|
518
|
+
async def retrieve(
|
519
|
+
self,
|
520
|
+
id: str,
|
521
|
+
*,
|
522
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
523
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
524
|
+
extra_headers: Headers | None = None,
|
525
|
+
extra_query: Query | None = None,
|
526
|
+
extra_body: Body | None = None,
|
527
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
528
|
+
) -> MaterialRetrieveResponse:
|
529
|
+
"""
|
530
|
+
Get material by ID
|
531
|
+
|
532
|
+
Args:
|
533
|
+
extra_headers: Send extra headers
|
534
|
+
|
535
|
+
extra_query: Add additional query parameters to the request
|
536
|
+
|
537
|
+
extra_body: Add additional JSON properties to the request
|
538
|
+
|
539
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
540
|
+
"""
|
541
|
+
if not id:
|
542
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
543
|
+
return await self._get(
|
544
|
+
f"/api/v1/materials/{id}",
|
545
|
+
options=make_request_options(
|
546
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
547
|
+
),
|
548
|
+
cast_to=MaterialRetrieveResponse,
|
549
|
+
)
|
550
|
+
|
551
|
+
async def list(
|
552
|
+
self,
|
553
|
+
*,
|
554
|
+
folder_id: str | NotGiven = NOT_GIVEN,
|
555
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
556
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
557
|
+
extra_headers: Headers | None = None,
|
558
|
+
extra_query: Query | None = None,
|
559
|
+
extra_body: Body | None = None,
|
560
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
561
|
+
) -> MaterialListResponse:
|
562
|
+
"""
|
563
|
+
Get all materials for organization
|
564
|
+
|
565
|
+
Args:
|
566
|
+
folder_id: Filter by folder ID
|
567
|
+
|
568
|
+
extra_headers: Send extra headers
|
569
|
+
|
570
|
+
extra_query: Add additional query parameters to the request
|
571
|
+
|
572
|
+
extra_body: Add additional JSON properties to the request
|
573
|
+
|
574
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
575
|
+
"""
|
576
|
+
return await self._get(
|
577
|
+
"/api/v1/materials",
|
578
|
+
options=make_request_options(
|
579
|
+
extra_headers=extra_headers,
|
580
|
+
extra_query=extra_query,
|
581
|
+
extra_body=extra_body,
|
582
|
+
timeout=timeout,
|
583
|
+
query=await async_maybe_transform({"folder_id": folder_id}, material_list_params.MaterialListParams),
|
584
|
+
),
|
585
|
+
cast_to=MaterialListResponse,
|
586
|
+
)
|
587
|
+
|
588
|
+
async def delete(
|
589
|
+
self,
|
590
|
+
id: str,
|
591
|
+
*,
|
592
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
593
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
594
|
+
extra_headers: Headers | None = None,
|
595
|
+
extra_query: Query | None = None,
|
596
|
+
extra_body: Body | None = None,
|
597
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
598
|
+
) -> None:
|
599
|
+
"""
|
600
|
+
Delete material
|
601
|
+
|
602
|
+
Args:
|
603
|
+
extra_headers: Send extra headers
|
604
|
+
|
605
|
+
extra_query: Add additional query parameters to the request
|
606
|
+
|
607
|
+
extra_body: Add additional JSON properties to the request
|
608
|
+
|
609
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
610
|
+
"""
|
611
|
+
if not id:
|
612
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
613
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
614
|
+
return await self._delete(
|
615
|
+
f"/api/v1/materials/{id}",
|
616
|
+
options=make_request_options(
|
617
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
618
|
+
),
|
619
|
+
cast_to=NoneType,
|
620
|
+
)
|
621
|
+
|
622
|
+
async def create_batch(
|
623
|
+
self,
|
624
|
+
*,
|
625
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
626
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
627
|
+
extra_headers: Headers | None = None,
|
628
|
+
extra_query: Query | None = None,
|
629
|
+
extra_body: Body | None = None,
|
630
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
631
|
+
) -> None:
|
632
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
633
|
+
return await self._post(
|
634
|
+
"/api/v1/materials/batch",
|
635
|
+
options=make_request_options(
|
636
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
637
|
+
),
|
638
|
+
cast_to=NoneType,
|
639
|
+
)
|
640
|
+
|
641
|
+
async def debug(
|
642
|
+
self,
|
643
|
+
id: str,
|
644
|
+
*,
|
645
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
646
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
647
|
+
extra_headers: Headers | None = None,
|
648
|
+
extra_query: Query | None = None,
|
649
|
+
extra_body: Body | None = None,
|
650
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
651
|
+
) -> None:
|
652
|
+
"""
|
653
|
+
Args:
|
654
|
+
extra_headers: Send extra headers
|
655
|
+
|
656
|
+
extra_query: Add additional query parameters to the request
|
657
|
+
|
658
|
+
extra_body: Add additional JSON properties to the request
|
659
|
+
|
660
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
661
|
+
"""
|
662
|
+
if not id:
|
663
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
664
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
665
|
+
return await self._get(
|
666
|
+
f"/api/v1/materials/{id}/debug",
|
667
|
+
options=make_request_options(
|
668
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
669
|
+
),
|
670
|
+
cast_to=NoneType,
|
671
|
+
)
|
672
|
+
|
673
|
+
async def get_download_url(
|
674
|
+
self,
|
675
|
+
id: str,
|
676
|
+
*,
|
677
|
+
expires_in: str,
|
678
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
679
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
680
|
+
extra_headers: Headers | None = None,
|
681
|
+
extra_query: Query | None = None,
|
682
|
+
extra_body: Body | None = None,
|
683
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
684
|
+
) -> None:
|
685
|
+
"""
|
686
|
+
Args:
|
687
|
+
extra_headers: Send extra headers
|
688
|
+
|
689
|
+
extra_query: Add additional query parameters to the request
|
690
|
+
|
691
|
+
extra_body: Add additional JSON properties to the request
|
692
|
+
|
693
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
694
|
+
"""
|
695
|
+
if not id:
|
696
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
697
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
698
|
+
return await self._get(
|
699
|
+
f"/api/v1/materials/{id}/download-url",
|
700
|
+
options=make_request_options(
|
701
|
+
extra_headers=extra_headers,
|
702
|
+
extra_query=extra_query,
|
703
|
+
extra_body=extra_body,
|
704
|
+
timeout=timeout,
|
705
|
+
query=await async_maybe_transform(
|
706
|
+
{"expires_in": expires_in}, material_get_download_url_params.MaterialGetDownloadURLParams
|
707
|
+
),
|
708
|
+
),
|
709
|
+
cast_to=NoneType,
|
710
|
+
)
|
711
|
+
|
712
|
+
async def move(
|
713
|
+
self,
|
714
|
+
id: str,
|
715
|
+
*,
|
716
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
717
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
718
|
+
extra_headers: Headers | None = None,
|
719
|
+
extra_query: Query | None = None,
|
720
|
+
extra_body: Body | None = None,
|
721
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
722
|
+
) -> None:
|
723
|
+
"""
|
724
|
+
Args:
|
725
|
+
extra_headers: Send extra headers
|
726
|
+
|
727
|
+
extra_query: Add additional query parameters to the request
|
728
|
+
|
729
|
+
extra_body: Add additional JSON properties to the request
|
730
|
+
|
731
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
732
|
+
"""
|
733
|
+
if not id:
|
734
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
735
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
736
|
+
return await self._post(
|
737
|
+
f"/api/v1/materials/{id}/move",
|
738
|
+
options=make_request_options(
|
739
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
740
|
+
),
|
741
|
+
cast_to=NoneType,
|
742
|
+
)
|
743
|
+
|
744
|
+
async def rename(
|
745
|
+
self,
|
746
|
+
id: str,
|
747
|
+
*,
|
748
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
749
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
750
|
+
extra_headers: Headers | None = None,
|
751
|
+
extra_query: Query | None = None,
|
752
|
+
extra_body: Body | None = None,
|
753
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
754
|
+
) -> None:
|
755
|
+
"""
|
756
|
+
Args:
|
757
|
+
extra_headers: Send extra headers
|
758
|
+
|
759
|
+
extra_query: Add additional query parameters to the request
|
760
|
+
|
761
|
+
extra_body: Add additional JSON properties to the request
|
762
|
+
|
763
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
764
|
+
"""
|
765
|
+
if not id:
|
766
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
767
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
768
|
+
return await self._post(
|
769
|
+
f"/api/v1/materials/{id}/rename",
|
770
|
+
options=make_request_options(
|
771
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
772
|
+
),
|
773
|
+
cast_to=NoneType,
|
774
|
+
)
|
775
|
+
|
776
|
+
async def reprocess(
|
777
|
+
self,
|
778
|
+
id: str,
|
779
|
+
*,
|
780
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
781
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
782
|
+
extra_headers: Headers | None = None,
|
783
|
+
extra_query: Query | None = None,
|
784
|
+
extra_body: Body | None = None,
|
785
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
786
|
+
) -> None:
|
787
|
+
"""
|
788
|
+
Args:
|
789
|
+
extra_headers: Send extra headers
|
790
|
+
|
791
|
+
extra_query: Add additional query parameters to the request
|
792
|
+
|
793
|
+
extra_body: Add additional JSON properties to the request
|
794
|
+
|
795
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
796
|
+
"""
|
797
|
+
if not id:
|
798
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
799
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
800
|
+
return await self._post(
|
801
|
+
f"/api/v1/materials/{id}/reprocess",
|
802
|
+
options=make_request_options(
|
803
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
804
|
+
),
|
805
|
+
cast_to=NoneType,
|
806
|
+
)
|
807
|
+
|
808
|
+
async def search(
|
809
|
+
self,
|
810
|
+
*,
|
811
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
812
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
813
|
+
extra_headers: Headers | None = None,
|
814
|
+
extra_query: Query | None = None,
|
815
|
+
extra_body: Body | None = None,
|
816
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
817
|
+
) -> None:
|
818
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
819
|
+
return await self._post(
|
820
|
+
"/api/v1/materials/search",
|
821
|
+
options=make_request_options(
|
822
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
823
|
+
),
|
824
|
+
cast_to=NoneType,
|
825
|
+
)
|
826
|
+
|
827
|
+
|
828
|
+
class MaterialsResourceWithRawResponse:
|
829
|
+
def __init__(self, materials: MaterialsResource) -> None:
|
830
|
+
self._materials = materials
|
831
|
+
|
832
|
+
self.create = to_raw_response_wrapper(
|
833
|
+
materials.create,
|
834
|
+
)
|
835
|
+
self.retrieve = to_raw_response_wrapper(
|
836
|
+
materials.retrieve,
|
837
|
+
)
|
838
|
+
self.list = to_raw_response_wrapper(
|
839
|
+
materials.list,
|
840
|
+
)
|
841
|
+
self.delete = to_raw_response_wrapper(
|
842
|
+
materials.delete,
|
843
|
+
)
|
844
|
+
self.create_batch = to_raw_response_wrapper(
|
845
|
+
materials.create_batch,
|
846
|
+
)
|
847
|
+
self.debug = to_raw_response_wrapper(
|
848
|
+
materials.debug,
|
849
|
+
)
|
850
|
+
self.get_download_url = to_raw_response_wrapper(
|
851
|
+
materials.get_download_url,
|
852
|
+
)
|
853
|
+
self.move = to_raw_response_wrapper(
|
854
|
+
materials.move,
|
855
|
+
)
|
856
|
+
self.rename = to_raw_response_wrapper(
|
857
|
+
materials.rename,
|
858
|
+
)
|
859
|
+
self.reprocess = to_raw_response_wrapper(
|
860
|
+
materials.reprocess,
|
861
|
+
)
|
862
|
+
self.search = to_raw_response_wrapper(
|
863
|
+
materials.search,
|
864
|
+
)
|
865
|
+
|
866
|
+
@cached_property
|
867
|
+
def upload(self) -> UploadResourceWithRawResponse:
|
868
|
+
return UploadResourceWithRawResponse(self._materials.upload)
|
869
|
+
|
870
|
+
@cached_property
|
871
|
+
def bulk(self) -> BulkResourceWithRawResponse:
|
872
|
+
return BulkResourceWithRawResponse(self._materials.bulk)
|
873
|
+
|
874
|
+
@cached_property
|
875
|
+
def test(self) -> TestResourceWithRawResponse:
|
876
|
+
return TestResourceWithRawResponse(self._materials.test)
|
877
|
+
|
878
|
+
|
879
|
+
class AsyncMaterialsResourceWithRawResponse:
|
880
|
+
def __init__(self, materials: AsyncMaterialsResource) -> None:
|
881
|
+
self._materials = materials
|
882
|
+
|
883
|
+
self.create = async_to_raw_response_wrapper(
|
884
|
+
materials.create,
|
885
|
+
)
|
886
|
+
self.retrieve = async_to_raw_response_wrapper(
|
887
|
+
materials.retrieve,
|
888
|
+
)
|
889
|
+
self.list = async_to_raw_response_wrapper(
|
890
|
+
materials.list,
|
891
|
+
)
|
892
|
+
self.delete = async_to_raw_response_wrapper(
|
893
|
+
materials.delete,
|
894
|
+
)
|
895
|
+
self.create_batch = async_to_raw_response_wrapper(
|
896
|
+
materials.create_batch,
|
897
|
+
)
|
898
|
+
self.debug = async_to_raw_response_wrapper(
|
899
|
+
materials.debug,
|
900
|
+
)
|
901
|
+
self.get_download_url = async_to_raw_response_wrapper(
|
902
|
+
materials.get_download_url,
|
903
|
+
)
|
904
|
+
self.move = async_to_raw_response_wrapper(
|
905
|
+
materials.move,
|
906
|
+
)
|
907
|
+
self.rename = async_to_raw_response_wrapper(
|
908
|
+
materials.rename,
|
909
|
+
)
|
910
|
+
self.reprocess = async_to_raw_response_wrapper(
|
911
|
+
materials.reprocess,
|
912
|
+
)
|
913
|
+
self.search = async_to_raw_response_wrapper(
|
914
|
+
materials.search,
|
915
|
+
)
|
916
|
+
|
917
|
+
@cached_property
|
918
|
+
def upload(self) -> AsyncUploadResourceWithRawResponse:
|
919
|
+
return AsyncUploadResourceWithRawResponse(self._materials.upload)
|
920
|
+
|
921
|
+
@cached_property
|
922
|
+
def bulk(self) -> AsyncBulkResourceWithRawResponse:
|
923
|
+
return AsyncBulkResourceWithRawResponse(self._materials.bulk)
|
924
|
+
|
925
|
+
@cached_property
|
926
|
+
def test(self) -> AsyncTestResourceWithRawResponse:
|
927
|
+
return AsyncTestResourceWithRawResponse(self._materials.test)
|
928
|
+
|
929
|
+
|
930
|
+
class MaterialsResourceWithStreamingResponse:
|
931
|
+
def __init__(self, materials: MaterialsResource) -> None:
|
932
|
+
self._materials = materials
|
933
|
+
|
934
|
+
self.create = to_streamed_response_wrapper(
|
935
|
+
materials.create,
|
936
|
+
)
|
937
|
+
self.retrieve = to_streamed_response_wrapper(
|
938
|
+
materials.retrieve,
|
939
|
+
)
|
940
|
+
self.list = to_streamed_response_wrapper(
|
941
|
+
materials.list,
|
942
|
+
)
|
943
|
+
self.delete = to_streamed_response_wrapper(
|
944
|
+
materials.delete,
|
945
|
+
)
|
946
|
+
self.create_batch = to_streamed_response_wrapper(
|
947
|
+
materials.create_batch,
|
948
|
+
)
|
949
|
+
self.debug = to_streamed_response_wrapper(
|
950
|
+
materials.debug,
|
951
|
+
)
|
952
|
+
self.get_download_url = to_streamed_response_wrapper(
|
953
|
+
materials.get_download_url,
|
954
|
+
)
|
955
|
+
self.move = to_streamed_response_wrapper(
|
956
|
+
materials.move,
|
957
|
+
)
|
958
|
+
self.rename = to_streamed_response_wrapper(
|
959
|
+
materials.rename,
|
960
|
+
)
|
961
|
+
self.reprocess = to_streamed_response_wrapper(
|
962
|
+
materials.reprocess,
|
963
|
+
)
|
964
|
+
self.search = to_streamed_response_wrapper(
|
965
|
+
materials.search,
|
966
|
+
)
|
967
|
+
|
968
|
+
@cached_property
|
969
|
+
def upload(self) -> UploadResourceWithStreamingResponse:
|
970
|
+
return UploadResourceWithStreamingResponse(self._materials.upload)
|
971
|
+
|
972
|
+
@cached_property
|
973
|
+
def bulk(self) -> BulkResourceWithStreamingResponse:
|
974
|
+
return BulkResourceWithStreamingResponse(self._materials.bulk)
|
975
|
+
|
976
|
+
@cached_property
|
977
|
+
def test(self) -> TestResourceWithStreamingResponse:
|
978
|
+
return TestResourceWithStreamingResponse(self._materials.test)
|
979
|
+
|
980
|
+
|
981
|
+
class AsyncMaterialsResourceWithStreamingResponse:
|
982
|
+
def __init__(self, materials: AsyncMaterialsResource) -> None:
|
983
|
+
self._materials = materials
|
984
|
+
|
985
|
+
self.create = async_to_streamed_response_wrapper(
|
986
|
+
materials.create,
|
987
|
+
)
|
988
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
989
|
+
materials.retrieve,
|
990
|
+
)
|
991
|
+
self.list = async_to_streamed_response_wrapper(
|
992
|
+
materials.list,
|
993
|
+
)
|
994
|
+
self.delete = async_to_streamed_response_wrapper(
|
995
|
+
materials.delete,
|
996
|
+
)
|
997
|
+
self.create_batch = async_to_streamed_response_wrapper(
|
998
|
+
materials.create_batch,
|
999
|
+
)
|
1000
|
+
self.debug = async_to_streamed_response_wrapper(
|
1001
|
+
materials.debug,
|
1002
|
+
)
|
1003
|
+
self.get_download_url = async_to_streamed_response_wrapper(
|
1004
|
+
materials.get_download_url,
|
1005
|
+
)
|
1006
|
+
self.move = async_to_streamed_response_wrapper(
|
1007
|
+
materials.move,
|
1008
|
+
)
|
1009
|
+
self.rename = async_to_streamed_response_wrapper(
|
1010
|
+
materials.rename,
|
1011
|
+
)
|
1012
|
+
self.reprocess = async_to_streamed_response_wrapper(
|
1013
|
+
materials.reprocess,
|
1014
|
+
)
|
1015
|
+
self.search = async_to_streamed_response_wrapper(
|
1016
|
+
materials.search,
|
1017
|
+
)
|
1018
|
+
|
1019
|
+
@cached_property
|
1020
|
+
def upload(self) -> AsyncUploadResourceWithStreamingResponse:
|
1021
|
+
return AsyncUploadResourceWithStreamingResponse(self._materials.upload)
|
1022
|
+
|
1023
|
+
@cached_property
|
1024
|
+
def bulk(self) -> AsyncBulkResourceWithStreamingResponse:
|
1025
|
+
return AsyncBulkResourceWithStreamingResponse(self._materials.bulk)
|
1026
|
+
|
1027
|
+
@cached_property
|
1028
|
+
def test(self) -> AsyncTestResourceWithStreamingResponse:
|
1029
|
+
return AsyncTestResourceWithStreamingResponse(self._materials.test)
|