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,366 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.effective_status import EffectiveStatus
|
|
12
|
+
from ..models.planning_status import PlanningStatus
|
|
13
|
+
from typing import cast
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
18
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
19
|
+
from ..models.person_assignment import PersonAssignment
|
|
20
|
+
from ..models.settings_selector import SettingsSelector
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="ScheduledAcquisitionResponse")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_attrs_define
|
|
27
|
+
class ScheduledAcquisitionResponse:
|
|
28
|
+
"""A planned acquisition.
|
|
29
|
+
|
|
30
|
+
Attributes:
|
|
31
|
+
id (int):
|
|
32
|
+
subject_id (str):
|
|
33
|
+
instrument_id (str):
|
|
34
|
+
project_id (str):
|
|
35
|
+
scheduled_start (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
36
|
+
scheduled_end (datetime.datetime | None):
|
|
37
|
+
operator_instructions (str):
|
|
38
|
+
planning_status (PlanningStatus): A planned slot's own disposition, set by people (knowledge/decisions/0013).
|
|
39
|
+
effective_status (EffectiveStatus): What a scheduled acquisition reads as: a hand-set disposition when there is
|
|
40
|
+
one, otherwise its newest run's state, otherwise `scheduled`
|
|
41
|
+
(knowledge/decisions/0020).
|
|
42
|
+
has_runs (bool): Whether at least one run exists. Once true, subject, start, end, instrument and type refs can
|
|
43
|
+
no longer change (409 acquisition_has_runs), whatever the status says.
|
|
44
|
+
created_at (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
45
|
+
created_by (str):
|
|
46
|
+
created_by_object_id (None | str): Directory object id of the creator; null for rows made while authentication
|
|
47
|
+
was off. Only the creator (and maintainers) can change the row.
|
|
48
|
+
archived_at (datetime.datetime | None):
|
|
49
|
+
version (int): Opaque row version (PostgreSQL xmin). Changes on every edit; send it back as expected_version.
|
|
50
|
+
Not a counter.
|
|
51
|
+
people (list[PersonAssignment]):
|
|
52
|
+
type_refs (list[SettingsSelector]):
|
|
53
|
+
task_name (None | str): The behavior curriculum task name this acquisition runs, resolved from its
|
|
54
|
+
behavior_curriculum type ref (pinned version, newest live version, or the discriminator value); null when it has
|
|
55
|
+
no such ref or the task is unknown. For labelling lists without a request per row.
|
|
56
|
+
variables (list[AcquisitionVariable]):
|
|
57
|
+
recurring_acquisition_id (int | None): The recurring definition this acquisition is an occurrence of; null for a
|
|
58
|
+
one-off.
|
|
59
|
+
occurrence_local_date (datetime.date | None):
|
|
60
|
+
warnings (list[AcquisitionWarning]): Overlap warnings. Filled only on create and edit responses; always empty
|
|
61
|
+
when reading.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
id: int
|
|
65
|
+
subject_id: str
|
|
66
|
+
instrument_id: str
|
|
67
|
+
project_id: str
|
|
68
|
+
scheduled_start: datetime.datetime
|
|
69
|
+
scheduled_end: datetime.datetime | None
|
|
70
|
+
operator_instructions: str
|
|
71
|
+
planning_status: PlanningStatus
|
|
72
|
+
effective_status: EffectiveStatus
|
|
73
|
+
has_runs: bool
|
|
74
|
+
created_at: datetime.datetime
|
|
75
|
+
created_by: str
|
|
76
|
+
created_by_object_id: None | str
|
|
77
|
+
archived_at: datetime.datetime | None
|
|
78
|
+
version: int
|
|
79
|
+
people: list[PersonAssignment]
|
|
80
|
+
type_refs: list[SettingsSelector]
|
|
81
|
+
task_name: None | str
|
|
82
|
+
variables: list[AcquisitionVariable]
|
|
83
|
+
recurring_acquisition_id: int | None
|
|
84
|
+
occurrence_local_date: datetime.date | None
|
|
85
|
+
warnings: list[AcquisitionWarning]
|
|
86
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
87
|
+
|
|
88
|
+
def to_dict(self) -> dict[str, Any]:
|
|
89
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
90
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
91
|
+
from ..models.person_assignment import PersonAssignment
|
|
92
|
+
from ..models.settings_selector import SettingsSelector
|
|
93
|
+
|
|
94
|
+
id = self.id
|
|
95
|
+
|
|
96
|
+
subject_id = self.subject_id
|
|
97
|
+
|
|
98
|
+
instrument_id = self.instrument_id
|
|
99
|
+
|
|
100
|
+
project_id = self.project_id
|
|
101
|
+
|
|
102
|
+
scheduled_start = self.scheduled_start.isoformat()
|
|
103
|
+
|
|
104
|
+
scheduled_end: None | str
|
|
105
|
+
if isinstance(self.scheduled_end, datetime.datetime):
|
|
106
|
+
scheduled_end = self.scheduled_end.isoformat()
|
|
107
|
+
else:
|
|
108
|
+
scheduled_end = self.scheduled_end
|
|
109
|
+
|
|
110
|
+
operator_instructions = self.operator_instructions
|
|
111
|
+
|
|
112
|
+
planning_status = self.planning_status.value
|
|
113
|
+
|
|
114
|
+
effective_status = self.effective_status.value
|
|
115
|
+
|
|
116
|
+
has_runs = self.has_runs
|
|
117
|
+
|
|
118
|
+
created_at = self.created_at.isoformat()
|
|
119
|
+
|
|
120
|
+
created_by = self.created_by
|
|
121
|
+
|
|
122
|
+
created_by_object_id: None | str
|
|
123
|
+
created_by_object_id = self.created_by_object_id
|
|
124
|
+
|
|
125
|
+
archived_at: None | str
|
|
126
|
+
if isinstance(self.archived_at, datetime.datetime):
|
|
127
|
+
archived_at = self.archived_at.isoformat()
|
|
128
|
+
else:
|
|
129
|
+
archived_at = self.archived_at
|
|
130
|
+
|
|
131
|
+
version = self.version
|
|
132
|
+
|
|
133
|
+
people = []
|
|
134
|
+
for people_item_data in self.people:
|
|
135
|
+
people_item = people_item_data.to_dict()
|
|
136
|
+
people.append(people_item)
|
|
137
|
+
|
|
138
|
+
type_refs = []
|
|
139
|
+
for type_refs_item_data in self.type_refs:
|
|
140
|
+
type_refs_item = type_refs_item_data.to_dict()
|
|
141
|
+
type_refs.append(type_refs_item)
|
|
142
|
+
|
|
143
|
+
task_name: None | str
|
|
144
|
+
task_name = self.task_name
|
|
145
|
+
|
|
146
|
+
variables = []
|
|
147
|
+
for variables_item_data in self.variables:
|
|
148
|
+
variables_item = variables_item_data.to_dict()
|
|
149
|
+
variables.append(variables_item)
|
|
150
|
+
|
|
151
|
+
recurring_acquisition_id: int | None
|
|
152
|
+
recurring_acquisition_id = self.recurring_acquisition_id
|
|
153
|
+
|
|
154
|
+
occurrence_local_date: None | str
|
|
155
|
+
if isinstance(self.occurrence_local_date, datetime.date):
|
|
156
|
+
occurrence_local_date = self.occurrence_local_date.isoformat()
|
|
157
|
+
else:
|
|
158
|
+
occurrence_local_date = self.occurrence_local_date
|
|
159
|
+
|
|
160
|
+
warnings = []
|
|
161
|
+
for warnings_item_data in self.warnings:
|
|
162
|
+
warnings_item = warnings_item_data.to_dict()
|
|
163
|
+
warnings.append(warnings_item)
|
|
164
|
+
|
|
165
|
+
field_dict: dict[str, Any] = {}
|
|
166
|
+
field_dict.update(self.additional_properties)
|
|
167
|
+
field_dict.update(
|
|
168
|
+
{
|
|
169
|
+
"id": id,
|
|
170
|
+
"subject_id": subject_id,
|
|
171
|
+
"instrument_id": instrument_id,
|
|
172
|
+
"project_id": project_id,
|
|
173
|
+
"scheduled_start": scheduled_start,
|
|
174
|
+
"scheduled_end": scheduled_end,
|
|
175
|
+
"operator_instructions": operator_instructions,
|
|
176
|
+
"planning_status": planning_status,
|
|
177
|
+
"effective_status": effective_status,
|
|
178
|
+
"has_runs": has_runs,
|
|
179
|
+
"created_at": created_at,
|
|
180
|
+
"created_by": created_by,
|
|
181
|
+
"created_by_object_id": created_by_object_id,
|
|
182
|
+
"archived_at": archived_at,
|
|
183
|
+
"version": version,
|
|
184
|
+
"people": people,
|
|
185
|
+
"type_refs": type_refs,
|
|
186
|
+
"task_name": task_name,
|
|
187
|
+
"variables": variables,
|
|
188
|
+
"recurring_acquisition_id": recurring_acquisition_id,
|
|
189
|
+
"occurrence_local_date": occurrence_local_date,
|
|
190
|
+
"warnings": warnings,
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return field_dict
|
|
195
|
+
|
|
196
|
+
@classmethod
|
|
197
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
198
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
199
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
200
|
+
from ..models.person_assignment import PersonAssignment
|
|
201
|
+
from ..models.settings_selector import SettingsSelector
|
|
202
|
+
|
|
203
|
+
d = dict(src_dict)
|
|
204
|
+
id = d.pop("id")
|
|
205
|
+
|
|
206
|
+
subject_id = d.pop("subject_id")
|
|
207
|
+
|
|
208
|
+
instrument_id = d.pop("instrument_id")
|
|
209
|
+
|
|
210
|
+
project_id = d.pop("project_id")
|
|
211
|
+
|
|
212
|
+
scheduled_start = datetime.datetime.fromisoformat(d.pop("scheduled_start"))
|
|
213
|
+
|
|
214
|
+
def _parse_scheduled_end(data: object) -> datetime.datetime | None:
|
|
215
|
+
if data is None:
|
|
216
|
+
return data
|
|
217
|
+
try:
|
|
218
|
+
if not isinstance(data, str):
|
|
219
|
+
raise TypeError()
|
|
220
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
221
|
+
|
|
222
|
+
return componentsschemas_instant_nullable_type_1
|
|
223
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
224
|
+
pass
|
|
225
|
+
return cast(datetime.datetime | None, data)
|
|
226
|
+
|
|
227
|
+
scheduled_end = _parse_scheduled_end(d.pop("scheduled_end"))
|
|
228
|
+
|
|
229
|
+
operator_instructions = d.pop("operator_instructions")
|
|
230
|
+
|
|
231
|
+
planning_status = PlanningStatus(d.pop("planning_status"))
|
|
232
|
+
|
|
233
|
+
effective_status = EffectiveStatus(d.pop("effective_status"))
|
|
234
|
+
|
|
235
|
+
has_runs = d.pop("has_runs")
|
|
236
|
+
|
|
237
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
238
|
+
|
|
239
|
+
created_by = d.pop("created_by")
|
|
240
|
+
|
|
241
|
+
def _parse_created_by_object_id(data: object) -> None | str:
|
|
242
|
+
if data is None:
|
|
243
|
+
return data
|
|
244
|
+
return cast(None | str, data)
|
|
245
|
+
|
|
246
|
+
created_by_object_id = _parse_created_by_object_id(d.pop("created_by_object_id"))
|
|
247
|
+
|
|
248
|
+
def _parse_archived_at(data: object) -> datetime.datetime | None:
|
|
249
|
+
if data is None:
|
|
250
|
+
return data
|
|
251
|
+
try:
|
|
252
|
+
if not isinstance(data, str):
|
|
253
|
+
raise TypeError()
|
|
254
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
255
|
+
|
|
256
|
+
return componentsschemas_instant_nullable_type_1
|
|
257
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
258
|
+
pass
|
|
259
|
+
return cast(datetime.datetime | None, data)
|
|
260
|
+
|
|
261
|
+
archived_at = _parse_archived_at(d.pop("archived_at"))
|
|
262
|
+
|
|
263
|
+
version = d.pop("version")
|
|
264
|
+
|
|
265
|
+
people = []
|
|
266
|
+
_people = d.pop("people")
|
|
267
|
+
for people_item_data in _people:
|
|
268
|
+
people_item = PersonAssignment.from_dict(people_item_data)
|
|
269
|
+
|
|
270
|
+
people.append(people_item)
|
|
271
|
+
|
|
272
|
+
type_refs = []
|
|
273
|
+
_type_refs = d.pop("type_refs")
|
|
274
|
+
for type_refs_item_data in _type_refs:
|
|
275
|
+
type_refs_item = SettingsSelector.from_dict(type_refs_item_data)
|
|
276
|
+
|
|
277
|
+
type_refs.append(type_refs_item)
|
|
278
|
+
|
|
279
|
+
def _parse_task_name(data: object) -> None | str:
|
|
280
|
+
if data is None:
|
|
281
|
+
return data
|
|
282
|
+
return cast(None | str, data)
|
|
283
|
+
|
|
284
|
+
task_name = _parse_task_name(d.pop("task_name"))
|
|
285
|
+
|
|
286
|
+
variables = []
|
|
287
|
+
_variables = d.pop("variables")
|
|
288
|
+
for variables_item_data in _variables:
|
|
289
|
+
variables_item = AcquisitionVariable.from_dict(variables_item_data)
|
|
290
|
+
|
|
291
|
+
variables.append(variables_item)
|
|
292
|
+
|
|
293
|
+
def _parse_recurring_acquisition_id(data: object) -> int | None:
|
|
294
|
+
if data is None:
|
|
295
|
+
return data
|
|
296
|
+
return cast(int | None, data)
|
|
297
|
+
|
|
298
|
+
recurring_acquisition_id = _parse_recurring_acquisition_id(
|
|
299
|
+
d.pop("recurring_acquisition_id")
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
def _parse_occurrence_local_date(data: object) -> datetime.date | None:
|
|
303
|
+
if data is None:
|
|
304
|
+
return data
|
|
305
|
+
try:
|
|
306
|
+
if not isinstance(data, str):
|
|
307
|
+
raise TypeError()
|
|
308
|
+
componentsschemas_local_date_nullable_type_1 = datetime.date.fromisoformat(data)
|
|
309
|
+
|
|
310
|
+
return componentsschemas_local_date_nullable_type_1
|
|
311
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
312
|
+
pass
|
|
313
|
+
return cast(datetime.date | None, data)
|
|
314
|
+
|
|
315
|
+
occurrence_local_date = _parse_occurrence_local_date(d.pop("occurrence_local_date"))
|
|
316
|
+
|
|
317
|
+
warnings = []
|
|
318
|
+
_warnings = d.pop("warnings")
|
|
319
|
+
for warnings_item_data in _warnings:
|
|
320
|
+
warnings_item = AcquisitionWarning.from_dict(warnings_item_data)
|
|
321
|
+
|
|
322
|
+
warnings.append(warnings_item)
|
|
323
|
+
|
|
324
|
+
scheduled_acquisition_response = cls(
|
|
325
|
+
id=id,
|
|
326
|
+
subject_id=subject_id,
|
|
327
|
+
instrument_id=instrument_id,
|
|
328
|
+
project_id=project_id,
|
|
329
|
+
scheduled_start=scheduled_start,
|
|
330
|
+
scheduled_end=scheduled_end,
|
|
331
|
+
operator_instructions=operator_instructions,
|
|
332
|
+
planning_status=planning_status,
|
|
333
|
+
effective_status=effective_status,
|
|
334
|
+
has_runs=has_runs,
|
|
335
|
+
created_at=created_at,
|
|
336
|
+
created_by=created_by,
|
|
337
|
+
created_by_object_id=created_by_object_id,
|
|
338
|
+
archived_at=archived_at,
|
|
339
|
+
version=version,
|
|
340
|
+
people=people,
|
|
341
|
+
type_refs=type_refs,
|
|
342
|
+
task_name=task_name,
|
|
343
|
+
variables=variables,
|
|
344
|
+
recurring_acquisition_id=recurring_acquisition_id,
|
|
345
|
+
occurrence_local_date=occurrence_local_date,
|
|
346
|
+
warnings=warnings,
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
scheduled_acquisition_response.additional_properties = d
|
|
350
|
+
return scheduled_acquisition_response
|
|
351
|
+
|
|
352
|
+
@property
|
|
353
|
+
def additional_keys(self) -> list[str]:
|
|
354
|
+
return list(self.additional_properties.keys())
|
|
355
|
+
|
|
356
|
+
def __getitem__(self, key: str) -> Any:
|
|
357
|
+
return self.additional_properties[key]
|
|
358
|
+
|
|
359
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
360
|
+
self.additional_properties[key] = value
|
|
361
|
+
|
|
362
|
+
def __delitem__(self, key: str) -> None:
|
|
363
|
+
del self.additional_properties[key]
|
|
364
|
+
|
|
365
|
+
def __contains__(self, key: str) -> bool:
|
|
366
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.planning_status import PlanningStatus
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="SetPlanningStatusRequest")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class SetPlanningStatusRequest:
|
|
21
|
+
"""Set the hand-set disposition of a scheduled acquisition.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
planning_status (PlanningStatus): A planned slot's own disposition, set by people (knowledge/decisions/0013).
|
|
25
|
+
expected_version (int | None | Unset): The `version` the client last read. When given and stale, the change is
|
|
26
|
+
rejected with 409 `version_conflict` instead of overwriting another edit.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
planning_status: PlanningStatus
|
|
30
|
+
expected_version: int | None | Unset = UNSET
|
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
planning_status = self.planning_status.value
|
|
35
|
+
|
|
36
|
+
expected_version: int | None | Unset
|
|
37
|
+
if isinstance(self.expected_version, Unset):
|
|
38
|
+
expected_version = UNSET
|
|
39
|
+
else:
|
|
40
|
+
expected_version = self.expected_version
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"planning_status": planning_status,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
if expected_version is not UNSET:
|
|
50
|
+
field_dict["expected_version"] = expected_version
|
|
51
|
+
|
|
52
|
+
return field_dict
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
planning_status = PlanningStatus(d.pop("planning_status"))
|
|
58
|
+
|
|
59
|
+
def _parse_expected_version(data: object) -> int | None | Unset:
|
|
60
|
+
if data is None:
|
|
61
|
+
return data
|
|
62
|
+
if isinstance(data, Unset):
|
|
63
|
+
return data
|
|
64
|
+
return cast(int | None | Unset, data)
|
|
65
|
+
|
|
66
|
+
expected_version = _parse_expected_version(d.pop("expected_version", UNSET))
|
|
67
|
+
|
|
68
|
+
set_planning_status_request = cls(
|
|
69
|
+
planning_status=planning_status,
|
|
70
|
+
expected_version=expected_version,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
set_planning_status_request.additional_properties = d
|
|
74
|
+
return set_planning_status_request
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def additional_keys(self) -> list[str]:
|
|
78
|
+
return list(self.additional_properties.keys())
|
|
79
|
+
|
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
|
81
|
+
return self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
84
|
+
self.additional_properties[key] = value
|
|
85
|
+
|
|
86
|
+
def __delitem__(self, key: str) -> None:
|
|
87
|
+
del self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __contains__(self, key: str) -> bool:
|
|
90
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.resolution_mode import ResolutionMode
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="SettingsSelector")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class SettingsSelector:
|
|
21
|
+
"""A settings selection rule for one acquisition type.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
acquisition_type (str): Acquisition type key, e.g. `fip`.
|
|
25
|
+
resolution_mode (ResolutionMode): How a scheduled acquisition chooses its settings version for one acquisition
|
|
26
|
+
type.
|
|
27
|
+
pinned_settings_id (int | None | Unset): Required for `pinned`; otherwise null.
|
|
28
|
+
discriminator_field (None | str | Unset): Required for `discriminator`; one of the type's filter fields.
|
|
29
|
+
discriminator_value (None | str | Unset): Required for `discriminator`.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
acquisition_type: str
|
|
33
|
+
resolution_mode: ResolutionMode
|
|
34
|
+
pinned_settings_id: int | None | Unset = UNSET
|
|
35
|
+
discriminator_field: None | str | Unset = UNSET
|
|
36
|
+
discriminator_value: None | str | Unset = UNSET
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
def to_dict(self) -> dict[str, Any]:
|
|
40
|
+
acquisition_type = self.acquisition_type
|
|
41
|
+
|
|
42
|
+
resolution_mode = self.resolution_mode.value
|
|
43
|
+
|
|
44
|
+
pinned_settings_id: int | None | Unset
|
|
45
|
+
if isinstance(self.pinned_settings_id, Unset):
|
|
46
|
+
pinned_settings_id = UNSET
|
|
47
|
+
else:
|
|
48
|
+
pinned_settings_id = self.pinned_settings_id
|
|
49
|
+
|
|
50
|
+
discriminator_field: None | str | Unset
|
|
51
|
+
if isinstance(self.discriminator_field, Unset):
|
|
52
|
+
discriminator_field = UNSET
|
|
53
|
+
else:
|
|
54
|
+
discriminator_field = self.discriminator_field
|
|
55
|
+
|
|
56
|
+
discriminator_value: None | str | Unset
|
|
57
|
+
if isinstance(self.discriminator_value, Unset):
|
|
58
|
+
discriminator_value = UNSET
|
|
59
|
+
else:
|
|
60
|
+
discriminator_value = self.discriminator_value
|
|
61
|
+
|
|
62
|
+
field_dict: dict[str, Any] = {}
|
|
63
|
+
field_dict.update(self.additional_properties)
|
|
64
|
+
field_dict.update(
|
|
65
|
+
{
|
|
66
|
+
"acquisition_type": acquisition_type,
|
|
67
|
+
"resolution_mode": resolution_mode,
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
if pinned_settings_id is not UNSET:
|
|
71
|
+
field_dict["pinned_settings_id"] = pinned_settings_id
|
|
72
|
+
if discriminator_field is not UNSET:
|
|
73
|
+
field_dict["discriminator_field"] = discriminator_field
|
|
74
|
+
if discriminator_value is not UNSET:
|
|
75
|
+
field_dict["discriminator_value"] = discriminator_value
|
|
76
|
+
|
|
77
|
+
return field_dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
81
|
+
d = dict(src_dict)
|
|
82
|
+
acquisition_type = d.pop("acquisition_type")
|
|
83
|
+
|
|
84
|
+
resolution_mode = ResolutionMode(d.pop("resolution_mode"))
|
|
85
|
+
|
|
86
|
+
def _parse_pinned_settings_id(data: object) -> int | None | Unset:
|
|
87
|
+
if data is None:
|
|
88
|
+
return data
|
|
89
|
+
if isinstance(data, Unset):
|
|
90
|
+
return data
|
|
91
|
+
return cast(int | None | Unset, data)
|
|
92
|
+
|
|
93
|
+
pinned_settings_id = _parse_pinned_settings_id(d.pop("pinned_settings_id", UNSET))
|
|
94
|
+
|
|
95
|
+
def _parse_discriminator_field(data: object) -> None | str | Unset:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
if isinstance(data, Unset):
|
|
99
|
+
return data
|
|
100
|
+
return cast(None | str | Unset, data)
|
|
101
|
+
|
|
102
|
+
discriminator_field = _parse_discriminator_field(d.pop("discriminator_field", UNSET))
|
|
103
|
+
|
|
104
|
+
def _parse_discriminator_value(data: object) -> None | str | Unset:
|
|
105
|
+
if data is None:
|
|
106
|
+
return data
|
|
107
|
+
if isinstance(data, Unset):
|
|
108
|
+
return data
|
|
109
|
+
return cast(None | str | Unset, data)
|
|
110
|
+
|
|
111
|
+
discriminator_value = _parse_discriminator_value(d.pop("discriminator_value", UNSET))
|
|
112
|
+
|
|
113
|
+
settings_selector = cls(
|
|
114
|
+
acquisition_type=acquisition_type,
|
|
115
|
+
resolution_mode=resolution_mode,
|
|
116
|
+
pinned_settings_id=pinned_settings_id,
|
|
117
|
+
discriminator_field=discriminator_field,
|
|
118
|
+
discriminator_value=discriminator_value,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
settings_selector.additional_properties = d
|
|
122
|
+
return settings_selector
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def additional_keys(self) -> list[str]:
|
|
126
|
+
return list(self.additional_properties.keys())
|
|
127
|
+
|
|
128
|
+
def __getitem__(self, key: str) -> Any:
|
|
129
|
+
return self.additional_properties[key]
|
|
130
|
+
|
|
131
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
132
|
+
self.additional_properties[key] = value
|
|
133
|
+
|
|
134
|
+
def __delitem__(self, key: str) -> None:
|
|
135
|
+
del self.additional_properties[key]
|
|
136
|
+
|
|
137
|
+
def __contains__(self, key: str) -> bool:
|
|
138
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.recurrence_exception_kind import RecurrenceExceptionKind
|
|
12
|
+
from typing import cast
|
|
13
|
+
import datetime
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="SkippedOccurrence")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class SkippedOccurrence:
|
|
21
|
+
"""An occurrence the rule produced a date for but that cannot be scheduled.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
occurrence_local_date (datetime.date): Calendar date, e.g. 2026-10-15.
|
|
25
|
+
reason (RecurrenceExceptionKind): Why an occurrence has no acquisition, or what happened to it afterwards.
|
|
26
|
+
message (str): Human-readable explanation.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
occurrence_local_date: datetime.date
|
|
30
|
+
reason: RecurrenceExceptionKind
|
|
31
|
+
message: str
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
occurrence_local_date = self.occurrence_local_date.isoformat()
|
|
36
|
+
|
|
37
|
+
reason = self.reason.value
|
|
38
|
+
|
|
39
|
+
message = self.message
|
|
40
|
+
|
|
41
|
+
field_dict: dict[str, Any] = {}
|
|
42
|
+
field_dict.update(self.additional_properties)
|
|
43
|
+
field_dict.update(
|
|
44
|
+
{
|
|
45
|
+
"occurrence_local_date": occurrence_local_date,
|
|
46
|
+
"reason": reason,
|
|
47
|
+
"message": message,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
occurrence_local_date = datetime.date.fromisoformat(d.pop("occurrence_local_date"))
|
|
57
|
+
|
|
58
|
+
reason = RecurrenceExceptionKind(d.pop("reason"))
|
|
59
|
+
|
|
60
|
+
message = d.pop("message")
|
|
61
|
+
|
|
62
|
+
skipped_occurrence = cls(
|
|
63
|
+
occurrence_local_date=occurrence_local_date,
|
|
64
|
+
reason=reason,
|
|
65
|
+
message=message,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
skipped_occurrence.additional_properties = d
|
|
69
|
+
return skipped_occurrence
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def additional_keys(self) -> list[str]:
|
|
73
|
+
return list(self.additional_properties.keys())
|
|
74
|
+
|
|
75
|
+
def __getitem__(self, key: str) -> Any:
|
|
76
|
+
return self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
79
|
+
self.additional_properties[key] = value
|
|
80
|
+
|
|
81
|
+
def __delitem__(self, key: str) -> None:
|
|
82
|
+
del self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __contains__(self, key: str) -> bool:
|
|
85
|
+
return key in self.additional_properties
|