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,79 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
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 import ValidationError
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="HTTPValidationError")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class HTTPValidationError:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
detail (list[ValidationError] | Unset):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
detail: list[ValidationError] | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
detail: list[dict[str, Any]] | Unset = UNSET
|
|
30
|
+
if not isinstance(self.detail, Unset):
|
|
31
|
+
detail = []
|
|
32
|
+
for detail_item_data in self.detail:
|
|
33
|
+
detail_item = detail_item_data.to_dict()
|
|
34
|
+
detail.append(detail_item)
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update({})
|
|
39
|
+
if detail is not UNSET:
|
|
40
|
+
field_dict["detail"] = detail
|
|
41
|
+
|
|
42
|
+
return field_dict
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
46
|
+
from ..models.validation_error import ValidationError # noqa: PLC0415
|
|
47
|
+
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
_detail = d.pop("detail", UNSET)
|
|
50
|
+
detail: list[ValidationError] | Unset = UNSET
|
|
51
|
+
if _detail is not UNSET:
|
|
52
|
+
detail = []
|
|
53
|
+
for detail_item_data in _detail:
|
|
54
|
+
detail_item = ValidationError.from_dict(detail_item_data)
|
|
55
|
+
|
|
56
|
+
detail.append(detail_item)
|
|
57
|
+
|
|
58
|
+
http_validation_error = cls(
|
|
59
|
+
detail=detail,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
http_validation_error.additional_properties = d
|
|
63
|
+
return http_validation_error
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def additional_keys(self) -> list[str]:
|
|
67
|
+
return list(self.additional_properties.keys())
|
|
68
|
+
|
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
|
70
|
+
return self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
73
|
+
self.additional_properties[key] = value
|
|
74
|
+
|
|
75
|
+
def __delitem__(self, key: str) -> None:
|
|
76
|
+
del self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __contains__(self, key: str) -> bool:
|
|
79
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.instructions_model import InstructionsModel
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="InstructionsConflictModel")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class InstructionsConflictModel:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
detail (str):
|
|
21
|
+
current (InstructionsModel):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
detail: str
|
|
25
|
+
current: InstructionsModel
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
detail = self.detail
|
|
30
|
+
|
|
31
|
+
current = self.current.to_dict()
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update(
|
|
36
|
+
{
|
|
37
|
+
"detail": detail,
|
|
38
|
+
"current": current,
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return field_dict
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
46
|
+
from ..models.instructions_model import InstructionsModel # noqa: PLC0415
|
|
47
|
+
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
detail = d.pop("detail")
|
|
50
|
+
|
|
51
|
+
current = InstructionsModel.from_dict(d.pop("current"))
|
|
52
|
+
|
|
53
|
+
instructions_conflict_model = cls(
|
|
54
|
+
detail=detail,
|
|
55
|
+
current=current,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
instructions_conflict_model.additional_properties = d
|
|
59
|
+
return instructions_conflict_model
|
|
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,69 @@
|
|
|
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
|
+
T = TypeVar("T", bound="InstructionsEditModel")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class InstructionsEditModel:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
instructions (list[str]):
|
|
17
|
+
base_version (int):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
instructions: list[str]
|
|
21
|
+
base_version: int
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
instructions = self.instructions
|
|
26
|
+
|
|
27
|
+
base_version = self.base_version
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"instructions": instructions,
|
|
34
|
+
"base_version": base_version,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
instructions = cast(list[str], d.pop("instructions"))
|
|
44
|
+
|
|
45
|
+
base_version = d.pop("base_version")
|
|
46
|
+
|
|
47
|
+
instructions_edit_model = cls(
|
|
48
|
+
instructions=instructions,
|
|
49
|
+
base_version=base_version,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
instructions_edit_model.additional_properties = d
|
|
53
|
+
return instructions_edit_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,69 @@
|
|
|
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
|
+
T = TypeVar("T", bound="InstructionsModel")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class InstructionsModel:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
instructions (list[str]):
|
|
17
|
+
version (int):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
instructions: list[str]
|
|
21
|
+
version: int
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
instructions = self.instructions
|
|
26
|
+
|
|
27
|
+
version = self.version
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"instructions": instructions,
|
|
34
|
+
"version": version,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
instructions = cast(list[str], d.pop("instructions"))
|
|
44
|
+
|
|
45
|
+
version = d.pop("version")
|
|
46
|
+
|
|
47
|
+
instructions_model = cls(
|
|
48
|
+
instructions=instructions,
|
|
49
|
+
version=version,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
instructions_model.additional_properties = d
|
|
53
|
+
return instructions_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,75 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.note_model import NoteModel
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="NoteConflictModel")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class NoteConflictModel:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
detail (str):
|
|
21
|
+
current (NoteModel):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
detail: str
|
|
25
|
+
current: NoteModel
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
detail = self.detail
|
|
30
|
+
|
|
31
|
+
current = self.current.to_dict()
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update(
|
|
36
|
+
{
|
|
37
|
+
"detail": detail,
|
|
38
|
+
"current": current,
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return field_dict
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
46
|
+
from ..models.note_model import NoteModel # noqa: PLC0415
|
|
47
|
+
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
detail = d.pop("detail")
|
|
50
|
+
|
|
51
|
+
current = NoteModel.from_dict(d.pop("current"))
|
|
52
|
+
|
|
53
|
+
note_conflict_model = cls(
|
|
54
|
+
detail=detail,
|
|
55
|
+
current=current,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
note_conflict_model.additional_properties = d
|
|
59
|
+
return note_conflict_model
|
|
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,86 @@
|
|
|
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
|
+
T = TypeVar("T", bound="NoteMemberModel")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class NoteMemberModel:
|
|
16
|
+
"""Someone who joined the note through a write link
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
note_member_id (UUID):
|
|
20
|
+
member_name (None | str):
|
|
21
|
+
created_at (datetime.datetime):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
note_member_id: UUID
|
|
25
|
+
member_name: None | str
|
|
26
|
+
created_at: datetime.datetime
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
note_member_id = str(self.note_member_id)
|
|
31
|
+
|
|
32
|
+
member_name: None | str
|
|
33
|
+
member_name = self.member_name
|
|
34
|
+
|
|
35
|
+
created_at = self.created_at.isoformat()
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update(
|
|
40
|
+
{
|
|
41
|
+
"note_member_id": note_member_id,
|
|
42
|
+
"member_name": member_name,
|
|
43
|
+
"created_at": created_at,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
note_member_id = UUID(d.pop("note_member_id"))
|
|
53
|
+
|
|
54
|
+
def _parse_member_name(data: object) -> None | str:
|
|
55
|
+
if data is None:
|
|
56
|
+
return data
|
|
57
|
+
return cast(None | str, data)
|
|
58
|
+
|
|
59
|
+
member_name = _parse_member_name(d.pop("member_name"))
|
|
60
|
+
|
|
61
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
62
|
+
|
|
63
|
+
note_member_model = cls(
|
|
64
|
+
note_member_id=note_member_id,
|
|
65
|
+
member_name=member_name,
|
|
66
|
+
created_at=created_at,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
note_member_model.additional_properties = d
|
|
70
|
+
return note_member_model
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def additional_keys(self) -> list[str]:
|
|
74
|
+
return list(self.additional_properties.keys())
|
|
75
|
+
|
|
76
|
+
def __getitem__(self, key: str) -> Any:
|
|
77
|
+
return self.additional_properties[key]
|
|
78
|
+
|
|
79
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
80
|
+
self.additional_properties[key] = value
|
|
81
|
+
|
|
82
|
+
def __delitem__(self, key: str) -> None:
|
|
83
|
+
del self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __contains__(self, key: str) -> bool:
|
|
86
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import 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
|
+
T = TypeVar("T", bound="NoteModel")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class NoteModel:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
note_id (UUID):
|
|
21
|
+
content (str):
|
|
22
|
+
title (str):
|
|
23
|
+
is_default (bool):
|
|
24
|
+
updated_at (datetime.datetime):
|
|
25
|
+
version (int):
|
|
26
|
+
access (NoteAccess): What the user may do with a note
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
note_id: UUID
|
|
30
|
+
content: str
|
|
31
|
+
title: str
|
|
32
|
+
is_default: bool
|
|
33
|
+
updated_at: datetime.datetime
|
|
34
|
+
version: int
|
|
35
|
+
access: NoteAccess
|
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
37
|
+
|
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
|
39
|
+
note_id = str(self.note_id)
|
|
40
|
+
|
|
41
|
+
content = self.content
|
|
42
|
+
|
|
43
|
+
title = self.title
|
|
44
|
+
|
|
45
|
+
is_default = self.is_default
|
|
46
|
+
|
|
47
|
+
updated_at = self.updated_at.isoformat()
|
|
48
|
+
|
|
49
|
+
version = self.version
|
|
50
|
+
|
|
51
|
+
access = self.access.value
|
|
52
|
+
|
|
53
|
+
field_dict: dict[str, Any] = {}
|
|
54
|
+
field_dict.update(self.additional_properties)
|
|
55
|
+
field_dict.update(
|
|
56
|
+
{
|
|
57
|
+
"note_id": note_id,
|
|
58
|
+
"content": content,
|
|
59
|
+
"title": title,
|
|
60
|
+
"is_default": is_default,
|
|
61
|
+
"updated_at": updated_at,
|
|
62
|
+
"version": version,
|
|
63
|
+
"access": access,
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return field_dict
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
71
|
+
d = dict(src_dict)
|
|
72
|
+
note_id = UUID(d.pop("note_id"))
|
|
73
|
+
|
|
74
|
+
content = d.pop("content")
|
|
75
|
+
|
|
76
|
+
title = d.pop("title")
|
|
77
|
+
|
|
78
|
+
is_default = d.pop("is_default")
|
|
79
|
+
|
|
80
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
81
|
+
|
|
82
|
+
version = d.pop("version")
|
|
83
|
+
|
|
84
|
+
access = NoteAccess(d.pop("access"))
|
|
85
|
+
|
|
86
|
+
note_model = cls(
|
|
87
|
+
note_id=note_id,
|
|
88
|
+
content=content,
|
|
89
|
+
title=title,
|
|
90
|
+
is_default=is_default,
|
|
91
|
+
updated_at=updated_at,
|
|
92
|
+
version=version,
|
|
93
|
+
access=access,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
note_model.additional_properties = d
|
|
97
|
+
return note_model
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def additional_keys(self) -> list[str]:
|
|
101
|
+
return list(self.additional_properties.keys())
|
|
102
|
+
|
|
103
|
+
def __getitem__(self, key: str) -> Any:
|
|
104
|
+
return self.additional_properties[key]
|
|
105
|
+
|
|
106
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
107
|
+
self.additional_properties[key] = value
|
|
108
|
+
|
|
109
|
+
def __delitem__(self, key: str) -> None:
|
|
110
|
+
del self.additional_properties[key]
|
|
111
|
+
|
|
112
|
+
def __contains__(self, key: str) -> bool:
|
|
113
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.note_member_model import NoteMemberModel
|
|
11
|
+
from ..models.share_link_model import ShareLinkModel
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="NoteSharingModel")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class NoteSharingModel:
|
|
19
|
+
"""Who the note is shared with: its live links and members
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
links (list[ShareLinkModel]):
|
|
23
|
+
members (list[NoteMemberModel]):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
links: list[ShareLinkModel]
|
|
27
|
+
members: list[NoteMemberModel]
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
links = []
|
|
32
|
+
for links_item_data in self.links:
|
|
33
|
+
links_item = links_item_data.to_dict()
|
|
34
|
+
links.append(links_item)
|
|
35
|
+
|
|
36
|
+
members = []
|
|
37
|
+
for members_item_data in self.members:
|
|
38
|
+
members_item = members_item_data.to_dict()
|
|
39
|
+
members.append(members_item)
|
|
40
|
+
|
|
41
|
+
field_dict: dict[str, Any] = {}
|
|
42
|
+
field_dict.update(self.additional_properties)
|
|
43
|
+
field_dict.update(
|
|
44
|
+
{
|
|
45
|
+
"links": links,
|
|
46
|
+
"members": members,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
return field_dict
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
from ..models.note_member_model import NoteMemberModel # noqa: PLC0415
|
|
55
|
+
from ..models.share_link_model import ShareLinkModel # noqa: PLC0415
|
|
56
|
+
|
|
57
|
+
d = dict(src_dict)
|
|
58
|
+
links = []
|
|
59
|
+
_links = d.pop("links")
|
|
60
|
+
for links_item_data in _links:
|
|
61
|
+
links_item = ShareLinkModel.from_dict(links_item_data)
|
|
62
|
+
|
|
63
|
+
links.append(links_item)
|
|
64
|
+
|
|
65
|
+
members = []
|
|
66
|
+
_members = d.pop("members")
|
|
67
|
+
for members_item_data in _members:
|
|
68
|
+
members_item = NoteMemberModel.from_dict(members_item_data)
|
|
69
|
+
|
|
70
|
+
members.append(members_item)
|
|
71
|
+
|
|
72
|
+
note_sharing_model = cls(
|
|
73
|
+
links=links,
|
|
74
|
+
members=members,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
note_sharing_model.additional_properties = d
|
|
78
|
+
return note_sharing_model
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def additional_keys(self) -> list[str]:
|
|
82
|
+
return list(self.additional_properties.keys())
|
|
83
|
+
|
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
|
85
|
+
return self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
88
|
+
self.additional_properties[key] = value
|
|
89
|
+
|
|
90
|
+
def __delitem__(self, key: str) -> None:
|
|
91
|
+
del self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __contains__(self, key: str) -> bool:
|
|
94
|
+
return key in self.additional_properties
|