Parameters
albert.collections.parameters.ParameterCollection
Bases: BaseCollection
ParameterCollection is a collection class for managing Parameter entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
get_by_id |
Retrieve a parameter by its ID. |
create |
Create a new parameter. |
delete |
Delete a parameter by its ID. |
list |
Lists parameters that match the provided criteria. |
update |
Update a parameter. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/parameters.py
get_by_id
Retrieve a parameter by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the parameter to retrieve. |
required |
Returns:
Type | Description |
---|---|
Parameter
|
The parameter with the given ID. |
Source code in src/albert/collections/parameters.py
create
Create a new parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter
|
Parameter
|
The parameter to create. |
required |
Returns:
Type | Description |
---|---|
Parameter
|
Returns the created parameter or the existing parameter if it already exists. |
Source code in src/albert/collections/parameters.py
delete
delete(*, id: str) -> None
Delete a parameter by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the parameter to delete. |
required |
list
list(
*,
ids: list[str] | None = None,
names: str | list[str] = None,
exact_match: bool = False,
order_by: OrderBy = DESCENDING,
start_key: str | None = None,
limit: int = 50,
return_full: bool = True,
) -> Iterator[Parameter]
Lists parameters that match the provided criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids
|
list[str] | None
|
A list of parameter IDs to retrieve, by default None |
None
|
names
|
str | list[str]
|
A list of parameter names to retrieve, by default None |
None
|
exact_match
|
bool
|
Whether to match the name exactly, by default False |
False
|
order_by
|
OrderBy
|
The order in which to return results, by default OrderBy.DESCENDING |
DESCENDING
|
return_full
|
bool
|
Whether to make additional API call to fetch the full object, by default True |
True
|
Yields:
Type | Description |
---|---|
Iterator[Parameter]
|
An iterator of Parameters matching the given criteria. |
Source code in src/albert/collections/parameters.py
update
Update a parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter
|
Parameter
|
The updated parameter to save. The parameter must have an ID. |
required |
Returns:
Type | Description |
---|---|
Parameter
|
The updated parameter as returned by the server. |