Targets
albert.collections.targets.TargetCollection
Bases: BaseCollection
Beta Feature!
TargetCollection is a collection class for managing Target entities in the Albert platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base URL for target API requests. |
Methods:
| Name | Description |
|---|---|
create |
Creates a new target entity. |
get_by_id |
Retrieves a target by its ID. |
get_by_ids |
Fetches multiple targets at once by their IDs. |
delete |
Deletes a target by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Source code in src/albert/collections/targets.py
create
Creates a new target entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
Target
|
The target object to create. |
required |
Returns:
| Type | Description |
|---|---|
Target
|
The created Target entity. |
Source code in src/albert/collections/targets.py
get_by_id
get_by_ids
Fetches multiple targets at once by their IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list[TargetId]
|
The IDs of the targets to fetch. |
required |
Returns:
| Type | Description |
|---|---|
list[Target]
|
A list of Target entities. |