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,206 @@
|
|
|
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.report_run_outcome_request import ReportRunOutcomeRequest
|
|
14
|
+
from ...models.run_response import RunResponse
|
|
15
|
+
from typing import cast
|
|
16
|
+
from uuid import UUID
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
token: UUID,
|
|
21
|
+
*,
|
|
22
|
+
body: ReportRunOutcomeRequest,
|
|
23
|
+
) -> dict[str, Any]:
|
|
24
|
+
headers: dict[str, Any] = {}
|
|
25
|
+
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "post",
|
|
28
|
+
"url": "/api/v1/runs/{token}/outcome".format(
|
|
29
|
+
token=quote(str(token), safe=""),
|
|
30
|
+
),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
|
|
35
|
+
headers["Content-Type"] = "application/json"
|
|
36
|
+
|
|
37
|
+
_kwargs["headers"] = headers
|
|
38
|
+
return _kwargs
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _parse_response(
|
|
42
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
43
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunResponse | None:
|
|
44
|
+
if response.status_code == 200:
|
|
45
|
+
response_200 = RunResponse.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_200
|
|
48
|
+
|
|
49
|
+
if response.status_code == 401:
|
|
50
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_401
|
|
53
|
+
|
|
54
|
+
if response.status_code == 403:
|
|
55
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
return response_403
|
|
58
|
+
|
|
59
|
+
if response.status_code == 404:
|
|
60
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
61
|
+
|
|
62
|
+
return response_404
|
|
63
|
+
|
|
64
|
+
if response.status_code == 409:
|
|
65
|
+
response_409 = ProblemDetails.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_409
|
|
68
|
+
|
|
69
|
+
if response.status_code == 422:
|
|
70
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
return response_422
|
|
73
|
+
|
|
74
|
+
if client.raise_on_unexpected_status:
|
|
75
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
76
|
+
else:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _build_response(
|
|
81
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
82
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunResponse]:
|
|
83
|
+
return Response(
|
|
84
|
+
status_code=HTTPStatus(response.status_code),
|
|
85
|
+
content=response.content,
|
|
86
|
+
headers=response.headers,
|
|
87
|
+
parsed=_parse_response(client=client, response=response),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync_detailed(
|
|
92
|
+
token: UUID,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
body: ReportRunOutcomeRequest,
|
|
96
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunResponse]:
|
|
97
|
+
"""Report how a run ended. Allowed from started and timed_out; terminal runs cannot change.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
token (UUID):
|
|
101
|
+
body (ReportRunOutcomeRequest): Report how a run ended.
|
|
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
|
+
Response[HttpValidationProblemDetails | ProblemDetails | RunResponse]
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
kwargs = _get_kwargs(
|
|
112
|
+
token=token,
|
|
113
|
+
body=body,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
response = client.get_httpx_client().request(
|
|
117
|
+
**kwargs,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
return _build_response(client=client, response=response)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def sync(
|
|
124
|
+
token: UUID,
|
|
125
|
+
*,
|
|
126
|
+
client: AuthenticatedClient,
|
|
127
|
+
body: ReportRunOutcomeRequest,
|
|
128
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunResponse | None:
|
|
129
|
+
"""Report how a run ended. Allowed from started and timed_out; terminal runs cannot change.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
token (UUID):
|
|
133
|
+
body (ReportRunOutcomeRequest): Report how a run ended.
|
|
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
|
+
HttpValidationProblemDetails | ProblemDetails | RunResponse
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
return sync_detailed(
|
|
144
|
+
token=token,
|
|
145
|
+
client=client,
|
|
146
|
+
body=body,
|
|
147
|
+
).parsed
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio_detailed(
|
|
151
|
+
token: UUID,
|
|
152
|
+
*,
|
|
153
|
+
client: AuthenticatedClient,
|
|
154
|
+
body: ReportRunOutcomeRequest,
|
|
155
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | RunResponse]:
|
|
156
|
+
"""Report how a run ended. Allowed from started and timed_out; terminal runs cannot change.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
token (UUID):
|
|
160
|
+
body (ReportRunOutcomeRequest): Report how a run ended.
|
|
161
|
+
|
|
162
|
+
Raises:
|
|
163
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
164
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
Response[HttpValidationProblemDetails | ProblemDetails | RunResponse]
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
kwargs = _get_kwargs(
|
|
171
|
+
token=token,
|
|
172
|
+
body=body,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
176
|
+
|
|
177
|
+
return _build_response(client=client, response=response)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
async def asyncio(
|
|
181
|
+
token: UUID,
|
|
182
|
+
*,
|
|
183
|
+
client: AuthenticatedClient,
|
|
184
|
+
body: ReportRunOutcomeRequest,
|
|
185
|
+
) -> HttpValidationProblemDetails | ProblemDetails | RunResponse | None:
|
|
186
|
+
"""Report how a run ended. Allowed from started and timed_out; terminal runs cannot change.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
token (UUID):
|
|
190
|
+
body (ReportRunOutcomeRequest): Report how a run ended.
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
194
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
HttpValidationProblemDetails | ProblemDetails | RunResponse
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
await asyncio_detailed(
|
|
202
|
+
token=token,
|
|
203
|
+
client=client,
|
|
204
|
+
body=body,
|
|
205
|
+
)
|
|
206
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,203 @@
|
|
|
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.archive_scheduled_acquisition_request import ArchiveScheduledAcquisitionRequest
|
|
12
|
+
from ...models.problem_details import ProblemDetails
|
|
13
|
+
from ...models.scheduled_acquisition_response import ScheduledAcquisitionResponse
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
id: int,
|
|
19
|
+
*,
|
|
20
|
+
body: ArchiveScheduledAcquisitionRequest,
|
|
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}/archive".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: ArchiveScheduledAcquisitionRequest,
|
|
89
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
90
|
+
"""Archive: hide from default listings and stop it being run. Nothing is deleted.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
id (int):
|
|
94
|
+
body (ArchiveScheduledAcquisitionRequest): Archive a scheduled acquisition: hidden from
|
|
95
|
+
default listings and no longer runnable; history is kept.
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
id=id,
|
|
107
|
+
body=body,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
response = client.get_httpx_client().request(
|
|
111
|
+
**kwargs,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return _build_response(client=client, response=response)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def sync(
|
|
118
|
+
id: int,
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient,
|
|
121
|
+
body: ArchiveScheduledAcquisitionRequest,
|
|
122
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
123
|
+
"""Archive: hide from default listings and stop it being run. Nothing is deleted.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
id (int):
|
|
127
|
+
body (ArchiveScheduledAcquisitionRequest): Archive a scheduled acquisition: hidden from
|
|
128
|
+
default listings and no longer runnable; history is kept.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
132
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
return sync_detailed(
|
|
139
|
+
id=id,
|
|
140
|
+
client=client,
|
|
141
|
+
body=body,
|
|
142
|
+
).parsed
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
async def asyncio_detailed(
|
|
146
|
+
id: int,
|
|
147
|
+
*,
|
|
148
|
+
client: AuthenticatedClient,
|
|
149
|
+
body: ArchiveScheduledAcquisitionRequest,
|
|
150
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
151
|
+
"""Archive: hide from default listings and stop it being run. Nothing is deleted.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
id (int):
|
|
155
|
+
body (ArchiveScheduledAcquisitionRequest): Archive a scheduled acquisition: hidden from
|
|
156
|
+
default listings and no longer runnable; history is kept.
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
kwargs = _get_kwargs(
|
|
167
|
+
id=id,
|
|
168
|
+
body=body,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
172
|
+
|
|
173
|
+
return _build_response(client=client, response=response)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
async def asyncio(
|
|
177
|
+
id: int,
|
|
178
|
+
*,
|
|
179
|
+
client: AuthenticatedClient,
|
|
180
|
+
body: ArchiveScheduledAcquisitionRequest,
|
|
181
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
182
|
+
"""Archive: hide from default listings and stop it being run. Nothing is deleted.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
id (int):
|
|
186
|
+
body (ArchiveScheduledAcquisitionRequest): Archive a scheduled acquisition: hidden from
|
|
187
|
+
default listings and no longer runnable; history is kept.
|
|
188
|
+
|
|
189
|
+
Raises:
|
|
190
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
191
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
await asyncio_detailed(
|
|
199
|
+
id=id,
|
|
200
|
+
client=client,
|
|
201
|
+
body=body,
|
|
202
|
+
)
|
|
203
|
+
).parsed
|
|
@@ -0,0 +1,185 @@
|
|
|
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.create_scheduled_acquisition_request import CreateScheduledAcquisitionRequest
|
|
12
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
13
|
+
from ...models.problem_details import ProblemDetails
|
|
14
|
+
from ...models.scheduled_acquisition_response import ScheduledAcquisitionResponse
|
|
15
|
+
from typing import cast
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
*,
|
|
20
|
+
body: CreateScheduledAcquisitionRequest,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
headers: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "post",
|
|
26
|
+
"url": "/api/v1/scheduled-acquisitions",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_kwargs["json"] = body.to_dict()
|
|
30
|
+
|
|
31
|
+
headers["Content-Type"] = "application/json"
|
|
32
|
+
|
|
33
|
+
_kwargs["headers"] = headers
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
39
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
40
|
+
if response.status_code == 201:
|
|
41
|
+
response_201 = ScheduledAcquisitionResponse.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_201
|
|
44
|
+
|
|
45
|
+
if response.status_code == 401:
|
|
46
|
+
response_401 = ProblemDetails.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_401
|
|
49
|
+
|
|
50
|
+
if response.status_code == 403:
|
|
51
|
+
response_403 = ProblemDetails.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_403
|
|
54
|
+
|
|
55
|
+
if response.status_code == 422:
|
|
56
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
return response_422
|
|
59
|
+
|
|
60
|
+
if response.status_code == 503:
|
|
61
|
+
response_503 = ProblemDetails.from_dict(response.json())
|
|
62
|
+
|
|
63
|
+
return response_503
|
|
64
|
+
|
|
65
|
+
if client.raise_on_unexpected_status:
|
|
66
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
67
|
+
else:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _build_response(
|
|
72
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
73
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse]:
|
|
74
|
+
return Response(
|
|
75
|
+
status_code=HTTPStatus(response.status_code),
|
|
76
|
+
content=response.content,
|
|
77
|
+
headers=response.headers,
|
|
78
|
+
parsed=_parse_response(client=client, response=response),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync_detailed(
|
|
83
|
+
*,
|
|
84
|
+
client: AuthenticatedClient,
|
|
85
|
+
body: CreateScheduledAcquisitionRequest,
|
|
86
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse]:
|
|
87
|
+
"""Plan one acquisition. The response lists overlap warnings; they never reject the write.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
body (CreateScheduledAcquisitionRequest): Plan one acquisition.
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
94
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse]
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
kwargs = _get_kwargs(
|
|
101
|
+
body=body,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
response = client.get_httpx_client().request(
|
|
105
|
+
**kwargs,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return _build_response(client=client, response=response)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def sync(
|
|
112
|
+
*,
|
|
113
|
+
client: AuthenticatedClient,
|
|
114
|
+
body: CreateScheduledAcquisitionRequest,
|
|
115
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
116
|
+
"""Plan one acquisition. The response lists overlap warnings; they never reject the write.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
body (CreateScheduledAcquisitionRequest): Plan one acquisition.
|
|
120
|
+
|
|
121
|
+
Raises:
|
|
122
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
123
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
return sync_detailed(
|
|
130
|
+
client=client,
|
|
131
|
+
body=body,
|
|
132
|
+
).parsed
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
async def asyncio_detailed(
|
|
136
|
+
*,
|
|
137
|
+
client: AuthenticatedClient,
|
|
138
|
+
body: CreateScheduledAcquisitionRequest,
|
|
139
|
+
) -> Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse]:
|
|
140
|
+
"""Plan one acquisition. The response lists overlap warnings; they never reject the write.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
body (CreateScheduledAcquisitionRequest): Plan one acquisition.
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
147
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Response[HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse]
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
kwargs = _get_kwargs(
|
|
154
|
+
body=body,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
158
|
+
|
|
159
|
+
return _build_response(client=client, response=response)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
async def asyncio(
|
|
163
|
+
*,
|
|
164
|
+
client: AuthenticatedClient,
|
|
165
|
+
body: CreateScheduledAcquisitionRequest,
|
|
166
|
+
) -> HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
167
|
+
"""Plan one acquisition. The response lists overlap warnings; they never reject the write.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
body (CreateScheduledAcquisitionRequest): Plan one acquisition.
|
|
171
|
+
|
|
172
|
+
Raises:
|
|
173
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
174
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
HttpValidationProblemDetails | ProblemDetails | ScheduledAcquisitionResponse
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
await asyncio_detailed(
|
|
182
|
+
client=client,
|
|
183
|
+
body=body,
|
|
184
|
+
)
|
|
185
|
+
).parsed
|