katana_public_api_client.helpers.materials¶
katana_public_api_client.helpers.materials
¶
Material catalog operations.
Classes¶
Materials(client)
¶
Bases: Base
Material catalog management.
Provides CRUD operations for materials in the Katana catalog.
Example
async with KatanaClient() as client: ... # CRUD operations ... materials = await client.materials.list() ... material = await client.materials.get(123) ... new_material = await client.materials.create({"name": "Steel"})
Source code in katana_public_api_client/helpers/base.py
Functions¶
create(material_data)
async
¶
Create a new material.
Parameters:
-
material_data(CreateMaterialRequest) –CreateMaterialRequest model with material details.
Returns:
-
KatanaMaterial–Created KatanaMaterial domain model object.
Example
from katana_public_api_client.models import CreateMaterialRequest new_material = await client.materials.create( ... CreateMaterialRequest(name="Steel") ... )
Source code in katana_public_api_client/helpers/materials.py
delete(material_id)
async
¶
Delete a material.
Parameters:
-
material_id(int) –The material ID to delete.
Example
await client.materials.delete(123)
Source code in katana_public_api_client/helpers/materials.py
get(material_id)
async
¶
Get a specific material by ID.
Parameters:
-
material_id(int) –The material ID.
Returns:
-
KatanaMaterial–KatanaMaterial domain model object.
Example
material = await client.materials.get(123)
Source code in katana_public_api_client/helpers/materials.py
list(**filters)
async
¶
List all materials with optional filters.
Parameters:
-
**filters(Any, default:{}) –Filtering parameters.
Returns:
-
list[KatanaMaterial]–List of KatanaMaterial domain model objects.
Example
materials = await client.materials.list(limit=100)
Source code in katana_public_api_client/helpers/materials.py
update(material_id, material_data)
async
¶
Update an existing material.
Parameters:
-
material_id(int) –The material ID to update.
-
material_data(UpdateMaterialRequest) –UpdateMaterialRequest model with fields to update.
Returns:
-
KatanaMaterial–Updated KatanaMaterial domain model object.
Example
from katana_public_api_client.models import UpdateMaterialRequest updated = await client.materials.update( ... 123, UpdateMaterialRequest(name="Aluminum") ... )