pebbenote-cli 0.6.1__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.
- pebbenote_cli/__init__.py +0 -0
- pebbenote_cli/__main__.py +3 -0
- pebbenote_cli/api.py +62 -0
- pebbenote_cli/auth.py +120 -0
- pebbenote_cli/cli.py +282 -0
- pebbenote_cli/client/__init__.py +8 -0
- pebbenote_cli/client/api/__init__.py +1 -0
- pebbenote_cli/client/api/actions/__init__.py +1 -0
- pebbenote_cli/client/api/actions/apply_action.py +166 -0
- pebbenote_cli/client/api/instructions/__init__.py +1 -0
- pebbenote_cli/client/api/instructions/list_instructions.py +127 -0
- pebbenote_cli/client/api/instructions/replace_instructions.py +204 -0
- pebbenote_cli/client/api/notes/__init__.py +1 -0
- pebbenote_cli/client/api/notes/create_note.py +173 -0
- pebbenote_cli/client/api/notes/delete_note.py +159 -0
- pebbenote_cli/client/api/notes/edit_note_by_id.py +197 -0
- pebbenote_cli/client/api/notes/get_note_by_id.py +184 -0
- pebbenote_cli/client/api/notes/list_notes.py +132 -0
- pebbenote_cli/client/api/notes/set_default_note.py +161 -0
- pebbenote_cli/client/api/sharing/__init__.py +1 -0
- pebbenote_cli/client/api/sharing/get_note_sharing.py +161 -0
- pebbenote_cli/client/api/sharing/get_shared_note.py +172 -0
- pebbenote_cli/client/api/sharing/join_shared_note.py +176 -0
- pebbenote_cli/client/api/sharing/make_note_private.py +167 -0
- pebbenote_cli/client/api/sharing/remove_note_member.py +173 -0
- pebbenote_cli/client/api/sharing/revoke_share_link.py +181 -0
- pebbenote_cli/client/api/sharing/share_note.py +202 -0
- pebbenote_cli/client/client.py +280 -0
- pebbenote_cli/client/errors.py +16 -0
- pebbenote_cli/client/models/__init__.py +47 -0
- pebbenote_cli/client/models/action_accepted_model.py +68 -0
- pebbenote_cli/client/models/action_edit_model.py +96 -0
- pebbenote_cli/client/models/action_model.py +105 -0
- pebbenote_cli/client/models/action_status.py +10 -0
- pebbenote_cli/client/models/http_validation_error.py +79 -0
- pebbenote_cli/client/models/instructions_conflict_model.py +75 -0
- pebbenote_cli/client/models/instructions_edit_model.py +69 -0
- pebbenote_cli/client/models/instructions_model.py +69 -0
- pebbenote_cli/client/models/note_access.py +10 -0
- pebbenote_cli/client/models/note_conflict_model.py +75 -0
- pebbenote_cli/client/models/note_member_model.py +86 -0
- pebbenote_cli/client/models/note_model.py +113 -0
- pebbenote_cli/client/models/note_sharing_model.py +94 -0
- pebbenote_cli/client/models/note_update_model.py +83 -0
- pebbenote_cli/client/models/note_view_model.py +143 -0
- pebbenote_cli/client/models/share_access.py +9 -0
- pebbenote_cli/client/models/share_create_model.py +69 -0
- pebbenote_cli/client/models/share_link_model.py +120 -0
- pebbenote_cli/client/models/shared_note_model.py +89 -0
- pebbenote_cli/client/models/validation_error.py +125 -0
- pebbenote_cli/client/models/validation_error_context.py +44 -0
- pebbenote_cli/client/types.py +54 -0
- pebbenote_cli/config.py +46 -0
- pebbenote_cli/editor.py +23 -0
- pebbenote_cli/errors.py +10 -0
- pebbenote_cli/http.py +36 -0
- pebbenote_cli/instructions.py +24 -0
- pebbenote_cli/merge.py +79 -0
- pebbenote_cli-0.6.1.dist-info/METADATA +129 -0
- pebbenote_cli-0.6.1.dist-info/RECORD +62 -0
- pebbenote_cli-0.6.1.dist-info/WHEEL +4 -0
- pebbenote_cli-0.6.1.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
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
|
+
T = TypeVar("T", bound="NoteUpdateModel")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class NoteUpdateModel:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
content (str):
|
|
19
|
+
base_version (int | None | Unset):
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
content: str
|
|
23
|
+
base_version: int | None | Unset = UNSET
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
content = self.content
|
|
28
|
+
|
|
29
|
+
base_version: int | None | Unset
|
|
30
|
+
if isinstance(self.base_version, Unset):
|
|
31
|
+
base_version = UNSET
|
|
32
|
+
else:
|
|
33
|
+
base_version = self.base_version
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"content": content,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if base_version is not UNSET:
|
|
43
|
+
field_dict["base_version"] = base_version
|
|
44
|
+
|
|
45
|
+
return field_dict
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
content = d.pop("content")
|
|
51
|
+
|
|
52
|
+
def _parse_base_version(data: object) -> int | None | Unset:
|
|
53
|
+
if data is None:
|
|
54
|
+
return data
|
|
55
|
+
if isinstance(data, Unset):
|
|
56
|
+
return data
|
|
57
|
+
return cast(int | None | Unset, data)
|
|
58
|
+
|
|
59
|
+
base_version = _parse_base_version(d.pop("base_version", UNSET))
|
|
60
|
+
|
|
61
|
+
note_update_model = cls(
|
|
62
|
+
content=content,
|
|
63
|
+
base_version=base_version,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
note_update_model.additional_properties = d
|
|
67
|
+
return note_update_model
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
from attrs import define as _attrs_define
|
|
9
|
+
from attrs import field as _attrs_field
|
|
10
|
+
|
|
11
|
+
from ..models.note_access import NoteAccess
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.action_model import ActionModel
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="NoteViewModel")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class NoteViewModel:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
note_id (UUID):
|
|
25
|
+
content (str):
|
|
26
|
+
title (str):
|
|
27
|
+
is_default (bool):
|
|
28
|
+
updated_at (datetime.datetime):
|
|
29
|
+
version (int):
|
|
30
|
+
access (NoteAccess): What the user may do with a note
|
|
31
|
+
actions (list[ActionModel]):
|
|
32
|
+
last_modified (str):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
note_id: UUID
|
|
36
|
+
content: str
|
|
37
|
+
title: str
|
|
38
|
+
is_default: bool
|
|
39
|
+
updated_at: datetime.datetime
|
|
40
|
+
version: int
|
|
41
|
+
access: NoteAccess
|
|
42
|
+
actions: list[ActionModel]
|
|
43
|
+
last_modified: str
|
|
44
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
45
|
+
|
|
46
|
+
def to_dict(self) -> dict[str, Any]:
|
|
47
|
+
note_id = str(self.note_id)
|
|
48
|
+
|
|
49
|
+
content = self.content
|
|
50
|
+
|
|
51
|
+
title = self.title
|
|
52
|
+
|
|
53
|
+
is_default = self.is_default
|
|
54
|
+
|
|
55
|
+
updated_at = self.updated_at.isoformat()
|
|
56
|
+
|
|
57
|
+
version = self.version
|
|
58
|
+
|
|
59
|
+
access = self.access.value
|
|
60
|
+
|
|
61
|
+
actions = []
|
|
62
|
+
for actions_item_data in self.actions:
|
|
63
|
+
actions_item = actions_item_data.to_dict()
|
|
64
|
+
actions.append(actions_item)
|
|
65
|
+
|
|
66
|
+
last_modified = self.last_modified
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update(
|
|
71
|
+
{
|
|
72
|
+
"note_id": note_id,
|
|
73
|
+
"content": content,
|
|
74
|
+
"title": title,
|
|
75
|
+
"is_default": is_default,
|
|
76
|
+
"updated_at": updated_at,
|
|
77
|
+
"version": version,
|
|
78
|
+
"access": access,
|
|
79
|
+
"actions": actions,
|
|
80
|
+
"last_modified": last_modified,
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return field_dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
88
|
+
from ..models.action_model import ActionModel # noqa: PLC0415
|
|
89
|
+
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
note_id = UUID(d.pop("note_id"))
|
|
92
|
+
|
|
93
|
+
content = d.pop("content")
|
|
94
|
+
|
|
95
|
+
title = d.pop("title")
|
|
96
|
+
|
|
97
|
+
is_default = d.pop("is_default")
|
|
98
|
+
|
|
99
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
100
|
+
|
|
101
|
+
version = d.pop("version")
|
|
102
|
+
|
|
103
|
+
access = NoteAccess(d.pop("access"))
|
|
104
|
+
|
|
105
|
+
actions = []
|
|
106
|
+
_actions = d.pop("actions")
|
|
107
|
+
for actions_item_data in _actions:
|
|
108
|
+
actions_item = ActionModel.from_dict(actions_item_data)
|
|
109
|
+
|
|
110
|
+
actions.append(actions_item)
|
|
111
|
+
|
|
112
|
+
last_modified = d.pop("last_modified")
|
|
113
|
+
|
|
114
|
+
note_view_model = cls(
|
|
115
|
+
note_id=note_id,
|
|
116
|
+
content=content,
|
|
117
|
+
title=title,
|
|
118
|
+
is_default=is_default,
|
|
119
|
+
updated_at=updated_at,
|
|
120
|
+
version=version,
|
|
121
|
+
access=access,
|
|
122
|
+
actions=actions,
|
|
123
|
+
last_modified=last_modified,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
note_view_model.additional_properties = d
|
|
127
|
+
return note_view_model
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def additional_keys(self) -> list[str]:
|
|
131
|
+
return list(self.additional_properties.keys())
|
|
132
|
+
|
|
133
|
+
def __getitem__(self, key: str) -> Any:
|
|
134
|
+
return self.additional_properties[key]
|
|
135
|
+
|
|
136
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
137
|
+
self.additional_properties[key] = value
|
|
138
|
+
|
|
139
|
+
def __delitem__(self, key: str) -> None:
|
|
140
|
+
del self.additional_properties[key]
|
|
141
|
+
|
|
142
|
+
def __contains__(self, key: str) -> bool:
|
|
143
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.share_access import ShareAccess
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="ShareCreateModel")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class ShareCreateModel:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
access (ShareAccess | Unset):
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
access: ShareAccess | Unset = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
access: str | Unset = UNSET
|
|
27
|
+
if not isinstance(self.access, Unset):
|
|
28
|
+
access = self.access.value
|
|
29
|
+
|
|
30
|
+
field_dict: dict[str, Any] = {}
|
|
31
|
+
field_dict.update(self.additional_properties)
|
|
32
|
+
field_dict.update({})
|
|
33
|
+
if access is not UNSET:
|
|
34
|
+
field_dict["access"] = access
|
|
35
|
+
|
|
36
|
+
return field_dict
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
40
|
+
d = dict(src_dict)
|
|
41
|
+
_access = d.pop("access", UNSET)
|
|
42
|
+
access: ShareAccess | Unset
|
|
43
|
+
if isinstance(_access, Unset):
|
|
44
|
+
access = UNSET
|
|
45
|
+
else:
|
|
46
|
+
access = ShareAccess(_access)
|
|
47
|
+
|
|
48
|
+
share_create_model = cls(
|
|
49
|
+
access=access,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
share_create_model.additional_properties = d
|
|
53
|
+
return share_create_model
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar, cast
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
from attrs import define as _attrs_define
|
|
9
|
+
from attrs import field as _attrs_field
|
|
10
|
+
|
|
11
|
+
from ..models.share_access import ShareAccess
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="ShareLinkModel")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class ShareLinkModel:
|
|
19
|
+
"""
|
|
20
|
+
Attributes:
|
|
21
|
+
note_share_id (UUID):
|
|
22
|
+
access (ShareAccess):
|
|
23
|
+
path (str):
|
|
24
|
+
created_at (datetime.datetime):
|
|
25
|
+
expires_at (datetime.datetime | None | Unset):
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
note_share_id: UUID
|
|
29
|
+
access: ShareAccess
|
|
30
|
+
path: str
|
|
31
|
+
created_at: datetime.datetime
|
|
32
|
+
expires_at: datetime.datetime | None | Unset = UNSET
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
note_share_id = str(self.note_share_id)
|
|
37
|
+
|
|
38
|
+
access = self.access.value
|
|
39
|
+
|
|
40
|
+
path = self.path
|
|
41
|
+
|
|
42
|
+
created_at = self.created_at.isoformat()
|
|
43
|
+
|
|
44
|
+
expires_at: None | str | Unset
|
|
45
|
+
if isinstance(self.expires_at, Unset):
|
|
46
|
+
expires_at = UNSET
|
|
47
|
+
elif isinstance(self.expires_at, datetime.datetime):
|
|
48
|
+
expires_at = self.expires_at.isoformat()
|
|
49
|
+
else:
|
|
50
|
+
expires_at = self.expires_at
|
|
51
|
+
|
|
52
|
+
field_dict: dict[str, Any] = {}
|
|
53
|
+
field_dict.update(self.additional_properties)
|
|
54
|
+
field_dict.update(
|
|
55
|
+
{
|
|
56
|
+
"note_share_id": note_share_id,
|
|
57
|
+
"access": access,
|
|
58
|
+
"path": path,
|
|
59
|
+
"created_at": created_at,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
if expires_at is not UNSET:
|
|
63
|
+
field_dict["expires_at"] = expires_at
|
|
64
|
+
|
|
65
|
+
return field_dict
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
69
|
+
d = dict(src_dict)
|
|
70
|
+
note_share_id = UUID(d.pop("note_share_id"))
|
|
71
|
+
|
|
72
|
+
access = ShareAccess(d.pop("access"))
|
|
73
|
+
|
|
74
|
+
path = d.pop("path")
|
|
75
|
+
|
|
76
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
77
|
+
|
|
78
|
+
def _parse_expires_at(data: object) -> datetime.datetime | None | Unset:
|
|
79
|
+
if data is None:
|
|
80
|
+
return data
|
|
81
|
+
if isinstance(data, Unset):
|
|
82
|
+
return data
|
|
83
|
+
try:
|
|
84
|
+
if not isinstance(data, str):
|
|
85
|
+
raise TypeError()
|
|
86
|
+
expires_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
87
|
+
|
|
88
|
+
return expires_at_type_0
|
|
89
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
90
|
+
pass
|
|
91
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
92
|
+
|
|
93
|
+
expires_at = _parse_expires_at(d.pop("expires_at", UNSET))
|
|
94
|
+
|
|
95
|
+
share_link_model = cls(
|
|
96
|
+
note_share_id=note_share_id,
|
|
97
|
+
access=access,
|
|
98
|
+
path=path,
|
|
99
|
+
created_at=created_at,
|
|
100
|
+
expires_at=expires_at,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
share_link_model.additional_properties = d
|
|
104
|
+
return share_link_model
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def additional_keys(self) -> list[str]:
|
|
108
|
+
return list(self.additional_properties.keys())
|
|
109
|
+
|
|
110
|
+
def __getitem__(self, key: str) -> Any:
|
|
111
|
+
return self.additional_properties[key]
|
|
112
|
+
|
|
113
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
114
|
+
self.additional_properties[key] = value
|
|
115
|
+
|
|
116
|
+
def __delitem__(self, key: str) -> None:
|
|
117
|
+
del self.additional_properties[key]
|
|
118
|
+
|
|
119
|
+
def __contains__(self, key: str) -> bool:
|
|
120
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar
|
|
6
|
+
|
|
7
|
+
from attrs import define as _attrs_define
|
|
8
|
+
from attrs import field as _attrs_field
|
|
9
|
+
|
|
10
|
+
from ..models.share_access import ShareAccess
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="SharedNoteModel")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class SharedNoteModel:
|
|
17
|
+
"""What a link shows of a note, without its id
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
title (str):
|
|
21
|
+
content (str):
|
|
22
|
+
updated_at (datetime.datetime):
|
|
23
|
+
access (ShareAccess):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
title: str
|
|
27
|
+
content: str
|
|
28
|
+
updated_at: datetime.datetime
|
|
29
|
+
access: ShareAccess
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
title = self.title
|
|
34
|
+
|
|
35
|
+
content = self.content
|
|
36
|
+
|
|
37
|
+
updated_at = self.updated_at.isoformat()
|
|
38
|
+
|
|
39
|
+
access = self.access.value
|
|
40
|
+
|
|
41
|
+
field_dict: dict[str, Any] = {}
|
|
42
|
+
field_dict.update(self.additional_properties)
|
|
43
|
+
field_dict.update(
|
|
44
|
+
{
|
|
45
|
+
"title": title,
|
|
46
|
+
"content": content,
|
|
47
|
+
"updated_at": updated_at,
|
|
48
|
+
"access": access,
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
return field_dict
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
title = d.pop("title")
|
|
58
|
+
|
|
59
|
+
content = d.pop("content")
|
|
60
|
+
|
|
61
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
62
|
+
|
|
63
|
+
access = ShareAccess(d.pop("access"))
|
|
64
|
+
|
|
65
|
+
shared_note_model = cls(
|
|
66
|
+
title=title,
|
|
67
|
+
content=content,
|
|
68
|
+
updated_at=updated_at,
|
|
69
|
+
access=access,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
shared_note_model.additional_properties = d
|
|
73
|
+
return shared_note_model
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def additional_keys(self) -> list[str]:
|
|
77
|
+
return list(self.additional_properties.keys())
|
|
78
|
+
|
|
79
|
+
def __getitem__(self, key: str) -> Any:
|
|
80
|
+
return self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
83
|
+
self.additional_properties[key] = value
|
|
84
|
+
|
|
85
|
+
def __delitem__(self, key: str) -> None:
|
|
86
|
+
del self.additional_properties[key]
|
|
87
|
+
|
|
88
|
+
def __contains__(self, key: str) -> bool:
|
|
89
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
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
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.validation_error_context import ValidationErrorContext
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="ValidationError")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class ValidationError:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
loc (list[int | str]):
|
|
23
|
+
msg (str):
|
|
24
|
+
type_ (str):
|
|
25
|
+
input_ (Any | Unset):
|
|
26
|
+
ctx (ValidationErrorContext | Unset):
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
loc: list[int | str]
|
|
30
|
+
msg: str
|
|
31
|
+
type_: str
|
|
32
|
+
input_: Any | Unset = UNSET
|
|
33
|
+
ctx: ValidationErrorContext | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
loc = []
|
|
38
|
+
for loc_item_data in self.loc:
|
|
39
|
+
loc_item: int | str
|
|
40
|
+
loc_item = loc_item_data
|
|
41
|
+
loc.append(loc_item)
|
|
42
|
+
|
|
43
|
+
msg = self.msg
|
|
44
|
+
|
|
45
|
+
type_ = self.type_
|
|
46
|
+
|
|
47
|
+
input_ = self.input_
|
|
48
|
+
|
|
49
|
+
ctx: dict[str, Any] | Unset = UNSET
|
|
50
|
+
if not isinstance(self.ctx, Unset):
|
|
51
|
+
ctx = self.ctx.to_dict()
|
|
52
|
+
|
|
53
|
+
field_dict: dict[str, Any] = {}
|
|
54
|
+
field_dict.update(self.additional_properties)
|
|
55
|
+
field_dict.update(
|
|
56
|
+
{
|
|
57
|
+
"loc": loc,
|
|
58
|
+
"msg": msg,
|
|
59
|
+
"type": type_,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
if input_ is not UNSET:
|
|
63
|
+
field_dict["input"] = input_
|
|
64
|
+
if ctx is not UNSET:
|
|
65
|
+
field_dict["ctx"] = ctx
|
|
66
|
+
|
|
67
|
+
return field_dict
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
71
|
+
from ..models.validation_error_context import (
|
|
72
|
+
ValidationErrorContext, # noqa: PLC0415
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
d = dict(src_dict)
|
|
76
|
+
loc = []
|
|
77
|
+
_loc = d.pop("loc")
|
|
78
|
+
for loc_item_data in _loc:
|
|
79
|
+
|
|
80
|
+
def _parse_loc_item(data: object) -> int | str:
|
|
81
|
+
return cast(int | str, data)
|
|
82
|
+
|
|
83
|
+
loc_item = _parse_loc_item(loc_item_data)
|
|
84
|
+
|
|
85
|
+
loc.append(loc_item)
|
|
86
|
+
|
|
87
|
+
msg = d.pop("msg")
|
|
88
|
+
|
|
89
|
+
type_ = d.pop("type")
|
|
90
|
+
|
|
91
|
+
input_ = d.pop("input", UNSET)
|
|
92
|
+
|
|
93
|
+
_ctx = d.pop("ctx", UNSET)
|
|
94
|
+
ctx: ValidationErrorContext | Unset
|
|
95
|
+
if isinstance(_ctx, Unset):
|
|
96
|
+
ctx = UNSET
|
|
97
|
+
else:
|
|
98
|
+
ctx = ValidationErrorContext.from_dict(_ctx)
|
|
99
|
+
|
|
100
|
+
validation_error = cls(
|
|
101
|
+
loc=loc,
|
|
102
|
+
msg=msg,
|
|
103
|
+
type_=type_,
|
|
104
|
+
input_=input_,
|
|
105
|
+
ctx=ctx,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
validation_error.additional_properties = d
|
|
109
|
+
return validation_error
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def additional_keys(self) -> list[str]:
|
|
113
|
+
return list(self.additional_properties.keys())
|
|
114
|
+
|
|
115
|
+
def __getitem__(self, key: str) -> Any:
|
|
116
|
+
return self.additional_properties[key]
|
|
117
|
+
|
|
118
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
119
|
+
self.additional_properties[key] = value
|
|
120
|
+
|
|
121
|
+
def __delitem__(self, key: str) -> None:
|
|
122
|
+
del self.additional_properties[key]
|
|
123
|
+
|
|
124
|
+
def __contains__(self, key: str) -> bool:
|
|
125
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ValidationErrorContext")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ValidationErrorContext:
|
|
14
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
field_dict.update(self.additional_properties)
|
|
19
|
+
|
|
20
|
+
return field_dict
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
|
+
d = dict(src_dict)
|
|
25
|
+
validation_error_context = cls()
|
|
26
|
+
|
|
27
|
+
validation_error_context.additional_properties = d
|
|
28
|
+
return validation_error_context
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
38
|
+
self.additional_properties[key] = value
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key: str) -> None:
|
|
41
|
+
del self.additional_properties[key]
|
|
42
|
+
|
|
43
|
+
def __contains__(self, key: str) -> bool:
|
|
44
|
+
return key in self.additional_properties
|