wallaroo.wallaroo_ml_ops_api_client.api.task.v1_task_update API documentation

# wallaroo.wallaroo_ml_ops_api_client.api.task.v1_task_update

View Source

      1from typing import Any, Dict, Optional, Union
      2
      3import httpx
      4
      5from ...client import Client
      6from ...models.v1_task_update_json_body import V1TaskUpdateJsonBody
      7from ...models.v1_task_update_response_200 import V1TaskUpdateResponse200
      8from ...models.v1_task_update_response_500 import V1TaskUpdateResponse500
      9from ...types import Response
     10
     11
     12def _get_kwargs(
     13    *,
     14    client: Client,
     15    json_body: V1TaskUpdateJsonBody,
     16
     17) -> Dict[str, Any]:
     18    url = "{}/v1/api/v1/tasks/update".format(
     19        client.base_url)
     20
     21    headers: Dict[str, str] = client.get_headers()
     22    cookies: Dict[str, Any] = client.get_cookies()
     23
     24
     25
     26
     27
     28
     29
     30    json_json_body = json_body.to_dict()
     31
     32
     33
     34
     35
     36    return {
     37	    "method": "post",
     38        "url": url,
     39        "headers": headers,
     40        "cookies": cookies,
     41        "timeout": client.get_timeout(),
     42        "json": json_json_body,
     43    }
     44
     45
     46def _parse_response(*, response: httpx.Response) -> Optional[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
     47    if response.status_code == 500:
     48        response_500 = V1TaskUpdateResponse500.from_dict(response.json())
     49
     50
     51
     52        return response_500
     53    if response.status_code == 200:
     54        response_200 = V1TaskUpdateResponse200.from_dict(response.json())
     55
     56
     57
     58        return response_200
     59    return None
     60
     61
     62def _build_response(*, response: httpx.Response) -> Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
     63    return Response(
     64        status_code=response.status_code,
     65        content=response.content,
     66        headers=response.headers,
     67        parsed=_parse_response(response=response),
     68    )
     69
     70
     71def sync_detailed(
     72    *,
     73    client: Client,
     74    json_body: V1TaskUpdateJsonBody,
     75
     76) -> Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
     77    """Update a task by it's id.
     78
     79    Args:
     80        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
     81            Request body for v1.task.update
     82
     83    Returns:
     84        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
     85    """
     86
     87
     88    kwargs = _get_kwargs(
     89        client=client,
     90json_body=json_body,
     91
     92    )
     93
     94    response = httpx.request(
     95        verify=client.verify_ssl,
     96        **kwargs,
     97    )
     98
     99    return _build_response(response=response)
    100
    101def sync(
    102    *,
    103    client: Client,
    104    json_body: V1TaskUpdateJsonBody,
    105
    106) -> Optional[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    107    """Update a task by it's id.
    108
    109    Args:
    110        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    111            Request body for v1.task.update
    112
    113    Returns:
    114        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    115    """
    116
    117
    118    return sync_detailed(
    119        client=client,
    120json_body=json_body,
    121
    122    ).parsed
    123
    124async def asyncio_detailed(
    125    *,
    126    client: Client,
    127    json_body: V1TaskUpdateJsonBody,
    128
    129) -> Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    130    """Update a task by it's id.
    131
    132    Args:
    133        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    134            Request body for v1.task.update
    135
    136    Returns:
    137        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    138    """
    139
    140
    141    kwargs = _get_kwargs(
    142        client=client,
    143json_body=json_body,
    144
    145    )
    146
    147    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    148        response = await _client.request(
    149            **kwargs
    150        )
    151
    152    return _build_response(response=response)
    153
    154async def asyncio(
    155    *,
    156    client: Client,
    157    json_body: V1TaskUpdateJsonBody,
    158
    159) -> Optional[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    160    """Update a task by it's id.
    161
    162    Args:
    163        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    164            Request body for v1.task.update
    165
    166    Returns:
    167        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    168    """
    169
    170
    171    return (await asyncio_detailed(
    172        client=client,
    173json_body=json_body,
    174
    175    )).parsed

def sync_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body.V1TaskUpdateJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200.V1TaskUpdateResponse200, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_500.V1TaskUpdateResponse500]]: View Source

     72def sync_detailed(
     73    *,
     74    client: Client,
     75    json_body: V1TaskUpdateJsonBody,
     76
     77) -> Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
     78    """Update a task by it's id.
     79
     80    Args:
     81        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
     82            Request body for v1.task.update
     83
     84    Returns:
     85        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
     86    """
     87
     88
     89    kwargs = _get_kwargs(
     90        client=client,
     91json_body=json_body,
     92
     93    )
     94
     95    response = httpx.request(
     96        verify=client.verify_ssl,
     97        **kwargs,
     98    )
     99
    100    return _build_response(response=response)

Update a task by it's id.

Args: json_body (V1TaskUpdateJsonBody): Body for request to /tasks/get_by_workspace The Request body for v1.task.update

Returns: Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]

def sync( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body.V1TaskUpdateJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200.V1TaskUpdateResponse200, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_500.V1TaskUpdateResponse500, NoneType]: View Source

    102def sync(
    103    *,
    104    client: Client,
    105    json_body: V1TaskUpdateJsonBody,
    106
    107) -> Optional[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    108    """Update a task by it's id.
    109
    110    Args:
    111        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    112            Request body for v1.task.update
    113
    114    Returns:
    115        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    116    """
    117
    118
    119    return sync_detailed(
    120        client=client,
    121json_body=json_body,
    122
    123    ).parsed

Update a task by it's id.

Args: json_body (V1TaskUpdateJsonBody): Body for request to /tasks/get_by_workspace The Request body for v1.task.update

Returns: Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]

async def asyncio_detailed( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body.V1TaskUpdateJsonBody) -> wallaroo.wallaroo_ml_ops_api_client.types.Response[typing.Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200.V1TaskUpdateResponse200, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_500.V1TaskUpdateResponse500]]: View Source

    125async def asyncio_detailed(
    126    *,
    127    client: Client,
    128    json_body: V1TaskUpdateJsonBody,
    129
    130) -> Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    131    """Update a task by it's id.
    132
    133    Args:
    134        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    135            Request body for v1.task.update
    136
    137    Returns:
    138        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    139    """
    140
    141
    142    kwargs = _get_kwargs(
    143        client=client,
    144json_body=json_body,
    145
    146    )
    147
    148    async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
    149        response = await _client.request(
    150            **kwargs
    151        )
    152
    153    return _build_response(response=response)

Update a task by it's id.

Args: json_body (V1TaskUpdateJsonBody): Body for request to /tasks/get_by_workspace The Request body for v1.task.update

Returns: Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]

async def asyncio( *, client: wallaroo.wallaroo_ml_ops_api_client.client.Client, json_body: wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body.V1TaskUpdateJsonBody) -> Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200.V1TaskUpdateResponse200, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_500.V1TaskUpdateResponse500, NoneType]: View Source

    155async def asyncio(
    156    *,
    157    client: Client,
    158    json_body: V1TaskUpdateJsonBody,
    159
    160) -> Optional[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]:
    161    """Update a task by it's id.
    162
    163    Args:
    164        json_body (V1TaskUpdateJsonBody):  Body for request to /tasks/get_by_workspace   The
    165            Request body for v1.task.update
    166
    167    Returns:
    168        Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]
    169    """
    170
    171
    172    return (await asyncio_detailed(
    173        client=client,
    174json_body=json_body,
    175
    176    )).parsed

Update a task by it's id.

Args: json_body (V1TaskUpdateJsonBody): Body for request to /tasks/get_by_workspace The Request body for v1.task.update

Returns: Response[Union[V1TaskUpdateResponse200, V1TaskUpdateResponse500]]