Sub-client for asset-ID based item lookup.
Accessed via HomeboxClient.assets.
Source code in homebox/client.py
| class AssetsClient:
"""Sub-client for asset-ID based item lookup.
Accessed via ``HomeboxClient.assets``.
"""
def __init__(self, client: HomeboxClient):
"""Initialise the assets sub-client with the shared root client."""
self.client = client
def get_item_by_asset_id(self, id: str) -> PaginationResultRepoItemSummary:
"""Look up an item by its numeric asset ID.
Args:
id: The asset ID string (e.g. ``"000001"``).
Returns:
PaginationResultRepoItemSummary: Paginated result containing the
matching item summary, if found.
"""
return PaginationResultRepoItemSummary(**self.client._request("get", f"/v1/assets/{id}"))
|
__init__
__init__(client: HomeboxClient)
Initialise the assets sub-client with the shared root client.
Source code in homebox/client.py
| def __init__(self, client: HomeboxClient):
"""Initialise the assets sub-client with the shared root client."""
self.client = client
|
get_item_by_asset_id
get_item_by_asset_id(id: str) -> PaginationResultRepoItemSummary
Look up an item by its numeric asset ID.
Parameters:
| Name |
Type |
Description |
Default |
id
|
str
|
The asset ID string (e.g. "000001").
|
required
|
Returns:
| Name | Type |
Description |
PaginationResultRepoItemSummary |
PaginationResultRepoItemSummary
|
Paginated result containing the
matching item summary, if found.
|
Source code in homebox/client.py
| def get_item_by_asset_id(self, id: str) -> PaginationResultRepoItemSummary:
"""Look up an item by its numeric asset ID.
Args:
id: The asset ID string (e.g. ``"000001"``).
Returns:
PaginationResultRepoItemSummary: Paginated result containing the
matching item summary, if found.
"""
return PaginationResultRepoItemSummary(**self.client._request("get", f"/v1/assets/{id}"))
|