studyfetch-sdk 0.1.0a19__py3-none-any.whl → 0.1.0a21__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/_models.py +23 -2
- studyfetch_sdk/_version.py +1 -1
- studyfetch_sdk/resources/v1/__init__.py +6 -104
- studyfetch_sdk/resources/v1/chat.py +246 -0
- studyfetch_sdk/resources/v1/materials/materials.py +304 -0
- studyfetch_sdk/resources/v1/materials/upload.py +30 -14
- studyfetch_sdk/resources/v1/v1.py +20 -244
- studyfetch_sdk/types/v1/__init__.py +3 -22
- studyfetch_sdk/types/v1/chat_stream_params.py +39 -7
- studyfetch_sdk/types/v1/component_create_params.py +24 -0
- studyfetch_sdk/types/v1/component_generate_embed_params.py +7 -1
- studyfetch_sdk/types/v1/generated_material.py +65 -0
- studyfetch_sdk/types/v1/material_generate_and_process_params.py +38 -0
- studyfetch_sdk/types/v1/material_generate_params.py +32 -0
- studyfetch_sdk/types/v1/materials/upload_complete_upload_params.py +2 -5
- studyfetch_sdk/types/v1/materials/upload_create_presigned_url_params.py +3 -0
- studyfetch_sdk/types/v1/materials/upload_upload_file_and_process_params.py +4 -1
- studyfetch_sdk/types/v1/materials/upload_upload_file_params.py +3 -0
- {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/METADATA +1 -1
- {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/RECORD +22 -83
- studyfetch_sdk/resources/v1/audio_recaps/__init__.py +0 -33
- studyfetch_sdk/resources/v1/audio_recaps/audio_recaps.py +0 -328
- studyfetch_sdk/resources/v1/audio_recaps/sections.py +0 -250
- studyfetch_sdk/resources/v1/chat/__init__.py +0 -47
- studyfetch_sdk/resources/v1/chat/chat.py +0 -574
- studyfetch_sdk/resources/v1/chat/sessions.py +0 -222
- studyfetch_sdk/resources/v1/chat/test.py +0 -190
- studyfetch_sdk/resources/v1/data_analyst/__init__.py +0 -47
- studyfetch_sdk/resources/v1/data_analyst/data_analyst.py +0 -582
- studyfetch_sdk/resources/v1/data_analyst/sessions.py +0 -222
- studyfetch_sdk/resources/v1/data_analyst/test.py +0 -190
- studyfetch_sdk/resources/v1/explainers.py +0 -441
- studyfetch_sdk/resources/v1/flashcards.py +0 -783
- studyfetch_sdk/resources/v1/scenarios/__init__.py +0 -61
- studyfetch_sdk/resources/v1/scenarios/component.py +0 -426
- studyfetch_sdk/resources/v1/scenarios/scenarios.py +0 -936
- studyfetch_sdk/resources/v1/scenarios/sessions.py +0 -236
- studyfetch_sdk/resources/v1/scenarios/submissions/__init__.py +0 -33
- studyfetch_sdk/resources/v1/scenarios/submissions/submissions.py +0 -102
- studyfetch_sdk/resources/v1/scenarios/submissions/user.py +0 -210
- studyfetch_sdk/resources/v1/tests/__init__.py +0 -33
- studyfetch_sdk/resources/v1/tests/component.py +0 -160
- studyfetch_sdk/resources/v1/tests/tests.py +0 -682
- studyfetch_sdk/resources/v1/upload/__init__.py +0 -33
- studyfetch_sdk/resources/v1/upload/component.py +0 -572
- studyfetch_sdk/resources/v1/upload/upload.py +0 -102
- studyfetch_sdk/types/v1/audio_recaps/__init__.py +0 -3
- studyfetch_sdk/types/v1/chat/__init__.py +0 -5
- studyfetch_sdk/types/v1/chat/session_retrieve_params.py +0 -11
- studyfetch_sdk/types/v1/chat_get_session_params.py +0 -13
- studyfetch_sdk/types/v1/chat_send_message_params.py +0 -54
- studyfetch_sdk/types/v1/data_analyst/__init__.py +0 -5
- studyfetch_sdk/types/v1/data_analyst/session_retrieve_params.py +0 -11
- studyfetch_sdk/types/v1/data_analyst_retrieve_session_params.py +0 -13
- studyfetch_sdk/types/v1/data_analyst_send_message_params.py +0 -54
- studyfetch_sdk/types/v1/data_analyst_stream_params.py +0 -28
- studyfetch_sdk/types/v1/explainer_create_params.py +0 -45
- studyfetch_sdk/types/v1/explainer_handle_webhook_params.py +0 -53
- studyfetch_sdk/types/v1/flashcard_batch_process_params.py +0 -36
- studyfetch_sdk/types/v1/flashcard_batch_process_response.py +0 -39
- studyfetch_sdk/types/v1/flashcard_get_algorithm_response.py +0 -37
- studyfetch_sdk/types/v1/flashcard_get_all_params.py +0 -23
- studyfetch_sdk/types/v1/flashcard_get_due_params.py +0 -19
- studyfetch_sdk/types/v1/flashcard_get_stats_params.py +0 -17
- studyfetch_sdk/types/v1/flashcard_get_types_response.py +0 -14
- studyfetch_sdk/types/v1/flashcard_rate_params.py +0 -23
- studyfetch_sdk/types/v1/scenario_create_params.py +0 -48
- studyfetch_sdk/types/v1/scenario_submit_answer_params.py +0 -18
- studyfetch_sdk/types/v1/scenario_update_params.py +0 -45
- studyfetch_sdk/types/v1/scenarios/__init__.py +0 -5
- studyfetch_sdk/types/v1/scenarios/component_update_params.py +0 -45
- studyfetch_sdk/types/v1/scenarios/submissions/__init__.py +0 -3
- studyfetch_sdk/types/v1/test_create_params.py +0 -20
- studyfetch_sdk/types/v1/test_retake_params.py +0 -14
- studyfetch_sdk/types/v1/test_submit_answer_params.py +0 -20
- studyfetch_sdk/types/v1/test_submit_params.py +0 -14
- studyfetch_sdk/types/v1/tests/__init__.py +0 -3
- studyfetch_sdk/types/v1/upload/__init__.py +0 -11
- studyfetch_sdk/types/v1/upload/component_complete_upload_params.py +0 -20
- studyfetch_sdk/types/v1/upload/component_complete_upload_response.py +0 -16
- studyfetch_sdk/types/v1/upload/component_get_presigned_url_params.py +0 -23
- studyfetch_sdk/types/v1/upload/component_get_presigned_url_response.py +0 -15
- studyfetch_sdk/types/v1/upload/component_upload_file_params.py +0 -21
- studyfetch_sdk/types/v1/upload/component_upload_url_params.py +0 -23
- studyfetch_sdk/types/v1/upload/file_upload_response.py +0 -24
- {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/WHEEL +0 -0
- {studyfetch_sdk-0.1.0a19.dist-info → studyfetch_sdk-0.1.0a21.dist-info}/licenses/LICENSE +0 -0
@@ -1,682 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
|
5
|
-
import httpx
|
6
|
-
|
7
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
8
|
-
from ...._utils import maybe_transform, async_maybe_transform
|
9
|
-
from .component import (
|
10
|
-
ComponentResource,
|
11
|
-
AsyncComponentResource,
|
12
|
-
ComponentResourceWithRawResponse,
|
13
|
-
AsyncComponentResourceWithRawResponse,
|
14
|
-
ComponentResourceWithStreamingResponse,
|
15
|
-
AsyncComponentResourceWithStreamingResponse,
|
16
|
-
)
|
17
|
-
from ...._compat import cached_property
|
18
|
-
from ....types.v1 import test_create_params, test_retake_params, test_submit_params, test_submit_answer_params
|
19
|
-
from ...._resource import SyncAPIResource, AsyncAPIResource
|
20
|
-
from ...._response import (
|
21
|
-
to_raw_response_wrapper,
|
22
|
-
to_streamed_response_wrapper,
|
23
|
-
async_to_raw_response_wrapper,
|
24
|
-
async_to_streamed_response_wrapper,
|
25
|
-
)
|
26
|
-
from ...._base_client import make_request_options
|
27
|
-
|
28
|
-
__all__ = ["TestsResource", "AsyncTestsResource"]
|
29
|
-
|
30
|
-
|
31
|
-
class TestsResource(SyncAPIResource):
|
32
|
-
__test__ = False
|
33
|
-
|
34
|
-
@cached_property
|
35
|
-
def component(self) -> ComponentResource:
|
36
|
-
return ComponentResource(self._client)
|
37
|
-
|
38
|
-
@cached_property
|
39
|
-
def with_raw_response(self) -> TestsResourceWithRawResponse:
|
40
|
-
"""
|
41
|
-
This property can be used as a prefix for any HTTP method call to return
|
42
|
-
the raw response object instead of the parsed content.
|
43
|
-
|
44
|
-
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
45
|
-
"""
|
46
|
-
return TestsResourceWithRawResponse(self)
|
47
|
-
|
48
|
-
@cached_property
|
49
|
-
def with_streaming_response(self) -> TestsResourceWithStreamingResponse:
|
50
|
-
"""
|
51
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
52
|
-
|
53
|
-
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
54
|
-
"""
|
55
|
-
return TestsResourceWithStreamingResponse(self)
|
56
|
-
|
57
|
-
def create(
|
58
|
-
self,
|
59
|
-
*,
|
60
|
-
component_id: str,
|
61
|
-
name: str | NotGiven = NOT_GIVEN,
|
62
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
63
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
64
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
65
|
-
extra_headers: Headers | None = None,
|
66
|
-
extra_query: Query | None = None,
|
67
|
-
extra_body: Body | None = None,
|
68
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
69
|
-
) -> None:
|
70
|
-
"""
|
71
|
-
Create a new test
|
72
|
-
|
73
|
-
Args:
|
74
|
-
component_id: Component ID
|
75
|
-
|
76
|
-
name: Test name (optional)
|
77
|
-
|
78
|
-
user_id: User ID (optional)
|
79
|
-
|
80
|
-
extra_headers: Send extra headers
|
81
|
-
|
82
|
-
extra_query: Add additional query parameters to the request
|
83
|
-
|
84
|
-
extra_body: Add additional JSON properties to the request
|
85
|
-
|
86
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
87
|
-
"""
|
88
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
89
|
-
return self._post(
|
90
|
-
"/api/v1/tests/create",
|
91
|
-
body=maybe_transform(
|
92
|
-
{
|
93
|
-
"component_id": component_id,
|
94
|
-
"name": name,
|
95
|
-
"user_id": user_id,
|
96
|
-
},
|
97
|
-
test_create_params.TestCreateParams,
|
98
|
-
),
|
99
|
-
options=make_request_options(
|
100
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
101
|
-
),
|
102
|
-
cast_to=NoneType,
|
103
|
-
)
|
104
|
-
|
105
|
-
def retrieve(
|
106
|
-
self,
|
107
|
-
test_id: str,
|
108
|
-
*,
|
109
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
110
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
111
|
-
extra_headers: Headers | None = None,
|
112
|
-
extra_query: Query | None = None,
|
113
|
-
extra_body: Body | None = None,
|
114
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
115
|
-
) -> None:
|
116
|
-
"""
|
117
|
-
Get test by ID
|
118
|
-
|
119
|
-
Args:
|
120
|
-
extra_headers: Send extra headers
|
121
|
-
|
122
|
-
extra_query: Add additional query parameters to the request
|
123
|
-
|
124
|
-
extra_body: Add additional JSON properties to the request
|
125
|
-
|
126
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
127
|
-
"""
|
128
|
-
if not test_id:
|
129
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
130
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
131
|
-
return self._get(
|
132
|
-
f"/api/v1/tests/{test_id}",
|
133
|
-
options=make_request_options(
|
134
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
135
|
-
),
|
136
|
-
cast_to=NoneType,
|
137
|
-
)
|
138
|
-
|
139
|
-
def get_results(
|
140
|
-
self,
|
141
|
-
test_id: str,
|
142
|
-
*,
|
143
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
144
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
145
|
-
extra_headers: Headers | None = None,
|
146
|
-
extra_query: Query | None = None,
|
147
|
-
extra_body: Body | None = None,
|
148
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
149
|
-
) -> None:
|
150
|
-
"""
|
151
|
-
Get test results
|
152
|
-
|
153
|
-
Args:
|
154
|
-
extra_headers: Send extra headers
|
155
|
-
|
156
|
-
extra_query: Add additional query parameters to the request
|
157
|
-
|
158
|
-
extra_body: Add additional JSON properties to the request
|
159
|
-
|
160
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
161
|
-
"""
|
162
|
-
if not test_id:
|
163
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
164
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
165
|
-
return self._get(
|
166
|
-
f"/api/v1/tests/{test_id}/results",
|
167
|
-
options=make_request_options(
|
168
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
169
|
-
),
|
170
|
-
cast_to=NoneType,
|
171
|
-
)
|
172
|
-
|
173
|
-
def retake(
|
174
|
-
self,
|
175
|
-
test_id: str,
|
176
|
-
*,
|
177
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
178
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
179
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
180
|
-
extra_headers: Headers | None = None,
|
181
|
-
extra_query: Query | None = None,
|
182
|
-
extra_body: Body | None = None,
|
183
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
184
|
-
) -> None:
|
185
|
-
"""
|
186
|
-
Retake a test
|
187
|
-
|
188
|
-
Args:
|
189
|
-
user_id: User ID (optional)
|
190
|
-
|
191
|
-
extra_headers: Send extra headers
|
192
|
-
|
193
|
-
extra_query: Add additional query parameters to the request
|
194
|
-
|
195
|
-
extra_body: Add additional JSON properties to the request
|
196
|
-
|
197
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
198
|
-
"""
|
199
|
-
if not test_id:
|
200
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
201
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
202
|
-
return self._post(
|
203
|
-
f"/api/v1/tests/{test_id}/retake",
|
204
|
-
body=maybe_transform({"user_id": user_id}, test_retake_params.TestRetakeParams),
|
205
|
-
options=make_request_options(
|
206
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
207
|
-
),
|
208
|
-
cast_to=NoneType,
|
209
|
-
)
|
210
|
-
|
211
|
-
def submit(
|
212
|
-
self,
|
213
|
-
test_id: str,
|
214
|
-
*,
|
215
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
216
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
217
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
218
|
-
extra_headers: Headers | None = None,
|
219
|
-
extra_query: Query | None = None,
|
220
|
-
extra_body: Body | None = None,
|
221
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
222
|
-
) -> None:
|
223
|
-
"""
|
224
|
-
Submit completed test
|
225
|
-
|
226
|
-
Args:
|
227
|
-
user_id: User ID (optional)
|
228
|
-
|
229
|
-
extra_headers: Send extra headers
|
230
|
-
|
231
|
-
extra_query: Add additional query parameters to the request
|
232
|
-
|
233
|
-
extra_body: Add additional JSON properties to the request
|
234
|
-
|
235
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
236
|
-
"""
|
237
|
-
if not test_id:
|
238
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
239
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
240
|
-
return self._post(
|
241
|
-
f"/api/v1/tests/{test_id}/submit",
|
242
|
-
body=maybe_transform({"user_id": user_id}, test_submit_params.TestSubmitParams),
|
243
|
-
options=make_request_options(
|
244
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
245
|
-
),
|
246
|
-
cast_to=NoneType,
|
247
|
-
)
|
248
|
-
|
249
|
-
def submit_answer(
|
250
|
-
self,
|
251
|
-
test_id: str,
|
252
|
-
*,
|
253
|
-
answer: str,
|
254
|
-
question_id: str,
|
255
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
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
|
-
Submit test answer
|
265
|
-
|
266
|
-
Args:
|
267
|
-
answer: User answer
|
268
|
-
|
269
|
-
question_id: Question ID
|
270
|
-
|
271
|
-
user_id: User ID (optional)
|
272
|
-
|
273
|
-
extra_headers: Send extra headers
|
274
|
-
|
275
|
-
extra_query: Add additional query parameters to the request
|
276
|
-
|
277
|
-
extra_body: Add additional JSON properties to the request
|
278
|
-
|
279
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
280
|
-
"""
|
281
|
-
if not test_id:
|
282
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
283
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
284
|
-
return self._post(
|
285
|
-
f"/api/v1/tests/{test_id}/submit-answer",
|
286
|
-
body=maybe_transform(
|
287
|
-
{
|
288
|
-
"answer": answer,
|
289
|
-
"question_id": question_id,
|
290
|
-
"user_id": user_id,
|
291
|
-
},
|
292
|
-
test_submit_answer_params.TestSubmitAnswerParams,
|
293
|
-
),
|
294
|
-
options=make_request_options(
|
295
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
296
|
-
),
|
297
|
-
cast_to=NoneType,
|
298
|
-
)
|
299
|
-
|
300
|
-
|
301
|
-
class AsyncTestsResource(AsyncAPIResource):
|
302
|
-
@cached_property
|
303
|
-
def component(self) -> AsyncComponentResource:
|
304
|
-
return AsyncComponentResource(self._client)
|
305
|
-
|
306
|
-
@cached_property
|
307
|
-
def with_raw_response(self) -> AsyncTestsResourceWithRawResponse:
|
308
|
-
"""
|
309
|
-
This property can be used as a prefix for any HTTP method call to return
|
310
|
-
the raw response object instead of the parsed content.
|
311
|
-
|
312
|
-
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#accessing-raw-response-data-eg-headers
|
313
|
-
"""
|
314
|
-
return AsyncTestsResourceWithRawResponse(self)
|
315
|
-
|
316
|
-
@cached_property
|
317
|
-
def with_streaming_response(self) -> AsyncTestsResourceWithStreamingResponse:
|
318
|
-
"""
|
319
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
320
|
-
|
321
|
-
For more information, see https://www.github.com/GoStudyFetchGo/studyfetch-sdk-python#with_streaming_response
|
322
|
-
"""
|
323
|
-
return AsyncTestsResourceWithStreamingResponse(self)
|
324
|
-
|
325
|
-
async def create(
|
326
|
-
self,
|
327
|
-
*,
|
328
|
-
component_id: str,
|
329
|
-
name: str | NotGiven = NOT_GIVEN,
|
330
|
-
user_id: 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
|
-
) -> None:
|
338
|
-
"""
|
339
|
-
Create a new test
|
340
|
-
|
341
|
-
Args:
|
342
|
-
component_id: Component ID
|
343
|
-
|
344
|
-
name: Test name (optional)
|
345
|
-
|
346
|
-
user_id: User ID (optional)
|
347
|
-
|
348
|
-
extra_headers: Send extra headers
|
349
|
-
|
350
|
-
extra_query: Add additional query parameters to the request
|
351
|
-
|
352
|
-
extra_body: Add additional JSON properties to the request
|
353
|
-
|
354
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
355
|
-
"""
|
356
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
357
|
-
return await self._post(
|
358
|
-
"/api/v1/tests/create",
|
359
|
-
body=await async_maybe_transform(
|
360
|
-
{
|
361
|
-
"component_id": component_id,
|
362
|
-
"name": name,
|
363
|
-
"user_id": user_id,
|
364
|
-
},
|
365
|
-
test_create_params.TestCreateParams,
|
366
|
-
),
|
367
|
-
options=make_request_options(
|
368
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
369
|
-
),
|
370
|
-
cast_to=NoneType,
|
371
|
-
)
|
372
|
-
|
373
|
-
async def retrieve(
|
374
|
-
self,
|
375
|
-
test_id: str,
|
376
|
-
*,
|
377
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
378
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
379
|
-
extra_headers: Headers | None = None,
|
380
|
-
extra_query: Query | None = None,
|
381
|
-
extra_body: Body | None = None,
|
382
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
383
|
-
) -> None:
|
384
|
-
"""
|
385
|
-
Get test by ID
|
386
|
-
|
387
|
-
Args:
|
388
|
-
extra_headers: Send extra headers
|
389
|
-
|
390
|
-
extra_query: Add additional query parameters to the request
|
391
|
-
|
392
|
-
extra_body: Add additional JSON properties to the request
|
393
|
-
|
394
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
395
|
-
"""
|
396
|
-
if not test_id:
|
397
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
398
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
399
|
-
return await self._get(
|
400
|
-
f"/api/v1/tests/{test_id}",
|
401
|
-
options=make_request_options(
|
402
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
403
|
-
),
|
404
|
-
cast_to=NoneType,
|
405
|
-
)
|
406
|
-
|
407
|
-
async def get_results(
|
408
|
-
self,
|
409
|
-
test_id: str,
|
410
|
-
*,
|
411
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
412
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
413
|
-
extra_headers: Headers | None = None,
|
414
|
-
extra_query: Query | None = None,
|
415
|
-
extra_body: Body | None = None,
|
416
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
417
|
-
) -> None:
|
418
|
-
"""
|
419
|
-
Get test results
|
420
|
-
|
421
|
-
Args:
|
422
|
-
extra_headers: Send extra headers
|
423
|
-
|
424
|
-
extra_query: Add additional query parameters to the request
|
425
|
-
|
426
|
-
extra_body: Add additional JSON properties to the request
|
427
|
-
|
428
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
429
|
-
"""
|
430
|
-
if not test_id:
|
431
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
432
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
433
|
-
return await self._get(
|
434
|
-
f"/api/v1/tests/{test_id}/results",
|
435
|
-
options=make_request_options(
|
436
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
437
|
-
),
|
438
|
-
cast_to=NoneType,
|
439
|
-
)
|
440
|
-
|
441
|
-
async def retake(
|
442
|
-
self,
|
443
|
-
test_id: str,
|
444
|
-
*,
|
445
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
446
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
447
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
448
|
-
extra_headers: Headers | None = None,
|
449
|
-
extra_query: Query | None = None,
|
450
|
-
extra_body: Body | None = None,
|
451
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
452
|
-
) -> None:
|
453
|
-
"""
|
454
|
-
Retake a test
|
455
|
-
|
456
|
-
Args:
|
457
|
-
user_id: User ID (optional)
|
458
|
-
|
459
|
-
extra_headers: Send extra headers
|
460
|
-
|
461
|
-
extra_query: Add additional query parameters to the request
|
462
|
-
|
463
|
-
extra_body: Add additional JSON properties to the request
|
464
|
-
|
465
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
466
|
-
"""
|
467
|
-
if not test_id:
|
468
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
469
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
470
|
-
return await self._post(
|
471
|
-
f"/api/v1/tests/{test_id}/retake",
|
472
|
-
body=await async_maybe_transform({"user_id": user_id}, test_retake_params.TestRetakeParams),
|
473
|
-
options=make_request_options(
|
474
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
475
|
-
),
|
476
|
-
cast_to=NoneType,
|
477
|
-
)
|
478
|
-
|
479
|
-
async def submit(
|
480
|
-
self,
|
481
|
-
test_id: str,
|
482
|
-
*,
|
483
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
484
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
485
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
486
|
-
extra_headers: Headers | None = None,
|
487
|
-
extra_query: Query | None = None,
|
488
|
-
extra_body: Body | None = None,
|
489
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
490
|
-
) -> None:
|
491
|
-
"""
|
492
|
-
Submit completed test
|
493
|
-
|
494
|
-
Args:
|
495
|
-
user_id: User ID (optional)
|
496
|
-
|
497
|
-
extra_headers: Send extra headers
|
498
|
-
|
499
|
-
extra_query: Add additional query parameters to the request
|
500
|
-
|
501
|
-
extra_body: Add additional JSON properties to the request
|
502
|
-
|
503
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
504
|
-
"""
|
505
|
-
if not test_id:
|
506
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
507
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
508
|
-
return await self._post(
|
509
|
-
f"/api/v1/tests/{test_id}/submit",
|
510
|
-
body=await async_maybe_transform({"user_id": user_id}, test_submit_params.TestSubmitParams),
|
511
|
-
options=make_request_options(
|
512
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
513
|
-
),
|
514
|
-
cast_to=NoneType,
|
515
|
-
)
|
516
|
-
|
517
|
-
async def submit_answer(
|
518
|
-
self,
|
519
|
-
test_id: str,
|
520
|
-
*,
|
521
|
-
answer: str,
|
522
|
-
question_id: str,
|
523
|
-
user_id: str | NotGiven = NOT_GIVEN,
|
524
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
525
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
526
|
-
extra_headers: Headers | None = None,
|
527
|
-
extra_query: Query | None = None,
|
528
|
-
extra_body: Body | None = None,
|
529
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
530
|
-
) -> None:
|
531
|
-
"""
|
532
|
-
Submit test answer
|
533
|
-
|
534
|
-
Args:
|
535
|
-
answer: User answer
|
536
|
-
|
537
|
-
question_id: Question ID
|
538
|
-
|
539
|
-
user_id: User ID (optional)
|
540
|
-
|
541
|
-
extra_headers: Send extra headers
|
542
|
-
|
543
|
-
extra_query: Add additional query parameters to the request
|
544
|
-
|
545
|
-
extra_body: Add additional JSON properties to the request
|
546
|
-
|
547
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
548
|
-
"""
|
549
|
-
if not test_id:
|
550
|
-
raise ValueError(f"Expected a non-empty value for `test_id` but received {test_id!r}")
|
551
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
552
|
-
return await self._post(
|
553
|
-
f"/api/v1/tests/{test_id}/submit-answer",
|
554
|
-
body=await async_maybe_transform(
|
555
|
-
{
|
556
|
-
"answer": answer,
|
557
|
-
"question_id": question_id,
|
558
|
-
"user_id": user_id,
|
559
|
-
},
|
560
|
-
test_submit_answer_params.TestSubmitAnswerParams,
|
561
|
-
),
|
562
|
-
options=make_request_options(
|
563
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
564
|
-
),
|
565
|
-
cast_to=NoneType,
|
566
|
-
)
|
567
|
-
|
568
|
-
|
569
|
-
class TestsResourceWithRawResponse:
|
570
|
-
__test__ = False
|
571
|
-
|
572
|
-
def __init__(self, tests: TestsResource) -> None:
|
573
|
-
self._tests = tests
|
574
|
-
|
575
|
-
self.create = to_raw_response_wrapper(
|
576
|
-
tests.create,
|
577
|
-
)
|
578
|
-
self.retrieve = to_raw_response_wrapper(
|
579
|
-
tests.retrieve,
|
580
|
-
)
|
581
|
-
self.get_results = to_raw_response_wrapper(
|
582
|
-
tests.get_results,
|
583
|
-
)
|
584
|
-
self.retake = to_raw_response_wrapper(
|
585
|
-
tests.retake,
|
586
|
-
)
|
587
|
-
self.submit = to_raw_response_wrapper(
|
588
|
-
tests.submit,
|
589
|
-
)
|
590
|
-
self.submit_answer = to_raw_response_wrapper(
|
591
|
-
tests.submit_answer,
|
592
|
-
)
|
593
|
-
|
594
|
-
@cached_property
|
595
|
-
def component(self) -> ComponentResourceWithRawResponse:
|
596
|
-
return ComponentResourceWithRawResponse(self._tests.component)
|
597
|
-
|
598
|
-
|
599
|
-
class AsyncTestsResourceWithRawResponse:
|
600
|
-
def __init__(self, tests: AsyncTestsResource) -> None:
|
601
|
-
self._tests = tests
|
602
|
-
|
603
|
-
self.create = async_to_raw_response_wrapper(
|
604
|
-
tests.create,
|
605
|
-
)
|
606
|
-
self.retrieve = async_to_raw_response_wrapper(
|
607
|
-
tests.retrieve,
|
608
|
-
)
|
609
|
-
self.get_results = async_to_raw_response_wrapper(
|
610
|
-
tests.get_results,
|
611
|
-
)
|
612
|
-
self.retake = async_to_raw_response_wrapper(
|
613
|
-
tests.retake,
|
614
|
-
)
|
615
|
-
self.submit = async_to_raw_response_wrapper(
|
616
|
-
tests.submit,
|
617
|
-
)
|
618
|
-
self.submit_answer = async_to_raw_response_wrapper(
|
619
|
-
tests.submit_answer,
|
620
|
-
)
|
621
|
-
|
622
|
-
@cached_property
|
623
|
-
def component(self) -> AsyncComponentResourceWithRawResponse:
|
624
|
-
return AsyncComponentResourceWithRawResponse(self._tests.component)
|
625
|
-
|
626
|
-
|
627
|
-
class TestsResourceWithStreamingResponse:
|
628
|
-
__test__ = False
|
629
|
-
|
630
|
-
def __init__(self, tests: TestsResource) -> None:
|
631
|
-
self._tests = tests
|
632
|
-
|
633
|
-
self.create = to_streamed_response_wrapper(
|
634
|
-
tests.create,
|
635
|
-
)
|
636
|
-
self.retrieve = to_streamed_response_wrapper(
|
637
|
-
tests.retrieve,
|
638
|
-
)
|
639
|
-
self.get_results = to_streamed_response_wrapper(
|
640
|
-
tests.get_results,
|
641
|
-
)
|
642
|
-
self.retake = to_streamed_response_wrapper(
|
643
|
-
tests.retake,
|
644
|
-
)
|
645
|
-
self.submit = to_streamed_response_wrapper(
|
646
|
-
tests.submit,
|
647
|
-
)
|
648
|
-
self.submit_answer = to_streamed_response_wrapper(
|
649
|
-
tests.submit_answer,
|
650
|
-
)
|
651
|
-
|
652
|
-
@cached_property
|
653
|
-
def component(self) -> ComponentResourceWithStreamingResponse:
|
654
|
-
return ComponentResourceWithStreamingResponse(self._tests.component)
|
655
|
-
|
656
|
-
|
657
|
-
class AsyncTestsResourceWithStreamingResponse:
|
658
|
-
def __init__(self, tests: AsyncTestsResource) -> None:
|
659
|
-
self._tests = tests
|
660
|
-
|
661
|
-
self.create = async_to_streamed_response_wrapper(
|
662
|
-
tests.create,
|
663
|
-
)
|
664
|
-
self.retrieve = async_to_streamed_response_wrapper(
|
665
|
-
tests.retrieve,
|
666
|
-
)
|
667
|
-
self.get_results = async_to_streamed_response_wrapper(
|
668
|
-
tests.get_results,
|
669
|
-
)
|
670
|
-
self.retake = async_to_streamed_response_wrapper(
|
671
|
-
tests.retake,
|
672
|
-
)
|
673
|
-
self.submit = async_to_streamed_response_wrapper(
|
674
|
-
tests.submit,
|
675
|
-
)
|
676
|
-
self.submit_answer = async_to_streamed_response_wrapper(
|
677
|
-
tests.submit_answer,
|
678
|
-
)
|
679
|
-
|
680
|
-
@cached_property
|
681
|
-
def component(self) -> AsyncComponentResourceWithStreamingResponse:
|
682
|
-
return AsyncComponentResourceWithStreamingResponse(self._tests.component)
|