Links
albert.collections.links.LinksCollection
Bases: BaseCollection
LinksCollection is a collection class for managing Link entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
create |
Creates a new link entity. |
get_all |
Get all link entities with optional filters. |
get_by_id |
Retrieves a link entity by its ID. |
delete |
Deletes a link entity by its ID. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/links.py
create
Creates a new link entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
links
|
list[Link]
|
List of Link entities to create. |
required |
Returns:
Type | Description |
---|---|
Link
|
The created link entity. |
Source code in src/albert/collections/links.py
get_all
get_all(
*,
type: str | None = None,
category: LinkCategory | None = None,
id: str | None = None,
start_key: str | None = None,
max_items: int | None = None,
) -> Iterator[Link]
Get all link entities with optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
str
|
The type of the link entities to return. Allowed values are |
None
|
category
|
LinkCategory
|
The category of the link entities to return. Allowed values are |
None
|
id
|
str
|
The ID of the entity to fetch links for. |
None
|
start_key
|
str
|
The pagination key to start from. |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Returns:
Type | Description |
---|---|
Iterator[Link]
|
An iterator of Link entities. |
Source code in src/albert/collections/links.py
get_by_id
Retrieves a link entity by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the link entity to retrieve. |
required |
Returns:
Type | Description |
---|---|
Link
|
The retrieved link entity. |