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,129 @@
|
|
|
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.kept_occurrence import KeptOccurrence
|
|
15
|
+
from ..models.occurrence_preview import OccurrencePreview
|
|
16
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="SplitPreviewResponse")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class SplitPreviewResponse:
|
|
24
|
+
"""What splitting would do. Nothing was written.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
occurrences (list[OccurrencePreview]): Occurrences the new series would create, in order.
|
|
28
|
+
skipped (list[SkippedOccurrence]): Dates the new series would not create: DST skips, `kept_from_previous` and
|
|
29
|
+
`removed_in_previous`.
|
|
30
|
+
replaced (list[int]): Ids of old occurrences on or after `effective_date` that would be archived.
|
|
31
|
+
kept (list[KeptOccurrence]): Old occurrences on or after `effective_date` that stay, with the reason.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
occurrences: list[OccurrencePreview]
|
|
35
|
+
skipped: list[SkippedOccurrence]
|
|
36
|
+
replaced: list[int]
|
|
37
|
+
kept: list[KeptOccurrence]
|
|
38
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
39
|
+
|
|
40
|
+
def to_dict(self) -> dict[str, Any]:
|
|
41
|
+
from ..models.kept_occurrence import KeptOccurrence
|
|
42
|
+
from ..models.occurrence_preview import OccurrencePreview
|
|
43
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
44
|
+
|
|
45
|
+
occurrences = []
|
|
46
|
+
for occurrences_item_data in self.occurrences:
|
|
47
|
+
occurrences_item = occurrences_item_data.to_dict()
|
|
48
|
+
occurrences.append(occurrences_item)
|
|
49
|
+
|
|
50
|
+
skipped = []
|
|
51
|
+
for skipped_item_data in self.skipped:
|
|
52
|
+
skipped_item = skipped_item_data.to_dict()
|
|
53
|
+
skipped.append(skipped_item)
|
|
54
|
+
|
|
55
|
+
replaced = self.replaced
|
|
56
|
+
|
|
57
|
+
kept = []
|
|
58
|
+
for kept_item_data in self.kept:
|
|
59
|
+
kept_item = kept_item_data.to_dict()
|
|
60
|
+
kept.append(kept_item)
|
|
61
|
+
|
|
62
|
+
field_dict: dict[str, Any] = {}
|
|
63
|
+
field_dict.update(self.additional_properties)
|
|
64
|
+
field_dict.update(
|
|
65
|
+
{
|
|
66
|
+
"occurrences": occurrences,
|
|
67
|
+
"skipped": skipped,
|
|
68
|
+
"replaced": replaced,
|
|
69
|
+
"kept": kept,
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
return field_dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
77
|
+
from ..models.kept_occurrence import KeptOccurrence
|
|
78
|
+
from ..models.occurrence_preview import OccurrencePreview
|
|
79
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
80
|
+
|
|
81
|
+
d = dict(src_dict)
|
|
82
|
+
occurrences = []
|
|
83
|
+
_occurrences = d.pop("occurrences")
|
|
84
|
+
for occurrences_item_data in _occurrences:
|
|
85
|
+
occurrences_item = OccurrencePreview.from_dict(occurrences_item_data)
|
|
86
|
+
|
|
87
|
+
occurrences.append(occurrences_item)
|
|
88
|
+
|
|
89
|
+
skipped = []
|
|
90
|
+
_skipped = d.pop("skipped")
|
|
91
|
+
for skipped_item_data in _skipped:
|
|
92
|
+
skipped_item = SkippedOccurrence.from_dict(skipped_item_data)
|
|
93
|
+
|
|
94
|
+
skipped.append(skipped_item)
|
|
95
|
+
|
|
96
|
+
replaced = cast(list[int], d.pop("replaced"))
|
|
97
|
+
|
|
98
|
+
kept = []
|
|
99
|
+
_kept = d.pop("kept")
|
|
100
|
+
for kept_item_data in _kept:
|
|
101
|
+
kept_item = KeptOccurrence.from_dict(kept_item_data)
|
|
102
|
+
|
|
103
|
+
kept.append(kept_item)
|
|
104
|
+
|
|
105
|
+
split_preview_response = cls(
|
|
106
|
+
occurrences=occurrences,
|
|
107
|
+
skipped=skipped,
|
|
108
|
+
replaced=replaced,
|
|
109
|
+
kept=kept,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
split_preview_response.additional_properties = d
|
|
113
|
+
return split_preview_response
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def additional_keys(self) -> list[str]:
|
|
117
|
+
return list(self.additional_properties.keys())
|
|
118
|
+
|
|
119
|
+
def __getitem__(self, key: str) -> Any:
|
|
120
|
+
return self.additional_properties[key]
|
|
121
|
+
|
|
122
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
123
|
+
self.additional_properties[key] = value
|
|
124
|
+
|
|
125
|
+
def __delitem__(self, key: str) -> None:
|
|
126
|
+
del self.additional_properties[key]
|
|
127
|
+
|
|
128
|
+
def __contains__(self, key: str) -> bool:
|
|
129
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,261 @@
|
|
|
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.recurrence_rule import RecurrenceRule
|
|
19
|
+
from ..models.settings_selector import SettingsSelector
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="SplitRecurringAcquisitionRequest")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class SplitRecurringAcquisitionRequest:
|
|
27
|
+
"""Edit a series from a date onward: end the old series the day before
|
|
28
|
+
`effective_date` and start a new one from it. Carries the complete new definition (the same fields as
|
|
29
|
+
CreateRecurringAcquisitionRequest), not a patch; clients prefill it from the old one.
|
|
30
|
+
`rule.start_date` must equal `effective_date`. For a `count` rule, `count` is the number
|
|
31
|
+
of occurrences of the new part.
|
|
32
|
+
|
|
33
|
+
Attributes:
|
|
34
|
+
expected_version (int): The old definition's `version`. A stale value is rejected with 409 `version_conflict`.
|
|
35
|
+
effective_date (datetime.date): Calendar date, e.g. 2026-10-15.
|
|
36
|
+
subject_id (str): Subject; validated against the metadata service.
|
|
37
|
+
instrument_id (str): Instrument; must be in the synced list.
|
|
38
|
+
project_id (str): Project; must be in the synced list.
|
|
39
|
+
rule (RecurrenceRule): When a series occurs. Occurrences are computed from the local date and
|
|
40
|
+
`local_start_time` in `time_zone`, so 09:00
|
|
41
|
+
stays 09:00 across daylight-saving changes. Exactly one of
|
|
42
|
+
`count` and `until` is required (finite series only).
|
|
43
|
+
operator_instructions (str | Unset): Free text for the operator. Default: ''.
|
|
44
|
+
people (list[PersonAssignment] | None | Unset): People and their roles.
|
|
45
|
+
type_refs (list[SettingsSelector] | None | Unset): How each acquisition type's settings are chosen; at most one
|
|
46
|
+
per type.
|
|
47
|
+
variables (list[AcquisitionVariable] | None | Unset): Key/value inputs for the rig or operator.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
expected_version: int
|
|
51
|
+
effective_date: datetime.date
|
|
52
|
+
subject_id: str
|
|
53
|
+
instrument_id: str
|
|
54
|
+
project_id: str
|
|
55
|
+
rule: RecurrenceRule
|
|
56
|
+
operator_instructions: str | Unset = ""
|
|
57
|
+
people: list[PersonAssignment] | None | Unset = UNSET
|
|
58
|
+
type_refs: list[SettingsSelector] | None | Unset = UNSET
|
|
59
|
+
variables: list[AcquisitionVariable] | None | Unset = UNSET
|
|
60
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> dict[str, Any]:
|
|
63
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
64
|
+
from ..models.person_assignment import PersonAssignment
|
|
65
|
+
from ..models.recurrence_rule import RecurrenceRule
|
|
66
|
+
from ..models.settings_selector import SettingsSelector
|
|
67
|
+
|
|
68
|
+
expected_version = self.expected_version
|
|
69
|
+
|
|
70
|
+
effective_date = self.effective_date.isoformat()
|
|
71
|
+
|
|
72
|
+
subject_id = self.subject_id
|
|
73
|
+
|
|
74
|
+
instrument_id = self.instrument_id
|
|
75
|
+
|
|
76
|
+
project_id = self.project_id
|
|
77
|
+
|
|
78
|
+
rule = self.rule.to_dict()
|
|
79
|
+
|
|
80
|
+
operator_instructions = self.operator_instructions
|
|
81
|
+
|
|
82
|
+
people: list[dict[str, Any]] | None | Unset
|
|
83
|
+
if isinstance(self.people, Unset):
|
|
84
|
+
people = UNSET
|
|
85
|
+
elif isinstance(self.people, list):
|
|
86
|
+
people = []
|
|
87
|
+
for people_type_1_item_data in self.people:
|
|
88
|
+
people_type_1_item = people_type_1_item_data.to_dict()
|
|
89
|
+
people.append(people_type_1_item)
|
|
90
|
+
|
|
91
|
+
else:
|
|
92
|
+
people = self.people
|
|
93
|
+
|
|
94
|
+
type_refs: list[dict[str, Any]] | None | Unset
|
|
95
|
+
if isinstance(self.type_refs, Unset):
|
|
96
|
+
type_refs = UNSET
|
|
97
|
+
elif isinstance(self.type_refs, list):
|
|
98
|
+
type_refs = []
|
|
99
|
+
for type_refs_type_1_item_data in self.type_refs:
|
|
100
|
+
type_refs_type_1_item = type_refs_type_1_item_data.to_dict()
|
|
101
|
+
type_refs.append(type_refs_type_1_item)
|
|
102
|
+
|
|
103
|
+
else:
|
|
104
|
+
type_refs = self.type_refs
|
|
105
|
+
|
|
106
|
+
variables: list[dict[str, Any]] | None | Unset
|
|
107
|
+
if isinstance(self.variables, Unset):
|
|
108
|
+
variables = UNSET
|
|
109
|
+
elif isinstance(self.variables, list):
|
|
110
|
+
variables = []
|
|
111
|
+
for variables_type_1_item_data in self.variables:
|
|
112
|
+
variables_type_1_item = variables_type_1_item_data.to_dict()
|
|
113
|
+
variables.append(variables_type_1_item)
|
|
114
|
+
|
|
115
|
+
else:
|
|
116
|
+
variables = self.variables
|
|
117
|
+
|
|
118
|
+
field_dict: dict[str, Any] = {}
|
|
119
|
+
field_dict.update(self.additional_properties)
|
|
120
|
+
field_dict.update(
|
|
121
|
+
{
|
|
122
|
+
"expected_version": expected_version,
|
|
123
|
+
"effective_date": effective_date,
|
|
124
|
+
"subject_id": subject_id,
|
|
125
|
+
"instrument_id": instrument_id,
|
|
126
|
+
"project_id": project_id,
|
|
127
|
+
"rule": rule,
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
if operator_instructions is not UNSET:
|
|
131
|
+
field_dict["operator_instructions"] = operator_instructions
|
|
132
|
+
if people is not UNSET:
|
|
133
|
+
field_dict["people"] = people
|
|
134
|
+
if type_refs is not UNSET:
|
|
135
|
+
field_dict["type_refs"] = type_refs
|
|
136
|
+
if variables is not UNSET:
|
|
137
|
+
field_dict["variables"] = variables
|
|
138
|
+
|
|
139
|
+
return field_dict
|
|
140
|
+
|
|
141
|
+
@classmethod
|
|
142
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
143
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
144
|
+
from ..models.person_assignment import PersonAssignment
|
|
145
|
+
from ..models.recurrence_rule import RecurrenceRule
|
|
146
|
+
from ..models.settings_selector import SettingsSelector
|
|
147
|
+
|
|
148
|
+
d = dict(src_dict)
|
|
149
|
+
expected_version = d.pop("expected_version")
|
|
150
|
+
|
|
151
|
+
effective_date = datetime.date.fromisoformat(d.pop("effective_date"))
|
|
152
|
+
|
|
153
|
+
subject_id = d.pop("subject_id")
|
|
154
|
+
|
|
155
|
+
instrument_id = d.pop("instrument_id")
|
|
156
|
+
|
|
157
|
+
project_id = d.pop("project_id")
|
|
158
|
+
|
|
159
|
+
rule = RecurrenceRule.from_dict(d.pop("rule"))
|
|
160
|
+
|
|
161
|
+
operator_instructions = d.pop("operator_instructions", UNSET)
|
|
162
|
+
|
|
163
|
+
def _parse_people(data: object) -> list[PersonAssignment] | None | Unset:
|
|
164
|
+
if data is None:
|
|
165
|
+
return data
|
|
166
|
+
if isinstance(data, Unset):
|
|
167
|
+
return data
|
|
168
|
+
try:
|
|
169
|
+
if not isinstance(data, list):
|
|
170
|
+
raise TypeError()
|
|
171
|
+
people_type_1 = []
|
|
172
|
+
_people_type_1 = data
|
|
173
|
+
for people_type_1_item_data in _people_type_1:
|
|
174
|
+
people_type_1_item = PersonAssignment.from_dict(people_type_1_item_data)
|
|
175
|
+
|
|
176
|
+
people_type_1.append(people_type_1_item)
|
|
177
|
+
|
|
178
|
+
return people_type_1
|
|
179
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
180
|
+
pass
|
|
181
|
+
return cast(list[PersonAssignment] | None | Unset, data)
|
|
182
|
+
|
|
183
|
+
people = _parse_people(d.pop("people", UNSET))
|
|
184
|
+
|
|
185
|
+
def _parse_type_refs(data: object) -> list[SettingsSelector] | None | Unset:
|
|
186
|
+
if data is None:
|
|
187
|
+
return data
|
|
188
|
+
if isinstance(data, Unset):
|
|
189
|
+
return data
|
|
190
|
+
try:
|
|
191
|
+
if not isinstance(data, list):
|
|
192
|
+
raise TypeError()
|
|
193
|
+
type_refs_type_1 = []
|
|
194
|
+
_type_refs_type_1 = data
|
|
195
|
+
for type_refs_type_1_item_data in _type_refs_type_1:
|
|
196
|
+
type_refs_type_1_item = SettingsSelector.from_dict(type_refs_type_1_item_data)
|
|
197
|
+
|
|
198
|
+
type_refs_type_1.append(type_refs_type_1_item)
|
|
199
|
+
|
|
200
|
+
return type_refs_type_1
|
|
201
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
202
|
+
pass
|
|
203
|
+
return cast(list[SettingsSelector] | None | Unset, data)
|
|
204
|
+
|
|
205
|
+
type_refs = _parse_type_refs(d.pop("type_refs", UNSET))
|
|
206
|
+
|
|
207
|
+
def _parse_variables(data: object) -> list[AcquisitionVariable] | 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
|
+
variables_type_1 = []
|
|
216
|
+
_variables_type_1 = data
|
|
217
|
+
for variables_type_1_item_data in _variables_type_1:
|
|
218
|
+
variables_type_1_item = AcquisitionVariable.from_dict(
|
|
219
|
+
variables_type_1_item_data
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
variables_type_1.append(variables_type_1_item)
|
|
223
|
+
|
|
224
|
+
return variables_type_1
|
|
225
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
226
|
+
pass
|
|
227
|
+
return cast(list[AcquisitionVariable] | None | Unset, data)
|
|
228
|
+
|
|
229
|
+
variables = _parse_variables(d.pop("variables", UNSET))
|
|
230
|
+
|
|
231
|
+
split_recurring_acquisition_request = cls(
|
|
232
|
+
expected_version=expected_version,
|
|
233
|
+
effective_date=effective_date,
|
|
234
|
+
subject_id=subject_id,
|
|
235
|
+
instrument_id=instrument_id,
|
|
236
|
+
project_id=project_id,
|
|
237
|
+
rule=rule,
|
|
238
|
+
operator_instructions=operator_instructions,
|
|
239
|
+
people=people,
|
|
240
|
+
type_refs=type_refs,
|
|
241
|
+
variables=variables,
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
split_recurring_acquisition_request.additional_properties = d
|
|
245
|
+
return split_recurring_acquisition_request
|
|
246
|
+
|
|
247
|
+
@property
|
|
248
|
+
def additional_keys(self) -> list[str]:
|
|
249
|
+
return list(self.additional_properties.keys())
|
|
250
|
+
|
|
251
|
+
def __getitem__(self, key: str) -> Any:
|
|
252
|
+
return self.additional_properties[key]
|
|
253
|
+
|
|
254
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
255
|
+
self.additional_properties[key] = value
|
|
256
|
+
|
|
257
|
+
def __delitem__(self, key: str) -> None:
|
|
258
|
+
del self.additional_properties[key]
|
|
259
|
+
|
|
260
|
+
def __contains__(self, key: str) -> bool:
|
|
261
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,159 @@
|
|
|
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.kept_occurrence import KeptOccurrence
|
|
15
|
+
from ..models.occurrence_warnings import OccurrenceWarnings
|
|
16
|
+
from ..models.recurring_acquisition_response import RecurringAcquisitionResponse
|
|
17
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="SplitRecurringAcquisitionResponse")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class SplitRecurringAcquisitionResponse:
|
|
25
|
+
"""A series split in two.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
definition (RecurringAcquisitionResponse): A recurring definition: scheduling intent, from which occurrences
|
|
29
|
+
were materialized.
|
|
30
|
+
previous (RecurringAcquisitionResponse): A recurring definition: scheduling intent, from which occurrences were
|
|
31
|
+
materialized.
|
|
32
|
+
occurrence_ids (list[int]): Ids of the occurrences created for the new series, in order.
|
|
33
|
+
replaced (list[int]): Ids of old occurrences archived by the split (each recorded as an `archived` exception).
|
|
34
|
+
kept (list[KeptOccurrence]): Old occurrences on or after `effective_date` left untouched.
|
|
35
|
+
skipped (list[SkippedOccurrence]): Dates the new series did not create: DST skips, `kept_from_previous` and
|
|
36
|
+
`removed_in_previous`.
|
|
37
|
+
warnings (list[OccurrenceWarnings]): Overlap warnings per new occurrence; replaced occurrences are not counted
|
|
38
|
+
as overlaps.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
definition: RecurringAcquisitionResponse
|
|
42
|
+
previous: RecurringAcquisitionResponse
|
|
43
|
+
occurrence_ids: list[int]
|
|
44
|
+
replaced: list[int]
|
|
45
|
+
kept: list[KeptOccurrence]
|
|
46
|
+
skipped: list[SkippedOccurrence]
|
|
47
|
+
warnings: list[OccurrenceWarnings]
|
|
48
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
49
|
+
|
|
50
|
+
def to_dict(self) -> dict[str, Any]:
|
|
51
|
+
from ..models.kept_occurrence import KeptOccurrence
|
|
52
|
+
from ..models.occurrence_warnings import OccurrenceWarnings
|
|
53
|
+
from ..models.recurring_acquisition_response import RecurringAcquisitionResponse
|
|
54
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
55
|
+
|
|
56
|
+
definition = self.definition.to_dict()
|
|
57
|
+
|
|
58
|
+
previous = self.previous.to_dict()
|
|
59
|
+
|
|
60
|
+
occurrence_ids = self.occurrence_ids
|
|
61
|
+
|
|
62
|
+
replaced = self.replaced
|
|
63
|
+
|
|
64
|
+
kept = []
|
|
65
|
+
for kept_item_data in self.kept:
|
|
66
|
+
kept_item = kept_item_data.to_dict()
|
|
67
|
+
kept.append(kept_item)
|
|
68
|
+
|
|
69
|
+
skipped = []
|
|
70
|
+
for skipped_item_data in self.skipped:
|
|
71
|
+
skipped_item = skipped_item_data.to_dict()
|
|
72
|
+
skipped.append(skipped_item)
|
|
73
|
+
|
|
74
|
+
warnings = []
|
|
75
|
+
for warnings_item_data in self.warnings:
|
|
76
|
+
warnings_item = warnings_item_data.to_dict()
|
|
77
|
+
warnings.append(warnings_item)
|
|
78
|
+
|
|
79
|
+
field_dict: dict[str, Any] = {}
|
|
80
|
+
field_dict.update(self.additional_properties)
|
|
81
|
+
field_dict.update(
|
|
82
|
+
{
|
|
83
|
+
"definition": definition,
|
|
84
|
+
"previous": previous,
|
|
85
|
+
"occurrence_ids": occurrence_ids,
|
|
86
|
+
"replaced": replaced,
|
|
87
|
+
"kept": kept,
|
|
88
|
+
"skipped": skipped,
|
|
89
|
+
"warnings": warnings,
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return field_dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
97
|
+
from ..models.kept_occurrence import KeptOccurrence
|
|
98
|
+
from ..models.occurrence_warnings import OccurrenceWarnings
|
|
99
|
+
from ..models.recurring_acquisition_response import RecurringAcquisitionResponse
|
|
100
|
+
from ..models.skipped_occurrence import SkippedOccurrence
|
|
101
|
+
|
|
102
|
+
d = dict(src_dict)
|
|
103
|
+
definition = RecurringAcquisitionResponse.from_dict(d.pop("definition"))
|
|
104
|
+
|
|
105
|
+
previous = RecurringAcquisitionResponse.from_dict(d.pop("previous"))
|
|
106
|
+
|
|
107
|
+
occurrence_ids = cast(list[int], d.pop("occurrence_ids"))
|
|
108
|
+
|
|
109
|
+
replaced = cast(list[int], d.pop("replaced"))
|
|
110
|
+
|
|
111
|
+
kept = []
|
|
112
|
+
_kept = d.pop("kept")
|
|
113
|
+
for kept_item_data in _kept:
|
|
114
|
+
kept_item = KeptOccurrence.from_dict(kept_item_data)
|
|
115
|
+
|
|
116
|
+
kept.append(kept_item)
|
|
117
|
+
|
|
118
|
+
skipped = []
|
|
119
|
+
_skipped = d.pop("skipped")
|
|
120
|
+
for skipped_item_data in _skipped:
|
|
121
|
+
skipped_item = SkippedOccurrence.from_dict(skipped_item_data)
|
|
122
|
+
|
|
123
|
+
skipped.append(skipped_item)
|
|
124
|
+
|
|
125
|
+
warnings = []
|
|
126
|
+
_warnings = d.pop("warnings")
|
|
127
|
+
for warnings_item_data in _warnings:
|
|
128
|
+
warnings_item = OccurrenceWarnings.from_dict(warnings_item_data)
|
|
129
|
+
|
|
130
|
+
warnings.append(warnings_item)
|
|
131
|
+
|
|
132
|
+
split_recurring_acquisition_response = cls(
|
|
133
|
+
definition=definition,
|
|
134
|
+
previous=previous,
|
|
135
|
+
occurrence_ids=occurrence_ids,
|
|
136
|
+
replaced=replaced,
|
|
137
|
+
kept=kept,
|
|
138
|
+
skipped=skipped,
|
|
139
|
+
warnings=warnings,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
split_recurring_acquisition_response.additional_properties = d
|
|
143
|
+
return split_recurring_acquisition_response
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def additional_keys(self) -> list[str]:
|
|
147
|
+
return list(self.additional_properties.keys())
|
|
148
|
+
|
|
149
|
+
def __getitem__(self, key: str) -> Any:
|
|
150
|
+
return self.additional_properties[key]
|
|
151
|
+
|
|
152
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
153
|
+
self.additional_properties[key] = value
|
|
154
|
+
|
|
155
|
+
def __delitem__(self, key: str) -> None:
|
|
156
|
+
del self.additional_properties[key]
|
|
157
|
+
|
|
158
|
+
def __contains__(self, key: str) -> bool:
|
|
159
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,73 @@
|
|
|
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 ..types import UNSET, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="StartRunRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class StartRunRequest:
|
|
20
|
+
"""Start a run of a scheduled acquisition.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
origin (RunOrigin | Unset): Who started a run: the rig software, or a person recording it by hand.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
origin: RunOrigin | Unset = UNSET
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
origin: str | Unset = UNSET
|
|
31
|
+
if not isinstance(self.origin, Unset):
|
|
32
|
+
origin = self.origin.value
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update({})
|
|
37
|
+
if origin is not UNSET:
|
|
38
|
+
field_dict["origin"] = origin
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
d = dict(src_dict)
|
|
45
|
+
_origin = d.pop("origin", UNSET)
|
|
46
|
+
origin: RunOrigin | Unset
|
|
47
|
+
if isinstance(_origin, Unset):
|
|
48
|
+
origin = UNSET
|
|
49
|
+
else:
|
|
50
|
+
origin = RunOrigin(_origin)
|
|
51
|
+
|
|
52
|
+
start_run_request = cls(
|
|
53
|
+
origin=origin,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
start_run_request.additional_properties = d
|
|
57
|
+
return start_run_request
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def additional_keys(self) -> list[str]:
|
|
61
|
+
return list(self.additional_properties.keys())
|
|
62
|
+
|
|
63
|
+
def __getitem__(self, key: str) -> Any:
|
|
64
|
+
return self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
67
|
+
self.additional_properties[key] = value
|
|
68
|
+
|
|
69
|
+
def __delitem__(self, key: str) -> None:
|
|
70
|
+
del self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __contains__(self, key: str) -> bool:
|
|
73
|
+
return key in self.additional_properties
|