Skip to content

katana_public_api_client.api.variant.get_variant

katana_public_api_client.api.variant.get_variant

Classes

Functions

asyncio(id, *, client, extend=UNSET) async

Retrieve a variant

Retrieves the details of an existing variant based on ID.

Parameters:

  • id (int) –
  • extend (Union[Unset, list[GetVariantExtendItem]], default: UNSET ) –

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/variant/get_variant.py
async def asyncio(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    extend: Unset | list[GetVariantExtendItem] = UNSET,
) -> ErrorResponse | VariantResponse | None:
    """Retrieve a variant

     Retrieves the details of an existing variant based on ID.

    Args:
        id (int):
        extend (Union[Unset, list[GetVariantExtendItem]]):

    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[ErrorResponse, VariantResponse]
    """

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

asyncio_detailed(id, *, client, extend=UNSET) async

Retrieve a variant

Retrieves the details of an existing variant based on ID.

Parameters:

  • id (int) –
  • extend (Union[Unset, list[GetVariantExtendItem]], default: UNSET ) –

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/variant/get_variant.py
async def asyncio_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    extend: Unset | list[GetVariantExtendItem] = UNSET,
) -> Response[ErrorResponse | VariantResponse]:
    """Retrieve a variant

     Retrieves the details of an existing variant based on ID.

    Args:
        id (int):
        extend (Union[Unset, list[GetVariantExtendItem]]):

    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[ErrorResponse, VariantResponse]]
    """

    kwargs = _get_kwargs(
        id=id,
        extend=extend,
    )

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

    return _build_response(client=client, response=response)

sync(id, *, client, extend=UNSET)

Retrieve a variant

Retrieves the details of an existing variant based on ID.

Parameters:

  • id (int) –
  • extend (Union[Unset, list[GetVariantExtendItem]], default: UNSET ) –

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/variant/get_variant.py
def sync(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    extend: Unset | list[GetVariantExtendItem] = UNSET,
) -> ErrorResponse | VariantResponse | None:
    """Retrieve a variant

     Retrieves the details of an existing variant based on ID.

    Args:
        id (int):
        extend (Union[Unset, list[GetVariantExtendItem]]):

    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[ErrorResponse, VariantResponse]
    """

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

sync_detailed(id, *, client, extend=UNSET)

Retrieve a variant

Retrieves the details of an existing variant based on ID.

Parameters:

  • id (int) –
  • extend (Union[Unset, list[GetVariantExtendItem]], default: UNSET ) –

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/variant/get_variant.py
def sync_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    extend: Unset | list[GetVariantExtendItem] = UNSET,
) -> Response[ErrorResponse | VariantResponse]:
    """Retrieve a variant

     Retrieves the details of an existing variant based on ID.

    Args:
        id (int):
        extend (Union[Unset, list[GetVariantExtendItem]]):

    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[ErrorResponse, VariantResponse]]
    """

    kwargs = _get_kwargs(
        id=id,
        extend=extend,
    )

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

    return _build_response(client=client, response=response)