wallaroo.wallaroo_ml_ops_api_client.api.model.models_list API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.model.models_list

View Source

      1from typing import Any, Dict, Optional, Union
      2
      3import httpx
      4
      5from ...client import Client
      6from ...models.models_list_json_body import ModelsListJsonBody
      7from ...models.models_list_response_200 import ModelsListResponse200
      8from ...models.models_list_response_400 import ModelsListResponse400
      9from ...models.models_list_response_401 import ModelsListResponse401
     10from ...models.models_list_response_500 import ModelsListResponse500
     11from ...types import Response
     12
     13
     14def _get_kwargs(
     15    *,
     16    client: Client,
     17    json_body: ModelsListJsonBody,
     18
     19) -> Dict[str, Any]:
     20    url = "{}/v1/api/models/list".format(
     21        client.base_url)
     22
     23    headers: Dict[str, str] = client.get_headers()
     24    cookies: Dict[str, Any] = client.get_cookies()
     25
     26
     27
     28
     29
     30
     31
     32    json_json_body = json_body.to_dict()
     33
     34
     35
     36
     37
     38    return {
     39	    "method": "post",
     40        "url": url,
     41        "headers": headers,
     42        "cookies": cookies,
     43        "timeout": client.get_timeout(),
     44        "json": json_json_body,
     45    }
     46
     47
     48def _parse_response(*, response: httpx.Response) -> Optional[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
     49    if response.status_code == 500:
     50        response_500 = ModelsListResponse500.from_dict(response.json())
     51
     52
     53
     54        return response_500
     55    if response.status_code == 400:
     56        response_400 = ModelsListResponse400.from_dict(response.json())
     57
     58
     59
     60        return response_400
     61    if response.status_code == 401:
     62        response_401 = ModelsListResponse401.from_dict(response.json())
     63
     64
     65
     66        return response_401
     67    if response.status_code == 200:
     68        response_200 = ModelsListResponse200.from_dict(response.json())
     69
     70
     71
     72        return response_200
     73    return None
     74
     75
     76def _build_response(*, response: httpx.Response) -> Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
     77    return Response(
     78        status_code=response.status_code,
     79        content=response.content,
     80        headers=response.headers,
     81        parsed=_parse_response(response=response),
     82    )
     83
     84
     85def sync_detailed(
     86    *,
     87    client: Client,
     88    json_body: ModelsListJsonBody,
     89
     90) -> Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
     91    """Retrieve models
     92
     93     Returns models in the given workspace.
     94
     95    Args:
     96        json_body (ModelsListJsonBody):  Workspace model retrieval request.
     97
     98    Returns:
     99        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    100    """
    101
    102
    103    kwargs = _get_kwargs(
    104        client=client,
    105json_body=json_body,
    106
    107    )
    108
    109    response = httpx.request(
    110        verify=client.verify_ssl,
    111        **kwargs,
    112    )
    113
    114    return _build_response(response=response)
    115
    116def sync(
    117    *,
    118    client: Client,
    119    json_body: ModelsListJsonBody,
    120
    121) -> Optional[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    122    """Retrieve models
    123
    124     Returns models in the given workspace.
    125
    126    Args:
    127        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    128
    129    Returns:
    130        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    131    """
    132
    133
    134    return sync_detailed(
    135        client=client,
    136json_body=json_body,
    137
    138    ).parsed
    139
    140async def asyncio_detailed(
    141    *,
    142    client: Client,
    143    json_body: ModelsListJsonBody,
    144
    145) -> Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    146    """Retrieve models
    147
    148     Returns models in the given workspace.
    149
    150    Args:
    151        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    152
    153    Returns:
    154        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    155    """
    156
    157
    158    kwargs = _get_kwargs(
    159        client=client,
    160json_body=json_body,
    161
    162    )
    163
    164    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    165        response = await _client.request(
    166            **kwargs
    167        )
    168
    169    return _build_response(response=response)
    170
    171async def asyncio(
    172    *,
    173    client: Client,
    174    json_body: ModelsListJsonBody,
    175
    176) -> Optional[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    177    """Retrieve models
    178
    179     Returns models in the given workspace.
    180
    181    Args:
    182        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    183
    184    Returns:
    185        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    186    """
    187
    188
    189    return (await asyncio_detailed(
    190        client=client,
    191json_body=json_body,
    192
    193    )).parsed

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.models_list_json_body.ModelsListJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_200.ModelsListResponse200, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_400.ModelsListResponse400, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_401.ModelsListResponse401, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_500.ModelsListResponse500]]: View Source

     86def sync_detailed(
     87    *,
     88    client: Client,
     89    json_body: ModelsListJsonBody,
     90
     91) -> Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
     92    """Retrieve models
     93
     94     Returns models in the given workspace.
     95
     96    Args:
     97        json_body (ModelsListJsonBody):  Workspace model retrieval request.
     98
     99    Returns:
    100        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    101    """
    102
    103
    104    kwargs = _get_kwargs(
    105        client=client,
    106json_body=json_body,
    107
    108    )
    109
    110    response = httpx.request(
    111        verify=client.verify_ssl,
    112        **kwargs,
    113    )
    114
    115    return _build_response(response=response)

Retrieve models

Returns models in the given workspace.

Args: json_body (ModelsListJsonBody): Workspace model retrieval request.

Returns: Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.models_list_json_body.ModelsListJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_200.ModelsListResponse200, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_400.ModelsListResponse400, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_401.ModelsListResponse401, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_500.ModelsListResponse500, NoneType]: View Source

    117def sync(
    118    *,
    119    client: Client,
    120    json_body: ModelsListJsonBody,
    121
    122) -> Optional[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    123    """Retrieve models
    124
    125     Returns models in the given workspace.
    126
    127    Args:
    128        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    129
    130    Returns:
    131        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    132    """
    133
    134
    135    return sync_detailed(
    136        client=client,
    137json_body=json_body,
    138
    139    ).parsed

Retrieve models

Returns models in the given workspace.

Args: json_body (ModelsListJsonBody): Workspace model retrieval request.

Returns: Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.models_list_json_body.ModelsListJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_200.ModelsListResponse200, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_400.ModelsListResponse400, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_401.ModelsListResponse401, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_500.ModelsListResponse500]]: View Source

    141async def asyncio_detailed(
    142    *,
    143    client: Client,
    144    json_body: ModelsListJsonBody,
    145
    146) -> Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    147    """Retrieve models
    148
    149     Returns models in the given workspace.
    150
    151    Args:
    152        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    153
    154    Returns:
    155        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    156    """
    157
    158
    159    kwargs = _get_kwargs(
    160        client=client,
    161json_body=json_body,
    162
    163    )
    164
    165    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    166        response = await _client.request(
    167            **kwargs
    168        )
    169
    170    return _build_response(response=response)

Retrieve models

Returns models in the given workspace.

Args: json_body (ModelsListJsonBody): Workspace model retrieval request.

Returns: Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.models_list_json_body.ModelsListJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_200.ModelsListResponse200, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_400.ModelsListResponse400, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_401.ModelsListResponse401, wallaroo.wallaroo_ml_ops_api_client.models.models_list_response_500.ModelsListResponse500, NoneType]: View Source

    172async def asyncio(
    173    *,
    174    client: Client,
    175    json_body: ModelsListJsonBody,
    176
    177) -> Optional[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]:
    178    """Retrieve models
    179
    180     Returns models in the given workspace.
    181
    182    Args:
    183        json_body (ModelsListJsonBody):  Workspace model retrieval request.
    184
    185    Returns:
    186        Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]
    187    """
    188
    189
    190    return (await asyncio_detailed(
    191        client=client,
    192json_body=json_body,
    193
    194    )).parsed

Retrieve models

Returns models in the given workspace.

Args: json_body (ModelsListJsonBody): Workspace model retrieval request.

Returns: Response[Union[ModelsListResponse200, ModelsListResponse400, ModelsListResponse401, ModelsListResponse500]]