wallaroo.wallaroo_ml_ops_api_client.api.workspace.workspaces_list_users API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.workspace.workspaces_list_users

View Source

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

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_json_body.WorkspacesListUsersJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_200.WorkspacesListUsersResponse200, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_400.WorkspacesListUsersResponse400, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_401.WorkspacesListUsersResponse401, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_500.WorkspacesListUsersResponse500]]: View Source

     91def sync_detailed(
     92    *,
     93    client: Client,
     94    json_body: WorkspacesListUsersJsonBody,
     95
     96) -> Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]:
     97    """List workspace users
     98
     99     List the Users of a given Workspace
    100
    101    Args:
    102        json_body (WorkspacesListUsersJsonBody):  Request for listing Users belonging to a
    103            Workspace
    104
    105    Returns:
    106        Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]
    107    """
    108
    109
    110    kwargs = _get_kwargs(
    111        client=client,
    112json_body=json_body,
    113
    114    )
    115
    116    response = httpx.request(
    117        verify=client.verify_ssl,
    118        **kwargs,
    119    )
    120
    121    return _build_response(response=response)

List workspace users

List the Users of a given Workspace

Args: json_body (WorkspacesListUsersJsonBody): Request for listing Users belonging to a Workspace

Returns: Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_json_body.WorkspacesListUsersJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_200.WorkspacesListUsersResponse200, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_400.WorkspacesListUsersResponse400, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_401.WorkspacesListUsersResponse401, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_500.WorkspacesListUsersResponse500, NoneType]: View Source

    123def sync(
    124    *,
    125    client: Client,
    126    json_body: WorkspacesListUsersJsonBody,
    127
    128) -> Optional[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]:
    129    """List workspace users
    130
    131     List the Users of a given Workspace
    132
    133    Args:
    134        json_body (WorkspacesListUsersJsonBody):  Request for listing Users belonging to a
    135            Workspace
    136
    137    Returns:
    138        Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]
    139    """
    140
    141
    142    return sync_detailed(
    143        client=client,
    144json_body=json_body,
    145
    146    ).parsed

List workspace users

List the Users of a given Workspace

Args: json_body (WorkspacesListUsersJsonBody): Request for listing Users belonging to a Workspace

Returns: Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_json_body.WorkspacesListUsersJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_200.WorkspacesListUsersResponse200, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_400.WorkspacesListUsersResponse400, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_401.WorkspacesListUsersResponse401, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_500.WorkspacesListUsersResponse500]]: View Source

    148async def asyncio_detailed(
    149    *,
    150    client: Client,
    151    json_body: WorkspacesListUsersJsonBody,
    152
    153) -> Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]:
    154    """List workspace users
    155
    156     List the Users of a given Workspace
    157
    158    Args:
    159        json_body (WorkspacesListUsersJsonBody):  Request for listing Users belonging to a
    160            Workspace
    161
    162    Returns:
    163        Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]
    164    """
    165
    166
    167    kwargs = _get_kwargs(
    168        client=client,
    169json_body=json_body,
    170
    171    )
    172
    173    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    174        response = await _client.request(
    175            **kwargs
    176        )
    177
    178    return _build_response(response=response)

List workspace users

List the Users of a given Workspace

Args: json_body (WorkspacesListUsersJsonBody): Request for listing Users belonging to a Workspace

Returns: Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_json_body.WorkspacesListUsersJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_200.WorkspacesListUsersResponse200, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_400.WorkspacesListUsersResponse400, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_401.WorkspacesListUsersResponse401, wallaroo.wallaroo_ml_ops_api_client.models.workspaces_list_users_response_500.WorkspacesListUsersResponse500, NoneType]: View Source

    180async def asyncio(
    181    *,
    182    client: Client,
    183    json_body: WorkspacesListUsersJsonBody,
    184
    185) -> Optional[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]:
    186    """List workspace users
    187
    188     List the Users of a given Workspace
    189
    190    Args:
    191        json_body (WorkspacesListUsersJsonBody):  Request for listing Users belonging to a
    192            Workspace
    193
    194    Returns:
    195        Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]
    196    """
    197
    198
    199    return (await asyncio_detailed(
    200        client=client,
    201json_body=json_body,
    202
    203    )).parsed

List workspace users

List the Users of a given Workspace

Args: json_body (WorkspacesListUsersJsonBody): Request for listing Users belonging to a Workspace

Returns: Response[Union[WorkspacesListUsersResponse200, WorkspacesListUsersResponse400, WorkspacesListUsersResponse401, WorkspacesListUsersResponse500]]