Skip to content

katana_public_api_client.api.supplier_address.create_supplier_address

katana_public_api_client.api.supplier_address.create_supplier_address

Classes

Functions

asyncio(*, client, body) async

Create a supplier address

Add an address to an existing supplier. If the new address is the first one, it is assigned as the default. (A Supplier can have only one address for now)

Parameters:

  • body (CreateSupplierAddressRequest) –

    Request payload for creating a new address for an existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr', 'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

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/supplier_address/create_supplier_address.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSupplierAddressRequest,
) -> DetailedErrorResponse | ErrorResponse | SupplierAddress | None:
    """Create a supplier address

     Add an address to an existing supplier. If the new address is the first one, it is assigned as
      the default. (A Supplier can have only one address for now)

    Args:
        body (CreateSupplierAddressRequest): Request payload for creating a new address for an
            existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr',
            'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

    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, SupplierAddress]
    """

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

asyncio_detailed(*, client, body) async

Create a supplier address

Add an address to an existing supplier. If the new address is the first one, it is assigned as the default. (A Supplier can have only one address for now)

Parameters:

  • body (CreateSupplierAddressRequest) –

    Request payload for creating a new address for an existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr', 'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

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/supplier_address/create_supplier_address.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSupplierAddressRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | SupplierAddress]:
    """Create a supplier address

     Add an address to an existing supplier. If the new address is the first one, it is assigned as
      the default. (A Supplier can have only one address for now)

    Args:
        body (CreateSupplierAddressRequest): Request payload for creating a new address for an
            existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr',
            'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

    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, SupplierAddress]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync(*, client, body)

Create a supplier address

Add an address to an existing supplier. If the new address is the first one, it is assigned as the default. (A Supplier can have only one address for now)

Parameters:

  • body (CreateSupplierAddressRequest) –

    Request payload for creating a new address for an existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr', 'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

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/supplier_address/create_supplier_address.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSupplierAddressRequest,
) -> DetailedErrorResponse | ErrorResponse | SupplierAddress | None:
    """Create a supplier address

     Add an address to an existing supplier. If the new address is the first one, it is assigned as
      the default. (A Supplier can have only one address for now)

    Args:
        body (CreateSupplierAddressRequest): Request payload for creating a new address for an
            existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr',
            'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

    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, SupplierAddress]
    """

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

sync_detailed(*, client, body)

Create a supplier address

Add an address to an existing supplier. If the new address is the first one, it is assigned as the default. (A Supplier can have only one address for now)

Parameters:

  • body (CreateSupplierAddressRequest) –

    Request payload for creating a new address for an existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr', 'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

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/supplier_address/create_supplier_address.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSupplierAddressRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | SupplierAddress]:
    """Create a supplier address

     Add an address to an existing supplier. If the new address is the first one, it is assigned as
      the default. (A Supplier can have only one address for now)

    Args:
        body (CreateSupplierAddressRequest): Request payload for creating a new address for an
            existing supplier Example: {'supplier_id': 4001, 'line_1': '856 Distribution Center Dr',
            'line_2': None, 'city': 'Milwaukee', 'state': 'WI', 'zip': '53218', 'country': 'US'}.

    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, SupplierAddress]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)