docket-client 0.3.2__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.
- docket/__init__.py +8 -0
- docket/api/__init__.py +1 -0
- docket/api/access/__init__.py +1 -0
- docket/api/access/add_principal.py +193 -0
- docket/api/access/archive_role_assignment.py +182 -0
- docket/api/access/create_api_token.py +198 -0
- docket/api/access/create_application_principal.py +188 -0
- docket/api/access/create_role_assignment.py +194 -0
- docket/api/access/list_api_tokens.py +184 -0
- docket/api/access/list_principals.py +184 -0
- docket/api/access/list_role_assignments.py +200 -0
- docket/api/access/revoke_api_token.py +173 -0
- docket/api/identity/__init__.py +1 -0
- docket/api/identity/create_my_api_token.py +206 -0
- docket/api/identity/get_me.py +127 -0
- docket/api/identity/list_my_api_tokens.py +151 -0
- docket/api/identity/revoke_my_api_token.py +178 -0
- docket/api/recurring_acquisitions/__init__.py +1 -0
- docket/api/recurring_acquisitions/archive_recurring_acquisition.py +207 -0
- docket/api/recurring_acquisitions/create_recurring_acquisition.py +218 -0
- docket/api/recurring_acquisitions/get_recurring_acquisition.py +163 -0
- docket/api/recurring_acquisitions/list_recurring_acquisitions.py +248 -0
- docket/api/recurring_acquisitions/preview_recurring_acquisition.py +187 -0
- docket/api/recurring_acquisitions/preview_split_recurring_acquisition.py +232 -0
- docket/api/recurring_acquisitions/split_recurring_acquisition.py +258 -0
- docket/api/runs/__init__.py +1 -0
- docket/api/runs/get_run.py +160 -0
- docket/api/runs/list_runs.py +180 -0
- docket/api/runs/report_run_outcome.py +206 -0
- docket/api/scheduled_acquisitions/__init__.py +1 -0
- docket/api/scheduled_acquisitions/archive_scheduled_acquisition.py +203 -0
- docket/api/scheduled_acquisitions/create_scheduled_acquisition.py +185 -0
- docket/api/scheduled_acquisitions/get_resolved_settings.py +169 -0
- docket/api/scheduled_acquisitions/get_scheduled_acquisition.py +159 -0
- docket/api/scheduled_acquisitions/list_active_acquisitions.py +297 -0
- docket/api/scheduled_acquisitions/list_runs_for_scheduled_acquisition.py +191 -0
- docket/api/scheduled_acquisitions/list_scheduled_acquisitions.py +332 -0
- docket/api/scheduled_acquisitions/preview_scheduled_acquisition_edit.py +224 -0
- docket/api/scheduled_acquisitions/set_planning_status.py +199 -0
- docket/api/scheduled_acquisitions/start_run.py +221 -0
- docket/api/scheduled_acquisitions/update_scheduled_acquisition.py +226 -0
- docket/api/settings/__init__.py +1 -0
- docket/api/settings/list_behavior_curriculum_discriminator_values.py +188 -0
- docket/api/settings/list_behavior_curriculum_settings.py +199 -0
- docket/api/settings/list_fip_discriminator_values.py +184 -0
- docket/api/settings/list_fip_settings.py +195 -0
- docket/api/settings/list_live_behavior_curriculum_settings.py +233 -0
- docket/api/settings/list_live_fip_settings.py +225 -0
- docket/api/settings/preview_behavior_curriculum_settings.py +191 -0
- docket/api/settings/preview_fip_settings.py +177 -0
- docket/api/settings/push_behavior_curriculum_settings.py +222 -0
- docket/api/settings/push_fip_settings.py +206 -0
- docket/api/templates/__init__.py +1 -0
- docket/api/templates/archive_template.py +203 -0
- docket/api/templates/create_template.py +206 -0
- docket/api/templates/get_template.py +159 -0
- docket/api/templates/list_templates.py +174 -0
- docket/api/templates/update_template.py +234 -0
- docket/api/vocabulary/__init__.py +1 -0
- docket/api/vocabulary/list_instruments.py +165 -0
- docket/api/vocabulary/list_persons.py +132 -0
- docket/api/vocabulary/list_projects.py +132 -0
- docket/api/vocabulary/list_subjects.py +132 -0
- docket/api/vocabulary/lookup_person.py +166 -0
- docket/api/vocabulary/lookup_subject.py +166 -0
- docket/api/vocabulary/sync_vocabulary.py +148 -0
- docket/client.py +272 -0
- docket/errors.py +16 -0
- docket/models/__init__.py +221 -0
- docket/models/access_role.py +12 -0
- docket/models/access_role_nullable_type_1.py +12 -0
- docket/models/access_role_nullable_type_2_type_1.py +12 -0
- docket/models/access_role_nullable_type_3_type_1.py +12 -0
- docket/models/acquisition_variable.py +72 -0
- docket/models/acquisition_warning.py +126 -0
- docket/models/add_principal_request.py +83 -0
- docket/models/api_token_response.py +271 -0
- docket/models/api_token_status.py +10 -0
- docket/models/archive_recurring_acquisition_request.py +77 -0
- docket/models/archive_recurring_acquisition_response.py +83 -0
- docket/models/archive_scheduled_acquisition_request.py +78 -0
- docket/models/archive_template_request.py +66 -0
- docket/models/auth_mode.py +10 -0
- docket/models/behavior_curriculum_push_settings_request.py +85 -0
- docket/models/behavior_curriculum_settings.py +55 -0
- docket/models/behavior_curriculum_settings_preview_response.py +102 -0
- docket/models/behavior_curriculum_settings_preview_response_promoted.py +50 -0
- docket/models/behavior_curriculum_settings_version_response.py +160 -0
- docket/models/behavior_curriculum_settings_version_response_promoted.py +50 -0
- docket/models/caller_kind.py +11 -0
- docket/models/create_api_token_request.py +97 -0
- docket/models/create_application_principal_request.py +65 -0
- docket/models/create_personal_api_token_request.py +167 -0
- docket/models/create_recurring_acquisition_request.py +269 -0
- docket/models/create_role_assignment_request.py +99 -0
- docket/models/create_scheduled_acquisition_request.py +265 -0
- docket/models/create_template_request.py +323 -0
- docket/models/created_api_token_response.py +82 -0
- docket/models/effective_status.py +15 -0
- docket/models/fip_color.py +13 -0
- docket/models/fip_fiber.py +93 -0
- docket/models/fip_mode.py +9 -0
- docket/models/fip_push_settings_request.py +82 -0
- docket/models/fip_settings.py +91 -0
- docket/models/fip_settings_preview_response.py +97 -0
- docket/models/fip_settings_preview_response_promoted.py +50 -0
- docket/models/fip_settings_version_response.py +155 -0
- docket/models/fip_settings_version_response_promoted.py +50 -0
- docket/models/future_occurrences.py +9 -0
- docket/models/get_resolved_settings_response_200.py +65 -0
- docket/models/held_role_response.py +116 -0
- docket/models/http_validation_problem_details.py +204 -0
- docket/models/http_validation_problem_details_errors.py +59 -0
- docket/models/instrument_response.py +91 -0
- docket/models/kept_occurrence.py +85 -0
- docket/models/kept_occurrence_reason.py +10 -0
- docket/models/list_active_acquisitions_effective_status_item.py +15 -0
- docket/models/list_scheduled_acquisitions_planning_status.py +11 -0
- docket/models/me_caller.py +118 -0
- docket/models/me_permission.py +98 -0
- docket/models/me_response.py +158 -0
- docket/models/me_role.py +75 -0
- docket/models/occurrence_preview.py +121 -0
- docket/models/occurrence_summary.py +126 -0
- docket/models/occurrence_warnings.py +91 -0
- docket/models/permission_action.py +12 -0
- docket/models/person_assignment.py +74 -0
- docket/models/person_lookup_response.py +131 -0
- docket/models/person_response.py +103 -0
- docket/models/person_role.py +9 -0
- docket/models/personal_token_limits.py +92 -0
- docket/models/planning_status.py +11 -0
- docket/models/principal_kind.py +9 -0
- docket/models/principal_response.py +216 -0
- docket/models/problem_details.py +177 -0
- docket/models/project_response.py +75 -0
- docket/models/recurrence_exception_kind.py +13 -0
- docket/models/recurrence_exception_response.py +103 -0
- docket/models/recurrence_frequency.py +9 -0
- docket/models/recurrence_preview_response.py +101 -0
- docket/models/recurrence_rule.py +207 -0
- docket/models/recurring_acquisition_created_response.py +123 -0
- docket/models/recurring_acquisition_detail_response.py +105 -0
- docket/models/recurring_acquisition_response.py +326 -0
- docket/models/report_run_outcome_request.py +89 -0
- docket/models/resolution_mode.py +10 -0
- docket/models/resolved_settings.py +73 -0
- docket/models/role_assignment_response.py +157 -0
- docket/models/role_origin.py +10 -0
- docket/models/role_source_kind.py +10 -0
- docket/models/run_origin.py +9 -0
- docket/models/run_outcome.py +9 -0
- docket/models/run_response.py +181 -0
- docket/models/run_settings_snapshot.py +72 -0
- docket/models/run_start_response.py +91 -0
- docket/models/run_start_response_settings.py +65 -0
- docket/models/run_status.py +11 -0
- docket/models/scheduled_acquisition_edit_preview_response.py +150 -0
- docket/models/scheduled_acquisition_response.py +366 -0
- docket/models/set_planning_status_request.py +90 -0
- docket/models/settings_selector.py +138 -0
- docket/models/skipped_occurrence.py +85 -0
- docket/models/split_preview_response.py +129 -0
- docket/models/split_recurring_acquisition_request.py +261 -0
- docket/models/split_recurring_acquisition_response.py +159 -0
- docket/models/start_run_request.py +73 -0
- docket/models/subject_lookup_response.py +149 -0
- docket/models/subject_response.py +128 -0
- docket/models/sync_counts.py +80 -0
- docket/models/sync_response.py +81 -0
- docket/models/template_response.py +302 -0
- docket/models/update_scheduled_acquisition_request.py +235 -0
- docket/models/update_template_request.py +279 -0
- docket/models/weekday.py +14 -0
- docket/types.py +54 -0
- docket_auth/__init__.py +239 -0
- docket_client-0.3.2.dist-info/METADATA +233 -0
- docket_client-0.3.2.dist-info/RECORD +188 -0
- docket_client-0.3.2.dist-info/WHEEL +4 -0
- docket_client-0.3.2.dist-info/entry_points.txt +2 -0
- docket_mcp/__init__.py +6 -0
- docket_mcp/api.py +207 -0
- docket_mcp/config.py +57 -0
- docket_mcp/server.py +78 -0
- docket_mcp/signin.py +155 -0
- docket_mcp/slots.py +80 -0
- docket_mcp/times.py +160 -0
- docket_mcp/tools.py +1202 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.fip_settings_version_response import FipSettingsVersionResponse
|
|
12
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
13
|
+
from ...types import UNSET, Unset
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
subject_id: str | Unset = UNSET,
|
|
20
|
+
discriminator_field: str | Unset = UNSET,
|
|
21
|
+
discriminator_value: str | Unset = UNSET,
|
|
22
|
+
limit: int | None | Unset = UNSET,
|
|
23
|
+
) -> dict[str, Any]:
|
|
24
|
+
|
|
25
|
+
params: dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
params["subject_id"] = subject_id
|
|
28
|
+
|
|
29
|
+
params["discriminator_field"] = discriminator_field
|
|
30
|
+
|
|
31
|
+
params["discriminator_value"] = discriminator_value
|
|
32
|
+
|
|
33
|
+
json_limit: int | None | Unset
|
|
34
|
+
if isinstance(limit, Unset):
|
|
35
|
+
json_limit = UNSET
|
|
36
|
+
else:
|
|
37
|
+
json_limit = limit
|
|
38
|
+
params["limit"] = json_limit
|
|
39
|
+
|
|
40
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
41
|
+
|
|
42
|
+
_kwargs: dict[str, Any] = {
|
|
43
|
+
"method": "get",
|
|
44
|
+
"url": "/api/v1/settings/fip/live",
|
|
45
|
+
"params": params,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return _kwargs
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _parse_response(
|
|
52
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
53
|
+
) -> HttpValidationProblemDetails | list[FipSettingsVersionResponse] | None:
|
|
54
|
+
if response.status_code == 200:
|
|
55
|
+
response_200 = []
|
|
56
|
+
_response_200 = response.json()
|
|
57
|
+
for response_200_item_data in _response_200:
|
|
58
|
+
response_200_item = FipSettingsVersionResponse.from_dict(response_200_item_data)
|
|
59
|
+
|
|
60
|
+
response_200.append(response_200_item)
|
|
61
|
+
|
|
62
|
+
return response_200
|
|
63
|
+
|
|
64
|
+
if response.status_code == 422:
|
|
65
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_422
|
|
68
|
+
|
|
69
|
+
if client.raise_on_unexpected_status:
|
|
70
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
71
|
+
else:
|
|
72
|
+
return None
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _build_response(
|
|
76
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
77
|
+
) -> Response[HttpValidationProblemDetails | list[FipSettingsVersionResponse]]:
|
|
78
|
+
return Response(
|
|
79
|
+
status_code=HTTPStatus(response.status_code),
|
|
80
|
+
content=response.content,
|
|
81
|
+
headers=response.headers,
|
|
82
|
+
parsed=_parse_response(client=client, response=response),
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def sync_detailed(
|
|
87
|
+
*,
|
|
88
|
+
client: AuthenticatedClient,
|
|
89
|
+
subject_id: str | Unset = UNSET,
|
|
90
|
+
discriminator_field: str | Unset = UNSET,
|
|
91
|
+
discriminator_value: str | Unset = UNSET,
|
|
92
|
+
limit: int | None | Unset = UNSET,
|
|
93
|
+
) -> Response[HttpValidationProblemDetails | list[FipSettingsVersionResponse]]:
|
|
94
|
+
"""Live fip settings versions, newest first, optionally filtered by a discriminator field.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
subject_id (str | Unset):
|
|
98
|
+
discriminator_field (str | Unset):
|
|
99
|
+
discriminator_value (str | Unset):
|
|
100
|
+
limit (int | None | Unset):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Response[HttpValidationProblemDetails | list[FipSettingsVersionResponse]]
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
kwargs = _get_kwargs(
|
|
111
|
+
subject_id=subject_id,
|
|
112
|
+
discriminator_field=discriminator_field,
|
|
113
|
+
discriminator_value=discriminator_value,
|
|
114
|
+
limit=limit,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
response = client.get_httpx_client().request(
|
|
118
|
+
**kwargs,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return _build_response(client=client, response=response)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def sync(
|
|
125
|
+
*,
|
|
126
|
+
client: AuthenticatedClient,
|
|
127
|
+
subject_id: str | Unset = UNSET,
|
|
128
|
+
discriminator_field: str | Unset = UNSET,
|
|
129
|
+
discriminator_value: str | Unset = UNSET,
|
|
130
|
+
limit: int | None | Unset = UNSET,
|
|
131
|
+
) -> HttpValidationProblemDetails | list[FipSettingsVersionResponse] | None:
|
|
132
|
+
"""Live fip settings versions, newest first, optionally filtered by a discriminator field.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
subject_id (str | Unset):
|
|
136
|
+
discriminator_field (str | Unset):
|
|
137
|
+
discriminator_value (str | Unset):
|
|
138
|
+
limit (int | None | Unset):
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
HttpValidationProblemDetails | list[FipSettingsVersionResponse]
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return sync_detailed(
|
|
149
|
+
client=client,
|
|
150
|
+
subject_id=subject_id,
|
|
151
|
+
discriminator_field=discriminator_field,
|
|
152
|
+
discriminator_value=discriminator_value,
|
|
153
|
+
limit=limit,
|
|
154
|
+
).parsed
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
async def asyncio_detailed(
|
|
158
|
+
*,
|
|
159
|
+
client: AuthenticatedClient,
|
|
160
|
+
subject_id: str | Unset = UNSET,
|
|
161
|
+
discriminator_field: str | Unset = UNSET,
|
|
162
|
+
discriminator_value: str | Unset = UNSET,
|
|
163
|
+
limit: int | None | Unset = UNSET,
|
|
164
|
+
) -> Response[HttpValidationProblemDetails | list[FipSettingsVersionResponse]]:
|
|
165
|
+
"""Live fip settings versions, newest first, optionally filtered by a discriminator field.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
subject_id (str | Unset):
|
|
169
|
+
discriminator_field (str | Unset):
|
|
170
|
+
discriminator_value (str | Unset):
|
|
171
|
+
limit (int | None | Unset):
|
|
172
|
+
|
|
173
|
+
Raises:
|
|
174
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
175
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
176
|
+
|
|
177
|
+
Returns:
|
|
178
|
+
Response[HttpValidationProblemDetails | list[FipSettingsVersionResponse]]
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
kwargs = _get_kwargs(
|
|
182
|
+
subject_id=subject_id,
|
|
183
|
+
discriminator_field=discriminator_field,
|
|
184
|
+
discriminator_value=discriminator_value,
|
|
185
|
+
limit=limit,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
189
|
+
|
|
190
|
+
return _build_response(client=client, response=response)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
async def asyncio(
|
|
194
|
+
*,
|
|
195
|
+
client: AuthenticatedClient,
|
|
196
|
+
subject_id: str | Unset = UNSET,
|
|
197
|
+
discriminator_field: str | Unset = UNSET,
|
|
198
|
+
discriminator_value: str | Unset = UNSET,
|
|
199
|
+
limit: int | None | Unset = UNSET,
|
|
200
|
+
) -> HttpValidationProblemDetails | list[FipSettingsVersionResponse] | None:
|
|
201
|
+
"""Live fip settings versions, newest first, optionally filtered by a discriminator field.
|
|
202
|
+
|
|
203
|
+
Args:
|
|
204
|
+
subject_id (str | Unset):
|
|
205
|
+
discriminator_field (str | Unset):
|
|
206
|
+
discriminator_value (str | Unset):
|
|
207
|
+
limit (int | None | Unset):
|
|
208
|
+
|
|
209
|
+
Raises:
|
|
210
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
211
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
HttpValidationProblemDetails | list[FipSettingsVersionResponse]
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
await asyncio_detailed(
|
|
219
|
+
client=client,
|
|
220
|
+
subject_id=subject_id,
|
|
221
|
+
discriminator_field=discriminator_field,
|
|
222
|
+
discriminator_value=discriminator_value,
|
|
223
|
+
limit=limit,
|
|
224
|
+
)
|
|
225
|
+
).parsed
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.behavior_curriculum_settings import BehaviorCurriculumSettings
|
|
12
|
+
from ...models.behavior_curriculum_settings_preview_response import (
|
|
13
|
+
BehaviorCurriculumSettingsPreviewResponse,
|
|
14
|
+
)
|
|
15
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
16
|
+
from typing import cast
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
*,
|
|
21
|
+
body: BehaviorCurriculumSettings,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
headers: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
_kwargs: dict[str, Any] = {
|
|
26
|
+
"method": "post",
|
|
27
|
+
"url": "/api/v1/settings/behavior-curriculum/preview",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_kwargs["json"] = body.to_dict()
|
|
31
|
+
|
|
32
|
+
headers["Content-Type"] = "application/json"
|
|
33
|
+
|
|
34
|
+
_kwargs["headers"] = headers
|
|
35
|
+
return _kwargs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _parse_response(
|
|
39
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
40
|
+
) -> BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
41
|
+
if response.status_code == 200:
|
|
42
|
+
response_200 = BehaviorCurriculumSettingsPreviewResponse.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_200
|
|
45
|
+
|
|
46
|
+
if response.status_code == 422:
|
|
47
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
59
|
+
) -> Response[BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
body: BehaviorCurriculumSettings,
|
|
72
|
+
) -> Response[BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
73
|
+
"""Validate and canonicalize a behavior_curriculum payload and compute its live scope and promoted
|
|
74
|
+
fields, without storing it.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
body (BehaviorCurriculumSettings): A curriculum/trainer-state document owned by the
|
|
78
|
+
downstream training
|
|
79
|
+
software. Any JSON object; stored exactly as pushed. Docket reads only
|
|
80
|
+
`stage.task.name`, `curriculum.name`, `curriculum.version` and
|
|
81
|
+
`is_on_curriculum`.
|
|
82
|
+
|
|
83
|
+
Raises:
|
|
84
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
85
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Response[BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails]
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
kwargs = _get_kwargs(
|
|
92
|
+
body=body,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
response = client.get_httpx_client().request(
|
|
96
|
+
**kwargs,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return _build_response(client=client, response=response)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def sync(
|
|
103
|
+
*,
|
|
104
|
+
client: AuthenticatedClient,
|
|
105
|
+
body: BehaviorCurriculumSettings,
|
|
106
|
+
) -> BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
107
|
+
"""Validate and canonicalize a behavior_curriculum payload and compute its live scope and promoted
|
|
108
|
+
fields, without storing it.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
body (BehaviorCurriculumSettings): A curriculum/trainer-state document owned by the
|
|
112
|
+
downstream training
|
|
113
|
+
software. Any JSON object; stored exactly as pushed. Docket reads only
|
|
114
|
+
`stage.task.name`, `curriculum.name`, `curriculum.version` and
|
|
115
|
+
`is_on_curriculum`.
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
return sync_detailed(
|
|
126
|
+
client=client,
|
|
127
|
+
body=body,
|
|
128
|
+
).parsed
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
async def asyncio_detailed(
|
|
132
|
+
*,
|
|
133
|
+
client: AuthenticatedClient,
|
|
134
|
+
body: BehaviorCurriculumSettings,
|
|
135
|
+
) -> Response[BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
136
|
+
"""Validate and canonicalize a behavior_curriculum payload and compute its live scope and promoted
|
|
137
|
+
fields, without storing it.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
body (BehaviorCurriculumSettings): A curriculum/trainer-state document owned by the
|
|
141
|
+
downstream training
|
|
142
|
+
software. Any JSON object; stored exactly as pushed. Docket reads only
|
|
143
|
+
`stage.task.name`, `curriculum.name`, `curriculum.version` and
|
|
144
|
+
`is_on_curriculum`.
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Response[BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails]
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
body=body,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
159
|
+
|
|
160
|
+
return _build_response(client=client, response=response)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def asyncio(
|
|
164
|
+
*,
|
|
165
|
+
client: AuthenticatedClient,
|
|
166
|
+
body: BehaviorCurriculumSettings,
|
|
167
|
+
) -> BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
168
|
+
"""Validate and canonicalize a behavior_curriculum payload and compute its live scope and promoted
|
|
169
|
+
fields, without storing it.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
body (BehaviorCurriculumSettings): A curriculum/trainer-state document owned by the
|
|
173
|
+
downstream training
|
|
174
|
+
software. Any JSON object; stored exactly as pushed. Docket reads only
|
|
175
|
+
`stage.task.name`, `curriculum.name`, `curriculum.version` and
|
|
176
|
+
`is_on_curriculum`.
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
180
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
BehaviorCurriculumSettingsPreviewResponse | HttpValidationProblemDetails
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
await asyncio_detailed(
|
|
188
|
+
client=client,
|
|
189
|
+
body=body,
|
|
190
|
+
)
|
|
191
|
+
).parsed
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.fip_settings import FipSettings
|
|
12
|
+
from ...models.fip_settings_preview_response import FipSettingsPreviewResponse
|
|
13
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
body: FipSettings,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
headers: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
_kwargs: dict[str, Any] = {
|
|
24
|
+
"method": "post",
|
|
25
|
+
"url": "/api/v1/settings/fip/preview",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_kwargs["json"] = body.to_dict()
|
|
29
|
+
|
|
30
|
+
headers["Content-Type"] = "application/json"
|
|
31
|
+
|
|
32
|
+
_kwargs["headers"] = headers
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> FipSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = FipSettingsPreviewResponse.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
|
|
44
|
+
if response.status_code == 422:
|
|
45
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_422
|
|
48
|
+
|
|
49
|
+
if client.raise_on_unexpected_status:
|
|
50
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
51
|
+
else:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _build_response(
|
|
56
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
57
|
+
) -> Response[FipSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
58
|
+
return Response(
|
|
59
|
+
status_code=HTTPStatus(response.status_code),
|
|
60
|
+
content=response.content,
|
|
61
|
+
headers=response.headers,
|
|
62
|
+
parsed=_parse_response(client=client, response=response),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def sync_detailed(
|
|
67
|
+
*,
|
|
68
|
+
client: AuthenticatedClient,
|
|
69
|
+
body: FipSettings,
|
|
70
|
+
) -> Response[FipSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
71
|
+
"""Validate and canonicalize a fip payload and compute its live scope and promoted fields, without
|
|
72
|
+
storing it.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
body (FipSettings): FIP (fiber photometry) settings for one subject. One live version per
|
|
76
|
+
subject.
|
|
77
|
+
|
|
78
|
+
Raises:
|
|
79
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
80
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Response[FipSettingsPreviewResponse | HttpValidationProblemDetails]
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
kwargs = _get_kwargs(
|
|
87
|
+
body=body,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
response = client.get_httpx_client().request(
|
|
91
|
+
**kwargs,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
return _build_response(client=client, response=response)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def sync(
|
|
98
|
+
*,
|
|
99
|
+
client: AuthenticatedClient,
|
|
100
|
+
body: FipSettings,
|
|
101
|
+
) -> FipSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
102
|
+
"""Validate and canonicalize a fip payload and compute its live scope and promoted fields, without
|
|
103
|
+
storing it.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
body (FipSettings): FIP (fiber photometry) settings for one subject. One live version per
|
|
107
|
+
subject.
|
|
108
|
+
|
|
109
|
+
Raises:
|
|
110
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
111
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
FipSettingsPreviewResponse | HttpValidationProblemDetails
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
return sync_detailed(
|
|
118
|
+
client=client,
|
|
119
|
+
body=body,
|
|
120
|
+
).parsed
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
async def asyncio_detailed(
|
|
124
|
+
*,
|
|
125
|
+
client: AuthenticatedClient,
|
|
126
|
+
body: FipSettings,
|
|
127
|
+
) -> Response[FipSettingsPreviewResponse | HttpValidationProblemDetails]:
|
|
128
|
+
"""Validate and canonicalize a fip payload and compute its live scope and promoted fields, without
|
|
129
|
+
storing it.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
body (FipSettings): FIP (fiber photometry) settings for one subject. One live version per
|
|
133
|
+
subject.
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Response[FipSettingsPreviewResponse | HttpValidationProblemDetails]
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
kwargs = _get_kwargs(
|
|
144
|
+
body=body,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
148
|
+
|
|
149
|
+
return _build_response(client=client, response=response)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
async def asyncio(
|
|
153
|
+
*,
|
|
154
|
+
client: AuthenticatedClient,
|
|
155
|
+
body: FipSettings,
|
|
156
|
+
) -> FipSettingsPreviewResponse | HttpValidationProblemDetails | None:
|
|
157
|
+
"""Validate and canonicalize a fip payload and compute its live scope and promoted fields, without
|
|
158
|
+
storing it.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
body (FipSettings): FIP (fiber photometry) settings for one subject. One live version per
|
|
162
|
+
subject.
|
|
163
|
+
|
|
164
|
+
Raises:
|
|
165
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
166
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
167
|
+
|
|
168
|
+
Returns:
|
|
169
|
+
FipSettingsPreviewResponse | HttpValidationProblemDetails
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
await asyncio_detailed(
|
|
174
|
+
client=client,
|
|
175
|
+
body=body,
|
|
176
|
+
)
|
|
177
|
+
).parsed
|