Skip to content

katana_public_api_client.api.material.update_material

katana_public_api_client.api.material.update_material

Classes

Functions

asyncio(id, *, client, body) async

Update a material

Updates the specified material by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateMaterialRequest) –

    Request payload for updating an existing raw material's properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated', 'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502, 'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications', 'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom': 'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade', 'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror', 'Matte']}], 'custom_field_collection_id': 201}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/material/update_material.py
async def asyncio(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateMaterialRequest,
) -> DetailedErrorResponse | ErrorResponse | Material | None:
    """Update a material

     Updates the specified material by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateMaterialRequest): Request payload for updating an existing raw material's
            properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated',
            'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502,
            'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications',
            'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom':
            'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade',
            'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror',
            'Matte']}], 'custom_field_collection_id': 201}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Union[DetailedErrorResponse, ErrorResponse, Material]
    """

    return (
        await asyncio_detailed(
            id=id,
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed(id, *, client, body) async

Update a material

Updates the specified material by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateMaterialRequest) –

    Request payload for updating an existing raw material's properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated', 'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502, 'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications', 'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom': 'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade', 'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror', 'Matte']}], 'custom_field_collection_id': 201}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/material/update_material.py
async def asyncio_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateMaterialRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Material]:
    """Update a material

     Updates the specified material by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateMaterialRequest): Request payload for updating an existing raw material's
            properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated',
            'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502,
            'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications',
            'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom':
            'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade',
            'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror',
            'Matte']}], 'custom_field_collection_id': 201}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Response[Union[DetailedErrorResponse, ErrorResponse, Material]]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(id, *, client, body)

Update a material

Updates the specified material by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateMaterialRequest) –

    Request payload for updating an existing raw material's properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated', 'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502, 'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications', 'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom': 'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade', 'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror', 'Matte']}], 'custom_field_collection_id': 201}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/material/update_material.py
def sync(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateMaterialRequest,
) -> DetailedErrorResponse | ErrorResponse | Material | None:
    """Update a material

     Updates the specified material by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateMaterialRequest): Request payload for updating an existing raw material's
            properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated',
            'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502,
            'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications',
            'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom':
            'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade',
            'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror',
            'Matte']}], 'custom_field_collection_id': 201}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Union[DetailedErrorResponse, ErrorResponse, Material]
    """

    return sync_detailed(
        id=id,
        client=client,
        body=body,
    ).parsed

sync_detailed(id, *, client, body)

Update a material

Updates the specified material by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateMaterialRequest) –

    Request payload for updating an existing raw material's properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated', 'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502, 'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications', 'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom': 'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade', 'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror', 'Matte']}], 'custom_field_collection_id': 201}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/material/update_material.py
def sync_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateMaterialRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Material]:
    """Update a material

     Updates the specified material by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateMaterialRequest): Request payload for updating an existing raw material's
            properties and specifications Example: {'name': 'Stainless Steel Sheet 304 - Updated',
            'uom': 'm²', 'category_name': 'Premium Raw Materials', 'default_supplier_id': 1502,
            'additional_info': 'Food-grade stainless steel, 1.5mm thickness - Updated specifications',
            'batch_tracked': True, 'is_sellable': False, 'is_archived': False, 'purchase_uom':
            'sheet', 'purchase_uom_conversion_rate': 2.0, 'configs': [{'id': 101, 'name': 'Grade',
            'values': ['304', '316', '430']}, {'name': 'Finish', 'values': ['Brushed', 'Mirror',
            'Matte']}], 'custom_field_collection_id': 201}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Response[Union[DetailedErrorResponse, ErrorResponse, Material]]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)