It Management
Usage
List IT assets and asset models:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
assets = factorialhr.ItAssetsEndpoint(api)
response = await assets.all()
for a in response.data():
print(a.name, a.asset_model_id)
models = factorialhr.ItAssetModelsEndpoint(api)
for m in (await models.get(params={"limit": 20})).data():
print(m.name)
asyncio.run(main())
- class factorialhr.ItAsset(*, id: int, company_id: int, it_asset_model_id: int, serial_number: str | None = None, status: str, owner_id: int | None = None, location_id: int | None = None, workplace_id: int | None = None, team_id: int | None = None, purchase_date: date | None = None, purchase_price_cents: int | None = None, currency: str | None = None, warranty_end_date: date | None = None, label: str | None = None, notes: str | None = None)[source]
Model for it_management_it_asset. IT Asset (device, accessory, keys, etc).
- company_id: int
Company identifier
- currency: str | None
Currency code
- id: int
IT asset identifier
- it_asset_model_id: int
IT asset model identifier
- label: str | None
Label
- location_id: int | None
Location identifier
- notes: str | None
Notes
- owner_id: int | None
Owner employee identifier
- purchase_date: date | None
Purchase date
- purchase_price_cents: int | None
Purchase price in cents
- serial_number: str | None
Serial number
- status: str
Status of the asset
- team_id: int | None
Team identifier
- warranty_end_date: date | None
Warranty end date
- workplace_id: int | None
Workplace identifier
- class factorialhr.ItAssetModel(*, id: int, type_name: str, company_id: int, brand: str | None = None, name: str, created_at: datetime, updated_at: datetime)[source]
Model for it_management_it_asset_model. IT Asset Model (make/model of device).
- brand: str | None
Brand
- company_id: int
Company identifier
- created_at: datetime
Creation date
- id: int
IT asset model identifier
- name: str
Name
- type_name: str
Type name
- updated_at: datetime
Last update date
- class factorialhr.ItAssetModelsEndpoint(api: ApiClient)[source]
Endpoint for it_management/it_asset_models operations.
- async all(**kwargs) ListApiResponse[ItAssetModel][source]
Get all IT asset models.
Official documentation: it_management/it_asset_models
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) ItAssetModel[source]
Create an IT asset model.
Official documentation: it_management/it_asset_models
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async get(**kwargs) MetaApiResponse[ItAssetModel][source]
Get IT asset models with pagination metadata.
Official documentation: it_management/it_asset_models
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(model_id: int | str, **kwargs) ItAssetModel[source]
Get a specific IT asset model by ID.
Official documentation: it_management/it_asset_models
- Parameters:
model_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(model_id: int | str, data: Mapping[str, Any], **kwargs) ItAssetModel[source]
Update an IT asset model.
Official documentation: it_management/it_asset_models
- Parameters:
model_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.ItAssetsEndpoint(api: ApiClient)[source]
Endpoint for it_management/it_assets operations.
- async all(**kwargs) ListApiResponse[ItAsset][source]
Get all IT assets.
Official documentation: it_management/it_assets
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) ItAsset[source]
Create an IT asset.
Official documentation: it_management/it_assets
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(asset_id: int | str, **kwargs) ItAsset[source]
Delete an IT asset.
Official documentation: it_management/it_assets
- Parameters:
asset_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[ItAsset][source]
Get IT assets with pagination metadata.
Official documentation: it_management/it_assets
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(asset_id: int | str, **kwargs) ItAsset[source]
Get a specific IT asset by ID.
Official documentation: it_management/it_assets
- Parameters:
asset_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(asset_id: int | str, data: Mapping[str, Any], **kwargs) ItAsset[source]
Update an IT asset.
Official documentation: it_management/it_assets
- Parameters:
asset_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type: