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,118 @@
|
|
|
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.caller_kind import CallerKind
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="MeCaller")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class MeCaller:
|
|
20
|
+
"""The caller as the API sees it.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
kind (CallerKind): What kind of principal made a request.
|
|
24
|
+
display_name (str): For display only; never an identity key.
|
|
25
|
+
object_id (None | str): Directory object id; null when anonymous.
|
|
26
|
+
tenant_id (None | str): Directory tenant; null when anonymous.
|
|
27
|
+
calling_application_id (None | str): The client application that obtained the token.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
kind: CallerKind
|
|
31
|
+
display_name: str
|
|
32
|
+
object_id: None | str
|
|
33
|
+
tenant_id: None | str
|
|
34
|
+
calling_application_id: None | str
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
kind = self.kind.value
|
|
39
|
+
|
|
40
|
+
display_name = self.display_name
|
|
41
|
+
|
|
42
|
+
object_id: None | str
|
|
43
|
+
object_id = self.object_id
|
|
44
|
+
|
|
45
|
+
tenant_id: None | str
|
|
46
|
+
tenant_id = self.tenant_id
|
|
47
|
+
|
|
48
|
+
calling_application_id: None | str
|
|
49
|
+
calling_application_id = self.calling_application_id
|
|
50
|
+
|
|
51
|
+
field_dict: dict[str, Any] = {}
|
|
52
|
+
field_dict.update(self.additional_properties)
|
|
53
|
+
field_dict.update(
|
|
54
|
+
{
|
|
55
|
+
"kind": kind,
|
|
56
|
+
"display_name": display_name,
|
|
57
|
+
"object_id": object_id,
|
|
58
|
+
"tenant_id": tenant_id,
|
|
59
|
+
"calling_application_id": calling_application_id,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
67
|
+
d = dict(src_dict)
|
|
68
|
+
kind = CallerKind(d.pop("kind"))
|
|
69
|
+
|
|
70
|
+
display_name = d.pop("display_name")
|
|
71
|
+
|
|
72
|
+
def _parse_object_id(data: object) -> None | str:
|
|
73
|
+
if data is None:
|
|
74
|
+
return data
|
|
75
|
+
return cast(None | str, data)
|
|
76
|
+
|
|
77
|
+
object_id = _parse_object_id(d.pop("object_id"))
|
|
78
|
+
|
|
79
|
+
def _parse_tenant_id(data: object) -> None | str:
|
|
80
|
+
if data is None:
|
|
81
|
+
return data
|
|
82
|
+
return cast(None | str, data)
|
|
83
|
+
|
|
84
|
+
tenant_id = _parse_tenant_id(d.pop("tenant_id"))
|
|
85
|
+
|
|
86
|
+
def _parse_calling_application_id(data: object) -> None | str:
|
|
87
|
+
if data is None:
|
|
88
|
+
return data
|
|
89
|
+
return cast(None | str, data)
|
|
90
|
+
|
|
91
|
+
calling_application_id = _parse_calling_application_id(d.pop("calling_application_id"))
|
|
92
|
+
|
|
93
|
+
me_caller = cls(
|
|
94
|
+
kind=kind,
|
|
95
|
+
display_name=display_name,
|
|
96
|
+
object_id=object_id,
|
|
97
|
+
tenant_id=tenant_id,
|
|
98
|
+
calling_application_id=calling_application_id,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
me_caller.additional_properties = d
|
|
102
|
+
return me_caller
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def additional_keys(self) -> list[str]:
|
|
106
|
+
return list(self.additional_properties.keys())
|
|
107
|
+
|
|
108
|
+
def __getitem__(self, key: str) -> Any:
|
|
109
|
+
return self.additional_properties[key]
|
|
110
|
+
|
|
111
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
112
|
+
self.additional_properties[key] = value
|
|
113
|
+
|
|
114
|
+
def __delitem__(self, key: str) -> None:
|
|
115
|
+
del self.additional_properties[key]
|
|
116
|
+
|
|
117
|
+
def __contains__(self, key: str) -> bool:
|
|
118
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,98 @@
|
|
|
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.permission_action import PermissionAction
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="MePermission")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class MePermission:
|
|
20
|
+
"""One permission granted to the caller.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
resource (str): Resource kind, e.g. `scheduled-acquisition`.
|
|
24
|
+
action (PermissionAction): What a mutation does. Classified by effect, not by HTTP method.
|
|
25
|
+
scope (None | str): Acquisition-type key the grant is limited to; null means any.
|
|
26
|
+
own_only (bool): True when it covers only resources the caller created.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
resource: str
|
|
30
|
+
action: PermissionAction
|
|
31
|
+
scope: None | str
|
|
32
|
+
own_only: bool
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
resource = self.resource
|
|
37
|
+
|
|
38
|
+
action = self.action.value
|
|
39
|
+
|
|
40
|
+
scope: None | str
|
|
41
|
+
scope = self.scope
|
|
42
|
+
|
|
43
|
+
own_only = self.own_only
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update(
|
|
48
|
+
{
|
|
49
|
+
"resource": resource,
|
|
50
|
+
"action": action,
|
|
51
|
+
"scope": scope,
|
|
52
|
+
"own_only": own_only,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
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
|
+
resource = d.pop("resource")
|
|
62
|
+
|
|
63
|
+
action = PermissionAction(d.pop("action"))
|
|
64
|
+
|
|
65
|
+
def _parse_scope(data: object) -> None | str:
|
|
66
|
+
if data is None:
|
|
67
|
+
return data
|
|
68
|
+
return cast(None | str, data)
|
|
69
|
+
|
|
70
|
+
scope = _parse_scope(d.pop("scope"))
|
|
71
|
+
|
|
72
|
+
own_only = d.pop("own_only")
|
|
73
|
+
|
|
74
|
+
me_permission = cls(
|
|
75
|
+
resource=resource,
|
|
76
|
+
action=action,
|
|
77
|
+
scope=scope,
|
|
78
|
+
own_only=own_only,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
me_permission.additional_properties = d
|
|
82
|
+
return me_permission
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def additional_keys(self) -> list[str]:
|
|
86
|
+
return list(self.additional_properties.keys())
|
|
87
|
+
|
|
88
|
+
def __getitem__(self, key: str) -> Any:
|
|
89
|
+
return self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
92
|
+
self.additional_properties[key] = value
|
|
93
|
+
|
|
94
|
+
def __delitem__(self, key: str) -> None:
|
|
95
|
+
del self.additional_properties[key]
|
|
96
|
+
|
|
97
|
+
def __contains__(self, key: str) -> bool:
|
|
98
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,158 @@
|
|
|
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.auth_mode import AuthMode
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.me_caller import MeCaller
|
|
16
|
+
from ..models.me_permission import MePermission
|
|
17
|
+
from ..models.me_role import MeRole
|
|
18
|
+
from ..models.personal_token_limits import PersonalTokenLimits
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="MeResponse")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class MeResponse:
|
|
26
|
+
"""Who the API thinks you are and what you may do. Public, like every read.
|
|
27
|
+
|
|
28
|
+
Attributes:
|
|
29
|
+
auth_mode (AuthMode): Authentication mode, set by configuration key `Auth:Mode`.
|
|
30
|
+
all_allowed (bool): True when authentication is disabled: every mutation is accepted, so the list below is
|
|
31
|
+
informational.
|
|
32
|
+
caller (MeCaller): The caller as the API sees it.
|
|
33
|
+
roles (list[str]): Docket roles the caller holds. Assigned in Docket; the token's own roles claim is ignored.
|
|
34
|
+
role_sources (list[MeRole]): The same roles with where each comes from: assignment, default or bootstrap.
|
|
35
|
+
permissions (list[MePermission]): Everything the caller may do (reads are public and not listed).
|
|
36
|
+
self_service_tokens (bool): True when people can create their own API tokens here: Entra mode and
|
|
37
|
+
`Auth:ApiTokens:SelfService` on.
|
|
38
|
+
personal_tokens (PersonalTokenLimits): The limits of personal API tokens, as configured.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
auth_mode: AuthMode
|
|
42
|
+
all_allowed: bool
|
|
43
|
+
caller: MeCaller
|
|
44
|
+
roles: list[str]
|
|
45
|
+
role_sources: list[MeRole]
|
|
46
|
+
permissions: list[MePermission]
|
|
47
|
+
self_service_tokens: bool
|
|
48
|
+
personal_tokens: PersonalTokenLimits
|
|
49
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
from ..models.me_caller import MeCaller
|
|
53
|
+
from ..models.me_permission import MePermission
|
|
54
|
+
from ..models.me_role import MeRole
|
|
55
|
+
from ..models.personal_token_limits import PersonalTokenLimits
|
|
56
|
+
|
|
57
|
+
auth_mode = self.auth_mode.value
|
|
58
|
+
|
|
59
|
+
all_allowed = self.all_allowed
|
|
60
|
+
|
|
61
|
+
caller = self.caller.to_dict()
|
|
62
|
+
|
|
63
|
+
roles = self.roles
|
|
64
|
+
|
|
65
|
+
role_sources = []
|
|
66
|
+
for role_sources_item_data in self.role_sources:
|
|
67
|
+
role_sources_item = role_sources_item_data.to_dict()
|
|
68
|
+
role_sources.append(role_sources_item)
|
|
69
|
+
|
|
70
|
+
permissions = []
|
|
71
|
+
for permissions_item_data in self.permissions:
|
|
72
|
+
permissions_item = permissions_item_data.to_dict()
|
|
73
|
+
permissions.append(permissions_item)
|
|
74
|
+
|
|
75
|
+
self_service_tokens = self.self_service_tokens
|
|
76
|
+
|
|
77
|
+
personal_tokens = self.personal_tokens.to_dict()
|
|
78
|
+
|
|
79
|
+
field_dict: dict[str, Any] = {}
|
|
80
|
+
field_dict.update(self.additional_properties)
|
|
81
|
+
field_dict.update(
|
|
82
|
+
{
|
|
83
|
+
"auth_mode": auth_mode,
|
|
84
|
+
"all_allowed": all_allowed,
|
|
85
|
+
"caller": caller,
|
|
86
|
+
"roles": roles,
|
|
87
|
+
"role_sources": role_sources,
|
|
88
|
+
"permissions": permissions,
|
|
89
|
+
"self_service_tokens": self_service_tokens,
|
|
90
|
+
"personal_tokens": personal_tokens,
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
return field_dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
98
|
+
from ..models.me_caller import MeCaller
|
|
99
|
+
from ..models.me_permission import MePermission
|
|
100
|
+
from ..models.me_role import MeRole
|
|
101
|
+
from ..models.personal_token_limits import PersonalTokenLimits
|
|
102
|
+
|
|
103
|
+
d = dict(src_dict)
|
|
104
|
+
auth_mode = AuthMode(d.pop("auth_mode"))
|
|
105
|
+
|
|
106
|
+
all_allowed = d.pop("all_allowed")
|
|
107
|
+
|
|
108
|
+
caller = MeCaller.from_dict(d.pop("caller"))
|
|
109
|
+
|
|
110
|
+
roles = cast(list[str], d.pop("roles"))
|
|
111
|
+
|
|
112
|
+
role_sources = []
|
|
113
|
+
_role_sources = d.pop("role_sources")
|
|
114
|
+
for role_sources_item_data in _role_sources:
|
|
115
|
+
role_sources_item = MeRole.from_dict(role_sources_item_data)
|
|
116
|
+
|
|
117
|
+
role_sources.append(role_sources_item)
|
|
118
|
+
|
|
119
|
+
permissions = []
|
|
120
|
+
_permissions = d.pop("permissions")
|
|
121
|
+
for permissions_item_data in _permissions:
|
|
122
|
+
permissions_item = MePermission.from_dict(permissions_item_data)
|
|
123
|
+
|
|
124
|
+
permissions.append(permissions_item)
|
|
125
|
+
|
|
126
|
+
self_service_tokens = d.pop("self_service_tokens")
|
|
127
|
+
|
|
128
|
+
personal_tokens = PersonalTokenLimits.from_dict(d.pop("personal_tokens"))
|
|
129
|
+
|
|
130
|
+
me_response = cls(
|
|
131
|
+
auth_mode=auth_mode,
|
|
132
|
+
all_allowed=all_allowed,
|
|
133
|
+
caller=caller,
|
|
134
|
+
roles=roles,
|
|
135
|
+
role_sources=role_sources,
|
|
136
|
+
permissions=permissions,
|
|
137
|
+
self_service_tokens=self_service_tokens,
|
|
138
|
+
personal_tokens=personal_tokens,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
me_response.additional_properties = d
|
|
142
|
+
return me_response
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def additional_keys(self) -> list[str]:
|
|
146
|
+
return list(self.additional_properties.keys())
|
|
147
|
+
|
|
148
|
+
def __getitem__(self, key: str) -> Any:
|
|
149
|
+
return self.additional_properties[key]
|
|
150
|
+
|
|
151
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
152
|
+
self.additional_properties[key] = value
|
|
153
|
+
|
|
154
|
+
def __delitem__(self, key: str) -> None:
|
|
155
|
+
del self.additional_properties[key]
|
|
156
|
+
|
|
157
|
+
def __contains__(self, key: str) -> bool:
|
|
158
|
+
return key in self.additional_properties
|
docket/models/me_role.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
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.role_source_kind import RoleSourceKind
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="MeRole")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class MeRole:
|
|
19
|
+
"""A held role and its origin.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
role (str): Role value, e.g. `Docket.User` or `Docket.AcquisitionSettingsMaintainer.fip`.
|
|
23
|
+
source (RoleSourceKind): Where a held role comes from.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
role: str
|
|
27
|
+
source: RoleSourceKind
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
role = self.role
|
|
32
|
+
|
|
33
|
+
source = self.source.value
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"role": role,
|
|
40
|
+
"source": source,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return field_dict
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
role = d.pop("role")
|
|
50
|
+
|
|
51
|
+
source = RoleSourceKind(d.pop("source"))
|
|
52
|
+
|
|
53
|
+
me_role = cls(
|
|
54
|
+
role=role,
|
|
55
|
+
source=source,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
me_role.additional_properties = d
|
|
59
|
+
return me_role
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def additional_keys(self) -> list[str]:
|
|
63
|
+
return list(self.additional_properties.keys())
|
|
64
|
+
|
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
|
66
|
+
return self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
69
|
+
self.additional_properties[key] = value
|
|
70
|
+
|
|
71
|
+
def __delitem__(self, key: str) -> None:
|
|
72
|
+
del self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __contains__(self, key: str) -> bool:
|
|
75
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,121 @@
|
|
|
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_warning import AcquisitionWarning
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="OccurrencePreview")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class OccurrencePreview:
|
|
24
|
+
"""An occurrence the rule produces, as it would be (or was) scheduled.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
occurrence_local_date (datetime.date): Calendar date, e.g. 2026-10-15.
|
|
28
|
+
scheduled_start (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
29
|
+
scheduled_end (datetime.datetime): UTC instant, ISO 8601 with offset, e.g. 2026-10-15T16:00:00Z.
|
|
30
|
+
warnings (list[AcquisitionWarning]): Instrument overlaps with other acquisitions (same rules as a single
|
|
31
|
+
acquisition).
|
|
32
|
+
attached (bool | Unset): True for the existing session a series is started from (`source_acquisition_id`): it is
|
|
33
|
+
the first
|
|
34
|
+
occurrence, shown with its own times, and no new session is created for it. It has no warnings: only the
|
|
35
|
+
sessions the rule creates are checked for overlaps. Default: False.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
occurrence_local_date: datetime.date
|
|
39
|
+
scheduled_start: datetime.datetime
|
|
40
|
+
scheduled_end: datetime.datetime
|
|
41
|
+
warnings: list[AcquisitionWarning]
|
|
42
|
+
attached: bool | Unset = False
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
|
46
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
47
|
+
|
|
48
|
+
occurrence_local_date = self.occurrence_local_date.isoformat()
|
|
49
|
+
|
|
50
|
+
scheduled_start = self.scheduled_start.isoformat()
|
|
51
|
+
|
|
52
|
+
scheduled_end = self.scheduled_end.isoformat()
|
|
53
|
+
|
|
54
|
+
warnings = []
|
|
55
|
+
for warnings_item_data in self.warnings:
|
|
56
|
+
warnings_item = warnings_item_data.to_dict()
|
|
57
|
+
warnings.append(warnings_item)
|
|
58
|
+
|
|
59
|
+
attached = self.attached
|
|
60
|
+
|
|
61
|
+
field_dict: dict[str, Any] = {}
|
|
62
|
+
field_dict.update(self.additional_properties)
|
|
63
|
+
field_dict.update(
|
|
64
|
+
{
|
|
65
|
+
"occurrence_local_date": occurrence_local_date,
|
|
66
|
+
"scheduled_start": scheduled_start,
|
|
67
|
+
"scheduled_end": scheduled_end,
|
|
68
|
+
"warnings": warnings,
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
if attached is not UNSET:
|
|
72
|
+
field_dict["attached"] = attached
|
|
73
|
+
|
|
74
|
+
return field_dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
78
|
+
from ..models.acquisition_warning import AcquisitionWarning
|
|
79
|
+
|
|
80
|
+
d = dict(src_dict)
|
|
81
|
+
occurrence_local_date = datetime.date.fromisoformat(d.pop("occurrence_local_date"))
|
|
82
|
+
|
|
83
|
+
scheduled_start = datetime.datetime.fromisoformat(d.pop("scheduled_start"))
|
|
84
|
+
|
|
85
|
+
scheduled_end = datetime.datetime.fromisoformat(d.pop("scheduled_end"))
|
|
86
|
+
|
|
87
|
+
warnings = []
|
|
88
|
+
_warnings = d.pop("warnings")
|
|
89
|
+
for warnings_item_data in _warnings:
|
|
90
|
+
warnings_item = AcquisitionWarning.from_dict(warnings_item_data)
|
|
91
|
+
|
|
92
|
+
warnings.append(warnings_item)
|
|
93
|
+
|
|
94
|
+
attached = d.pop("attached", UNSET)
|
|
95
|
+
|
|
96
|
+
occurrence_preview = cls(
|
|
97
|
+
occurrence_local_date=occurrence_local_date,
|
|
98
|
+
scheduled_start=scheduled_start,
|
|
99
|
+
scheduled_end=scheduled_end,
|
|
100
|
+
warnings=warnings,
|
|
101
|
+
attached=attached,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
occurrence_preview.additional_properties = d
|
|
105
|
+
return occurrence_preview
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
def additional_keys(self) -> list[str]:
|
|
109
|
+
return list(self.additional_properties.keys())
|
|
110
|
+
|
|
111
|
+
def __getitem__(self, key: str) -> Any:
|
|
112
|
+
return self.additional_properties[key]
|
|
113
|
+
|
|
114
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
115
|
+
self.additional_properties[key] = value
|
|
116
|
+
|
|
117
|
+
def __delitem__(self, key: str) -> None:
|
|
118
|
+
del self.additional_properties[key]
|
|
119
|
+
|
|
120
|
+
def __contains__(self, key: str) -> bool:
|
|
121
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
|
|
15
|
+
T = TypeVar("T", bound="OccurrenceSummary")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class OccurrenceSummary:
|
|
20
|
+
"""Summary of a series' occurrences (archived ones included).
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
count (int): Number of scheduled acquisitions in the series.
|
|
24
|
+
first_scheduled_start (datetime.datetime | None):
|
|
25
|
+
last_scheduled_start (datetime.datetime | None):
|
|
26
|
+
ids (list[int]): Their ids, ordered by start.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
count: int
|
|
30
|
+
first_scheduled_start: datetime.datetime | None
|
|
31
|
+
last_scheduled_start: datetime.datetime | None
|
|
32
|
+
ids: list[int]
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
count = self.count
|
|
37
|
+
|
|
38
|
+
first_scheduled_start: None | str
|
|
39
|
+
if isinstance(self.first_scheduled_start, datetime.datetime):
|
|
40
|
+
first_scheduled_start = self.first_scheduled_start.isoformat()
|
|
41
|
+
else:
|
|
42
|
+
first_scheduled_start = self.first_scheduled_start
|
|
43
|
+
|
|
44
|
+
last_scheduled_start: None | str
|
|
45
|
+
if isinstance(self.last_scheduled_start, datetime.datetime):
|
|
46
|
+
last_scheduled_start = self.last_scheduled_start.isoformat()
|
|
47
|
+
else:
|
|
48
|
+
last_scheduled_start = self.last_scheduled_start
|
|
49
|
+
|
|
50
|
+
ids = self.ids
|
|
51
|
+
|
|
52
|
+
field_dict: dict[str, Any] = {}
|
|
53
|
+
field_dict.update(self.additional_properties)
|
|
54
|
+
field_dict.update(
|
|
55
|
+
{
|
|
56
|
+
"count": count,
|
|
57
|
+
"first_scheduled_start": first_scheduled_start,
|
|
58
|
+
"last_scheduled_start": last_scheduled_start,
|
|
59
|
+
"ids": ids,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
67
|
+
d = dict(src_dict)
|
|
68
|
+
count = d.pop("count")
|
|
69
|
+
|
|
70
|
+
def _parse_first_scheduled_start(data: object) -> datetime.datetime | None:
|
|
71
|
+
if data is None:
|
|
72
|
+
return data
|
|
73
|
+
try:
|
|
74
|
+
if not isinstance(data, str):
|
|
75
|
+
raise TypeError()
|
|
76
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
77
|
+
|
|
78
|
+
return componentsschemas_instant_nullable_type_1
|
|
79
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
80
|
+
pass
|
|
81
|
+
return cast(datetime.datetime | None, data)
|
|
82
|
+
|
|
83
|
+
first_scheduled_start = _parse_first_scheduled_start(d.pop("first_scheduled_start"))
|
|
84
|
+
|
|
85
|
+
def _parse_last_scheduled_start(data: object) -> datetime.datetime | None:
|
|
86
|
+
if data is None:
|
|
87
|
+
return data
|
|
88
|
+
try:
|
|
89
|
+
if not isinstance(data, str):
|
|
90
|
+
raise TypeError()
|
|
91
|
+
componentsschemas_instant_nullable_type_1 = datetime.datetime.fromisoformat(data)
|
|
92
|
+
|
|
93
|
+
return componentsschemas_instant_nullable_type_1
|
|
94
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
95
|
+
pass
|
|
96
|
+
return cast(datetime.datetime | None, data)
|
|
97
|
+
|
|
98
|
+
last_scheduled_start = _parse_last_scheduled_start(d.pop("last_scheduled_start"))
|
|
99
|
+
|
|
100
|
+
ids = cast(list[int], d.pop("ids"))
|
|
101
|
+
|
|
102
|
+
occurrence_summary = cls(
|
|
103
|
+
count=count,
|
|
104
|
+
first_scheduled_start=first_scheduled_start,
|
|
105
|
+
last_scheduled_start=last_scheduled_start,
|
|
106
|
+
ids=ids,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
occurrence_summary.additional_properties = d
|
|
110
|
+
return occurrence_summary
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def additional_keys(self) -> list[str]:
|
|
114
|
+
return list(self.additional_properties.keys())
|
|
115
|
+
|
|
116
|
+
def __getitem__(self, key: str) -> Any:
|
|
117
|
+
return self.additional_properties[key]
|
|
118
|
+
|
|
119
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
120
|
+
self.additional_properties[key] = value
|
|
121
|
+
|
|
122
|
+
def __delitem__(self, key: str) -> None:
|
|
123
|
+
del self.additional_properties[key]
|
|
124
|
+
|
|
125
|
+
def __contains__(self, key: str) -> bool:
|
|
126
|
+
return key in self.additional_properties
|