UN Numbers
albert.collections.un_numbers.UnNumberCollection
Bases: BaseCollection
UnNumberCollection is a collection class for managing UnNumber entities in the Albert platform.
Note
Creating UN Numbers is not supported via the SDK, as UN Numbers are highly controlled by Albert.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
create |
This method is not implemented as UN Numbers cannot be created through the SDK. |
get_by_id |
Retrieve a UN Number by its ID. |
get_by_name |
Retrieve a UN Number by its name. |
list |
List UN Numbers matching the provided criteria. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/un_numbers.py
create
get_by_id
Retrieve a UN Number by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the UN Number to retrieve. |
required |
Returns:
Type | Description |
---|---|
UnNumber
|
The corresponding UN Number |
Source code in src/albert/collections/un_numbers.py
get_by_name
Retrieve a UN Number by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the UN Number to retrieve |
required |
Returns:
Type | Description |
---|---|
UnNumber | None
|
The corresponding UN Number or None if not found |
Source code in src/albert/collections/un_numbers.py
list
list(
*,
name: str | None = None,
exact_match: bool = False,
limit: int = 50,
start_key: str | None = None,
) -> Iterator[UnNumber]
List UN Numbers matching the provided criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
The name of the UN Number to search for, by default None |
None
|
exact_match
|
bool
|
Weather to return exact matches only, by default False |
False
|
Yields:
Type | Description |
---|---|
Iterator[UnNumber]
|
The UN Numbers matching the search criteria |