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,169 @@
|
|
|
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.get_resolved_settings_response_200 import GetResolvedSettingsResponse200
|
|
12
|
+
from ...models.http_validation_problem_details import HttpValidationProblemDetails
|
|
13
|
+
from ...models.problem_details import ProblemDetails
|
|
14
|
+
from typing import cast
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
id: int,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "get",
|
|
23
|
+
"url": "/api/v1/scheduled-acquisitions/{id}/resolved-settings".format(
|
|
24
|
+
id=quote(str(id), safe=""),
|
|
25
|
+
),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return _kwargs
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _parse_response(
|
|
32
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
33
|
+
) -> GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails | None:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = GetResolvedSettingsResponse200.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
|
|
39
|
+
if response.status_code == 404:
|
|
40
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_404
|
|
43
|
+
|
|
44
|
+
if response.status_code == 422:
|
|
45
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_422
|
|
48
|
+
|
|
49
|
+
if client.raise_on_unexpected_status:
|
|
50
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
51
|
+
else:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _build_response(
|
|
56
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
57
|
+
) -> Response[GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails]:
|
|
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
|
+
id: int,
|
|
68
|
+
*,
|
|
69
|
+
client: AuthenticatedClient,
|
|
70
|
+
) -> Response[GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails]:
|
|
71
|
+
"""The settings a run started now would use, per acquisition type. Read-only.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
id (int):
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
78
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Response[GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails]
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
kwargs = _get_kwargs(
|
|
85
|
+
id=id,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
response = client.get_httpx_client().request(
|
|
89
|
+
**kwargs,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return _build_response(client=client, response=response)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def sync(
|
|
96
|
+
id: int,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
) -> GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails | None:
|
|
100
|
+
"""The settings a run started now would use, per acquisition type. Read-only.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
id (int):
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
return sync_detailed(
|
|
114
|
+
id=id,
|
|
115
|
+
client=client,
|
|
116
|
+
).parsed
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
async def asyncio_detailed(
|
|
120
|
+
id: int,
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient,
|
|
123
|
+
) -> Response[GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails]:
|
|
124
|
+
"""The settings a run started now would use, per acquisition type. Read-only.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
id (int):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Response[GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
kwargs = _get_kwargs(
|
|
138
|
+
id=id,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
142
|
+
|
|
143
|
+
return _build_response(client=client, response=response)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio(
|
|
147
|
+
id: int,
|
|
148
|
+
*,
|
|
149
|
+
client: AuthenticatedClient,
|
|
150
|
+
) -> GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails | None:
|
|
151
|
+
"""The settings a run started now would use, per acquisition type. Read-only.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
id (int):
|
|
155
|
+
|
|
156
|
+
Raises:
|
|
157
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
158
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
GetResolvedSettingsResponse200 | HttpValidationProblemDetails | ProblemDetails
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
await asyncio_detailed(
|
|
166
|
+
id=id,
|
|
167
|
+
client=client,
|
|
168
|
+
)
|
|
169
|
+
).parsed
|
|
@@ -0,0 +1,159 @@
|
|
|
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 typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
id: int,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "get",
|
|
22
|
+
"url": "/api/v1/scheduled-acquisitions/{id}".format(
|
|
23
|
+
id=quote(str(id), safe=""),
|
|
24
|
+
),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _kwargs
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(
|
|
31
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
32
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
33
|
+
if response.status_code == 200:
|
|
34
|
+
response_200 = ScheduledAcquisitionResponse.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_200
|
|
37
|
+
|
|
38
|
+
if response.status_code == 404:
|
|
39
|
+
response_404 = ProblemDetails.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_404
|
|
42
|
+
|
|
43
|
+
if client.raise_on_unexpected_status:
|
|
44
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
45
|
+
else:
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _build_response(
|
|
50
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
51
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
52
|
+
return Response(
|
|
53
|
+
status_code=HTTPStatus(response.status_code),
|
|
54
|
+
content=response.content,
|
|
55
|
+
headers=response.headers,
|
|
56
|
+
parsed=_parse_response(client=client, response=response),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sync_detailed(
|
|
61
|
+
id: int,
|
|
62
|
+
*,
|
|
63
|
+
client: AuthenticatedClient,
|
|
64
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
65
|
+
"""
|
|
66
|
+
Args:
|
|
67
|
+
id (int):
|
|
68
|
+
|
|
69
|
+
Raises:
|
|
70
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
71
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
id=id,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
id: int,
|
|
90
|
+
*,
|
|
91
|
+
client: AuthenticatedClient,
|
|
92
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
93
|
+
"""
|
|
94
|
+
Args:
|
|
95
|
+
id (int):
|
|
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
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
return sync_detailed(
|
|
106
|
+
id=id,
|
|
107
|
+
client=client,
|
|
108
|
+
).parsed
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio_detailed(
|
|
112
|
+
id: int,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
) -> Response[ProblemDetails | ScheduledAcquisitionResponse]:
|
|
116
|
+
"""
|
|
117
|
+
Args:
|
|
118
|
+
id (int):
|
|
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
|
+
Response[ProblemDetails | ScheduledAcquisitionResponse]
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
kwargs = _get_kwargs(
|
|
129
|
+
id=id,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
133
|
+
|
|
134
|
+
return _build_response(client=client, response=response)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def asyncio(
|
|
138
|
+
id: int,
|
|
139
|
+
*,
|
|
140
|
+
client: AuthenticatedClient,
|
|
141
|
+
) -> ProblemDetails | ScheduledAcquisitionResponse | None:
|
|
142
|
+
"""
|
|
143
|
+
Args:
|
|
144
|
+
id (int):
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
ProblemDetails | ScheduledAcquisitionResponse
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
await asyncio_detailed(
|
|
156
|
+
id=id,
|
|
157
|
+
client=client,
|
|
158
|
+
)
|
|
159
|
+
).parsed
|
|
@@ -0,0 +1,297 @@
|
|
|
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.list_active_acquisitions_effective_status_item import (
|
|
13
|
+
ListActiveAcquisitionsEffectiveStatusItem,
|
|
14
|
+
)
|
|
15
|
+
from ...models.scheduled_acquisition_response import ScheduledAcquisitionResponse
|
|
16
|
+
from ...types import UNSET, Unset
|
|
17
|
+
from typing import cast
|
|
18
|
+
import datetime
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _get_kwargs(
|
|
22
|
+
*,
|
|
23
|
+
at: datetime.datetime | Unset = UNSET,
|
|
24
|
+
before_minutes: int | None | Unset = UNSET,
|
|
25
|
+
after_minutes: int | None | Unset = UNSET,
|
|
26
|
+
instrument_id: str | Unset = UNSET,
|
|
27
|
+
subject_id: str | Unset = UNSET,
|
|
28
|
+
person_id: str | Unset = UNSET,
|
|
29
|
+
effective_status: list[ListActiveAcquisitionsEffectiveStatusItem] | Unset = UNSET,
|
|
30
|
+
) -> dict[str, Any]:
|
|
31
|
+
|
|
32
|
+
params: dict[str, Any] = {}
|
|
33
|
+
|
|
34
|
+
json_at: str | Unset = UNSET
|
|
35
|
+
if not isinstance(at, Unset):
|
|
36
|
+
json_at = at.isoformat()
|
|
37
|
+
params["at"] = json_at
|
|
38
|
+
|
|
39
|
+
json_before_minutes: int | None | Unset
|
|
40
|
+
if isinstance(before_minutes, Unset):
|
|
41
|
+
json_before_minutes = UNSET
|
|
42
|
+
else:
|
|
43
|
+
json_before_minutes = before_minutes
|
|
44
|
+
params["before_minutes"] = json_before_minutes
|
|
45
|
+
|
|
46
|
+
json_after_minutes: int | None | Unset
|
|
47
|
+
if isinstance(after_minutes, Unset):
|
|
48
|
+
json_after_minutes = UNSET
|
|
49
|
+
else:
|
|
50
|
+
json_after_minutes = after_minutes
|
|
51
|
+
params["after_minutes"] = json_after_minutes
|
|
52
|
+
|
|
53
|
+
params["instrument_id"] = instrument_id
|
|
54
|
+
|
|
55
|
+
params["subject_id"] = subject_id
|
|
56
|
+
|
|
57
|
+
params["person_id"] = person_id
|
|
58
|
+
|
|
59
|
+
json_effective_status: list[str] | Unset = UNSET
|
|
60
|
+
if not isinstance(effective_status, Unset):
|
|
61
|
+
json_effective_status = []
|
|
62
|
+
for effective_status_item_data in effective_status:
|
|
63
|
+
effective_status_item = effective_status_item_data.value
|
|
64
|
+
json_effective_status.append(effective_status_item)
|
|
65
|
+
|
|
66
|
+
params["effective_status"] = json_effective_status
|
|
67
|
+
|
|
68
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
69
|
+
|
|
70
|
+
_kwargs: dict[str, Any] = {
|
|
71
|
+
"method": "get",
|
|
72
|
+
"url": "/api/v1/scheduled-acquisitions/active",
|
|
73
|
+
"params": params,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return _kwargs
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _parse_response(
|
|
80
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
81
|
+
) -> HttpValidationProblemDetails | list[ScheduledAcquisitionResponse] | None:
|
|
82
|
+
if response.status_code == 200:
|
|
83
|
+
response_200 = []
|
|
84
|
+
_response_200 = response.json()
|
|
85
|
+
for response_200_item_data in _response_200:
|
|
86
|
+
response_200_item = ScheduledAcquisitionResponse.from_dict(response_200_item_data)
|
|
87
|
+
|
|
88
|
+
response_200.append(response_200_item)
|
|
89
|
+
|
|
90
|
+
return response_200
|
|
91
|
+
|
|
92
|
+
if response.status_code == 422:
|
|
93
|
+
response_422 = HttpValidationProblemDetails.from_dict(response.json())
|
|
94
|
+
|
|
95
|
+
return response_422
|
|
96
|
+
|
|
97
|
+
if client.raise_on_unexpected_status:
|
|
98
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
99
|
+
else:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _build_response(
|
|
104
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
105
|
+
) -> Response[HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]]:
|
|
106
|
+
return Response(
|
|
107
|
+
status_code=HTTPStatus(response.status_code),
|
|
108
|
+
content=response.content,
|
|
109
|
+
headers=response.headers,
|
|
110
|
+
parsed=_parse_response(client=client, response=response),
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def sync_detailed(
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient,
|
|
117
|
+
at: datetime.datetime | Unset = UNSET,
|
|
118
|
+
before_minutes: int | None | Unset = UNSET,
|
|
119
|
+
after_minutes: int | None | Unset = UNSET,
|
|
120
|
+
instrument_id: str | Unset = UNSET,
|
|
121
|
+
subject_id: str | Unset = UNSET,
|
|
122
|
+
person_id: str | Unset = UNSET,
|
|
123
|
+
effective_status: list[ListActiveAcquisitionsEffectiveStatusItem] | Unset = UNSET,
|
|
124
|
+
) -> Response[HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]]:
|
|
125
|
+
"""Acquisitions whose planned window overlaps [at - before_minutes, at + after_minutes]; used by rigs
|
|
126
|
+
at startup.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
at (datetime.datetime | Unset): ISO 8601 timestamp with an offset, e.g.
|
|
130
|
+
2026-10-15T16:00:00Z.
|
|
131
|
+
before_minutes (int | None | Unset):
|
|
132
|
+
after_minutes (int | None | Unset):
|
|
133
|
+
instrument_id (str | Unset):
|
|
134
|
+
subject_id (str | Unset):
|
|
135
|
+
person_id (str | Unset):
|
|
136
|
+
effective_status (list[ListActiveAcquisitionsEffectiveStatusItem] | Unset):
|
|
137
|
+
|
|
138
|
+
Raises:
|
|
139
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
140
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
Response[HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]]
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
kwargs = _get_kwargs(
|
|
147
|
+
at=at,
|
|
148
|
+
before_minutes=before_minutes,
|
|
149
|
+
after_minutes=after_minutes,
|
|
150
|
+
instrument_id=instrument_id,
|
|
151
|
+
subject_id=subject_id,
|
|
152
|
+
person_id=person_id,
|
|
153
|
+
effective_status=effective_status,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
response = client.get_httpx_client().request(
|
|
157
|
+
**kwargs,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
return _build_response(client=client, response=response)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def sync(
|
|
164
|
+
*,
|
|
165
|
+
client: AuthenticatedClient,
|
|
166
|
+
at: datetime.datetime | Unset = UNSET,
|
|
167
|
+
before_minutes: int | None | Unset = UNSET,
|
|
168
|
+
after_minutes: int | None | Unset = UNSET,
|
|
169
|
+
instrument_id: str | Unset = UNSET,
|
|
170
|
+
subject_id: str | Unset = UNSET,
|
|
171
|
+
person_id: str | Unset = UNSET,
|
|
172
|
+
effective_status: list[ListActiveAcquisitionsEffectiveStatusItem] | Unset = UNSET,
|
|
173
|
+
) -> HttpValidationProblemDetails | list[ScheduledAcquisitionResponse] | None:
|
|
174
|
+
"""Acquisitions whose planned window overlaps [at - before_minutes, at + after_minutes]; used by rigs
|
|
175
|
+
at startup.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
at (datetime.datetime | Unset): ISO 8601 timestamp with an offset, e.g.
|
|
179
|
+
2026-10-15T16:00:00Z.
|
|
180
|
+
before_minutes (int | None | Unset):
|
|
181
|
+
after_minutes (int | None | Unset):
|
|
182
|
+
instrument_id (str | Unset):
|
|
183
|
+
subject_id (str | Unset):
|
|
184
|
+
person_id (str | Unset):
|
|
185
|
+
effective_status (list[ListActiveAcquisitionsEffectiveStatusItem] | Unset):
|
|
186
|
+
|
|
187
|
+
Raises:
|
|
188
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
189
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
return sync_detailed(
|
|
196
|
+
client=client,
|
|
197
|
+
at=at,
|
|
198
|
+
before_minutes=before_minutes,
|
|
199
|
+
after_minutes=after_minutes,
|
|
200
|
+
instrument_id=instrument_id,
|
|
201
|
+
subject_id=subject_id,
|
|
202
|
+
person_id=person_id,
|
|
203
|
+
effective_status=effective_status,
|
|
204
|
+
).parsed
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
async def asyncio_detailed(
|
|
208
|
+
*,
|
|
209
|
+
client: AuthenticatedClient,
|
|
210
|
+
at: datetime.datetime | Unset = UNSET,
|
|
211
|
+
before_minutes: int | None | Unset = UNSET,
|
|
212
|
+
after_minutes: int | None | Unset = UNSET,
|
|
213
|
+
instrument_id: str | Unset = UNSET,
|
|
214
|
+
subject_id: str | Unset = UNSET,
|
|
215
|
+
person_id: str | Unset = UNSET,
|
|
216
|
+
effective_status: list[ListActiveAcquisitionsEffectiveStatusItem] | Unset = UNSET,
|
|
217
|
+
) -> Response[HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]]:
|
|
218
|
+
"""Acquisitions whose planned window overlaps [at - before_minutes, at + after_minutes]; used by rigs
|
|
219
|
+
at startup.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
at (datetime.datetime | Unset): ISO 8601 timestamp with an offset, e.g.
|
|
223
|
+
2026-10-15T16:00:00Z.
|
|
224
|
+
before_minutes (int | None | Unset):
|
|
225
|
+
after_minutes (int | None | Unset):
|
|
226
|
+
instrument_id (str | Unset):
|
|
227
|
+
subject_id (str | Unset):
|
|
228
|
+
person_id (str | Unset):
|
|
229
|
+
effective_status (list[ListActiveAcquisitionsEffectiveStatusItem] | Unset):
|
|
230
|
+
|
|
231
|
+
Raises:
|
|
232
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
233
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
234
|
+
|
|
235
|
+
Returns:
|
|
236
|
+
Response[HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]]
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
kwargs = _get_kwargs(
|
|
240
|
+
at=at,
|
|
241
|
+
before_minutes=before_minutes,
|
|
242
|
+
after_minutes=after_minutes,
|
|
243
|
+
instrument_id=instrument_id,
|
|
244
|
+
subject_id=subject_id,
|
|
245
|
+
person_id=person_id,
|
|
246
|
+
effective_status=effective_status,
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
250
|
+
|
|
251
|
+
return _build_response(client=client, response=response)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
async def asyncio(
|
|
255
|
+
*,
|
|
256
|
+
client: AuthenticatedClient,
|
|
257
|
+
at: datetime.datetime | Unset = UNSET,
|
|
258
|
+
before_minutes: int | None | Unset = UNSET,
|
|
259
|
+
after_minutes: int | None | Unset = UNSET,
|
|
260
|
+
instrument_id: str | Unset = UNSET,
|
|
261
|
+
subject_id: str | Unset = UNSET,
|
|
262
|
+
person_id: str | Unset = UNSET,
|
|
263
|
+
effective_status: list[ListActiveAcquisitionsEffectiveStatusItem] | Unset = UNSET,
|
|
264
|
+
) -> HttpValidationProblemDetails | list[ScheduledAcquisitionResponse] | None:
|
|
265
|
+
"""Acquisitions whose planned window overlaps [at - before_minutes, at + after_minutes]; used by rigs
|
|
266
|
+
at startup.
|
|
267
|
+
|
|
268
|
+
Args:
|
|
269
|
+
at (datetime.datetime | Unset): ISO 8601 timestamp with an offset, e.g.
|
|
270
|
+
2026-10-15T16:00:00Z.
|
|
271
|
+
before_minutes (int | None | Unset):
|
|
272
|
+
after_minutes (int | None | Unset):
|
|
273
|
+
instrument_id (str | Unset):
|
|
274
|
+
subject_id (str | Unset):
|
|
275
|
+
person_id (str | Unset):
|
|
276
|
+
effective_status (list[ListActiveAcquisitionsEffectiveStatusItem] | Unset):
|
|
277
|
+
|
|
278
|
+
Raises:
|
|
279
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
280
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
281
|
+
|
|
282
|
+
Returns:
|
|
283
|
+
HttpValidationProblemDetails | list[ScheduledAcquisitionResponse]
|
|
284
|
+
"""
|
|
285
|
+
|
|
286
|
+
return (
|
|
287
|
+
await asyncio_detailed(
|
|
288
|
+
client=client,
|
|
289
|
+
at=at,
|
|
290
|
+
before_minutes=before_minutes,
|
|
291
|
+
after_minutes=after_minutes,
|
|
292
|
+
instrument_id=instrument_id,
|
|
293
|
+
subject_id=subject_id,
|
|
294
|
+
person_id=person_id,
|
|
295
|
+
effective_status=effective_status,
|
|
296
|
+
)
|
|
297
|
+
).parsed
|