Storage Locations
albert.collections.storage_locations.StorageLocationsCollection
Bases: BaseCollection
StorageLocationsCollection is a collection class for managing StorageLoction entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert Session information |
required |
Methods:
Name | Description |
---|---|
get_by_id |
Get a storage location by its ID. |
get_all |
Get all storage locations with optional filtering. |
create |
Create a new storage location. |
get_or_create |
Get or create a storage location. |
delete |
Delete a storage location by its ID. |
update |
Update a storage location. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/storage_locations.py
get_by_id
get_by_id(*, id: str) -> StorageLocation
Get a storage location by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the storage location to retrieve. |
required |
Returns:
Type | Description |
---|---|
StorageLocation
|
The retrieved storage location with the given ID. |
Source code in src/albert/collections/storage_locations.py
get_all
get_all(
*,
name: str | list[str] | None = None,
exact_match: bool = False,
location: str | Location | None = None,
start_key: str | None = None,
max_items: int | None = None,
) -> Iterator[StorageLocation]
Get all storage locations with optional filtering.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str or list[str]
|
The name or names of the storage locations to filter by. |
None
|
exact_match
|
bool
|
Whether to perform an exact match on the name(s). Default is False. |
False
|
location
|
str or Location
|
A location ID or Location object to filter by. |
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[StorageLocation]
|
An iterator over StorageLocation items matching the search criteria. |
Source code in src/albert/collections/storage_locations.py
create
create(
*, storage_location: StorageLocation
) -> StorageLocation
Create a new storage location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storage_location
|
StorageLocation
|
The storage location to create. |
required |
Returns:
Type | Description |
---|---|
StorageLocation
|
The created storage location. |
Source code in src/albert/collections/storage_locations.py
get_or_create
get_or_create(
*, storage_location: StorageLocation
) -> StorageLocation
Get or create a storage location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storage_location
|
StorageLocation
|
The storage location to get or create. |
required |
Returns:
Type | Description |
---|---|
StorageLocation
|
The existing or newly created storage location. |
Source code in src/albert/collections/storage_locations.py
delete
delete(*, id: str) -> None
Delete a storage location by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the storage location to delete. |
required |
Source code in src/albert/collections/storage_locations.py
update
update(
*, storage_location: StorageLocation
) -> StorageLocation
Update a storage location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storage_location
|
StorageLocation
|
The storage location to update. |
required |
Returns:
Type | Description |
---|---|
StorageLocation
|
The updated storage location as returned by the server. |