wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union
      2
      3import attr
      4
      5from ..models.v1_task_update_json_body_additional_data import \
      6    V1TaskUpdateJsonBodyAdditionalData
      7from ..models.v1_task_update_json_body_error_data import \
      8    V1TaskUpdateJsonBodyErrorData
      9from ..models.v1_task_update_json_body_status import V1TaskUpdateJsonBodyStatus
     10from ..types import UNSET, Unset
     11
     12T = TypeVar("T", bound="V1TaskUpdateJsonBody")
     13
     14@attr.s(auto_attribs=True)
     15class V1TaskUpdateJsonBody:
     16    """ Body for request to /tasks/get_by_workspace   The Request body for v1.task.update
     17
     18    Attributes:
     19        task_id (str):  The primary id of the task.
     20        attempt (int):  The attempt number of this update.
     21        status (V1TaskUpdateJsonBodyStatus):  The status of the task.
     22        additional_data (Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]):  Any additional output data from the
     23            task as a json value.
     24        error_data (Union[Unset, None, V1TaskUpdateJsonBodyErrorData]):  Any additional error output as a json value.
     25        end_time (Union[Unset, None, str]):  The end time of the task if finished, optional can be null to denote not
     26            finished.
     27    """
     28
     29    task_id: str
     30    attempt: int
     31    status: V1TaskUpdateJsonBodyStatus
     32    additional_data: Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData] = UNSET
     33    error_data: Union[Unset, None, V1TaskUpdateJsonBodyErrorData] = UNSET
     34    end_time: Union[Unset, None, str] = UNSET
     35    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     36
     37
     38    def to_dict(self) -> Dict[str, Any]:
     39        task_id = self.task_id
     40        attempt = self.attempt
     41        status = self.status.value
     42
     43        additional_data: Union[Unset, None, Dict[str, Any]] = UNSET
     44        if not isinstance(self.additional_data, Unset):
     45            additional_data = self.additional_data.to_dict() if self.additional_data else None
     46
     47        error_data: Union[Unset, None, Dict[str, Any]] = UNSET
     48        if not isinstance(self.error_data, Unset):
     49            error_data = self.error_data.to_dict() if self.error_data else None
     50
     51        end_time = self.end_time
     52
     53        field_dict: Dict[str, Any] = {}
     54        field_dict.update(self.additional_properties)
     55        field_dict.update({
     56            "task_id": task_id,
     57            "attempt": attempt,
     58            "status": status,
     59        })
     60        if additional_data is not UNSET:
     61            field_dict["additional_data"] = additional_data
     62        if error_data is not UNSET:
     63            field_dict["error_data"] = error_data
     64        if end_time is not UNSET:
     65            field_dict["end_time"] = end_time
     66
     67        return field_dict
     68
     69
     70
     71    @classmethod
     72    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     73        d = src_dict.copy()
     74        task_id = d.pop("task_id")
     75
     76        attempt = d.pop("attempt")
     77
     78        status = V1TaskUpdateJsonBodyStatus(d.pop("status"))
     79
     80
     81
     82
     83        _additional_data = d.pop("additional_data", UNSET)
     84        additional_data: Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]
     85        if _additional_data is None:
     86            additional_data = None
     87        elif isinstance(_additional_data,  Unset):
     88            additional_data = UNSET
     89        else:
     90            additional_data = V1TaskUpdateJsonBodyAdditionalData.from_dict(_additional_data)
     91
     92
     93
     94
     95        _error_data = d.pop("error_data", UNSET)
     96        error_data: Union[Unset, None, V1TaskUpdateJsonBodyErrorData]
     97        if _error_data is None:
     98            error_data = None
     99        elif isinstance(_error_data,  Unset):
    100            error_data = UNSET
    101        else:
    102            error_data = V1TaskUpdateJsonBodyErrorData.from_dict(_error_data)
    103
    104
    105
    106
    107        end_time = d.pop("end_time", UNSET)
    108
    109        v1_task_update_json_body = cls(
    110            task_id=task_id,
    111            attempt=attempt,
    112            status=status,
    113            additional_data=additional_data,
    114            error_data=error_data,
    115            end_time=end_time,
    116        )
    117
    118        v1_task_update_json_body.additional_properties = d
    119        return v1_task_update_json_body
    120
    121    @property
    122    def additional_keys(self) -> List[str]:
    123        return list(self.additional_properties.keys())
    124
    125    def __getitem__(self, key: str) -> Any:
    126        return self.additional_properties[key]
    127
    128    def __setitem__(self, key: str, value: Any) -> None:
    129        self.additional_properties[key] = value
    130
    131    def __delitem__(self, key: str) -> None:
    132        del self.additional_properties[key]
    133
    134    def __contains__(self, key: str) -> bool:
    135        return key in self.additional_properties

@attr.s(auto_attribs=True)
class V1TaskUpdateJsonBody: View Source

     15@attr.s(auto_attribs=True)
     16class V1TaskUpdateJsonBody:
     17    """ Body for request to /tasks/get_by_workspace   The Request body for v1.task.update
     18
     19    Attributes:
     20        task_id (str):  The primary id of the task.
     21        attempt (int):  The attempt number of this update.
     22        status (V1TaskUpdateJsonBodyStatus):  The status of the task.
     23        additional_data (Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]):  Any additional output data from the
     24            task as a json value.
     25        error_data (Union[Unset, None, V1TaskUpdateJsonBodyErrorData]):  Any additional error output as a json value.
     26        end_time (Union[Unset, None, str]):  The end time of the task if finished, optional can be null to denote not
     27            finished.
     28    """
     29
     30    task_id: str
     31    attempt: int
     32    status: V1TaskUpdateJsonBodyStatus
     33    additional_data: Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData] = UNSET
     34    error_data: Union[Unset, None, V1TaskUpdateJsonBodyErrorData] = UNSET
     35    end_time: Union[Unset, None, str] = UNSET
     36    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     37
     38
     39    def to_dict(self) -> Dict[str, Any]:
     40        task_id = self.task_id
     41        attempt = self.attempt
     42        status = self.status.value
     43
     44        additional_data: Union[Unset, None, Dict[str, Any]] = UNSET
     45        if not isinstance(self.additional_data, Unset):
     46            additional_data = self.additional_data.to_dict() if self.additional_data else None
     47
     48        error_data: Union[Unset, None, Dict[str, Any]] = UNSET
     49        if not isinstance(self.error_data, Unset):
     50            error_data = self.error_data.to_dict() if self.error_data else None
     51
     52        end_time = self.end_time
     53
     54        field_dict: Dict[str, Any] = {}
     55        field_dict.update(self.additional_properties)
     56        field_dict.update({
     57            "task_id": task_id,
     58            "attempt": attempt,
     59            "status": status,
     60        })
     61        if additional_data is not UNSET:
     62            field_dict["additional_data"] = additional_data
     63        if error_data is not UNSET:
     64            field_dict["error_data"] = error_data
     65        if end_time is not UNSET:
     66            field_dict["end_time"] = end_time
     67
     68        return field_dict
     69
     70
     71
     72    @classmethod
     73    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     74        d = src_dict.copy()
     75        task_id = d.pop("task_id")
     76
     77        attempt = d.pop("attempt")
     78
     79        status = V1TaskUpdateJsonBodyStatus(d.pop("status"))
     80
     81
     82
     83
     84        _additional_data = d.pop("additional_data", UNSET)
     85        additional_data: Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]
     86        if _additional_data is None:
     87            additional_data = None
     88        elif isinstance(_additional_data,  Unset):
     89            additional_data = UNSET
     90        else:
     91            additional_data = V1TaskUpdateJsonBodyAdditionalData.from_dict(_additional_data)
     92
     93
     94
     95
     96        _error_data = d.pop("error_data", UNSET)
     97        error_data: Union[Unset, None, V1TaskUpdateJsonBodyErrorData]
     98        if _error_data is None:
     99            error_data = None
    100        elif isinstance(_error_data,  Unset):
    101            error_data = UNSET
    102        else:
    103            error_data = V1TaskUpdateJsonBodyErrorData.from_dict(_error_data)
    104
    105
    106
    107
    108        end_time = d.pop("end_time", UNSET)
    109
    110        v1_task_update_json_body = cls(
    111            task_id=task_id,
    112            attempt=attempt,
    113            status=status,
    114            additional_data=additional_data,
    115            error_data=error_data,
    116            end_time=end_time,
    117        )
    118
    119        v1_task_update_json_body.additional_properties = d
    120        return v1_task_update_json_body
    121
    122    @property
    123    def additional_keys(self) -> List[str]:
    124        return list(self.additional_properties.keys())
    125
    126    def __getitem__(self, key: str) -> Any:
    127        return self.additional_properties[key]
    128
    129    def __setitem__(self, key: str, value: Any) -> None:
    130        self.additional_properties[key] = value
    131
    132    def __delitem__(self, key: str) -> None:
    133        del self.additional_properties[key]
    134
    135    def __contains__(self, key: str) -> bool:
    136        return key in self.additional_properties

Body for request to /tasks/get_by_workspace The Request body for v1.task.update

Attributes: task_id (str): The primary id of the task. attempt (int): The attempt number of this update. status (V1TaskUpdateJsonBodyStatus): The status of the task. additional_data (Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]): Any additional output data from the task as a json value. error_data (Union[Unset, None, V1TaskUpdateJsonBodyErrorData]): Any additional error output as a json value. end_time (Union[Unset, None, str]): The end time of the task if finished, optional can be null to denote not finished.

V1TaskUpdateJsonBody( task_id: str, attempt: int, status: wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body_status.V1TaskUpdateJsonBodyStatus, additional_data: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body_additional_data.V1TaskUpdateJsonBodyAdditionalData] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, error_data: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_json_body_error_data.V1TaskUpdateJsonBodyErrorData] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, end_time: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

    2def __init__(self, task_id, attempt, status, additional_data=attr_dict['additional_data'].default, error_data=attr_dict['error_data'].default, end_time=attr_dict['end_time'].default):
    3    self.task_id = task_id
    4    self.attempt = attempt
    5    self.status = status
    6    self.additional_data = additional_data
    7    self.error_data = error_data
    8    self.end_time = end_time
    9    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1TaskUpdateJsonBody.

def to_dict(self) -> Dict[str, Any]: View Source

    39    def to_dict(self) -> Dict[str, Any]:
    40        task_id = self.task_id
    41        attempt = self.attempt
    42        status = self.status.value
    43
    44        additional_data: Union[Unset, None, Dict[str, Any]] = UNSET
    45        if not isinstance(self.additional_data, Unset):
    46            additional_data = self.additional_data.to_dict() if self.additional_data else None
    47
    48        error_data: Union[Unset, None, Dict[str, Any]] = UNSET
    49        if not isinstance(self.error_data, Unset):
    50            error_data = self.error_data.to_dict() if self.error_data else None
    51
    52        end_time = self.end_time
    53
    54        field_dict: Dict[str, Any] = {}
    55        field_dict.update(self.additional_properties)
    56        field_dict.update({
    57            "task_id": task_id,
    58            "attempt": attempt,
    59            "status": status,
    60        })
    61        if additional_data is not UNSET:
    62            field_dict["additional_data"] = additional_data
    63        if error_data is not UNSET:
    64            field_dict["error_data"] = error_data
    65        if end_time is not UNSET:
    66            field_dict["end_time"] = end_time
    67
    68        return field_dict

@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T: View Source

     72    @classmethod
     73    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     74        d = src_dict.copy()
     75        task_id = d.pop("task_id")
     76
     77        attempt = d.pop("attempt")
     78
     79        status = V1TaskUpdateJsonBodyStatus(d.pop("status"))
     80
     81
     82
     83
     84        _additional_data = d.pop("additional_data", UNSET)
     85        additional_data: Union[Unset, None, V1TaskUpdateJsonBodyAdditionalData]
     86        if _additional_data is None:
     87            additional_data = None
     88        elif isinstance(_additional_data,  Unset):
     89            additional_data = UNSET
     90        else:
     91            additional_data = V1TaskUpdateJsonBodyAdditionalData.from_dict(_additional_data)
     92
     93
     94
     95
     96        _error_data = d.pop("error_data", UNSET)
     97        error_data: Union[Unset, None, V1TaskUpdateJsonBodyErrorData]
     98        if _error_data is None:
     99            error_data = None
    100        elif isinstance(_error_data,  Unset):
    101            error_data = UNSET
    102        else:
    103            error_data = V1TaskUpdateJsonBodyErrorData.from_dict(_error_data)
    104
    105
    106
    107
    108        end_time = d.pop("end_time", UNSET)
    109
    110        v1_task_update_json_body = cls(
    111            task_id=task_id,
    112            attempt=attempt,
    113            status=status,
    114            additional_data=additional_data,
    115            error_data=error_data,
    116            end_time=end_time,
    117        )
    118
    119        v1_task_update_json_body.additional_properties = d
    120        return v1_task_update_json_body

additional_keys: List[str]