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,265 @@
|
|
|
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="CreateScheduledAcquisitionRequest")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class CreateScheduledAcquisitionRequest:
|
|
26
|
+
"""Plan one acquisition.
|
|
27
|
+
|
|
28
|
+
Attributes:
|
|
29
|
+
subject_id (str): Subject; validated against the metadata service.
|
|
30
|
+
instrument_id (str): Instrument (MPE comp_id); must be in the synced list.
|
|
31
|
+
project_id (str): Project; must be in the synced list.
|
|
32
|
+
scheduled_start (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
33
|
+
scheduled_end (datetime.datetime | None | Unset): Planned end, after the start; null when open-ended.
|
|
34
|
+
operator_instructions (str | Unset): Free text for the operator. Default: ''.
|
|
35
|
+
people (list[PersonAssignment] | None | Unset): People and their roles.
|
|
36
|
+
type_refs (list[SettingsSelector] | None | Unset): How each acquisition type's settings are chosen; at most one
|
|
37
|
+
per type.
|
|
38
|
+
variables (list[AcquisitionVariable] | None | Unset): Key/value inputs for the rig or operator.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
subject_id: str
|
|
42
|
+
instrument_id: str
|
|
43
|
+
project_id: str
|
|
44
|
+
scheduled_start: datetime.datetime
|
|
45
|
+
scheduled_end: datetime.datetime | None | Unset = UNSET
|
|
46
|
+
operator_instructions: str | Unset = ""
|
|
47
|
+
people: list[PersonAssignment] | None | Unset = UNSET
|
|
48
|
+
type_refs: list[SettingsSelector] | None | Unset = UNSET
|
|
49
|
+
variables: list[AcquisitionVariable] | None | Unset = UNSET
|
|
50
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
54
|
+
from ..models.person_assignment import PersonAssignment
|
|
55
|
+
from ..models.settings_selector import SettingsSelector
|
|
56
|
+
|
|
57
|
+
subject_id = self.subject_id
|
|
58
|
+
|
|
59
|
+
instrument_id = self.instrument_id
|
|
60
|
+
|
|
61
|
+
project_id = self.project_id
|
|
62
|
+
|
|
63
|
+
scheduled_start = self.scheduled_start.isoformat()
|
|
64
|
+
|
|
65
|
+
scheduled_end: None | str | Unset
|
|
66
|
+
if isinstance(self.scheduled_end, Unset):
|
|
67
|
+
scheduled_end = UNSET
|
|
68
|
+
elif isinstance(self.scheduled_end, datetime.datetime):
|
|
69
|
+
scheduled_end = self.scheduled_end.isoformat()
|
|
70
|
+
else:
|
|
71
|
+
scheduled_end = self.scheduled_end
|
|
72
|
+
|
|
73
|
+
operator_instructions = self.operator_instructions
|
|
74
|
+
|
|
75
|
+
people: list[dict[str, Any]] | None | Unset
|
|
76
|
+
if isinstance(self.people, Unset):
|
|
77
|
+
people = UNSET
|
|
78
|
+
elif isinstance(self.people, list):
|
|
79
|
+
people = []
|
|
80
|
+
for people_type_1_item_data in self.people:
|
|
81
|
+
people_type_1_item = people_type_1_item_data.to_dict()
|
|
82
|
+
people.append(people_type_1_item)
|
|
83
|
+
|
|
84
|
+
else:
|
|
85
|
+
people = self.people
|
|
86
|
+
|
|
87
|
+
type_refs: list[dict[str, Any]] | None | Unset
|
|
88
|
+
if isinstance(self.type_refs, Unset):
|
|
89
|
+
type_refs = UNSET
|
|
90
|
+
elif isinstance(self.type_refs, list):
|
|
91
|
+
type_refs = []
|
|
92
|
+
for type_refs_type_1_item_data in self.type_refs:
|
|
93
|
+
type_refs_type_1_item = type_refs_type_1_item_data.to_dict()
|
|
94
|
+
type_refs.append(type_refs_type_1_item)
|
|
95
|
+
|
|
96
|
+
else:
|
|
97
|
+
type_refs = self.type_refs
|
|
98
|
+
|
|
99
|
+
variables: list[dict[str, Any]] | None | Unset
|
|
100
|
+
if isinstance(self.variables, Unset):
|
|
101
|
+
variables = UNSET
|
|
102
|
+
elif isinstance(self.variables, list):
|
|
103
|
+
variables = []
|
|
104
|
+
for variables_type_1_item_data in self.variables:
|
|
105
|
+
variables_type_1_item = variables_type_1_item_data.to_dict()
|
|
106
|
+
variables.append(variables_type_1_item)
|
|
107
|
+
|
|
108
|
+
else:
|
|
109
|
+
variables = self.variables
|
|
110
|
+
|
|
111
|
+
field_dict: dict[str, Any] = {}
|
|
112
|
+
field_dict.update(self.additional_properties)
|
|
113
|
+
field_dict.update(
|
|
114
|
+
{
|
|
115
|
+
"subject_id": subject_id,
|
|
116
|
+
"instrument_id": instrument_id,
|
|
117
|
+
"project_id": project_id,
|
|
118
|
+
"scheduled_start": scheduled_start,
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
if scheduled_end is not UNSET:
|
|
122
|
+
field_dict["scheduled_end"] = scheduled_end
|
|
123
|
+
if operator_instructions is not UNSET:
|
|
124
|
+
field_dict["operator_instructions"] = operator_instructions
|
|
125
|
+
if people is not UNSET:
|
|
126
|
+
field_dict["people"] = people
|
|
127
|
+
if type_refs is not UNSET:
|
|
128
|
+
field_dict["type_refs"] = type_refs
|
|
129
|
+
if variables is not UNSET:
|
|
130
|
+
field_dict["variables"] = variables
|
|
131
|
+
|
|
132
|
+
return field_dict
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
136
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
137
|
+
from ..models.person_assignment import PersonAssignment
|
|
138
|
+
from ..models.settings_selector import SettingsSelector
|
|
139
|
+
|
|
140
|
+
d = dict(src_dict)
|
|
141
|
+
subject_id = d.pop("subject_id")
|
|
142
|
+
|
|
143
|
+
instrument_id = d.pop("instrument_id")
|
|
144
|
+
|
|
145
|
+
project_id = d.pop("project_id")
|
|
146
|
+
|
|
147
|
+
scheduled_start = datetime.datetime.fromisoformat(d.pop("scheduled_start"))
|
|
148
|
+
|
|
149
|
+
def _parse_scheduled_end(data: object) -> datetime.datetime | None | Unset:
|
|
150
|
+
if data is None:
|
|
151
|
+
return data
|
|
152
|
+
if isinstance(data, Unset):
|
|
153
|
+
return data
|
|
154
|
+
try:
|
|
155
|
+
if not isinstance(data, str):
|
|
156
|
+
raise TypeError()
|
|
157
|
+
scheduled_end_type_1 = datetime.datetime.fromisoformat(data)
|
|
158
|
+
|
|
159
|
+
return scheduled_end_type_1
|
|
160
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
161
|
+
pass
|
|
162
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
163
|
+
|
|
164
|
+
scheduled_end = _parse_scheduled_end(d.pop("scheduled_end", UNSET))
|
|
165
|
+
|
|
166
|
+
operator_instructions = d.pop("operator_instructions", UNSET)
|
|
167
|
+
|
|
168
|
+
def _parse_people(data: object) -> list[PersonAssignment] | None | Unset:
|
|
169
|
+
if data is None:
|
|
170
|
+
return data
|
|
171
|
+
if isinstance(data, Unset):
|
|
172
|
+
return data
|
|
173
|
+
try:
|
|
174
|
+
if not isinstance(data, list):
|
|
175
|
+
raise TypeError()
|
|
176
|
+
people_type_1 = []
|
|
177
|
+
_people_type_1 = data
|
|
178
|
+
for people_type_1_item_data in _people_type_1:
|
|
179
|
+
people_type_1_item = PersonAssignment.from_dict(people_type_1_item_data)
|
|
180
|
+
|
|
181
|
+
people_type_1.append(people_type_1_item)
|
|
182
|
+
|
|
183
|
+
return people_type_1
|
|
184
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
185
|
+
pass
|
|
186
|
+
return cast(list[PersonAssignment] | None | Unset, data)
|
|
187
|
+
|
|
188
|
+
people = _parse_people(d.pop("people", UNSET))
|
|
189
|
+
|
|
190
|
+
def _parse_type_refs(data: object) -> list[SettingsSelector] | None | Unset:
|
|
191
|
+
if data is None:
|
|
192
|
+
return data
|
|
193
|
+
if isinstance(data, Unset):
|
|
194
|
+
return data
|
|
195
|
+
try:
|
|
196
|
+
if not isinstance(data, list):
|
|
197
|
+
raise TypeError()
|
|
198
|
+
type_refs_type_1 = []
|
|
199
|
+
_type_refs_type_1 = data
|
|
200
|
+
for type_refs_type_1_item_data in _type_refs_type_1:
|
|
201
|
+
type_refs_type_1_item = SettingsSelector.from_dict(type_refs_type_1_item_data)
|
|
202
|
+
|
|
203
|
+
type_refs_type_1.append(type_refs_type_1_item)
|
|
204
|
+
|
|
205
|
+
return type_refs_type_1
|
|
206
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
207
|
+
pass
|
|
208
|
+
return cast(list[SettingsSelector] | None | Unset, data)
|
|
209
|
+
|
|
210
|
+
type_refs = _parse_type_refs(d.pop("type_refs", UNSET))
|
|
211
|
+
|
|
212
|
+
def _parse_variables(data: object) -> list[AcquisitionVariable] | None | Unset:
|
|
213
|
+
if data is None:
|
|
214
|
+
return data
|
|
215
|
+
if isinstance(data, Unset):
|
|
216
|
+
return data
|
|
217
|
+
try:
|
|
218
|
+
if not isinstance(data, list):
|
|
219
|
+
raise TypeError()
|
|
220
|
+
variables_type_1 = []
|
|
221
|
+
_variables_type_1 = data
|
|
222
|
+
for variables_type_1_item_data in _variables_type_1:
|
|
223
|
+
variables_type_1_item = AcquisitionVariable.from_dict(
|
|
224
|
+
variables_type_1_item_data
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
variables_type_1.append(variables_type_1_item)
|
|
228
|
+
|
|
229
|
+
return variables_type_1
|
|
230
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
231
|
+
pass
|
|
232
|
+
return cast(list[AcquisitionVariable] | None | Unset, data)
|
|
233
|
+
|
|
234
|
+
variables = _parse_variables(d.pop("variables", UNSET))
|
|
235
|
+
|
|
236
|
+
create_scheduled_acquisition_request = cls(
|
|
237
|
+
subject_id=subject_id,
|
|
238
|
+
instrument_id=instrument_id,
|
|
239
|
+
project_id=project_id,
|
|
240
|
+
scheduled_start=scheduled_start,
|
|
241
|
+
scheduled_end=scheduled_end,
|
|
242
|
+
operator_instructions=operator_instructions,
|
|
243
|
+
people=people,
|
|
244
|
+
type_refs=type_refs,
|
|
245
|
+
variables=variables,
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
create_scheduled_acquisition_request.additional_properties = d
|
|
249
|
+
return create_scheduled_acquisition_request
|
|
250
|
+
|
|
251
|
+
@property
|
|
252
|
+
def additional_keys(self) -> list[str]:
|
|
253
|
+
return list(self.additional_properties.keys())
|
|
254
|
+
|
|
255
|
+
def __getitem__(self, key: str) -> Any:
|
|
256
|
+
return self.additional_properties[key]
|
|
257
|
+
|
|
258
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
259
|
+
self.additional_properties[key] = value
|
|
260
|
+
|
|
261
|
+
def __delitem__(self, key: str) -> None:
|
|
262
|
+
del self.additional_properties[key]
|
|
263
|
+
|
|
264
|
+
def __contains__(self, key: str) -> bool:
|
|
265
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,323 @@
|
|
|
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
|
+
|
|
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="CreateTemplateRequest")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class CreateTemplateRequest:
|
|
25
|
+
"""A named set of optional scheduling defaults. Using a template is a client-side
|
|
26
|
+
prefill: the form copies the defaults, the user adjusts them, and the normal
|
|
27
|
+
create request is validated as usual. Nothing refers back to the template, so
|
|
28
|
+
editing it affects only later uses.
|
|
29
|
+
|
|
30
|
+
Attributes:
|
|
31
|
+
name (str): Unique among non-archived templates, ignoring case and surrounding spaces.
|
|
32
|
+
subject_id (None | str | Unset): Default subject; not validated until a template is used.
|
|
33
|
+
instrument_id (None | str | Unset): Default instrument; validated against the synced list.
|
|
34
|
+
project_id (None | str | Unset): Default project; validated against the synced list.
|
|
35
|
+
operator_instructions (None | str | Unset): Default operator text.
|
|
36
|
+
people (list[PersonAssignment] | None | Unset): Default people and roles.
|
|
37
|
+
type_refs (list[SettingsSelector] | None | Unset): Default settings selectors; at most one per acquisition type.
|
|
38
|
+
variables (list[AcquisitionVariable] | None | Unset): Default variables.
|
|
39
|
+
duration_minutes (int | None | Unset): Default length of an acquisition in minutes.
|
|
40
|
+
local_start_time (None | str | Unset): Default wall-clock start time of day.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
name: str
|
|
44
|
+
subject_id: None | str | Unset = UNSET
|
|
45
|
+
instrument_id: None | str | Unset = UNSET
|
|
46
|
+
project_id: None | str | Unset = UNSET
|
|
47
|
+
operator_instructions: None | str | Unset = UNSET
|
|
48
|
+
people: list[PersonAssignment] | None | Unset = UNSET
|
|
49
|
+
type_refs: list[SettingsSelector] | None | Unset = UNSET
|
|
50
|
+
variables: list[AcquisitionVariable] | None | Unset = UNSET
|
|
51
|
+
duration_minutes: int | None | Unset = UNSET
|
|
52
|
+
local_start_time: None | str | Unset = UNSET
|
|
53
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> dict[str, Any]:
|
|
56
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
57
|
+
from ..models.person_assignment import PersonAssignment
|
|
58
|
+
from ..models.settings_selector import SettingsSelector
|
|
59
|
+
|
|
60
|
+
name = self.name
|
|
61
|
+
|
|
62
|
+
subject_id: None | str | Unset
|
|
63
|
+
if isinstance(self.subject_id, Unset):
|
|
64
|
+
subject_id = UNSET
|
|
65
|
+
else:
|
|
66
|
+
subject_id = self.subject_id
|
|
67
|
+
|
|
68
|
+
instrument_id: None | str | Unset
|
|
69
|
+
if isinstance(self.instrument_id, Unset):
|
|
70
|
+
instrument_id = UNSET
|
|
71
|
+
else:
|
|
72
|
+
instrument_id = self.instrument_id
|
|
73
|
+
|
|
74
|
+
project_id: None | str | Unset
|
|
75
|
+
if isinstance(self.project_id, Unset):
|
|
76
|
+
project_id = UNSET
|
|
77
|
+
else:
|
|
78
|
+
project_id = self.project_id
|
|
79
|
+
|
|
80
|
+
operator_instructions: None | str | Unset
|
|
81
|
+
if isinstance(self.operator_instructions, Unset):
|
|
82
|
+
operator_instructions = UNSET
|
|
83
|
+
else:
|
|
84
|
+
operator_instructions = self.operator_instructions
|
|
85
|
+
|
|
86
|
+
people: list[dict[str, Any]] | None | Unset
|
|
87
|
+
if isinstance(self.people, Unset):
|
|
88
|
+
people = UNSET
|
|
89
|
+
elif isinstance(self.people, list):
|
|
90
|
+
people = []
|
|
91
|
+
for people_type_1_item_data in self.people:
|
|
92
|
+
people_type_1_item = people_type_1_item_data.to_dict()
|
|
93
|
+
people.append(people_type_1_item)
|
|
94
|
+
|
|
95
|
+
else:
|
|
96
|
+
people = self.people
|
|
97
|
+
|
|
98
|
+
type_refs: list[dict[str, Any]] | None | Unset
|
|
99
|
+
if isinstance(self.type_refs, Unset):
|
|
100
|
+
type_refs = UNSET
|
|
101
|
+
elif isinstance(self.type_refs, list):
|
|
102
|
+
type_refs = []
|
|
103
|
+
for type_refs_type_1_item_data in self.type_refs:
|
|
104
|
+
type_refs_type_1_item = type_refs_type_1_item_data.to_dict()
|
|
105
|
+
type_refs.append(type_refs_type_1_item)
|
|
106
|
+
|
|
107
|
+
else:
|
|
108
|
+
type_refs = self.type_refs
|
|
109
|
+
|
|
110
|
+
variables: list[dict[str, Any]] | None | Unset
|
|
111
|
+
if isinstance(self.variables, Unset):
|
|
112
|
+
variables = UNSET
|
|
113
|
+
elif isinstance(self.variables, list):
|
|
114
|
+
variables = []
|
|
115
|
+
for variables_type_1_item_data in self.variables:
|
|
116
|
+
variables_type_1_item = variables_type_1_item_data.to_dict()
|
|
117
|
+
variables.append(variables_type_1_item)
|
|
118
|
+
|
|
119
|
+
else:
|
|
120
|
+
variables = self.variables
|
|
121
|
+
|
|
122
|
+
duration_minutes: int | None | Unset
|
|
123
|
+
if isinstance(self.duration_minutes, Unset):
|
|
124
|
+
duration_minutes = UNSET
|
|
125
|
+
else:
|
|
126
|
+
duration_minutes = self.duration_minutes
|
|
127
|
+
|
|
128
|
+
local_start_time: None | str | Unset
|
|
129
|
+
if isinstance(self.local_start_time, Unset):
|
|
130
|
+
local_start_time = UNSET
|
|
131
|
+
else:
|
|
132
|
+
local_start_time = self.local_start_time
|
|
133
|
+
|
|
134
|
+
field_dict: dict[str, Any] = {}
|
|
135
|
+
field_dict.update(self.additional_properties)
|
|
136
|
+
field_dict.update(
|
|
137
|
+
{
|
|
138
|
+
"name": name,
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
if subject_id is not UNSET:
|
|
142
|
+
field_dict["subject_id"] = subject_id
|
|
143
|
+
if instrument_id is not UNSET:
|
|
144
|
+
field_dict["instrument_id"] = instrument_id
|
|
145
|
+
if project_id is not UNSET:
|
|
146
|
+
field_dict["project_id"] = project_id
|
|
147
|
+
if operator_instructions is not UNSET:
|
|
148
|
+
field_dict["operator_instructions"] = operator_instructions
|
|
149
|
+
if people is not UNSET:
|
|
150
|
+
field_dict["people"] = people
|
|
151
|
+
if type_refs is not UNSET:
|
|
152
|
+
field_dict["type_refs"] = type_refs
|
|
153
|
+
if variables is not UNSET:
|
|
154
|
+
field_dict["variables"] = variables
|
|
155
|
+
if duration_minutes is not UNSET:
|
|
156
|
+
field_dict["duration_minutes"] = duration_minutes
|
|
157
|
+
if local_start_time is not UNSET:
|
|
158
|
+
field_dict["local_start_time"] = local_start_time
|
|
159
|
+
|
|
160
|
+
return field_dict
|
|
161
|
+
|
|
162
|
+
@classmethod
|
|
163
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
164
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
165
|
+
from ..models.person_assignment import PersonAssignment
|
|
166
|
+
from ..models.settings_selector import SettingsSelector
|
|
167
|
+
|
|
168
|
+
d = dict(src_dict)
|
|
169
|
+
name = d.pop("name")
|
|
170
|
+
|
|
171
|
+
def _parse_subject_id(data: object) -> None | str | Unset:
|
|
172
|
+
if data is None:
|
|
173
|
+
return data
|
|
174
|
+
if isinstance(data, Unset):
|
|
175
|
+
return data
|
|
176
|
+
return cast(None | str | Unset, data)
|
|
177
|
+
|
|
178
|
+
subject_id = _parse_subject_id(d.pop("subject_id", UNSET))
|
|
179
|
+
|
|
180
|
+
def _parse_instrument_id(data: object) -> None | str | Unset:
|
|
181
|
+
if data is None:
|
|
182
|
+
return data
|
|
183
|
+
if isinstance(data, Unset):
|
|
184
|
+
return data
|
|
185
|
+
return cast(None | str | Unset, data)
|
|
186
|
+
|
|
187
|
+
instrument_id = _parse_instrument_id(d.pop("instrument_id", UNSET))
|
|
188
|
+
|
|
189
|
+
def _parse_project_id(data: object) -> None | str | Unset:
|
|
190
|
+
if data is None:
|
|
191
|
+
return data
|
|
192
|
+
if isinstance(data, Unset):
|
|
193
|
+
return data
|
|
194
|
+
return cast(None | str | Unset, data)
|
|
195
|
+
|
|
196
|
+
project_id = _parse_project_id(d.pop("project_id", UNSET))
|
|
197
|
+
|
|
198
|
+
def _parse_operator_instructions(data: object) -> None | str | Unset:
|
|
199
|
+
if data is None:
|
|
200
|
+
return data
|
|
201
|
+
if isinstance(data, Unset):
|
|
202
|
+
return data
|
|
203
|
+
return cast(None | str | Unset, data)
|
|
204
|
+
|
|
205
|
+
operator_instructions = _parse_operator_instructions(d.pop("operator_instructions", UNSET))
|
|
206
|
+
|
|
207
|
+
def _parse_people(data: object) -> list[PersonAssignment] | None | Unset:
|
|
208
|
+
if data is None:
|
|
209
|
+
return data
|
|
210
|
+
if isinstance(data, Unset):
|
|
211
|
+
return data
|
|
212
|
+
try:
|
|
213
|
+
if not isinstance(data, list):
|
|
214
|
+
raise TypeError()
|
|
215
|
+
people_type_1 = []
|
|
216
|
+
_people_type_1 = data
|
|
217
|
+
for people_type_1_item_data in _people_type_1:
|
|
218
|
+
people_type_1_item = PersonAssignment.from_dict(people_type_1_item_data)
|
|
219
|
+
|
|
220
|
+
people_type_1.append(people_type_1_item)
|
|
221
|
+
|
|
222
|
+
return people_type_1
|
|
223
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
224
|
+
pass
|
|
225
|
+
return cast(list[PersonAssignment] | None | Unset, data)
|
|
226
|
+
|
|
227
|
+
people = _parse_people(d.pop("people", UNSET))
|
|
228
|
+
|
|
229
|
+
def _parse_type_refs(data: object) -> list[SettingsSelector] | None | Unset:
|
|
230
|
+
if data is None:
|
|
231
|
+
return data
|
|
232
|
+
if isinstance(data, Unset):
|
|
233
|
+
return data
|
|
234
|
+
try:
|
|
235
|
+
if not isinstance(data, list):
|
|
236
|
+
raise TypeError()
|
|
237
|
+
type_refs_type_1 = []
|
|
238
|
+
_type_refs_type_1 = data
|
|
239
|
+
for type_refs_type_1_item_data in _type_refs_type_1:
|
|
240
|
+
type_refs_type_1_item = SettingsSelector.from_dict(type_refs_type_1_item_data)
|
|
241
|
+
|
|
242
|
+
type_refs_type_1.append(type_refs_type_1_item)
|
|
243
|
+
|
|
244
|
+
return type_refs_type_1
|
|
245
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
246
|
+
pass
|
|
247
|
+
return cast(list[SettingsSelector] | None | Unset, data)
|
|
248
|
+
|
|
249
|
+
type_refs = _parse_type_refs(d.pop("type_refs", UNSET))
|
|
250
|
+
|
|
251
|
+
def _parse_variables(data: object) -> list[AcquisitionVariable] | None | Unset:
|
|
252
|
+
if data is None:
|
|
253
|
+
return data
|
|
254
|
+
if isinstance(data, Unset):
|
|
255
|
+
return data
|
|
256
|
+
try:
|
|
257
|
+
if not isinstance(data, list):
|
|
258
|
+
raise TypeError()
|
|
259
|
+
variables_type_1 = []
|
|
260
|
+
_variables_type_1 = data
|
|
261
|
+
for variables_type_1_item_data in _variables_type_1:
|
|
262
|
+
variables_type_1_item = AcquisitionVariable.from_dict(
|
|
263
|
+
variables_type_1_item_data
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
variables_type_1.append(variables_type_1_item)
|
|
267
|
+
|
|
268
|
+
return variables_type_1
|
|
269
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
270
|
+
pass
|
|
271
|
+
return cast(list[AcquisitionVariable] | None | Unset, data)
|
|
272
|
+
|
|
273
|
+
variables = _parse_variables(d.pop("variables", UNSET))
|
|
274
|
+
|
|
275
|
+
def _parse_duration_minutes(data: object) -> int | None | Unset:
|
|
276
|
+
if data is None:
|
|
277
|
+
return data
|
|
278
|
+
if isinstance(data, Unset):
|
|
279
|
+
return data
|
|
280
|
+
return cast(int | None | Unset, data)
|
|
281
|
+
|
|
282
|
+
duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET))
|
|
283
|
+
|
|
284
|
+
def _parse_local_start_time(data: object) -> None | str | Unset:
|
|
285
|
+
if data is None:
|
|
286
|
+
return data
|
|
287
|
+
if isinstance(data, Unset):
|
|
288
|
+
return data
|
|
289
|
+
return cast(None | str | Unset, data)
|
|
290
|
+
|
|
291
|
+
local_start_time = _parse_local_start_time(d.pop("local_start_time", UNSET))
|
|
292
|
+
|
|
293
|
+
create_template_request = cls(
|
|
294
|
+
name=name,
|
|
295
|
+
subject_id=subject_id,
|
|
296
|
+
instrument_id=instrument_id,
|
|
297
|
+
project_id=project_id,
|
|
298
|
+
operator_instructions=operator_instructions,
|
|
299
|
+
people=people,
|
|
300
|
+
type_refs=type_refs,
|
|
301
|
+
variables=variables,
|
|
302
|
+
duration_minutes=duration_minutes,
|
|
303
|
+
local_start_time=local_start_time,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
create_template_request.additional_properties = d
|
|
307
|
+
return create_template_request
|
|
308
|
+
|
|
309
|
+
@property
|
|
310
|
+
def additional_keys(self) -> list[str]:
|
|
311
|
+
return list(self.additional_properties.keys())
|
|
312
|
+
|
|
313
|
+
def __getitem__(self, key: str) -> Any:
|
|
314
|
+
return self.additional_properties[key]
|
|
315
|
+
|
|
316
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
317
|
+
self.additional_properties[key] = value
|
|
318
|
+
|
|
319
|
+
def __delitem__(self, key: str) -> None:
|
|
320
|
+
del self.additional_properties[key]
|
|
321
|
+
|
|
322
|
+
def __contains__(self, key: str) -> bool:
|
|
323
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.api_token_response import ApiTokenResponse
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="CreatedApiTokenResponse")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class CreatedApiTokenResponse:
|
|
22
|
+
"""A newly issued token. `token` is the only time the secret is returned.
|
|
23
|
+
|
|
24
|
+
Attributes:
|
|
25
|
+
token (str): The full token (`dkt_` + 43 characters). Copy it now; it is not stored and cannot be shown again.
|
|
26
|
+
metadata (ApiTokenResponse): An API token's metadata. The secret is shown once, when created, and never again.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
token: str
|
|
30
|
+
metadata: ApiTokenResponse
|
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
from ..models.api_token_response import ApiTokenResponse
|
|
35
|
+
|
|
36
|
+
token = self.token
|
|
37
|
+
|
|
38
|
+
metadata = self.metadata.to_dict()
|
|
39
|
+
|
|
40
|
+
field_dict: dict[str, Any] = {}
|
|
41
|
+
field_dict.update(self.additional_properties)
|
|
42
|
+
field_dict.update(
|
|
43
|
+
{
|
|
44
|
+
"token": token,
|
|
45
|
+
"metadata": metadata,
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
53
|
+
from ..models.api_token_response import ApiTokenResponse
|
|
54
|
+
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
token = d.pop("token")
|
|
57
|
+
|
|
58
|
+
metadata = ApiTokenResponse.from_dict(d.pop("metadata"))
|
|
59
|
+
|
|
60
|
+
created_api_token_response = cls(
|
|
61
|
+
token=token,
|
|
62
|
+
metadata=metadata,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
created_api_token_response.additional_properties = d
|
|
66
|
+
return created_api_token_response
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class EffectiveStatus(str, Enum):
|
|
5
|
+
CANCELLED = "cancelled"
|
|
6
|
+
COMPLETED = "completed"
|
|
7
|
+
ERRORED = "errored"
|
|
8
|
+
FAILED = "failed"
|
|
9
|
+
ONGOING = "ongoing"
|
|
10
|
+
SCHEDULED = "scheduled"
|
|
11
|
+
SUCCEEDED = "succeeded"
|
|
12
|
+
TIMED_OUT = "timed_out"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|