wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union
      2
      3import attr
      4
      5from ..models.v1_task_update_response_200_data_status_type_0 import \
      6    V1TaskUpdateResponse200DataStatusType0
      7from ..models.v1_task_update_response_200_data_status_type_1 import \
      8    V1TaskUpdateResponse200DataStatusType1
      9from ..models.v1_task_update_response_200_data_status_type_2 import \
     10    V1TaskUpdateResponse200DataStatusType2
     11from ..models.v1_task_update_response_200_data_status_type_3 import \
     12    V1TaskUpdateResponse200DataStatusType3
     13from ..models.v1_task_update_response_200_data_status_type_4 import \
     14    V1TaskUpdateResponse200DataStatusType4
     15from ..models.v1_task_update_response_200_data_status_type_5 import \
     16    V1TaskUpdateResponse200DataStatusType5
     17from ..models.v1_task_update_response_200_data_status_type_6 import \
     18    V1TaskUpdateResponse200DataStatusType6
     19from ..models.v1_task_update_response_200_data_status_type_7 import \
     20    V1TaskUpdateResponse200DataStatusType7
     21
     22T = TypeVar("T", bound="V1TaskUpdateResponse200Data")
     23
     24@attr.s(auto_attribs=True)
     25class V1TaskUpdateResponse200Data:
     26    """ Response structure for updating a task.
     27
     28    Attributes:
     29        task_id (str):  The updated task id.
     30        status (Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1,
     31            V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3,
     32            V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5,
     33            V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]):  The last set status, and
     34            returned status from the task update.
     35        output_id (str):  The primary key of the output table, for output data either additional or error.
     36    """
     37
     38    task_id: str
     39    status: Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]
     40    output_id: str
     41    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     42
     43
     44    def to_dict(self) -> Dict[str, Any]:
     45        task_id = self.task_id
     46        status: Union[Dict[str, Any], str]
     47
     48        if isinstance(self.status, V1TaskUpdateResponse200DataStatusType0):
     49            status = self.status.value
     50
     51        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType1):
     52            status = self.status.value
     53
     54        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType2):
     55            status = self.status.value
     56
     57        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType3):
     58            status = self.status.value
     59
     60        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType4):
     61            status = self.status.value
     62
     63        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType5):
     64            status = self.status.value
     65
     66        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType6):
     67            status = self.status.value
     68
     69        else:
     70            status = self.status.to_dict()
     71
     72
     73
     74        output_id = self.output_id
     75
     76        field_dict: Dict[str, Any] = {}
     77        field_dict.update(self.additional_properties)
     78        field_dict.update({
     79            "task_id": task_id,
     80            "status": status,
     81            "output_id": output_id,
     82        })
     83
     84        return field_dict
     85
     86
     87
     88    @classmethod
     89    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     90        d = src_dict.copy()
     91        task_id = d.pop("task_id")
     92
     93        def _parse_status(data: object) -> Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]:
     94            try:
     95                if not isinstance(data, str):
     96                    raise TypeError()
     97                status_type_0 = V1TaskUpdateResponse200DataStatusType0(data)
     98
     99
    100
    101                return status_type_0
    102            except: # noqa: E722
    103                pass
    104            try:
    105                if not isinstance(data, str):
    106                    raise TypeError()
    107                status_type_1 = V1TaskUpdateResponse200DataStatusType1(data)
    108
    109
    110
    111                return status_type_1
    112            except: # noqa: E722
    113                pass
    114            try:
    115                if not isinstance(data, str):
    116                    raise TypeError()
    117                status_type_2 = V1TaskUpdateResponse200DataStatusType2(data)
    118
    119
    120
    121                return status_type_2
    122            except: # noqa: E722
    123                pass
    124            try:
    125                if not isinstance(data, str):
    126                    raise TypeError()
    127                status_type_3 = V1TaskUpdateResponse200DataStatusType3(data)
    128
    129
    130
    131                return status_type_3
    132            except: # noqa: E722
    133                pass
    134            try:
    135                if not isinstance(data, str):
    136                    raise TypeError()
    137                status_type_4 = V1TaskUpdateResponse200DataStatusType4(data)
    138
    139
    140
    141                return status_type_4
    142            except: # noqa: E722
    143                pass
    144            try:
    145                if not isinstance(data, str):
    146                    raise TypeError()
    147                status_type_5 = V1TaskUpdateResponse200DataStatusType5(data)
    148
    149
    150
    151                return status_type_5
    152            except: # noqa: E722
    153                pass
    154            try:
    155                if not isinstance(data, str):
    156                    raise TypeError()
    157                status_type_6 = V1TaskUpdateResponse200DataStatusType6(data)
    158
    159
    160
    161                return status_type_6
    162            except: # noqa: E722
    163                pass
    164            if not isinstance(data, dict):
    165                raise TypeError()
    166            status_type_7 = V1TaskUpdateResponse200DataStatusType7.from_dict(data)
    167
    168
    169
    170            return status_type_7
    171
    172        status = _parse_status(d.pop("status"))
    173
    174
    175        output_id = d.pop("output_id")
    176
    177        v1_task_update_response_200_data = cls(
    178            task_id=task_id,
    179            status=status,
    180            output_id=output_id,
    181        )
    182
    183        v1_task_update_response_200_data.additional_properties = d
    184        return v1_task_update_response_200_data
    185
    186    @property
    187    def additional_keys(self) -> List[str]:
    188        return list(self.additional_properties.keys())
    189
    190    def __getitem__(self, key: str) -> Any:
    191        return self.additional_properties[key]
    192
    193    def __setitem__(self, key: str, value: Any) -> None:
    194        self.additional_properties[key] = value
    195
    196    def __delitem__(self, key: str) -> None:
    197        del self.additional_properties[key]
    198
    199    def __contains__(self, key: str) -> bool:
    200        return key in self.additional_properties

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

     25@attr.s(auto_attribs=True)
     26class V1TaskUpdateResponse200Data:
     27    """ Response structure for updating a task.
     28
     29    Attributes:
     30        task_id (str):  The updated task id.
     31        status (Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1,
     32            V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3,
     33            V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5,
     34            V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]):  The last set status, and
     35            returned status from the task update.
     36        output_id (str):  The primary key of the output table, for output data either additional or error.
     37    """
     38
     39    task_id: str
     40    status: Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]
     41    output_id: str
     42    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     43
     44
     45    def to_dict(self) -> Dict[str, Any]:
     46        task_id = self.task_id
     47        status: Union[Dict[str, Any], str]
     48
     49        if isinstance(self.status, V1TaskUpdateResponse200DataStatusType0):
     50            status = self.status.value
     51
     52        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType1):
     53            status = self.status.value
     54
     55        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType2):
     56            status = self.status.value
     57
     58        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType3):
     59            status = self.status.value
     60
     61        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType4):
     62            status = self.status.value
     63
     64        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType5):
     65            status = self.status.value
     66
     67        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType6):
     68            status = self.status.value
     69
     70        else:
     71            status = self.status.to_dict()
     72
     73
     74
     75        output_id = self.output_id
     76
     77        field_dict: Dict[str, Any] = {}
     78        field_dict.update(self.additional_properties)
     79        field_dict.update({
     80            "task_id": task_id,
     81            "status": status,
     82            "output_id": output_id,
     83        })
     84
     85        return field_dict
     86
     87
     88
     89    @classmethod
     90    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     91        d = src_dict.copy()
     92        task_id = d.pop("task_id")
     93
     94        def _parse_status(data: object) -> Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]:
     95            try:
     96                if not isinstance(data, str):
     97                    raise TypeError()
     98                status_type_0 = V1TaskUpdateResponse200DataStatusType0(data)
     99
    100
    101
    102                return status_type_0
    103            except: # noqa: E722
    104                pass
    105            try:
    106                if not isinstance(data, str):
    107                    raise TypeError()
    108                status_type_1 = V1TaskUpdateResponse200DataStatusType1(data)
    109
    110
    111
    112                return status_type_1
    113            except: # noqa: E722
    114                pass
    115            try:
    116                if not isinstance(data, str):
    117                    raise TypeError()
    118                status_type_2 = V1TaskUpdateResponse200DataStatusType2(data)
    119
    120
    121
    122                return status_type_2
    123            except: # noqa: E722
    124                pass
    125            try:
    126                if not isinstance(data, str):
    127                    raise TypeError()
    128                status_type_3 = V1TaskUpdateResponse200DataStatusType3(data)
    129
    130
    131
    132                return status_type_3
    133            except: # noqa: E722
    134                pass
    135            try:
    136                if not isinstance(data, str):
    137                    raise TypeError()
    138                status_type_4 = V1TaskUpdateResponse200DataStatusType4(data)
    139
    140
    141
    142                return status_type_4
    143            except: # noqa: E722
    144                pass
    145            try:
    146                if not isinstance(data, str):
    147                    raise TypeError()
    148                status_type_5 = V1TaskUpdateResponse200DataStatusType5(data)
    149
    150
    151
    152                return status_type_5
    153            except: # noqa: E722
    154                pass
    155            try:
    156                if not isinstance(data, str):
    157                    raise TypeError()
    158                status_type_6 = V1TaskUpdateResponse200DataStatusType6(data)
    159
    160
    161
    162                return status_type_6
    163            except: # noqa: E722
    164                pass
    165            if not isinstance(data, dict):
    166                raise TypeError()
    167            status_type_7 = V1TaskUpdateResponse200DataStatusType7.from_dict(data)
    168
    169
    170
    171            return status_type_7
    172
    173        status = _parse_status(d.pop("status"))
    174
    175
    176        output_id = d.pop("output_id")
    177
    178        v1_task_update_response_200_data = cls(
    179            task_id=task_id,
    180            status=status,
    181            output_id=output_id,
    182        )
    183
    184        v1_task_update_response_200_data.additional_properties = d
    185        return v1_task_update_response_200_data
    186
    187    @property
    188    def additional_keys(self) -> List[str]:
    189        return list(self.additional_properties.keys())
    190
    191    def __getitem__(self, key: str) -> Any:
    192        return self.additional_properties[key]
    193
    194    def __setitem__(self, key: str, value: Any) -> None:
    195        self.additional_properties[key] = value
    196
    197    def __delitem__(self, key: str) -> None:
    198        del self.additional_properties[key]
    199
    200    def __contains__(self, key: str) -> bool:
    201        return key in self.additional_properties

Response structure for updating a task.

Attributes: task_id (str): The updated task id. status (Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]): The last set status, and returned status from the task update. output_id (str): The primary key of the output table, for output data either additional or error.

V1TaskUpdateResponse200Data( task_id: str, status: Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_0.V1TaskUpdateResponse200DataStatusType0, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_1.V1TaskUpdateResponse200DataStatusType1, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_2.V1TaskUpdateResponse200DataStatusType2, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_3.V1TaskUpdateResponse200DataStatusType3, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_4.V1TaskUpdateResponse200DataStatusType4, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_5.V1TaskUpdateResponse200DataStatusType5, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_6.V1TaskUpdateResponse200DataStatusType6, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_update_response_200_data_status_type_7.V1TaskUpdateResponse200DataStatusType7], output_id: str) View Source

    2def __init__(self, task_id, status, output_id):
    3    self.task_id = task_id
    4    self.status = status
    5    self.output_id = output_id
    6    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1TaskUpdateResponse200Data.

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

    45    def to_dict(self) -> Dict[str, Any]:
    46        task_id = self.task_id
    47        status: Union[Dict[str, Any], str]
    48
    49        if isinstance(self.status, V1TaskUpdateResponse200DataStatusType0):
    50            status = self.status.value
    51
    52        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType1):
    53            status = self.status.value
    54
    55        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType2):
    56            status = self.status.value
    57
    58        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType3):
    59            status = self.status.value
    60
    61        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType4):
    62            status = self.status.value
    63
    64        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType5):
    65            status = self.status.value
    66
    67        elif isinstance(self.status, V1TaskUpdateResponse200DataStatusType6):
    68            status = self.status.value
    69
    70        else:
    71            status = self.status.to_dict()
    72
    73
    74
    75        output_id = self.output_id
    76
    77        field_dict: Dict[str, Any] = {}
    78        field_dict.update(self.additional_properties)
    79        field_dict.update({
    80            "task_id": task_id,
    81            "status": status,
    82            "output_id": output_id,
    83        })
    84
    85        return field_dict

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

     89    @classmethod
     90    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     91        d = src_dict.copy()
     92        task_id = d.pop("task_id")
     93
     94        def _parse_status(data: object) -> Union[V1TaskUpdateResponse200DataStatusType0, V1TaskUpdateResponse200DataStatusType1, V1TaskUpdateResponse200DataStatusType2, V1TaskUpdateResponse200DataStatusType3, V1TaskUpdateResponse200DataStatusType4, V1TaskUpdateResponse200DataStatusType5, V1TaskUpdateResponse200DataStatusType6, V1TaskUpdateResponse200DataStatusType7]:
     95            try:
     96                if not isinstance(data, str):
     97                    raise TypeError()
     98                status_type_0 = V1TaskUpdateResponse200DataStatusType0(data)
     99
    100
    101
    102                return status_type_0
    103            except: # noqa: E722
    104                pass
    105            try:
    106                if not isinstance(data, str):
    107                    raise TypeError()
    108                status_type_1 = V1TaskUpdateResponse200DataStatusType1(data)
    109
    110
    111
    112                return status_type_1
    113            except: # noqa: E722
    114                pass
    115            try:
    116                if not isinstance(data, str):
    117                    raise TypeError()
    118                status_type_2 = V1TaskUpdateResponse200DataStatusType2(data)
    119
    120
    121
    122                return status_type_2
    123            except: # noqa: E722
    124                pass
    125            try:
    126                if not isinstance(data, str):
    127                    raise TypeError()
    128                status_type_3 = V1TaskUpdateResponse200DataStatusType3(data)
    129
    130
    131
    132                return status_type_3
    133            except: # noqa: E722
    134                pass
    135            try:
    136                if not isinstance(data, str):
    137                    raise TypeError()
    138                status_type_4 = V1TaskUpdateResponse200DataStatusType4(data)
    139
    140
    141
    142                return status_type_4
    143            except: # noqa: E722
    144                pass
    145            try:
    146                if not isinstance(data, str):
    147                    raise TypeError()
    148                status_type_5 = V1TaskUpdateResponse200DataStatusType5(data)
    149
    150
    151
    152                return status_type_5
    153            except: # noqa: E722
    154                pass
    155            try:
    156                if not isinstance(data, str):
    157                    raise TypeError()
    158                status_type_6 = V1TaskUpdateResponse200DataStatusType6(data)
    159
    160
    161
    162                return status_type_6
    163            except: # noqa: E722
    164                pass
    165            if not isinstance(data, dict):
    166                raise TypeError()
    167            status_type_7 = V1TaskUpdateResponse200DataStatusType7.from_dict(data)
    168
    169
    170
    171            return status_type_7
    172
    173        status = _parse_status(d.pop("status"))
    174
    175
    176        output_id = d.pop("output_id")
    177
    178        v1_task_update_response_200_data = cls(
    179            task_id=task_id,
    180            status=status,
    181            output_id=output_id,
    182        )
    183
    184        v1_task_update_response_200_data.additional_properties = d
    185        return v1_task_update_response_200_data

additional_keys: List[str]