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,181 @@
|
|
|
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.run_origin import RunOrigin
|
|
12
|
+
from ..models.run_status import RunStatus
|
|
13
|
+
from typing import cast
|
|
14
|
+
from uuid import UUID
|
|
15
|
+
import datetime
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from ..models.run_settings_snapshot import RunSettingsSnapshot
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="RunResponse")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class RunResponse:
|
|
26
|
+
"""One attempt at a scheduled acquisition.
|
|
27
|
+
|
|
28
|
+
Attributes:
|
|
29
|
+
id (int):
|
|
30
|
+
scheduled_acquisition_id (int):
|
|
31
|
+
token (UUID):
|
|
32
|
+
origin (RunOrigin): Who started a run: the rig software, or a person recording it by hand.
|
|
33
|
+
status (RunStatus):
|
|
34
|
+
started_at (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
35
|
+
ended_at (datetime.datetime | None):
|
|
36
|
+
error_detail (None | str):
|
|
37
|
+
started_by (str):
|
|
38
|
+
resolved_settings (list[RunSettingsSnapshot]):
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
id: int
|
|
42
|
+
scheduled_acquisition_id: int
|
|
43
|
+
token: UUID
|
|
44
|
+
origin: RunOrigin
|
|
45
|
+
status: RunStatus
|
|
46
|
+
started_at: datetime.datetime
|
|
47
|
+
ended_at: datetime.datetime | None
|
|
48
|
+
error_detail: None | str
|
|
49
|
+
started_by: str
|
|
50
|
+
resolved_settings: list[RunSettingsSnapshot]
|
|
51
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> dict[str, Any]:
|
|
54
|
+
from ..models.run_settings_snapshot import RunSettingsSnapshot
|
|
55
|
+
|
|
56
|
+
id = self.id
|
|
57
|
+
|
|
58
|
+
scheduled_acquisition_id = self.scheduled_acquisition_id
|
|
59
|
+
|
|
60
|
+
token = str(self.token)
|
|
61
|
+
|
|
62
|
+
origin = self.origin.value
|
|
63
|
+
|
|
64
|
+
status = self.status.value
|
|
65
|
+
|
|
66
|
+
started_at = self.started_at.isoformat()
|
|
67
|
+
|
|
68
|
+
ended_at: None | str
|
|
69
|
+
if isinstance(self.ended_at, datetime.datetime):
|
|
70
|
+
ended_at = self.ended_at.isoformat()
|
|
71
|
+
else:
|
|
72
|
+
ended_at = self.ended_at
|
|
73
|
+
|
|
74
|
+
error_detail: None | str
|
|
75
|
+
error_detail = self.error_detail
|
|
76
|
+
|
|
77
|
+
started_by = self.started_by
|
|
78
|
+
|
|
79
|
+
resolved_settings = []
|
|
80
|
+
for resolved_settings_item_data in self.resolved_settings:
|
|
81
|
+
resolved_settings_item = resolved_settings_item_data.to_dict()
|
|
82
|
+
resolved_settings.append(resolved_settings_item)
|
|
83
|
+
|
|
84
|
+
field_dict: dict[str, Any] = {}
|
|
85
|
+
field_dict.update(self.additional_properties)
|
|
86
|
+
field_dict.update(
|
|
87
|
+
{
|
|
88
|
+
"id": id,
|
|
89
|
+
"scheduled_acquisition_id": scheduled_acquisition_id,
|
|
90
|
+
"token": token,
|
|
91
|
+
"origin": origin,
|
|
92
|
+
"status": status,
|
|
93
|
+
"started_at": started_at,
|
|
94
|
+
"ended_at": ended_at,
|
|
95
|
+
"error_detail": error_detail,
|
|
96
|
+
"started_by": started_by,
|
|
97
|
+
"resolved_settings": resolved_settings,
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
return field_dict
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
105
|
+
from ..models.run_settings_snapshot import RunSettingsSnapshot
|
|
106
|
+
|
|
107
|
+
d = dict(src_dict)
|
|
108
|
+
id = d.pop("id")
|
|
109
|
+
|
|
110
|
+
scheduled_acquisition_id = d.pop("scheduled_acquisition_id")
|
|
111
|
+
|
|
112
|
+
token = UUID(d.pop("token"))
|
|
113
|
+
|
|
114
|
+
origin = RunOrigin(d.pop("origin"))
|
|
115
|
+
|
|
116
|
+
status = RunStatus(d.pop("status"))
|
|
117
|
+
|
|
118
|
+
started_at = datetime.datetime.fromisoformat(d.pop("started_at"))
|
|
119
|
+
|
|
120
|
+
def _parse_ended_at(data: object) -> datetime.datetime | None:
|
|
121
|
+
if data is None:
|
|
122
|
+
return data
|
|
123
|
+
try:
|
|
124
|
+
if not isinstance(data, str):
|
|
125
|
+
raise TypeError()
|
|
126
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
127
|
+
|
|
128
|
+
return componentsschemas_instant_nullable_type_1
|
|
129
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
130
|
+
pass
|
|
131
|
+
return cast(datetime.datetime | None, data)
|
|
132
|
+
|
|
133
|
+
ended_at = _parse_ended_at(d.pop("ended_at"))
|
|
134
|
+
|
|
135
|
+
def _parse_error_detail(data: object) -> None | str:
|
|
136
|
+
if data is None:
|
|
137
|
+
return data
|
|
138
|
+
return cast(None | str, data)
|
|
139
|
+
|
|
140
|
+
error_detail = _parse_error_detail(d.pop("error_detail"))
|
|
141
|
+
|
|
142
|
+
started_by = d.pop("started_by")
|
|
143
|
+
|
|
144
|
+
resolved_settings = []
|
|
145
|
+
_resolved_settings = d.pop("resolved_settings")
|
|
146
|
+
for resolved_settings_item_data in _resolved_settings:
|
|
147
|
+
resolved_settings_item = RunSettingsSnapshot.from_dict(resolved_settings_item_data)
|
|
148
|
+
|
|
149
|
+
resolved_settings.append(resolved_settings_item)
|
|
150
|
+
|
|
151
|
+
run_response = cls(
|
|
152
|
+
id=id,
|
|
153
|
+
scheduled_acquisition_id=scheduled_acquisition_id,
|
|
154
|
+
token=token,
|
|
155
|
+
origin=origin,
|
|
156
|
+
status=status,
|
|
157
|
+
started_at=started_at,
|
|
158
|
+
ended_at=ended_at,
|
|
159
|
+
error_detail=error_detail,
|
|
160
|
+
started_by=started_by,
|
|
161
|
+
resolved_settings=resolved_settings,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
run_response.additional_properties = d
|
|
165
|
+
return run_response
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
def additional_keys(self) -> list[str]:
|
|
169
|
+
return list(self.additional_properties.keys())
|
|
170
|
+
|
|
171
|
+
def __getitem__(self, key: str) -> Any:
|
|
172
|
+
return self.additional_properties[key]
|
|
173
|
+
|
|
174
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
175
|
+
self.additional_properties[key] = value
|
|
176
|
+
|
|
177
|
+
def __delitem__(self, key: str) -> None:
|
|
178
|
+
del self.additional_properties[key]
|
|
179
|
+
|
|
180
|
+
def __contains__(self, key: str) -> bool:
|
|
181
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
|
|
12
|
+
T = TypeVar("T", bound="RunSettingsSnapshot")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class RunSettingsSnapshot:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
acquisition_type (str): Acquisition type key.
|
|
20
|
+
settings_id (int): The settings version the run used.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
acquisition_type: str
|
|
24
|
+
settings_id: int
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
acquisition_type = self.acquisition_type
|
|
29
|
+
|
|
30
|
+
settings_id = self.settings_id
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
field_dict.update(
|
|
35
|
+
{
|
|
36
|
+
"acquisition_type": acquisition_type,
|
|
37
|
+
"settings_id": settings_id,
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
return field_dict
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
45
|
+
d = dict(src_dict)
|
|
46
|
+
acquisition_type = d.pop("acquisition_type")
|
|
47
|
+
|
|
48
|
+
settings_id = d.pop("settings_id")
|
|
49
|
+
|
|
50
|
+
run_settings_snapshot = cls(
|
|
51
|
+
acquisition_type=acquisition_type,
|
|
52
|
+
settings_id=settings_id,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
run_settings_snapshot.additional_properties = d
|
|
56
|
+
return run_settings_snapshot
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def additional_keys(self) -> list[str]:
|
|
60
|
+
return list(self.additional_properties.keys())
|
|
61
|
+
|
|
62
|
+
def __getitem__(self, key: str) -> Any:
|
|
63
|
+
return self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
66
|
+
self.additional_properties[key] = value
|
|
67
|
+
|
|
68
|
+
def __delitem__(self, key: str) -> None:
|
|
69
|
+
del self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __contains__(self, key: str) -> bool:
|
|
72
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
from uuid import UUID
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.run_start_response_settings import RunStartResponseSettings
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="RunStartResponse")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class RunStartResponse:
|
|
23
|
+
"""A started run and the settings it must use.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
run_id (int): Run id.
|
|
27
|
+
token (UUID): Identifier to report the outcome with. Not a credential.
|
|
28
|
+
settings (RunStartResponseSettings): Resolved settings per acquisition type, exactly as snapshotted.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
run_id: int
|
|
32
|
+
token: UUID
|
|
33
|
+
settings: RunStartResponseSettings
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
from ..models.run_start_response_settings import RunStartResponseSettings
|
|
38
|
+
|
|
39
|
+
run_id = self.run_id
|
|
40
|
+
|
|
41
|
+
token = str(self.token)
|
|
42
|
+
|
|
43
|
+
settings = self.settings.to_dict()
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update(
|
|
48
|
+
{
|
|
49
|
+
"run_id": run_id,
|
|
50
|
+
"token": token,
|
|
51
|
+
"settings": settings,
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
|
+
from ..models.run_start_response_settings import RunStartResponseSettings
|
|
60
|
+
|
|
61
|
+
d = dict(src_dict)
|
|
62
|
+
run_id = d.pop("run_id")
|
|
63
|
+
|
|
64
|
+
token = UUID(d.pop("token"))
|
|
65
|
+
|
|
66
|
+
settings = RunStartResponseSettings.from_dict(d.pop("settings"))
|
|
67
|
+
|
|
68
|
+
run_start_response = cls(
|
|
69
|
+
run_id=run_id,
|
|
70
|
+
token=token,
|
|
71
|
+
settings=settings,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
run_start_response.additional_properties = d
|
|
75
|
+
return run_start_response
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def additional_keys(self) -> list[str]:
|
|
79
|
+
return list(self.additional_properties.keys())
|
|
80
|
+
|
|
81
|
+
def __getitem__(self, key: str) -> Any:
|
|
82
|
+
return self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
85
|
+
self.additional_properties[key] = value
|
|
86
|
+
|
|
87
|
+
def __delitem__(self, key: str) -> None:
|
|
88
|
+
del self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __contains__(self, key: str) -> bool:
|
|
91
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,65 @@
|
|
|
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.resolved_settings import ResolvedSettings
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="RunStartResponseSettings")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class RunStartResponseSettings:
|
|
22
|
+
"""Resolved settings per acquisition type, exactly as snapshotted."""
|
|
23
|
+
|
|
24
|
+
additional_properties: dict[str, ResolvedSettings] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
from ..models.resolved_settings import ResolvedSettings
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
for prop_name, prop in self.additional_properties.items():
|
|
31
|
+
field_dict[prop_name] = prop.to_dict()
|
|
32
|
+
|
|
33
|
+
return field_dict
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
37
|
+
from ..models.resolved_settings import ResolvedSettings
|
|
38
|
+
|
|
39
|
+
d = dict(src_dict)
|
|
40
|
+
run_start_response_settings = cls()
|
|
41
|
+
|
|
42
|
+
additional_properties = {}
|
|
43
|
+
for prop_name, prop_dict in d.items():
|
|
44
|
+
additional_property = ResolvedSettings.from_dict(prop_dict)
|
|
45
|
+
|
|
46
|
+
additional_properties[prop_name] = additional_property
|
|
47
|
+
|
|
48
|
+
run_start_response_settings.additional_properties = additional_properties
|
|
49
|
+
return run_start_response_settings
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def additional_keys(self) -> list[str]:
|
|
53
|
+
return list(self.additional_properties.keys())
|
|
54
|
+
|
|
55
|
+
def __getitem__(self, key: str) -> ResolvedSettings:
|
|
56
|
+
return self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: str, value: ResolvedSettings) -> None:
|
|
59
|
+
self.additional_properties[key] = value
|
|
60
|
+
|
|
61
|
+
def __delitem__(self, key: str) -> None:
|
|
62
|
+
del self.additional_properties[key]
|
|
63
|
+
|
|
64
|
+
def __contains__(self, key: str) -> bool:
|
|
65
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,150 @@
|
|
|
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_warning import AcquisitionWarning
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="ScheduledAcquisitionEditPreviewResponse")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class ScheduledAcquisitionEditPreviewResponse:
|
|
23
|
+
"""What an edit would produce. Nothing is written to scheduling data, audit or exceptions; the one exception is that
|
|
24
|
+
looking up a person never seen before may add them to the vocabulary cache.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
scheduled_start (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
28
|
+
scheduled_end (datetime.datetime | None):
|
|
29
|
+
instrument_id (str): Instrument after the edit.
|
|
30
|
+
warnings (list[AcquisitionWarning]): Overlap warnings for the edited window, as the real edit would return them.
|
|
31
|
+
in_series (bool): True when the acquisition is an occurrence of a series; the real edit would then record an
|
|
32
|
+
`edited` exception for it.
|
|
33
|
+
recurring_acquisition_id (int | None): The series, when `in_series`.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
scheduled_start: datetime.datetime
|
|
37
|
+
scheduled_end: datetime.datetime | None
|
|
38
|
+
instrument_id: str
|
|
39
|
+
warnings: list[AcquisitionWarning]
|
|
40
|
+
in_series: bool
|
|
41
|
+
recurring_acquisition_id: int | None
|
|
42
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
46
|
+
|
|
47
|
+
scheduled_start = self.scheduled_start.isoformat()
|
|
48
|
+
|
|
49
|
+
scheduled_end: None | str
|
|
50
|
+
if isinstance(self.scheduled_end, datetime.datetime):
|
|
51
|
+
scheduled_end = self.scheduled_end.isoformat()
|
|
52
|
+
else:
|
|
53
|
+
scheduled_end = self.scheduled_end
|
|
54
|
+
|
|
55
|
+
instrument_id = self.instrument_id
|
|
56
|
+
|
|
57
|
+
warnings = []
|
|
58
|
+
for warnings_item_data in self.warnings:
|
|
59
|
+
warnings_item = warnings_item_data.to_dict()
|
|
60
|
+
warnings.append(warnings_item)
|
|
61
|
+
|
|
62
|
+
in_series = self.in_series
|
|
63
|
+
|
|
64
|
+
recurring_acquisition_id: int | None
|
|
65
|
+
recurring_acquisition_id = self.recurring_acquisition_id
|
|
66
|
+
|
|
67
|
+
field_dict: dict[str, Any] = {}
|
|
68
|
+
field_dict.update(self.additional_properties)
|
|
69
|
+
field_dict.update(
|
|
70
|
+
{
|
|
71
|
+
"scheduled_start": scheduled_start,
|
|
72
|
+
"scheduled_end": scheduled_end,
|
|
73
|
+
"instrument_id": instrument_id,
|
|
74
|
+
"warnings": warnings,
|
|
75
|
+
"in_series": in_series,
|
|
76
|
+
"recurring_acquisition_id": recurring_acquisition_id,
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return field_dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
84
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
85
|
+
|
|
86
|
+
d = dict(src_dict)
|
|
87
|
+
scheduled_start = datetime.datetime.fromisoformat(d.pop("scheduled_start"))
|
|
88
|
+
|
|
89
|
+
def _parse_scheduled_end(data: object) -> datetime.datetime | None:
|
|
90
|
+
if data is None:
|
|
91
|
+
return data
|
|
92
|
+
try:
|
|
93
|
+
if not isinstance(data, str):
|
|
94
|
+
raise TypeError()
|
|
95
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
96
|
+
|
|
97
|
+
return componentsschemas_instant_nullable_type_1
|
|
98
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
99
|
+
pass
|
|
100
|
+
return cast(datetime.datetime | None, data)
|
|
101
|
+
|
|
102
|
+
scheduled_end = _parse_scheduled_end(d.pop("scheduled_end"))
|
|
103
|
+
|
|
104
|
+
instrument_id = d.pop("instrument_id")
|
|
105
|
+
|
|
106
|
+
warnings = []
|
|
107
|
+
_warnings = d.pop("warnings")
|
|
108
|
+
for warnings_item_data in _warnings:
|
|
109
|
+
warnings_item = AcquisitionWarning.from_dict(warnings_item_data)
|
|
110
|
+
|
|
111
|
+
warnings.append(warnings_item)
|
|
112
|
+
|
|
113
|
+
in_series = d.pop("in_series")
|
|
114
|
+
|
|
115
|
+
def _parse_recurring_acquisition_id(data: object) -> int | None:
|
|
116
|
+
if data is None:
|
|
117
|
+
return data
|
|
118
|
+
return cast(int | None, data)
|
|
119
|
+
|
|
120
|
+
recurring_acquisition_id = _parse_recurring_acquisition_id(
|
|
121
|
+
d.pop("recurring_acquisition_id")
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
scheduled_acquisition_edit_preview_response = cls(
|
|
125
|
+
scheduled_start=scheduled_start,
|
|
126
|
+
scheduled_end=scheduled_end,
|
|
127
|
+
instrument_id=instrument_id,
|
|
128
|
+
warnings=warnings,
|
|
129
|
+
in_series=in_series,
|
|
130
|
+
recurring_acquisition_id=recurring_acquisition_id,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
scheduled_acquisition_edit_preview_response.additional_properties = d
|
|
134
|
+
return scheduled_acquisition_edit_preview_response
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def additional_keys(self) -> list[str]:
|
|
138
|
+
return list(self.additional_properties.keys())
|
|
139
|
+
|
|
140
|
+
def __getitem__(self, key: str) -> Any:
|
|
141
|
+
return self.additional_properties[key]
|
|
142
|
+
|
|
143
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
144
|
+
self.additional_properties[key] = value
|
|
145
|
+
|
|
146
|
+
def __delitem__(self, key: str) -> None:
|
|
147
|
+
del self.additional_properties[key]
|
|
148
|
+
|
|
149
|
+
def __contains__(self, key: str) -> bool:
|
|
150
|
+
return key in self.additional_properties
|