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,97 @@
|
|
|
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
|
+
|
|
15
|
+
T = TypeVar("T", bound="CreateApiTokenRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class CreateApiTokenRequest:
|
|
20
|
+
"""Issues an API token.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
principal_object_id (str): The principal it acts as. Not a bootstrap admin.
|
|
24
|
+
name (str): What it is for.
|
|
25
|
+
expires_in_days (int | None | Unset): Lifetime in days; default 90, at most `Auth:ApiTokens:MaxLifetimeDays`
|
|
26
|
+
(default 365).
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
principal_object_id: str
|
|
30
|
+
name: str
|
|
31
|
+
expires_in_days: int | None | Unset = UNSET
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
principal_object_id = self.principal_object_id
|
|
36
|
+
|
|
37
|
+
name = self.name
|
|
38
|
+
|
|
39
|
+
expires_in_days: int | None | Unset
|
|
40
|
+
if isinstance(self.expires_in_days, Unset):
|
|
41
|
+
expires_in_days = UNSET
|
|
42
|
+
else:
|
|
43
|
+
expires_in_days = self.expires_in_days
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update(
|
|
48
|
+
{
|
|
49
|
+
"principal_object_id": principal_object_id,
|
|
50
|
+
"name": name,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
if expires_in_days is not UNSET:
|
|
54
|
+
field_dict["expires_in_days"] = expires_in_days
|
|
55
|
+
|
|
56
|
+
return field_dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
60
|
+
d = dict(src_dict)
|
|
61
|
+
principal_object_id = d.pop("principal_object_id")
|
|
62
|
+
|
|
63
|
+
name = d.pop("name")
|
|
64
|
+
|
|
65
|
+
def _parse_expires_in_days(data: object) -> int | None | Unset:
|
|
66
|
+
if data is None:
|
|
67
|
+
return data
|
|
68
|
+
if isinstance(data, Unset):
|
|
69
|
+
return data
|
|
70
|
+
return cast(int | None | Unset, data)
|
|
71
|
+
|
|
72
|
+
expires_in_days = _parse_expires_in_days(d.pop("expires_in_days", UNSET))
|
|
73
|
+
|
|
74
|
+
create_api_token_request = cls(
|
|
75
|
+
principal_object_id=principal_object_id,
|
|
76
|
+
name=name,
|
|
77
|
+
expires_in_days=expires_in_days,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
create_api_token_request.additional_properties = d
|
|
81
|
+
return create_api_token_request
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def additional_keys(self) -> list[str]:
|
|
85
|
+
return list(self.additional_properties.keys())
|
|
86
|
+
|
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
|
88
|
+
return self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
91
|
+
self.additional_properties[key] = value
|
|
92
|
+
|
|
93
|
+
def __delitem__(self, key: str) -> None:
|
|
94
|
+
del self.additional_properties[key]
|
|
95
|
+
|
|
96
|
+
def __contains__(self, key: str) -> bool:
|
|
97
|
+
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
|
+
|
|
12
|
+
T = TypeVar("T", bound="CreateApplicationPrincipalRequest")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class CreateApplicationPrincipalRequest:
|
|
17
|
+
"""Creates a Docket-local application principal: a rig or script with no Entra registration.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
display_name (str): A label, e.g. "BEH.B-Box1 rig".
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
display_name: str
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
display_name = self.display_name
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"display_name": display_name,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
display_name = d.pop("display_name")
|
|
43
|
+
|
|
44
|
+
create_application_principal_request = cls(
|
|
45
|
+
display_name=display_name,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
create_application_principal_request.additional_properties = d
|
|
49
|
+
return create_application_principal_request
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def additional_keys(self) -> list[str]:
|
|
53
|
+
return list(self.additional_properties.keys())
|
|
54
|
+
|
|
55
|
+
def __getitem__(self, key: str) -> Any:
|
|
56
|
+
return self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: str, value: Any) -> 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,167 @@
|
|
|
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.access_role_nullable_type_1 import AccessRoleNullableType1
|
|
12
|
+
from ..models.access_role_nullable_type_2_type_1 import AccessRoleNullableType2Type1
|
|
13
|
+
from ..models.access_role_nullable_type_3_type_1 import AccessRoleNullableType3Type1
|
|
14
|
+
from ..types import UNSET, Unset
|
|
15
|
+
from typing import cast
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="CreatePersonalApiTokenRequest")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class CreatePersonalApiTokenRequest:
|
|
23
|
+
"""Creates a personal API token for the signed-in caller.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
name (str): What it is for.
|
|
27
|
+
expires_in_days (int | None | Unset): Lifetime in days; default 30, at most
|
|
28
|
+
`Auth:ApiTokens:PersonalMaxLifetimeDays` (default 90). `GET /api/v1/me` lists the lifetimes to offer.
|
|
29
|
+
max_role (AccessRoleNullableType1 | AccessRoleNullableType2Type1 | AccessRoleNullableType3Type1 | None | Unset):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
name: str
|
|
33
|
+
expires_in_days: int | None | Unset = UNSET
|
|
34
|
+
max_role: (
|
|
35
|
+
AccessRoleNullableType1
|
|
36
|
+
| AccessRoleNullableType2Type1
|
|
37
|
+
| AccessRoleNullableType3Type1
|
|
38
|
+
| None
|
|
39
|
+
| Unset
|
|
40
|
+
) = UNSET
|
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
name = self.name
|
|
45
|
+
|
|
46
|
+
expires_in_days: int | None | Unset
|
|
47
|
+
if isinstance(self.expires_in_days, Unset):
|
|
48
|
+
expires_in_days = UNSET
|
|
49
|
+
else:
|
|
50
|
+
expires_in_days = self.expires_in_days
|
|
51
|
+
|
|
52
|
+
max_role: None | str | Unset
|
|
53
|
+
if isinstance(self.max_role, Unset):
|
|
54
|
+
max_role = UNSET
|
|
55
|
+
elif isinstance(self.max_role, AccessRoleNullableType1):
|
|
56
|
+
max_role = self.max_role.value
|
|
57
|
+
elif isinstance(self.max_role, AccessRoleNullableType2Type1):
|
|
58
|
+
max_role = self.max_role.value
|
|
59
|
+
elif isinstance(self.max_role, AccessRoleNullableType3Type1):
|
|
60
|
+
max_role = self.max_role.value
|
|
61
|
+
else:
|
|
62
|
+
max_role = self.max_role
|
|
63
|
+
|
|
64
|
+
field_dict: dict[str, Any] = {}
|
|
65
|
+
field_dict.update(self.additional_properties)
|
|
66
|
+
field_dict.update(
|
|
67
|
+
{
|
|
68
|
+
"name": name,
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
if expires_in_days is not UNSET:
|
|
72
|
+
field_dict["expires_in_days"] = expires_in_days
|
|
73
|
+
if max_role is not UNSET:
|
|
74
|
+
field_dict["max_role"] = max_role
|
|
75
|
+
|
|
76
|
+
return field_dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
80
|
+
d = dict(src_dict)
|
|
81
|
+
name = d.pop("name")
|
|
82
|
+
|
|
83
|
+
def _parse_expires_in_days(data: object) -> int | None | Unset:
|
|
84
|
+
if data is None:
|
|
85
|
+
return data
|
|
86
|
+
if isinstance(data, Unset):
|
|
87
|
+
return data
|
|
88
|
+
return cast(int | None | Unset, data)
|
|
89
|
+
|
|
90
|
+
expires_in_days = _parse_expires_in_days(d.pop("expires_in_days", UNSET))
|
|
91
|
+
|
|
92
|
+
def _parse_max_role(
|
|
93
|
+
data: object,
|
|
94
|
+
) -> (
|
|
95
|
+
AccessRoleNullableType1
|
|
96
|
+
| AccessRoleNullableType2Type1
|
|
97
|
+
| AccessRoleNullableType3Type1
|
|
98
|
+
| None
|
|
99
|
+
| Unset
|
|
100
|
+
):
|
|
101
|
+
if data is None:
|
|
102
|
+
return data
|
|
103
|
+
if isinstance(data, Unset):
|
|
104
|
+
return data
|
|
105
|
+
try:
|
|
106
|
+
if not isinstance(data, str):
|
|
107
|
+
raise TypeError()
|
|
108
|
+
componentsschemas_access_role_nullable_type_1 = AccessRoleNullableType1(data)
|
|
109
|
+
|
|
110
|
+
return componentsschemas_access_role_nullable_type_1
|
|
111
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
112
|
+
pass
|
|
113
|
+
try:
|
|
114
|
+
if not isinstance(data, str):
|
|
115
|
+
raise TypeError()
|
|
116
|
+
componentsschemas_access_role_nullable_type_2_type_1 = AccessRoleNullableType2Type1(
|
|
117
|
+
data
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
return componentsschemas_access_role_nullable_type_2_type_1
|
|
121
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
122
|
+
pass
|
|
123
|
+
try:
|
|
124
|
+
if not isinstance(data, str):
|
|
125
|
+
raise TypeError()
|
|
126
|
+
componentsschemas_access_role_nullable_type_3_type_1 = AccessRoleNullableType3Type1(
|
|
127
|
+
data
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
return componentsschemas_access_role_nullable_type_3_type_1
|
|
131
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
132
|
+
pass
|
|
133
|
+
return cast(
|
|
134
|
+
AccessRoleNullableType1
|
|
135
|
+
| AccessRoleNullableType2Type1
|
|
136
|
+
| AccessRoleNullableType3Type1
|
|
137
|
+
| None
|
|
138
|
+
| Unset,
|
|
139
|
+
data,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
max_role = _parse_max_role(d.pop("max_role", UNSET))
|
|
143
|
+
|
|
144
|
+
create_personal_api_token_request = cls(
|
|
145
|
+
name=name,
|
|
146
|
+
expires_in_days=expires_in_days,
|
|
147
|
+
max_role=max_role,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
create_personal_api_token_request.additional_properties = d
|
|
151
|
+
return create_personal_api_token_request
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def additional_keys(self) -> list[str]:
|
|
155
|
+
return list(self.additional_properties.keys())
|
|
156
|
+
|
|
157
|
+
def __getitem__(self, key: str) -> Any:
|
|
158
|
+
return self.additional_properties[key]
|
|
159
|
+
|
|
160
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
161
|
+
self.additional_properties[key] = value
|
|
162
|
+
|
|
163
|
+
def __delitem__(self, key: str) -> None:
|
|
164
|
+
del self.additional_properties[key]
|
|
165
|
+
|
|
166
|
+
def __contains__(self, key: str) -> bool:
|
|
167
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,269 @@
|
|
|
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.recurrence_rule import RecurrenceRule
|
|
18
|
+
from ..models.settings_selector import SettingsSelector
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="CreateRecurringAcquisitionRequest")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class CreateRecurringAcquisitionRequest:
|
|
26
|
+
"""Plan a finite series. The acquisition fields mean what they do on
|
|
27
|
+
CreateScheduledAcquisitionRequest and are copied onto every occurrence.
|
|
28
|
+
|
|
29
|
+
Attributes:
|
|
30
|
+
subject_id (str): Subject; validated against the metadata service.
|
|
31
|
+
instrument_id (str): Instrument; must be in the synced list.
|
|
32
|
+
project_id (str): Project; must be in the synced list.
|
|
33
|
+
rule (RecurrenceRule): When a series occurs. Occurrences are computed from the local date and
|
|
34
|
+
`local_start_time` in `time_zone`, so 09:00
|
|
35
|
+
stays 09:00 across daylight-saving changes. Exactly one of
|
|
36
|
+
`count` and `until` is required (finite series only).
|
|
37
|
+
operator_instructions (str | Unset): Free text for the operator. Default: ''.
|
|
38
|
+
people (list[PersonAssignment] | None | Unset): People and their roles.
|
|
39
|
+
type_refs (list[SettingsSelector] | None | Unset): How each acquisition type's settings are chosen; at most one
|
|
40
|
+
per type.
|
|
41
|
+
variables (list[AcquisitionVariable] | None | Unset): Key/value inputs for the rig or operator.
|
|
42
|
+
source_acquisition_id (int | None | Unset): Start the series from an existing scheduled session: that session
|
|
43
|
+
becomes the series' first occurrence instead of
|
|
44
|
+
a new one being created for its date. It must exist (404), not be archived (409 `acquisition_archived`), not
|
|
45
|
+
belong to a series (409 `acquisition_in_series`) and have no runs (409 `acquisition_has_runs`). Its subject and
|
|
46
|
+
instrument must be this request's (422 `subject_id` / `instrument_id`, compared as canonical ids). Its local
|
|
47
|
+
date in the rule's zone must equal `rule.start_date` and be a date the rule selects (422). It keeps its own
|
|
48
|
+
times, people, settings and variables; only the new occurrences follow the rule and these fields. An `edited`
|
|
49
|
+
exception is recorded for it when its times or any of those fields differ from the series', so a later split
|
|
50
|
+
keeps it.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
subject_id: str
|
|
54
|
+
instrument_id: str
|
|
55
|
+
project_id: str
|
|
56
|
+
rule: RecurrenceRule
|
|
57
|
+
operator_instructions: str | Unset = ""
|
|
58
|
+
people: list[PersonAssignment] | None | Unset = UNSET
|
|
59
|
+
type_refs: list[SettingsSelector] | None | Unset = UNSET
|
|
60
|
+
variables: list[AcquisitionVariable] | None | Unset = UNSET
|
|
61
|
+
source_acquisition_id: int | None | Unset = UNSET
|
|
62
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> dict[str, Any]:
|
|
65
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
66
|
+
from ..models.person_assignment import PersonAssignment
|
|
67
|
+
from ..models.recurrence_rule import RecurrenceRule
|
|
68
|
+
from ..models.settings_selector import SettingsSelector
|
|
69
|
+
|
|
70
|
+
subject_id = self.subject_id
|
|
71
|
+
|
|
72
|
+
instrument_id = self.instrument_id
|
|
73
|
+
|
|
74
|
+
project_id = self.project_id
|
|
75
|
+
|
|
76
|
+
rule = self.rule.to_dict()
|
|
77
|
+
|
|
78
|
+
operator_instructions = self.operator_instructions
|
|
79
|
+
|
|
80
|
+
people: list[dict[str, Any]] | None | Unset
|
|
81
|
+
if isinstance(self.people, Unset):
|
|
82
|
+
people = UNSET
|
|
83
|
+
elif isinstance(self.people, list):
|
|
84
|
+
people = []
|
|
85
|
+
for people_type_1_item_data in self.people:
|
|
86
|
+
people_type_1_item = people_type_1_item_data.to_dict()
|
|
87
|
+
people.append(people_type_1_item)
|
|
88
|
+
|
|
89
|
+
else:
|
|
90
|
+
people = self.people
|
|
91
|
+
|
|
92
|
+
type_refs: list[dict[str, Any]] | None | Unset
|
|
93
|
+
if isinstance(self.type_refs, Unset):
|
|
94
|
+
type_refs = UNSET
|
|
95
|
+
elif isinstance(self.type_refs, list):
|
|
96
|
+
type_refs = []
|
|
97
|
+
for type_refs_type_1_item_data in self.type_refs:
|
|
98
|
+
type_refs_type_1_item = type_refs_type_1_item_data.to_dict()
|
|
99
|
+
type_refs.append(type_refs_type_1_item)
|
|
100
|
+
|
|
101
|
+
else:
|
|
102
|
+
type_refs = self.type_refs
|
|
103
|
+
|
|
104
|
+
variables: list[dict[str, Any]] | None | Unset
|
|
105
|
+
if isinstance(self.variables, Unset):
|
|
106
|
+
variables = UNSET
|
|
107
|
+
elif isinstance(self.variables, list):
|
|
108
|
+
variables = []
|
|
109
|
+
for variables_type_1_item_data in self.variables:
|
|
110
|
+
variables_type_1_item = variables_type_1_item_data.to_dict()
|
|
111
|
+
variables.append(variables_type_1_item)
|
|
112
|
+
|
|
113
|
+
else:
|
|
114
|
+
variables = self.variables
|
|
115
|
+
|
|
116
|
+
source_acquisition_id: int | None | Unset
|
|
117
|
+
if isinstance(self.source_acquisition_id, Unset):
|
|
118
|
+
source_acquisition_id = UNSET
|
|
119
|
+
else:
|
|
120
|
+
source_acquisition_id = self.source_acquisition_id
|
|
121
|
+
|
|
122
|
+
field_dict: dict[str, Any] = {}
|
|
123
|
+
field_dict.update(self.additional_properties)
|
|
124
|
+
field_dict.update(
|
|
125
|
+
{
|
|
126
|
+
"subject_id": subject_id,
|
|
127
|
+
"instrument_id": instrument_id,
|
|
128
|
+
"project_id": project_id,
|
|
129
|
+
"rule": rule,
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
if operator_instructions is not UNSET:
|
|
133
|
+
field_dict["operator_instructions"] = operator_instructions
|
|
134
|
+
if people is not UNSET:
|
|
135
|
+
field_dict["people"] = people
|
|
136
|
+
if type_refs is not UNSET:
|
|
137
|
+
field_dict["type_refs"] = type_refs
|
|
138
|
+
if variables is not UNSET:
|
|
139
|
+
field_dict["variables"] = variables
|
|
140
|
+
if source_acquisition_id is not UNSET:
|
|
141
|
+
field_dict["source_acquisition_id"] = source_acquisition_id
|
|
142
|
+
|
|
143
|
+
return field_dict
|
|
144
|
+
|
|
145
|
+
@classmethod
|
|
146
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
147
|
+
from ..models.acquisition_variable import AcquisitionVariable
|
|
148
|
+
from ..models.person_assignment import PersonAssignment
|
|
149
|
+
from ..models.recurrence_rule import RecurrenceRule
|
|
150
|
+
from ..models.settings_selector import SettingsSelector
|
|
151
|
+
|
|
152
|
+
d = dict(src_dict)
|
|
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
|
+
def _parse_source_acquisition_id(data: object) -> int | None | Unset:
|
|
232
|
+
if data is None:
|
|
233
|
+
return data
|
|
234
|
+
if isinstance(data, Unset):
|
|
235
|
+
return data
|
|
236
|
+
return cast(int | None | Unset, data)
|
|
237
|
+
|
|
238
|
+
source_acquisition_id = _parse_source_acquisition_id(d.pop("source_acquisition_id", UNSET))
|
|
239
|
+
|
|
240
|
+
create_recurring_acquisition_request = cls(
|
|
241
|
+
subject_id=subject_id,
|
|
242
|
+
instrument_id=instrument_id,
|
|
243
|
+
project_id=project_id,
|
|
244
|
+
rule=rule,
|
|
245
|
+
operator_instructions=operator_instructions,
|
|
246
|
+
people=people,
|
|
247
|
+
type_refs=type_refs,
|
|
248
|
+
variables=variables,
|
|
249
|
+
source_acquisition_id=source_acquisition_id,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
create_recurring_acquisition_request.additional_properties = d
|
|
253
|
+
return create_recurring_acquisition_request
|
|
254
|
+
|
|
255
|
+
@property
|
|
256
|
+
def additional_keys(self) -> list[str]:
|
|
257
|
+
return list(self.additional_properties.keys())
|
|
258
|
+
|
|
259
|
+
def __getitem__(self, key: str) -> Any:
|
|
260
|
+
return self.additional_properties[key]
|
|
261
|
+
|
|
262
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
263
|
+
self.additional_properties[key] = value
|
|
264
|
+
|
|
265
|
+
def __delitem__(self, key: str) -> None:
|
|
266
|
+
del self.additional_properties[key]
|
|
267
|
+
|
|
268
|
+
def __contains__(self, key: str) -> bool:
|
|
269
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,99 @@
|
|
|
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.access_role import AccessRole
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from typing import cast
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="CreateRoleAssignmentRequest")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class CreateRoleAssignmentRequest:
|
|
21
|
+
"""Grants a role.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
principal_object_id (str): A known principal (one who has signed in, or was added).
|
|
25
|
+
role (AccessRole): A role Docket grants. Roles live in Docket's database; Entra only proves
|
|
26
|
+
who the caller is, and the token's own `roles` claim is ignored.
|
|
27
|
+
scope (None | str | Unset): For acquisition settings maintainers: an acquisition-type key, or omitted for all
|
|
28
|
+
acquisition types. Must be omitted for other roles.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
principal_object_id: str
|
|
32
|
+
role: AccessRole
|
|
33
|
+
scope: None | str | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
principal_object_id = self.principal_object_id
|
|
38
|
+
|
|
39
|
+
role = self.role.value
|
|
40
|
+
|
|
41
|
+
scope: None | str | Unset
|
|
42
|
+
if isinstance(self.scope, Unset):
|
|
43
|
+
scope = UNSET
|
|
44
|
+
else:
|
|
45
|
+
scope = self.scope
|
|
46
|
+
|
|
47
|
+
field_dict: dict[str, Any] = {}
|
|
48
|
+
field_dict.update(self.additional_properties)
|
|
49
|
+
field_dict.update(
|
|
50
|
+
{
|
|
51
|
+
"principal_object_id": principal_object_id,
|
|
52
|
+
"role": role,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
if scope is not UNSET:
|
|
56
|
+
field_dict["scope"] = scope
|
|
57
|
+
|
|
58
|
+
return field_dict
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
62
|
+
d = dict(src_dict)
|
|
63
|
+
principal_object_id = d.pop("principal_object_id")
|
|
64
|
+
|
|
65
|
+
role = AccessRole(d.pop("role"))
|
|
66
|
+
|
|
67
|
+
def _parse_scope(data: object) -> None | str | Unset:
|
|
68
|
+
if data is None:
|
|
69
|
+
return data
|
|
70
|
+
if isinstance(data, Unset):
|
|
71
|
+
return data
|
|
72
|
+
return cast(None | str | Unset, data)
|
|
73
|
+
|
|
74
|
+
scope = _parse_scope(d.pop("scope", UNSET))
|
|
75
|
+
|
|
76
|
+
create_role_assignment_request = cls(
|
|
77
|
+
principal_object_id=principal_object_id,
|
|
78
|
+
role=role,
|
|
79
|
+
scope=scope,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
create_role_assignment_request.additional_properties = d
|
|
83
|
+
return create_role_assignment_request
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def additional_keys(self) -> list[str]:
|
|
87
|
+
return list(self.additional_properties.keys())
|
|
88
|
+
|
|
89
|
+
def __getitem__(self, key: str) -> Any:
|
|
90
|
+
return self.additional_properties[key]
|
|
91
|
+
|
|
92
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
93
|
+
self.additional_properties[key] = value
|
|
94
|
+
|
|
95
|
+
def __delitem__(self, key: str) -> None:
|
|
96
|
+
del self.additional_properties[key]
|
|
97
|
+
|
|
98
|
+
def __contains__(self, key: str) -> bool:
|
|
99
|
+
return key in self.additional_properties
|