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,234 @@
|
|
|
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.http_validation_problem_details import HttpValidationProblemDetails
|
|
12
|
+
from ...models.problem_details import ProblemDetails
|
|
13
|
+
from ...models.template_response import TemplateResponse
|
|
14
|
+
from ...models.update_template_request import UpdateTemplateRequest
|
|
15
|
+
from typing import cast
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
id: int,
|
|
20
|
+
*,
|
|
21
|
+
body: UpdateTemplateRequest,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
headers: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
_kwargs: dict[str, Any] = {
|
|
26
|
+
"method": "patch",
|
|
27
|
+
"url": "/api/v1/templates/{id}".format(
|
|
28
|
+
id=quote(str(id), safe=""),
|
|
29
|
+
),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_kwargs["json"] = body.to_dict()
|
|
33
|
+
|
|
34
|
+
headers["Content-Type"] = "application/json"
|
|
35
|
+
|
|
36
|
+
_kwargs["headers"] = headers
|
|
37
|
+
return _kwargs
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _parse_response(
|
|
41
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
42
|
+
) -> HttpValidationProblemDetails | ProblemDetails | TemplateResponse | None:
|
|
43
|
+
if response.status_code == 200:
|
|
44
|
+
response_200 = TemplateResponse.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_200
|
|
47
|
+
|
|
48
|
+
if response.status_code == 401:
|
|
49
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
return response_401
|
|
52
|
+
|
|
53
|
+
if response.status_code == 403:
|
|
54
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
55
|
+
|
|
56
|
+
return response_403
|
|
57
|
+
|
|
58
|
+
if response.status_code == 404:
|
|
59
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
60
|
+
|
|
61
|
+
return response_404
|
|
62
|
+
|
|
63
|
+
if response.status_code == 409:
|
|
64
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_409
|
|
67
|
+
|
|
68
|
+
if response.status_code == 422:
|
|
69
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_422
|
|
72
|
+
|
|
73
|
+
if response.status_code == 503:
|
|
74
|
+
response_503 = ProblemDetails.from_dict(response.json())
|
|
75
|
+
|
|
76
|
+
return response_503
|
|
77
|
+
|
|
78
|
+
if client.raise_on_unexpected_status:
|
|
79
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
80
|
+
else:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _build_response(
|
|
85
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
86
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | TemplateResponse]:
|
|
87
|
+
return Response(
|
|
88
|
+
status_code=HTTPStatus(response.status_code),
|
|
89
|
+
content=response.content,
|
|
90
|
+
headers=response.headers,
|
|
91
|
+
parsed=_parse_response(client=client, response=response),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def sync_detailed(
|
|
96
|
+
id: int,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
body: UpdateTemplateRequest,
|
|
100
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | TemplateResponse]:
|
|
101
|
+
"""Edit a template: only the fields sent change. Needs expected_version. Affects future uses only.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
id (int):
|
|
105
|
+
body (UpdateTemplateRequest): Change a template. Every field except `expected_version` is
|
|
106
|
+
optional: an
|
|
107
|
+
omitted field is left unchanged. For the scalar defaults (`subject_id`,
|
|
108
|
+
`instrument_id`, `project_id`, `operator_instructions`,
|
|
109
|
+
`duration_minutes`, `local_start_time`) an explicit `null` clears the
|
|
110
|
+
default. `name`, `people`, `type_refs` and `variables` cannot be
|
|
111
|
+
null; send an empty list to clear a list. Lists replace the whole list when present.
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
Response[HttpValidationProblemDetails | ProblemDetails | TemplateResponse]
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
kwargs = _get_kwargs(
|
|
122
|
+
id=id,
|
|
123
|
+
body=body,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
response = client.get_httpx_client().request(
|
|
127
|
+
**kwargs,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
return _build_response(client=client, response=response)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def sync(
|
|
134
|
+
id: int,
|
|
135
|
+
*,
|
|
136
|
+
client: AuthenticatedClient,
|
|
137
|
+
body: UpdateTemplateRequest,
|
|
138
|
+
) -> HttpValidationProblemDetails | ProblemDetails | TemplateResponse | None:
|
|
139
|
+
"""Edit a template: only the fields sent change. Needs expected_version. Affects future uses only.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
id (int):
|
|
143
|
+
body (UpdateTemplateRequest): Change a template. Every field except `expected_version` is
|
|
144
|
+
optional: an
|
|
145
|
+
omitted field is left unchanged. For the scalar defaults (`subject_id`,
|
|
146
|
+
`instrument_id`, `project_id`, `operator_instructions`,
|
|
147
|
+
`duration_minutes`, `local_start_time`) an explicit `null` clears the
|
|
148
|
+
default. `name`, `people`, `type_refs` and `variables` cannot be
|
|
149
|
+
null; send an empty list to clear a list. Lists replace the whole list when present.
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
HttpValidationProblemDetails | ProblemDetails | TemplateResponse
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
return sync_detailed(
|
|
160
|
+
id=id,
|
|
161
|
+
client=client,
|
|
162
|
+
body=body,
|
|
163
|
+
).parsed
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
async def asyncio_detailed(
|
|
167
|
+
id: int,
|
|
168
|
+
*,
|
|
169
|
+
client: AuthenticatedClient,
|
|
170
|
+
body: UpdateTemplateRequest,
|
|
171
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | TemplateResponse]:
|
|
172
|
+
"""Edit a template: only the fields sent change. Needs expected_version. Affects future uses only.
|
|
173
|
+
|
|
174
|
+
Args:
|
|
175
|
+
id (int):
|
|
176
|
+
body (UpdateTemplateRequest): Change a template. Every field except `expected_version` is
|
|
177
|
+
optional: an
|
|
178
|
+
omitted field is left unchanged. For the scalar defaults (`subject_id`,
|
|
179
|
+
`instrument_id`, `project_id`, `operator_instructions`,
|
|
180
|
+
`duration_minutes`, `local_start_time`) an explicit `null` clears the
|
|
181
|
+
default. `name`, `people`, `type_refs` and `variables` cannot be
|
|
182
|
+
null; send an empty list to clear a list. Lists replace the whole list when present.
|
|
183
|
+
|
|
184
|
+
Raises:
|
|
185
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
186
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
187
|
+
|
|
188
|
+
Returns:
|
|
189
|
+
Response[HttpValidationProblemDetails | ProblemDetails | TemplateResponse]
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
kwargs = _get_kwargs(
|
|
193
|
+
id=id,
|
|
194
|
+
body=body,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
198
|
+
|
|
199
|
+
return _build_response(client=client, response=response)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
async def asyncio(
|
|
203
|
+
id: int,
|
|
204
|
+
*,
|
|
205
|
+
client: AuthenticatedClient,
|
|
206
|
+
body: UpdateTemplateRequest,
|
|
207
|
+
) -> HttpValidationProblemDetails | ProblemDetails | TemplateResponse | None:
|
|
208
|
+
"""Edit a template: only the fields sent change. Needs expected_version. Affects future uses only.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
id (int):
|
|
212
|
+
body (UpdateTemplateRequest): Change a template. Every field except `expected_version` is
|
|
213
|
+
optional: an
|
|
214
|
+
omitted field is left unchanged. For the scalar defaults (`subject_id`,
|
|
215
|
+
`instrument_id`, `project_id`, `operator_instructions`,
|
|
216
|
+
`duration_minutes`, `local_start_time`) an explicit `null` clears the
|
|
217
|
+
default. `name`, `people`, `type_refs` and `variables` cannot be
|
|
218
|
+
null; send an empty list to clear a list. Lists replace the whole list when present.
|
|
219
|
+
|
|
220
|
+
Raises:
|
|
221
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
222
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
223
|
+
|
|
224
|
+
Returns:
|
|
225
|
+
HttpValidationProblemDetails | ProblemDetails | TemplateResponse
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
await asyncio_detailed(
|
|
230
|
+
id=id,
|
|
231
|
+
client=client,
|
|
232
|
+
body=body,
|
|
233
|
+
)
|
|
234
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,165 @@
|
|
|
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.instrument_response import InstrumentResponse
|
|
12
|
+
from ...types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
*,
|
|
18
|
+
rig_id: str | Unset = UNSET,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
params["rig_id"] = rig_id
|
|
24
|
+
|
|
25
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "get",
|
|
29
|
+
"url": "/api/v1/instruments",
|
|
30
|
+
"params": params,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _kwargs
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_response(
|
|
37
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
38
|
+
) -> list[InstrumentResponse] | None:
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = []
|
|
41
|
+
_response_200 = response.json()
|
|
42
|
+
for response_200_item_data in _response_200:
|
|
43
|
+
response_200_item = InstrumentResponse.from_dict(response_200_item_data)
|
|
44
|
+
|
|
45
|
+
response_200.append(response_200_item)
|
|
46
|
+
|
|
47
|
+
return response_200
|
|
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[list[InstrumentResponse]]:
|
|
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
|
+
rig_id: str | Unset = UNSET,
|
|
70
|
+
) -> Response[list[InstrumentResponse]]:
|
|
71
|
+
"""
|
|
72
|
+
Args:
|
|
73
|
+
rig_id (str | Unset):
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[list[InstrumentResponse]]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
rig_id=rig_id,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
response = client.get_httpx_client().request(
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return _build_response(client=client, response=response)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync(
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient,
|
|
97
|
+
rig_id: str | Unset = UNSET,
|
|
98
|
+
) -> list[InstrumentResponse] | None:
|
|
99
|
+
"""
|
|
100
|
+
Args:
|
|
101
|
+
rig_id (str | Unset):
|
|
102
|
+
|
|
103
|
+
Raises:
|
|
104
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
105
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
list[InstrumentResponse]
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
return sync_detailed(
|
|
112
|
+
client=client,
|
|
113
|
+
rig_id=rig_id,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
*,
|
|
119
|
+
client: AuthenticatedClient,
|
|
120
|
+
rig_id: str | Unset = UNSET,
|
|
121
|
+
) -> Response[list[InstrumentResponse]]:
|
|
122
|
+
"""
|
|
123
|
+
Args:
|
|
124
|
+
rig_id (str | Unset):
|
|
125
|
+
|
|
126
|
+
Raises:
|
|
127
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
128
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Response[list[InstrumentResponse]]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
rig_id=rig_id,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
139
|
+
|
|
140
|
+
return _build_response(client=client, response=response)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio(
|
|
144
|
+
*,
|
|
145
|
+
client: AuthenticatedClient,
|
|
146
|
+
rig_id: str | Unset = UNSET,
|
|
147
|
+
) -> list[InstrumentResponse] | None:
|
|
148
|
+
"""
|
|
149
|
+
Args:
|
|
150
|
+
rig_id (str | Unset):
|
|
151
|
+
|
|
152
|
+
Raises:
|
|
153
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
154
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
list[InstrumentResponse]
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
await asyncio_detailed(
|
|
162
|
+
client=client,
|
|
163
|
+
rig_id=rig_id,
|
|
164
|
+
)
|
|
165
|
+
).parsed
|
|
@@ -0,0 +1,132 @@
|
|
|
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.person_response import PersonResponse
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
16
|
+
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/api/v1/persons",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return _kwargs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _parse_response(
|
|
26
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
27
|
+
) -> list[PersonResponse] | None:
|
|
28
|
+
if response.status_code == 200:
|
|
29
|
+
response_200 = []
|
|
30
|
+
_response_200 = response.json()
|
|
31
|
+
for response_200_item_data in _response_200:
|
|
32
|
+
response_200_item = PersonResponse.from_dict(response_200_item_data)
|
|
33
|
+
|
|
34
|
+
response_200.append(response_200_item)
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
|
|
38
|
+
if client.raise_on_unexpected_status:
|
|
39
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
40
|
+
else:
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(
|
|
45
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
46
|
+
) -> Response[list[PersonResponse]]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
) -> Response[list[PersonResponse]]:
|
|
59
|
+
"""
|
|
60
|
+
Raises:
|
|
61
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
62
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
Response[list[PersonResponse]]
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
kwargs = _get_kwargs()
|
|
69
|
+
|
|
70
|
+
response = client.get_httpx_client().request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _build_response(client=client, response=response)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync(
|
|
78
|
+
*,
|
|
79
|
+
client: AuthenticatedClient,
|
|
80
|
+
) -> list[PersonResponse] | None:
|
|
81
|
+
"""
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
list[PersonResponse]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
return sync_detailed(
|
|
91
|
+
client=client,
|
|
92
|
+
).parsed
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def asyncio_detailed(
|
|
96
|
+
*,
|
|
97
|
+
client: AuthenticatedClient,
|
|
98
|
+
) -> Response[list[PersonResponse]]:
|
|
99
|
+
"""
|
|
100
|
+
Raises:
|
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
Response[list[PersonResponse]]
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
kwargs = _get_kwargs()
|
|
109
|
+
|
|
110
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
111
|
+
|
|
112
|
+
return _build_response(client=client, response=response)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
async def asyncio(
|
|
116
|
+
*,
|
|
117
|
+
client: AuthenticatedClient,
|
|
118
|
+
) -> list[PersonResponse] | None:
|
|
119
|
+
"""
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
list[PersonResponse]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
await asyncio_detailed(
|
|
130
|
+
client=client,
|
|
131
|
+
)
|
|
132
|
+
).parsed
|
|
@@ -0,0 +1,132 @@
|
|
|
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.project_response import ProjectResponse
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
16
|
+
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/api/v1/projects",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return _kwargs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _parse_response(
|
|
26
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
27
|
+
) -> list[ProjectResponse] | None:
|
|
28
|
+
if response.status_code == 200:
|
|
29
|
+
response_200 = []
|
|
30
|
+
_response_200 = response.json()
|
|
31
|
+
for response_200_item_data in _response_200:
|
|
32
|
+
response_200_item = ProjectResponse.from_dict(response_200_item_data)
|
|
33
|
+
|
|
34
|
+
response_200.append(response_200_item)
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
|
|
38
|
+
if client.raise_on_unexpected_status:
|
|
39
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
40
|
+
else:
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(
|
|
45
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
46
|
+
) -> Response[list[ProjectResponse]]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
) -> Response[list[ProjectResponse]]:
|
|
59
|
+
"""
|
|
60
|
+
Raises:
|
|
61
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
62
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
Response[list[ProjectResponse]]
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
kwargs = _get_kwargs()
|
|
69
|
+
|
|
70
|
+
response = client.get_httpx_client().request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _build_response(client=client, response=response)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync(
|
|
78
|
+
*,
|
|
79
|
+
client: AuthenticatedClient,
|
|
80
|
+
) -> list[ProjectResponse] | None:
|
|
81
|
+
"""
|
|
82
|
+
Raises:
|
|
83
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
list[ProjectResponse]
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
return sync_detailed(
|
|
91
|
+
client=client,
|
|
92
|
+
).parsed
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def asyncio_detailed(
|
|
96
|
+
*,
|
|
97
|
+
client: AuthenticatedClient,
|
|
98
|
+
) -> Response[list[ProjectResponse]]:
|
|
99
|
+
"""
|
|
100
|
+
Raises:
|
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
Response[list[ProjectResponse]]
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
kwargs = _get_kwargs()
|
|
109
|
+
|
|
110
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
111
|
+
|
|
112
|
+
return _build_response(client=client, response=response)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
async def asyncio(
|
|
116
|
+
*,
|
|
117
|
+
client: AuthenticatedClient,
|
|
118
|
+
) -> list[ProjectResponse] | None:
|
|
119
|
+
"""
|
|
120
|
+
Raises:
|
|
121
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
122
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
list[ProjectResponse]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
await asyncio_detailed(
|
|
130
|
+
client=client,
|
|
131
|
+
)
|
|
132
|
+
).parsed
|