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,302 @@
|
|
|
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 typing import cast
|
|
12
|
+
import datetime
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
16
|
+
from ..models.person_assignment import PersonAssignment
|
|
17
|
+
from ..models.settings_selector import SettingsSelector
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="TemplateResponse")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class TemplateResponse:
|
|
25
|
+
"""A template.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
id (int):
|
|
29
|
+
name (str):
|
|
30
|
+
subject_id (None | str):
|
|
31
|
+
instrument_id (None | str):
|
|
32
|
+
project_id (None | str):
|
|
33
|
+
operator_instructions (None | str):
|
|
34
|
+
people (list[PersonAssignment]):
|
|
35
|
+
type_refs (list[SettingsSelector]):
|
|
36
|
+
variables (list[AcquisitionVariable]):
|
|
37
|
+
duration_minutes (int | None):
|
|
38
|
+
local_start_time (None | str):
|
|
39
|
+
created_at (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
40
|
+
created_by (str):
|
|
41
|
+
created_by_object_id (None | str): Directory object id of the creator; null for rows made while authentication
|
|
42
|
+
was off. Only the creator (and maintainers) can change the row.
|
|
43
|
+
updated_at (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
44
|
+
updated_by (str):
|
|
45
|
+
archived_at (datetime.datetime | None):
|
|
46
|
+
version (int): Opaque row version (PostgreSQL xmin). Changes on every edit; send it back as expected_version.
|
|
47
|
+
Not a counter.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
id: int
|
|
51
|
+
name: str
|
|
52
|
+
subject_id: None | str
|
|
53
|
+
instrument_id: None | str
|
|
54
|
+
project_id: None | str
|
|
55
|
+
operator_instructions: None | str
|
|
56
|
+
people: list[PersonAssignment]
|
|
57
|
+
type_refs: list[SettingsSelector]
|
|
58
|
+
variables: list[AcquisitionVariable]
|
|
59
|
+
duration_minutes: int | None
|
|
60
|
+
local_start_time: None | str
|
|
61
|
+
created_at: datetime.datetime
|
|
62
|
+
created_by: str
|
|
63
|
+
created_by_object_id: None | str
|
|
64
|
+
updated_at: datetime.datetime
|
|
65
|
+
updated_by: str
|
|
66
|
+
archived_at: datetime.datetime | None
|
|
67
|
+
version: int
|
|
68
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> dict[str, Any]:
|
|
71
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
72
|
+
from ..models.person_assignment import PersonAssignment
|
|
73
|
+
from ..models.settings_selector import SettingsSelector
|
|
74
|
+
|
|
75
|
+
id = self.id
|
|
76
|
+
|
|
77
|
+
name = self.name
|
|
78
|
+
|
|
79
|
+
subject_id: None | str
|
|
80
|
+
subject_id = self.subject_id
|
|
81
|
+
|
|
82
|
+
instrument_id: None | str
|
|
83
|
+
instrument_id = self.instrument_id
|
|
84
|
+
|
|
85
|
+
project_id: None | str
|
|
86
|
+
project_id = self.project_id
|
|
87
|
+
|
|
88
|
+
operator_instructions: None | str
|
|
89
|
+
operator_instructions = self.operator_instructions
|
|
90
|
+
|
|
91
|
+
people = []
|
|
92
|
+
for people_item_data in self.people:
|
|
93
|
+
people_item = people_item_data.to_dict()
|
|
94
|
+
people.append(people_item)
|
|
95
|
+
|
|
96
|
+
type_refs = []
|
|
97
|
+
for type_refs_item_data in self.type_refs:
|
|
98
|
+
type_refs_item = type_refs_item_data.to_dict()
|
|
99
|
+
type_refs.append(type_refs_item)
|
|
100
|
+
|
|
101
|
+
variables = []
|
|
102
|
+
for variables_item_data in self.variables:
|
|
103
|
+
variables_item = variables_item_data.to_dict()
|
|
104
|
+
variables.append(variables_item)
|
|
105
|
+
|
|
106
|
+
duration_minutes: int | None
|
|
107
|
+
duration_minutes = self.duration_minutes
|
|
108
|
+
|
|
109
|
+
local_start_time: None | str
|
|
110
|
+
local_start_time = self.local_start_time
|
|
111
|
+
|
|
112
|
+
created_at = self.created_at.isoformat()
|
|
113
|
+
|
|
114
|
+
created_by = self.created_by
|
|
115
|
+
|
|
116
|
+
created_by_object_id: None | str
|
|
117
|
+
created_by_object_id = self.created_by_object_id
|
|
118
|
+
|
|
119
|
+
updated_at = self.updated_at.isoformat()
|
|
120
|
+
|
|
121
|
+
updated_by = self.updated_by
|
|
122
|
+
|
|
123
|
+
archived_at: None | str
|
|
124
|
+
if isinstance(self.archived_at, datetime.datetime):
|
|
125
|
+
archived_at = self.archived_at.isoformat()
|
|
126
|
+
else:
|
|
127
|
+
archived_at = self.archived_at
|
|
128
|
+
|
|
129
|
+
version = self.version
|
|
130
|
+
|
|
131
|
+
field_dict: dict[str, Any] = {}
|
|
132
|
+
field_dict.update(self.additional_properties)
|
|
133
|
+
field_dict.update(
|
|
134
|
+
{
|
|
135
|
+
"id": id,
|
|
136
|
+
"name": name,
|
|
137
|
+
"subject_id": subject_id,
|
|
138
|
+
"instrument_id": instrument_id,
|
|
139
|
+
"project_id": project_id,
|
|
140
|
+
"operator_instructions": operator_instructions,
|
|
141
|
+
"people": people,
|
|
142
|
+
"type_refs": type_refs,
|
|
143
|
+
"variables": variables,
|
|
144
|
+
"duration_minutes": duration_minutes,
|
|
145
|
+
"local_start_time": local_start_time,
|
|
146
|
+
"created_at": created_at,
|
|
147
|
+
"created_by": created_by,
|
|
148
|
+
"created_by_object_id": created_by_object_id,
|
|
149
|
+
"updated_at": updated_at,
|
|
150
|
+
"updated_by": updated_by,
|
|
151
|
+
"archived_at": archived_at,
|
|
152
|
+
"version": version,
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
return field_dict
|
|
157
|
+
|
|
158
|
+
@classmethod
|
|
159
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
160
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
161
|
+
from ..models.person_assignment import PersonAssignment
|
|
162
|
+
from ..models.settings_selector import SettingsSelector
|
|
163
|
+
|
|
164
|
+
d = dict(src_dict)
|
|
165
|
+
id = d.pop("id")
|
|
166
|
+
|
|
167
|
+
name = d.pop("name")
|
|
168
|
+
|
|
169
|
+
def _parse_subject_id(data: object) -> None | str:
|
|
170
|
+
if data is None:
|
|
171
|
+
return data
|
|
172
|
+
return cast(None | str, data)
|
|
173
|
+
|
|
174
|
+
subject_id = _parse_subject_id(d.pop("subject_id"))
|
|
175
|
+
|
|
176
|
+
def _parse_instrument_id(data: object) -> None | str:
|
|
177
|
+
if data is None:
|
|
178
|
+
return data
|
|
179
|
+
return cast(None | str, data)
|
|
180
|
+
|
|
181
|
+
instrument_id = _parse_instrument_id(d.pop("instrument_id"))
|
|
182
|
+
|
|
183
|
+
def _parse_project_id(data: object) -> None | str:
|
|
184
|
+
if data is None:
|
|
185
|
+
return data
|
|
186
|
+
return cast(None | str, data)
|
|
187
|
+
|
|
188
|
+
project_id = _parse_project_id(d.pop("project_id"))
|
|
189
|
+
|
|
190
|
+
def _parse_operator_instructions(data: object) -> None | str:
|
|
191
|
+
if data is None:
|
|
192
|
+
return data
|
|
193
|
+
return cast(None | str, data)
|
|
194
|
+
|
|
195
|
+
operator_instructions = _parse_operator_instructions(d.pop("operator_instructions"))
|
|
196
|
+
|
|
197
|
+
people = []
|
|
198
|
+
_people = d.pop("people")
|
|
199
|
+
for people_item_data in _people:
|
|
200
|
+
people_item = PersonAssignment.from_dict(people_item_data)
|
|
201
|
+
|
|
202
|
+
people.append(people_item)
|
|
203
|
+
|
|
204
|
+
type_refs = []
|
|
205
|
+
_type_refs = d.pop("type_refs")
|
|
206
|
+
for type_refs_item_data in _type_refs:
|
|
207
|
+
type_refs_item = SettingsSelector.from_dict(type_refs_item_data)
|
|
208
|
+
|
|
209
|
+
type_refs.append(type_refs_item)
|
|
210
|
+
|
|
211
|
+
variables = []
|
|
212
|
+
_variables = d.pop("variables")
|
|
213
|
+
for variables_item_data in _variables:
|
|
214
|
+
variables_item = AcquisitionVariable.from_dict(variables_item_data)
|
|
215
|
+
|
|
216
|
+
variables.append(variables_item)
|
|
217
|
+
|
|
218
|
+
def _parse_duration_minutes(data: object) -> int | None:
|
|
219
|
+
if data is None:
|
|
220
|
+
return data
|
|
221
|
+
return cast(int | None, data)
|
|
222
|
+
|
|
223
|
+
duration_minutes = _parse_duration_minutes(d.pop("duration_minutes"))
|
|
224
|
+
|
|
225
|
+
def _parse_local_start_time(data: object) -> None | str:
|
|
226
|
+
if data is None:
|
|
227
|
+
return data
|
|
228
|
+
return cast(None | str, data)
|
|
229
|
+
|
|
230
|
+
local_start_time = _parse_local_start_time(d.pop("local_start_time"))
|
|
231
|
+
|
|
232
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
233
|
+
|
|
234
|
+
created_by = d.pop("created_by")
|
|
235
|
+
|
|
236
|
+
def _parse_created_by_object_id(data: object) -> None | str:
|
|
237
|
+
if data is None:
|
|
238
|
+
return data
|
|
239
|
+
return cast(None | str, data)
|
|
240
|
+
|
|
241
|
+
created_by_object_id = _parse_created_by_object_id(d.pop("created_by_object_id"))
|
|
242
|
+
|
|
243
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
244
|
+
|
|
245
|
+
updated_by = d.pop("updated_by")
|
|
246
|
+
|
|
247
|
+
def _parse_archived_at(data: object) -> datetime.datetime | None:
|
|
248
|
+
if data is None:
|
|
249
|
+
return data
|
|
250
|
+
try:
|
|
251
|
+
if not isinstance(data, str):
|
|
252
|
+
raise TypeError()
|
|
253
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
254
|
+
|
|
255
|
+
return componentsschemas_instant_nullable_type_1
|
|
256
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
257
|
+
pass
|
|
258
|
+
return cast(datetime.datetime | None, data)
|
|
259
|
+
|
|
260
|
+
archived_at = _parse_archived_at(d.pop("archived_at"))
|
|
261
|
+
|
|
262
|
+
version = d.pop("version")
|
|
263
|
+
|
|
264
|
+
template_response = cls(
|
|
265
|
+
id=id,
|
|
266
|
+
name=name,
|
|
267
|
+
subject_id=subject_id,
|
|
268
|
+
instrument_id=instrument_id,
|
|
269
|
+
project_id=project_id,
|
|
270
|
+
operator_instructions=operator_instructions,
|
|
271
|
+
people=people,
|
|
272
|
+
type_refs=type_refs,
|
|
273
|
+
variables=variables,
|
|
274
|
+
duration_minutes=duration_minutes,
|
|
275
|
+
local_start_time=local_start_time,
|
|
276
|
+
created_at=created_at,
|
|
277
|
+
created_by=created_by,
|
|
278
|
+
created_by_object_id=created_by_object_id,
|
|
279
|
+
updated_at=updated_at,
|
|
280
|
+
updated_by=updated_by,
|
|
281
|
+
archived_at=archived_at,
|
|
282
|
+
version=version,
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
template_response.additional_properties = d
|
|
286
|
+
return template_response
|
|
287
|
+
|
|
288
|
+
@property
|
|
289
|
+
def additional_keys(self) -> list[str]:
|
|
290
|
+
return list(self.additional_properties.keys())
|
|
291
|
+
|
|
292
|
+
def __getitem__(self, key: str) -> Any:
|
|
293
|
+
return self.additional_properties[key]
|
|
294
|
+
|
|
295
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
296
|
+
self.additional_properties[key] = value
|
|
297
|
+
|
|
298
|
+
def __delitem__(self, key: str) -> None:
|
|
299
|
+
del self.additional_properties[key]
|
|
300
|
+
|
|
301
|
+
def __contains__(self, key: str) -> bool:
|
|
302
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,235 @@
|
|
|
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 ..types import UNSET, Unset
|
|
12
|
+
from typing import cast
|
|
13
|
+
import datetime
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
17
|
+
from ..models.person_assignment import PersonAssignment
|
|
18
|
+
from ..models.settings_selector import SettingsSelector
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="UpdateScheduledAcquisitionRequest")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class UpdateScheduledAcquisitionRequest:
|
|
26
|
+
"""Change a scheduled acquisition. Every field except `expected_version`
|
|
27
|
+
is optional: an omitted field is left unchanged. `people`,
|
|
28
|
+
`type_refs` and `variables` replace the whole list when present.
|
|
29
|
+
|
|
30
|
+
Attributes:
|
|
31
|
+
expected_version (int): The `version` the client last read. A stale value is rejected with 409
|
|
32
|
+
`version_conflict`.
|
|
33
|
+
subject_id (str | Unset): New subject; validated against the metadata service. The type refs (sent or kept) must
|
|
34
|
+
be valid for it, so a
|
|
35
|
+
pinned settings version of the old subject has to be replaced in the same edit. Rejected with 409
|
|
36
|
+
`acquisition_has_runs` once a run exists.
|
|
37
|
+
instrument_id (str | Unset): New instrument; must be in the synced list. Rejected with 409
|
|
38
|
+
`acquisition_has_runs` once a run exists.
|
|
39
|
+
project_id (str | Unset): New project; must be in the synced list.
|
|
40
|
+
scheduled_start (datetime.datetime | Unset): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
41
|
+
scheduled_end (datetime.datetime | None | Unset):
|
|
42
|
+
operator_instructions (str | Unset): New operator text; an empty string clears it.
|
|
43
|
+
people (list[PersonAssignment] | Unset): Replaces the people list.
|
|
44
|
+
type_refs (list[SettingsSelector] | Unset): Replaces the type refs. Rejected with 409 `acquisition_has_runs`
|
|
45
|
+
once a run exists.
|
|
46
|
+
variables (list[AcquisitionVariable] | Unset): Replaces the variables.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
expected_version: int
|
|
50
|
+
subject_id: str | Unset = UNSET
|
|
51
|
+
instrument_id: str | Unset = UNSET
|
|
52
|
+
project_id: str | Unset = UNSET
|
|
53
|
+
scheduled_start: datetime.datetime | Unset = UNSET
|
|
54
|
+
scheduled_end: datetime.datetime | None | Unset = UNSET
|
|
55
|
+
operator_instructions: str | Unset = UNSET
|
|
56
|
+
people: list[PersonAssignment] | Unset = UNSET
|
|
57
|
+
type_refs: list[SettingsSelector] | Unset = UNSET
|
|
58
|
+
variables: list[AcquisitionVariable] | Unset = UNSET
|
|
59
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> dict[str, Any]:
|
|
62
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
63
|
+
from ..models.person_assignment import PersonAssignment
|
|
64
|
+
from ..models.settings_selector import SettingsSelector
|
|
65
|
+
|
|
66
|
+
expected_version = self.expected_version
|
|
67
|
+
|
|
68
|
+
subject_id = self.subject_id
|
|
69
|
+
|
|
70
|
+
instrument_id = self.instrument_id
|
|
71
|
+
|
|
72
|
+
project_id = self.project_id
|
|
73
|
+
|
|
74
|
+
scheduled_start: str | Unset = UNSET
|
|
75
|
+
if not isinstance(self.scheduled_start, Unset):
|
|
76
|
+
scheduled_start = self.scheduled_start.isoformat()
|
|
77
|
+
|
|
78
|
+
scheduled_end: None | str | Unset
|
|
79
|
+
if isinstance(self.scheduled_end, Unset):
|
|
80
|
+
scheduled_end = UNSET
|
|
81
|
+
elif isinstance(self.scheduled_end, datetime.datetime):
|
|
82
|
+
scheduled_end = self.scheduled_end.isoformat()
|
|
83
|
+
else:
|
|
84
|
+
scheduled_end = self.scheduled_end
|
|
85
|
+
|
|
86
|
+
operator_instructions = self.operator_instructions
|
|
87
|
+
|
|
88
|
+
people: list[dict[str, Any]] | Unset = UNSET
|
|
89
|
+
if not isinstance(self.people, Unset):
|
|
90
|
+
people = []
|
|
91
|
+
for people_item_data in self.people:
|
|
92
|
+
people_item = people_item_data.to_dict()
|
|
93
|
+
people.append(people_item)
|
|
94
|
+
|
|
95
|
+
type_refs: list[dict[str, Any]] | Unset = UNSET
|
|
96
|
+
if not isinstance(self.type_refs, Unset):
|
|
97
|
+
type_refs = []
|
|
98
|
+
for type_refs_item_data in self.type_refs:
|
|
99
|
+
type_refs_item = type_refs_item_data.to_dict()
|
|
100
|
+
type_refs.append(type_refs_item)
|
|
101
|
+
|
|
102
|
+
variables: list[dict[str, Any]] | Unset = UNSET
|
|
103
|
+
if not isinstance(self.variables, Unset):
|
|
104
|
+
variables = []
|
|
105
|
+
for variables_item_data in self.variables:
|
|
106
|
+
variables_item = variables_item_data.to_dict()
|
|
107
|
+
variables.append(variables_item)
|
|
108
|
+
|
|
109
|
+
field_dict: dict[str, Any] = {}
|
|
110
|
+
field_dict.update(self.additional_properties)
|
|
111
|
+
field_dict.update(
|
|
112
|
+
{
|
|
113
|
+
"expected_version": expected_version,
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
if subject_id is not UNSET:
|
|
117
|
+
field_dict["subject_id"] = subject_id
|
|
118
|
+
if instrument_id is not UNSET:
|
|
119
|
+
field_dict["instrument_id"] = instrument_id
|
|
120
|
+
if project_id is not UNSET:
|
|
121
|
+
field_dict["project_id"] = project_id
|
|
122
|
+
if scheduled_start is not UNSET:
|
|
123
|
+
field_dict["scheduled_start"] = scheduled_start
|
|
124
|
+
if scheduled_end is not UNSET:
|
|
125
|
+
field_dict["scheduled_end"] = scheduled_end
|
|
126
|
+
if operator_instructions is not UNSET:
|
|
127
|
+
field_dict["operator_instructions"] = operator_instructions
|
|
128
|
+
if people is not UNSET:
|
|
129
|
+
field_dict["people"] = people
|
|
130
|
+
if type_refs is not UNSET:
|
|
131
|
+
field_dict["type_refs"] = type_refs
|
|
132
|
+
if variables is not UNSET:
|
|
133
|
+
field_dict["variables"] = variables
|
|
134
|
+
|
|
135
|
+
return field_dict
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
139
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
140
|
+
from ..models.person_assignment import PersonAssignment
|
|
141
|
+
from ..models.settings_selector import SettingsSelector
|
|
142
|
+
|
|
143
|
+
d = dict(src_dict)
|
|
144
|
+
expected_version = d.pop("expected_version")
|
|
145
|
+
|
|
146
|
+
subject_id = d.pop("subject_id", UNSET)
|
|
147
|
+
|
|
148
|
+
instrument_id = d.pop("instrument_id", UNSET)
|
|
149
|
+
|
|
150
|
+
project_id = d.pop("project_id", UNSET)
|
|
151
|
+
|
|
152
|
+
_scheduled_start = d.pop("scheduled_start", UNSET)
|
|
153
|
+
scheduled_start: datetime.datetime | Unset
|
|
154
|
+
if isinstance(_scheduled_start, Unset):
|
|
155
|
+
scheduled_start = UNSET
|
|
156
|
+
else:
|
|
157
|
+
scheduled_start = datetime.datetime.fromisoformat(_scheduled_start)
|
|
158
|
+
|
|
159
|
+
def _parse_scheduled_end(data: object) -> datetime.datetime | None | Unset:
|
|
160
|
+
if data is None:
|
|
161
|
+
return data
|
|
162
|
+
if isinstance(data, Unset):
|
|
163
|
+
return data
|
|
164
|
+
try:
|
|
165
|
+
if not isinstance(data, str):
|
|
166
|
+
raise TypeError()
|
|
167
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
168
|
+
|
|
169
|
+
return componentsschemas_instant_nullable_type_1
|
|
170
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
171
|
+
pass
|
|
172
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
173
|
+
|
|
174
|
+
scheduled_end = _parse_scheduled_end(d.pop("scheduled_end", UNSET))
|
|
175
|
+
|
|
176
|
+
operator_instructions = d.pop("operator_instructions", UNSET)
|
|
177
|
+
|
|
178
|
+
_people = d.pop("people", UNSET)
|
|
179
|
+
people: list[PersonAssignment] | Unset = UNSET
|
|
180
|
+
if _people is not UNSET:
|
|
181
|
+
people = []
|
|
182
|
+
for people_item_data in _people:
|
|
183
|
+
people_item = PersonAssignment.from_dict(people_item_data)
|
|
184
|
+
|
|
185
|
+
people.append(people_item)
|
|
186
|
+
|
|
187
|
+
_type_refs = d.pop("type_refs", UNSET)
|
|
188
|
+
type_refs: list[SettingsSelector] | Unset = UNSET
|
|
189
|
+
if _type_refs is not UNSET:
|
|
190
|
+
type_refs = []
|
|
191
|
+
for type_refs_item_data in _type_refs:
|
|
192
|
+
type_refs_item = SettingsSelector.from_dict(type_refs_item_data)
|
|
193
|
+
|
|
194
|
+
type_refs.append(type_refs_item)
|
|
195
|
+
|
|
196
|
+
_variables = d.pop("variables", UNSET)
|
|
197
|
+
variables: list[AcquisitionVariable] | Unset = UNSET
|
|
198
|
+
if _variables is not UNSET:
|
|
199
|
+
variables = []
|
|
200
|
+
for variables_item_data in _variables:
|
|
201
|
+
variables_item = AcquisitionVariable.from_dict(variables_item_data)
|
|
202
|
+
|
|
203
|
+
variables.append(variables_item)
|
|
204
|
+
|
|
205
|
+
update_scheduled_acquisition_request = cls(
|
|
206
|
+
expected_version=expected_version,
|
|
207
|
+
subject_id=subject_id,
|
|
208
|
+
instrument_id=instrument_id,
|
|
209
|
+
project_id=project_id,
|
|
210
|
+
scheduled_start=scheduled_start,
|
|
211
|
+
scheduled_end=scheduled_end,
|
|
212
|
+
operator_instructions=operator_instructions,
|
|
213
|
+
people=people,
|
|
214
|
+
type_refs=type_refs,
|
|
215
|
+
variables=variables,
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
update_scheduled_acquisition_request.additional_properties = d
|
|
219
|
+
return update_scheduled_acquisition_request
|
|
220
|
+
|
|
221
|
+
@property
|
|
222
|
+
def additional_keys(self) -> list[str]:
|
|
223
|
+
return list(self.additional_properties.keys())
|
|
224
|
+
|
|
225
|
+
def __getitem__(self, key: str) -> Any:
|
|
226
|
+
return self.additional_properties[key]
|
|
227
|
+
|
|
228
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
229
|
+
self.additional_properties[key] = value
|
|
230
|
+
|
|
231
|
+
def __delitem__(self, key: str) -> None:
|
|
232
|
+
del self.additional_properties[key]
|
|
233
|
+
|
|
234
|
+
def __contains__(self, key: str) -> bool:
|
|
235
|
+
return key in self.additional_properties
|