Notes
albert.collections.notes.NotesCollection
Bases: BaseCollection
NotesCollection is a collection class for managing Note entities in the Albert platform.
Methods:
Name | Description |
---|---|
create |
Creates a new note. |
get_by_id |
Retrieves a note by its ID. |
update |
Updates a note. |
delete |
Deletes a note by its ID. |
list |
Lists notes by their parent ID. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/notes.py
create
Creates a new note.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
note
|
str
|
The note content. |
required |
Returns:
Type | Description |
---|---|
Note
|
The created note. |
Source code in src/albert/collections/notes.py
get_by_id
update
Updates a note.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
note
|
Note
|
The note to update. The note must have an ID. |
required |
Returns:
Type | Description |
---|---|
Note
|
The updated note as returned by the server. |
Source code in src/albert/collections/notes.py
delete
delete(*, id: str) -> None
Deletes a note by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the note to delete. |
required |
list
Lists notes by their parent ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_id
|
str
|
The parent ID of the notes to list. |
required |
order_by
|
OrderBy
|
The order to list notes in, by default OrderBy.DESCENDING. |
DESCENDING
|
Returns:
Type | Description |
---|---|
List[Note]
|
The list of notes. |