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,224 @@
|
|
|
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.scheduled_acquisition_edit_preview_response import (
|
|
14
|
+
ScheduledAcquisitionEditPreviewResponse,
|
|
15
|
+
)
|
|
16
|
+
from ...models.update_scheduled_acquisition_request import UpdateScheduledAcquisitionRequest
|
|
17
|
+
from typing import cast
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _get_kwargs(
|
|
21
|
+
id: int,
|
|
22
|
+
*,
|
|
23
|
+
body: UpdateScheduledAcquisitionRequest,
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
headers: dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
_kwargs: dict[str, Any] = {
|
|
28
|
+
"method": "post",
|
|
29
|
+
"url": "/api/v1/scheduled-acquisitions/{id}/edit-preview".format(
|
|
30
|
+
id=quote(str(id), safe=""),
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_kwargs["json"] = body.to_dict()
|
|
35
|
+
|
|
36
|
+
headers["Content-Type"] = "application/json"
|
|
37
|
+
|
|
38
|
+
_kwargs["headers"] = headers
|
|
39
|
+
return _kwargs
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _parse_response(
|
|
43
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
44
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse | None:
|
|
45
|
+
if response.status_code == 200:
|
|
46
|
+
response_200 = ScheduledAcquisitionEditPreviewResponse.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_200
|
|
49
|
+
|
|
50
|
+
if response.status_code == 404:
|
|
51
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_404
|
|
54
|
+
|
|
55
|
+
if response.status_code == 409:
|
|
56
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
return response_409
|
|
59
|
+
|
|
60
|
+
if response.status_code == 422:
|
|
61
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
62
|
+
|
|
63
|
+
return response_422
|
|
64
|
+
|
|
65
|
+
if response.status_code == 503:
|
|
66
|
+
response_503 = ProblemDetails.from_dict(response.json())
|
|
67
|
+
|
|
68
|
+
return response_503
|
|
69
|
+
|
|
70
|
+
if client.raise_on_unexpected_status:
|
|
71
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
72
|
+
else:
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _build_response(
|
|
77
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
78
|
+
) -> Response[
|
|
79
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse
|
|
80
|
+
]:
|
|
81
|
+
return Response(
|
|
82
|
+
status_code=HTTPStatus(response.status_code),
|
|
83
|
+
content=response.content,
|
|
84
|
+
headers=response.headers,
|
|
85
|
+
parsed=_parse_response(client=client, response=response),
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def sync_detailed(
|
|
90
|
+
id: int,
|
|
91
|
+
*,
|
|
92
|
+
client: AuthenticatedClient,
|
|
93
|
+
body: UpdateScheduledAcquisitionRequest,
|
|
94
|
+
) -> Response[
|
|
95
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse
|
|
96
|
+
]:
|
|
97
|
+
"""What an edit (same body as PATCH) would produce: the new window and instrument, overlap warnings,
|
|
98
|
+
and whether it is part of a series. Same checks and errors as the PATCH; writes nothing.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
id (int):
|
|
102
|
+
body (UpdateScheduledAcquisitionRequest): Change a scheduled acquisition. Every field
|
|
103
|
+
except `expected_version`
|
|
104
|
+
is optional: an omitted field is left unchanged. `people`,
|
|
105
|
+
`type_refs` and `variables` replace the whole list when present.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse]
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kwargs = _get_kwargs(
|
|
116
|
+
id=id,
|
|
117
|
+
body=body,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
response = client.get_httpx_client().request(
|
|
121
|
+
**kwargs,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return _build_response(client=client, response=response)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def sync(
|
|
128
|
+
id: int,
|
|
129
|
+
*,
|
|
130
|
+
client: AuthenticatedClient,
|
|
131
|
+
body: UpdateScheduledAcquisitionRequest,
|
|
132
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse | None:
|
|
133
|
+
"""What an edit (same body as PATCH) would produce: the new window and instrument, overlap warnings,
|
|
134
|
+
and whether it is part of a series. Same checks and errors as the PATCH; writes nothing.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
id (int):
|
|
138
|
+
body (UpdateScheduledAcquisitionRequest): Change a scheduled acquisition. Every field
|
|
139
|
+
except `expected_version`
|
|
140
|
+
is optional: an omitted field is left unchanged. `people`,
|
|
141
|
+
`type_refs` and `variables` replace the whole list when present.
|
|
142
|
+
|
|
143
|
+
Raises:
|
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
return sync_detailed(
|
|
152
|
+
id=id,
|
|
153
|
+
client=client,
|
|
154
|
+
body=body,
|
|
155
|
+
).parsed
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def asyncio_detailed(
|
|
159
|
+
id: int,
|
|
160
|
+
*,
|
|
161
|
+
client: AuthenticatedClient,
|
|
162
|
+
body: UpdateScheduledAcquisitionRequest,
|
|
163
|
+
) -> Response[
|
|
164
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse
|
|
165
|
+
]:
|
|
166
|
+
"""What an edit (same body as PATCH) would produce: the new window and instrument, overlap warnings,
|
|
167
|
+
and whether it is part of a series. Same checks and errors as the PATCH; writes nothing.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
id (int):
|
|
171
|
+
body (UpdateScheduledAcquisitionRequest): Change a scheduled acquisition. Every field
|
|
172
|
+
except `expected_version`
|
|
173
|
+
is optional: an omitted field is left unchanged. `people`,
|
|
174
|
+
`type_refs` and `variables` replace the whole list when present.
|
|
175
|
+
|
|
176
|
+
Raises:
|
|
177
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
178
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse]
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
kwargs = _get_kwargs(
|
|
185
|
+
id=id,
|
|
186
|
+
body=body,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
190
|
+
|
|
191
|
+
return _build_response(client=client, response=response)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
async def asyncio(
|
|
195
|
+
id: int,
|
|
196
|
+
*,
|
|
197
|
+
client: AuthenticatedClient,
|
|
198
|
+
body: UpdateScheduledAcquisitionRequest,
|
|
199
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse | None:
|
|
200
|
+
"""What an edit (same body as PATCH) would produce: the new window and instrument, overlap warnings,
|
|
201
|
+
and whether it is part of a series. Same checks and errors as the PATCH; writes nothing.
|
|
202
|
+
|
|
203
|
+
Args:
|
|
204
|
+
id (int):
|
|
205
|
+
body (UpdateScheduledAcquisitionRequest): Change a scheduled acquisition. Every field
|
|
206
|
+
except `expected_version`
|
|
207
|
+
is optional: an omitted field is left unchanged. `people`,
|
|
208
|
+
`type_refs` and `variables` replace the whole list when present.
|
|
209
|
+
|
|
210
|
+
Raises:
|
|
211
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
212
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
213
|
+
|
|
214
|
+
Returns:
|
|
215
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionEditPreviewResponse
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
await asyncio_detailed(
|
|
220
|
+
id=id,
|
|
221
|
+
client=client,
|
|
222
|
+
body=body,
|
|
223
|
+
)
|
|
224
|
+
).parsed
|
|
@@ -0,0 +1,199 @@
|
|
|
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.problem_details import ProblemDetails
|
|
12
|
+
from ...models.scheduled_acquisition_response import ScheduledAcquisitionResponse
|
|
13
|
+
from ...models.set_planning_status_request import SetPlanningStatusRequest
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
id: int,
|
|
19
|
+
*,
|
|
20
|
+
body: SetPlanningStatusRequest,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
headers: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "post",
|
|
26
|
+
"url": "/api/v1/scheduled-acquisitions/{id}/planning-status".format(
|
|
27
|
+
id=quote(str(id), safe=""),
|
|
28
|
+
),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_kwargs["json"] = body.to_dict()
|
|
32
|
+
|
|
33
|
+
headers["Content-Type"] = "application/json"
|
|
34
|
+
|
|
35
|
+
_kwargs["headers"] = headers
|
|
36
|
+
return _kwargs
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_response(
|
|
40
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
41
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
42
|
+
if response.status_code == 200:
|
|
43
|
+
response_200 = ScheduledAcquisitionResponse.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_200
|
|
46
|
+
|
|
47
|
+
if response.status_code == 401:
|
|
48
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_401
|
|
51
|
+
|
|
52
|
+
if response.status_code == 403:
|
|
53
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_403
|
|
56
|
+
|
|
57
|
+
if response.status_code == 404:
|
|
58
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_404
|
|
61
|
+
|
|
62
|
+
if response.status_code == 409:
|
|
63
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
return response_409
|
|
66
|
+
|
|
67
|
+
if client.raise_on_unexpected_status:
|
|
68
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
69
|
+
else:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _build_response(
|
|
74
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
75
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
76
|
+
return Response(
|
|
77
|
+
status_code=HTTPStatus(response.status_code),
|
|
78
|
+
content=response.content,
|
|
79
|
+
headers=response.headers,
|
|
80
|
+
parsed=_parse_response(client=client, response=response),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sync_detailed(
|
|
85
|
+
id: int,
|
|
86
|
+
*,
|
|
87
|
+
client: AuthenticatedClient,
|
|
88
|
+
body: SetPlanningStatusRequest,
|
|
89
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
90
|
+
"""Set the hand-set disposition (cancelled, succeeded, failed, or back to scheduled).
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
id (int):
|
|
94
|
+
body (SetPlanningStatusRequest): Set the hand-set disposition of a scheduled acquisition.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
kwargs = _get_kwargs(
|
|
105
|
+
id=id,
|
|
106
|
+
body=body,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
response = client.get_httpx_client().request(
|
|
110
|
+
**kwargs,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def sync(
|
|
117
|
+
id: int,
|
|
118
|
+
*,
|
|
119
|
+
client: AuthenticatedClient,
|
|
120
|
+
body: SetPlanningStatusRequest,
|
|
121
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
122
|
+
"""Set the hand-set disposition (cancelled, succeeded, failed, or back to scheduled).
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
id (int):
|
|
126
|
+
body (SetPlanningStatusRequest): Set the hand-set disposition of a scheduled acquisition.
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
return sync_detailed(
|
|
137
|
+
id=id,
|
|
138
|
+
client=client,
|
|
139
|
+
body=body,
|
|
140
|
+
).parsed
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
async def asyncio_detailed(
|
|
144
|
+
id: int,
|
|
145
|
+
*,
|
|
146
|
+
client: AuthenticatedClient,
|
|
147
|
+
body: SetPlanningStatusRequest,
|
|
148
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
149
|
+
"""Set the hand-set disposition (cancelled, succeeded, failed, or back to scheduled).
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
id (int):
|
|
153
|
+
body (SetPlanningStatusRequest): Set the hand-set disposition of a scheduled acquisition.
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
kwargs = _get_kwargs(
|
|
164
|
+
id=id,
|
|
165
|
+
body=body,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
169
|
+
|
|
170
|
+
return _build_response(client=client, response=response)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
async def asyncio(
|
|
174
|
+
id: int,
|
|
175
|
+
*,
|
|
176
|
+
client: AuthenticatedClient,
|
|
177
|
+
body: SetPlanningStatusRequest,
|
|
178
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
179
|
+
"""Set the hand-set disposition (cancelled, succeeded, failed, or back to scheduled).
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
id (int):
|
|
183
|
+
body (SetPlanningStatusRequest): Set the hand-set disposition of a scheduled acquisition.
|
|
184
|
+
|
|
185
|
+
Raises:
|
|
186
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
187
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
191
|
+
"""
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
await asyncio_detailed(
|
|
195
|
+
id=id,
|
|
196
|
+
client=client,
|
|
197
|
+
body=body,
|
|
198
|
+
)
|
|
199
|
+
).parsed
|
|
@@ -0,0 +1,221 @@
|
|
|
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.run_start_response import RunStartResponse
|
|
14
|
+
from ...models.start_run_request import StartRunRequest
|
|
15
|
+
from ...types import UNSET, Unset
|
|
16
|
+
from typing import cast
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
id: int,
|
|
21
|
+
*,
|
|
22
|
+
body: StartRunRequest,
|
|
23
|
+
idempotency_key: str | Unset = UNSET,
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
headers: dict[str, Any] = {}
|
|
26
|
+
if not isinstance(idempotency_key, Unset):
|
|
27
|
+
headers["Idempotency-Key"] = idempotency_key
|
|
28
|
+
|
|
29
|
+
_kwargs: dict[str, Any] = {
|
|
30
|
+
"method": "post",
|
|
31
|
+
"url": "/api/v1/scheduled-acquisitions/{id}/runs".format(
|
|
32
|
+
id=quote(str(id), safe=""),
|
|
33
|
+
),
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_kwargs["json"] = body.to_dict()
|
|
37
|
+
|
|
38
|
+
headers["Content-Type"] = "application/json"
|
|
39
|
+
|
|
40
|
+
_kwargs["headers"] = headers
|
|
41
|
+
return _kwargs
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _parse_response(
|
|
45
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
46
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunStartResponse | None:
|
|
47
|
+
if response.status_code == 201:
|
|
48
|
+
response_201 = RunStartResponse.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_201
|
|
51
|
+
|
|
52
|
+
if response.status_code == 401:
|
|
53
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_401
|
|
56
|
+
|
|
57
|
+
if response.status_code == 403:
|
|
58
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
59
|
+
|
|
60
|
+
return response_403
|
|
61
|
+
|
|
62
|
+
if response.status_code == 404:
|
|
63
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
return response_404
|
|
66
|
+
|
|
67
|
+
if response.status_code == 409:
|
|
68
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
69
|
+
|
|
70
|
+
return response_409
|
|
71
|
+
|
|
72
|
+
if response.status_code == 422:
|
|
73
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
74
|
+
|
|
75
|
+
return response_422
|
|
76
|
+
|
|
77
|
+
if client.raise_on_unexpected_status:
|
|
78
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
79
|
+
else:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _build_response(
|
|
84
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
85
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunStartResponse]:
|
|
86
|
+
return Response(
|
|
87
|
+
status_code=HTTPStatus(response.status_code),
|
|
88
|
+
content=response.content,
|
|
89
|
+
headers=response.headers,
|
|
90
|
+
parsed=_parse_response(client=client, response=response),
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync_detailed(
|
|
95
|
+
id: int,
|
|
96
|
+
*,
|
|
97
|
+
client: AuthenticatedClient,
|
|
98
|
+
body: StartRunRequest,
|
|
99
|
+
idempotency_key: str | Unset = UNSET,
|
|
100
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunStartResponse]:
|
|
101
|
+
"""Start a run: resolves and snapshots settings atomically. Retry-safe with an Idempotency-Key.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
id (int):
|
|
105
|
+
idempotency_key (str | Unset):
|
|
106
|
+
body (StartRunRequest): Start a run of a scheduled acquisition.
|
|
107
|
+
|
|
108
|
+
Raises:
|
|
109
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
110
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
Response[HttpValidationProblemDetails | ProblemDetails | RunStartResponse]
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
kwargs = _get_kwargs(
|
|
117
|
+
id=id,
|
|
118
|
+
body=body,
|
|
119
|
+
idempotency_key=idempotency_key,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
response = client.get_httpx_client().request(
|
|
123
|
+
**kwargs,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
return _build_response(client=client, response=response)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def sync(
|
|
130
|
+
id: int,
|
|
131
|
+
*,
|
|
132
|
+
client: AuthenticatedClient,
|
|
133
|
+
body: StartRunRequest,
|
|
134
|
+
idempotency_key: str | Unset = UNSET,
|
|
135
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunStartResponse | None:
|
|
136
|
+
"""Start a run: resolves and snapshots settings atomically. Retry-safe with an Idempotency-Key.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
id (int):
|
|
140
|
+
idempotency_key (str | Unset):
|
|
141
|
+
body (StartRunRequest): Start a run of a scheduled acquisition.
|
|
142
|
+
|
|
143
|
+
Raises:
|
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
HttpValidationProblemDetails | ProblemDetails | RunStartResponse
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
return sync_detailed(
|
|
152
|
+
id=id,
|
|
153
|
+
client=client,
|
|
154
|
+
body=body,
|
|
155
|
+
idempotency_key=idempotency_key,
|
|
156
|
+
).parsed
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
async def asyncio_detailed(
|
|
160
|
+
id: int,
|
|
161
|
+
*,
|
|
162
|
+
client: AuthenticatedClient,
|
|
163
|
+
body: StartRunRequest,
|
|
164
|
+
idempotency_key: str | Unset = UNSET,
|
|
165
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunStartResponse]:
|
|
166
|
+
"""Start a run: resolves and snapshots settings atomically. Retry-safe with an Idempotency-Key.
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
id (int):
|
|
170
|
+
idempotency_key (str | Unset):
|
|
171
|
+
body (StartRunRequest): Start a run of a scheduled acquisition.
|
|
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 | ProblemDetails | RunStartResponse]
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
kwargs = _get_kwargs(
|
|
182
|
+
id=id,
|
|
183
|
+
body=body,
|
|
184
|
+
idempotency_key=idempotency_key,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
188
|
+
|
|
189
|
+
return _build_response(client=client, response=response)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async def asyncio(
|
|
193
|
+
id: int,
|
|
194
|
+
*,
|
|
195
|
+
client: AuthenticatedClient,
|
|
196
|
+
body: StartRunRequest,
|
|
197
|
+
idempotency_key: str | Unset = UNSET,
|
|
198
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunStartResponse | None:
|
|
199
|
+
"""Start a run: resolves and snapshots settings atomically. Retry-safe with an Idempotency-Key.
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
id (int):
|
|
203
|
+
idempotency_key (str | Unset):
|
|
204
|
+
body (StartRunRequest): Start a run of a scheduled acquisition.
|
|
205
|
+
|
|
206
|
+
Raises:
|
|
207
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
208
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
HttpValidationProblemDetails | ProblemDetails | RunStartResponse
|
|
212
|
+
"""
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
await asyncio_detailed(
|
|
216
|
+
id=id,
|
|
217
|
+
client=client,
|
|
218
|
+
body=body,
|
|
219
|
+
idempotency_key=idempotency_key,
|
|
220
|
+
)
|
|
221
|
+
).parsed
|