wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union
      2
      3import attr
      4
      5from ..models.v1_task_get_by_id_response_200_task_attempt_output_item import \
      6    V1TaskGetByIdResponse200TaskAttemptOutputItem
      7from ..models.v1_task_get_by_id_response_200_task_flavor_type_0 import \
      8    V1TaskGetByIdResponse200TaskFlavorType0
      9from ..models.v1_task_get_by_id_response_200_task_flavor_type_1 import \
     10    V1TaskGetByIdResponse200TaskFlavorType1
     11from ..models.v1_task_get_by_id_response_200_task_flavor_type_2 import \
     12    V1TaskGetByIdResponse200TaskFlavorType2
     13from ..models.v1_task_get_by_id_response_200_task_status_type_0 import \
     14    V1TaskGetByIdResponse200TaskStatusType0
     15from ..models.v1_task_get_by_id_response_200_task_status_type_1 import \
     16    V1TaskGetByIdResponse200TaskStatusType1
     17from ..models.v1_task_get_by_id_response_200_task_status_type_2 import \
     18    V1TaskGetByIdResponse200TaskStatusType2
     19from ..models.v1_task_get_by_id_response_200_task_status_type_3 import \
     20    V1TaskGetByIdResponse200TaskStatusType3
     21from ..models.v1_task_get_by_id_response_200_task_status_type_4 import \
     22    V1TaskGetByIdResponse200TaskStatusType4
     23from ..models.v1_task_get_by_id_response_200_task_status_type_5 import \
     24    V1TaskGetByIdResponse200TaskStatusType5
     25from ..models.v1_task_get_by_id_response_200_task_status_type_6 import \
     26    V1TaskGetByIdResponse200TaskStatusType6
     27from ..models.v1_task_get_by_id_response_200_task_status_type_7 import \
     28    V1TaskGetByIdResponse200TaskStatusType7
     29from ..models.v1_task_get_by_id_response_200_task_task_type_type_0 import \
     30    V1TaskGetByIdResponse200TaskTaskTypeType0
     31from ..models.v1_task_get_by_id_response_200_task_task_type_type_1 import \
     32    V1TaskGetByIdResponse200TaskTaskTypeType1
     33from ..models.v1_task_get_by_id_response_200_task_task_type_type_2 import \
     34    V1TaskGetByIdResponse200TaskTaskTypeType2
     35from ..models.v1_task_get_by_id_response_200_task_task_type_type_3 import \
     36    V1TaskGetByIdResponse200TaskTaskTypeType3
     37from ..types import UNSET, Unset
     38
     39T = TypeVar("T", bound="V1TaskGetByIdResponse200Task")
     40
     41@attr.s(auto_attribs=True)
     42class V1TaskGetByIdResponse200Task:
     43    """ The task by it's given id
     44
     45    Attributes:
     46        id (str):
     47        status (Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1,
     48            V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3,
     49            V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5,
     50            V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]):
     51        flavor (Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1,
     52            V1TaskGetByIdResponse200TaskFlavorType2]):
     53        subject (str):
     54        task_type (Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1,
     55            V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]):
     56        next_attempt (Union[Unset, None, int]):
     57        attempt_output (Union[Unset, None, List[V1TaskGetByIdResponse200TaskAttemptOutputItem]]):
     58    """
     59
     60    id: str
     61    status: Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]
     62    flavor: Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]
     63    subject: str
     64    task_type: Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]
     65    next_attempt: Union[Unset, None, int] = UNSET
     66    attempt_output: Union[Unset, None, List[V1TaskGetByIdResponse200TaskAttemptOutputItem]] = UNSET
     67    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     68
     69
     70    def to_dict(self) -> Dict[str, Any]:
     71        id = self.id
     72        status: Union[Dict[str, Any], str]
     73
     74        if isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType0):
     75            status = self.status.value
     76
     77        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType1):
     78            status = self.status.value
     79
     80        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType2):
     81            status = self.status.value
     82
     83        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType3):
     84            status = self.status.value
     85
     86        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType4):
     87            status = self.status.value
     88
     89        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType5):
     90            status = self.status.value
     91
     92        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType6):
     93            status = self.status.value
     94
     95        else:
     96            status = self.status.to_dict()
     97
     98
     99
    100        flavor: Union[Dict[str, Any], str]
    101
    102        if isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType0):
    103            flavor = self.flavor.value
    104
    105        elif isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType1):
    106            flavor = self.flavor.value
    107
    108        else:
    109            flavor = self.flavor.to_dict()
    110
    111
    112
    113        subject = self.subject
    114        task_type: Union[Dict[str, Any], str]
    115
    116        if isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType0):
    117            task_type = self.task_type.value
    118
    119        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType1):
    120            task_type = self.task_type.value
    121
    122        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType2):
    123            task_type = self.task_type.value
    124
    125        else:
    126            task_type = self.task_type.to_dict()
    127
    128
    129
    130        next_attempt = self.next_attempt
    131        attempt_output: Union[Unset, None, List[Dict[str, Any]]] = UNSET
    132        if not isinstance(self.attempt_output, Unset):
    133            if self.attempt_output is None:
    134                attempt_output = None
    135            else:
    136                attempt_output = []
    137                for attempt_output_item_data in self.attempt_output:
    138                    attempt_output_item = attempt_output_item_data.to_dict()
    139
    140                    attempt_output.append(attempt_output_item)
    141
    142
    143
    144
    145
    146        field_dict: Dict[str, Any] = {}
    147        field_dict.update(self.additional_properties)
    148        field_dict.update({
    149            "id": id,
    150            "status": status,
    151            "flavor": flavor,
    152            "subject": subject,
    153            "task_type": task_type,
    154        })
    155        if next_attempt is not UNSET:
    156            field_dict["next_attempt"] = next_attempt
    157        if attempt_output is not UNSET:
    158            field_dict["attempt_output"] = attempt_output
    159
    160        return field_dict
    161
    162
    163
    164    @classmethod
    165    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    166        d = src_dict.copy()
    167        id = d.pop("id")
    168
    169        def _parse_status(data: object) -> Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]:
    170            try:
    171                if not isinstance(data, str):
    172                    raise TypeError()
    173                status_type_0 = V1TaskGetByIdResponse200TaskStatusType0(data)
    174
    175
    176
    177                return status_type_0
    178            except: # noqa: E722
    179                pass
    180            try:
    181                if not isinstance(data, str):
    182                    raise TypeError()
    183                status_type_1 = V1TaskGetByIdResponse200TaskStatusType1(data)
    184
    185
    186
    187                return status_type_1
    188            except: # noqa: E722
    189                pass
    190            try:
    191                if not isinstance(data, str):
    192                    raise TypeError()
    193                status_type_2 = V1TaskGetByIdResponse200TaskStatusType2(data)
    194
    195
    196
    197                return status_type_2
    198            except: # noqa: E722
    199                pass
    200            try:
    201                if not isinstance(data, str):
    202                    raise TypeError()
    203                status_type_3 = V1TaskGetByIdResponse200TaskStatusType3(data)
    204
    205
    206
    207                return status_type_3
    208            except: # noqa: E722
    209                pass
    210            try:
    211                if not isinstance(data, str):
    212                    raise TypeError()
    213                status_type_4 = V1TaskGetByIdResponse200TaskStatusType4(data)
    214
    215
    216
    217                return status_type_4
    218            except: # noqa: E722
    219                pass
    220            try:
    221                if not isinstance(data, str):
    222                    raise TypeError()
    223                status_type_5 = V1TaskGetByIdResponse200TaskStatusType5(data)
    224
    225
    226
    227                return status_type_5
    228            except: # noqa: E722
    229                pass
    230            try:
    231                if not isinstance(data, str):
    232                    raise TypeError()
    233                status_type_6 = V1TaskGetByIdResponse200TaskStatusType6(data)
    234
    235
    236
    237                return status_type_6
    238            except: # noqa: E722
    239                pass
    240            if not isinstance(data, dict):
    241                raise TypeError()
    242            status_type_7 = V1TaskGetByIdResponse200TaskStatusType7.from_dict(data)
    243
    244
    245
    246            return status_type_7
    247
    248        status = _parse_status(d.pop("status"))
    249
    250
    251        def _parse_flavor(data: object) -> Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]:
    252            try:
    253                if not isinstance(data, str):
    254                    raise TypeError()
    255                flavor_type_0 = V1TaskGetByIdResponse200TaskFlavorType0(data)
    256
    257
    258
    259                return flavor_type_0
    260            except: # noqa: E722
    261                pass
    262            try:
    263                if not isinstance(data, str):
    264                    raise TypeError()
    265                flavor_type_1 = V1TaskGetByIdResponse200TaskFlavorType1(data)
    266
    267
    268
    269                return flavor_type_1
    270            except: # noqa: E722
    271                pass
    272            if not isinstance(data, dict):
    273                raise TypeError()
    274            flavor_type_2 = V1TaskGetByIdResponse200TaskFlavorType2.from_dict(data)
    275
    276
    277
    278            return flavor_type_2
    279
    280        flavor = _parse_flavor(d.pop("flavor"))
    281
    282
    283        subject = d.pop("subject")
    284
    285        def _parse_task_type(data: object) -> Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]:
    286            try:
    287                if not isinstance(data, str):
    288                    raise TypeError()
    289                task_type_type_0 = V1TaskGetByIdResponse200TaskTaskTypeType0(data)
    290
    291
    292
    293                return task_type_type_0
    294            except: # noqa: E722
    295                pass
    296            try:
    297                if not isinstance(data, str):
    298                    raise TypeError()
    299                task_type_type_1 = V1TaskGetByIdResponse200TaskTaskTypeType1(data)
    300
    301
    302
    303                return task_type_type_1
    304            except: # noqa: E722
    305                pass
    306            try:
    307                if not isinstance(data, str):
    308                    raise TypeError()
    309                task_type_type_2 = V1TaskGetByIdResponse200TaskTaskTypeType2(data)
    310
    311
    312
    313                return task_type_type_2
    314            except: # noqa: E722
    315                pass
    316            if not isinstance(data, dict):
    317                raise TypeError()
    318            task_type_type_3 = V1TaskGetByIdResponse200TaskTaskTypeType3.from_dict(data)
    319
    320
    321
    322            return task_type_type_3
    323
    324        task_type = _parse_task_type(d.pop("task_type"))
    325
    326
    327        next_attempt = d.pop("next_attempt", UNSET)
    328
    329        attempt_output = []
    330        _attempt_output = d.pop("attempt_output", UNSET)
    331        for attempt_output_item_data in (_attempt_output or []):
    332            attempt_output_item = V1TaskGetByIdResponse200TaskAttemptOutputItem.from_dict(attempt_output_item_data)
    333
    334
    335
    336            attempt_output.append(attempt_output_item)
    337
    338
    339        v1_task_get_by_id_response_200_task = cls(
    340            id=id,
    341            status=status,
    342            flavor=flavor,
    343            subject=subject,
    344            task_type=task_type,
    345            next_attempt=next_attempt,
    346            attempt_output=attempt_output,
    347        )
    348
    349        v1_task_get_by_id_response_200_task.additional_properties = d
    350        return v1_task_get_by_id_response_200_task
    351
    352    @property
    353    def additional_keys(self) -> List[str]:
    354        return list(self.additional_properties.keys())
    355
    356    def __getitem__(self, key: str) -> Any:
    357        return self.additional_properties[key]
    358
    359    def __setitem__(self, key: str, value: Any) -> None:
    360        self.additional_properties[key] = value
    361
    362    def __delitem__(self, key: str) -> None:
    363        del self.additional_properties[key]
    364
    365    def __contains__(self, key: str) -> bool:
    366        return key in self.additional_properties

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

     42@attr.s(auto_attribs=True)
     43class V1TaskGetByIdResponse200Task:
     44    """ The task by it's given id
     45
     46    Attributes:
     47        id (str):
     48        status (Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1,
     49            V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3,
     50            V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5,
     51            V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]):
     52        flavor (Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1,
     53            V1TaskGetByIdResponse200TaskFlavorType2]):
     54        subject (str):
     55        task_type (Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1,
     56            V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]):
     57        next_attempt (Union[Unset, None, int]):
     58        attempt_output (Union[Unset, None, List[V1TaskGetByIdResponse200TaskAttemptOutputItem]]):
     59    """
     60
     61    id: str
     62    status: Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]
     63    flavor: Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]
     64    subject: str
     65    task_type: Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]
     66    next_attempt: Union[Unset, None, int] = UNSET
     67    attempt_output: Union[Unset, None, List[V1TaskGetByIdResponse200TaskAttemptOutputItem]] = UNSET
     68    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     69
     70
     71    def to_dict(self) -> Dict[str, Any]:
     72        id = self.id
     73        status: Union[Dict[str, Any], str]
     74
     75        if isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType0):
     76            status = self.status.value
     77
     78        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType1):
     79            status = self.status.value
     80
     81        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType2):
     82            status = self.status.value
     83
     84        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType3):
     85            status = self.status.value
     86
     87        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType4):
     88            status = self.status.value
     89
     90        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType5):
     91            status = self.status.value
     92
     93        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType6):
     94            status = self.status.value
     95
     96        else:
     97            status = self.status.to_dict()
     98
     99
    100
    101        flavor: Union[Dict[str, Any], str]
    102
    103        if isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType0):
    104            flavor = self.flavor.value
    105
    106        elif isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType1):
    107            flavor = self.flavor.value
    108
    109        else:
    110            flavor = self.flavor.to_dict()
    111
    112
    113
    114        subject = self.subject
    115        task_type: Union[Dict[str, Any], str]
    116
    117        if isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType0):
    118            task_type = self.task_type.value
    119
    120        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType1):
    121            task_type = self.task_type.value
    122
    123        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType2):
    124            task_type = self.task_type.value
    125
    126        else:
    127            task_type = self.task_type.to_dict()
    128
    129
    130
    131        next_attempt = self.next_attempt
    132        attempt_output: Union[Unset, None, List[Dict[str, Any]]] = UNSET
    133        if not isinstance(self.attempt_output, Unset):
    134            if self.attempt_output is None:
    135                attempt_output = None
    136            else:
    137                attempt_output = []
    138                for attempt_output_item_data in self.attempt_output:
    139                    attempt_output_item = attempt_output_item_data.to_dict()
    140
    141                    attempt_output.append(attempt_output_item)
    142
    143
    144
    145
    146
    147        field_dict: Dict[str, Any] = {}
    148        field_dict.update(self.additional_properties)
    149        field_dict.update({
    150            "id": id,
    151            "status": status,
    152            "flavor": flavor,
    153            "subject": subject,
    154            "task_type": task_type,
    155        })
    156        if next_attempt is not UNSET:
    157            field_dict["next_attempt"] = next_attempt
    158        if attempt_output is not UNSET:
    159            field_dict["attempt_output"] = attempt_output
    160
    161        return field_dict
    162
    163
    164
    165    @classmethod
    166    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    167        d = src_dict.copy()
    168        id = d.pop("id")
    169
    170        def _parse_status(data: object) -> Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]:
    171            try:
    172                if not isinstance(data, str):
    173                    raise TypeError()
    174                status_type_0 = V1TaskGetByIdResponse200TaskStatusType0(data)
    175
    176
    177
    178                return status_type_0
    179            except: # noqa: E722
    180                pass
    181            try:
    182                if not isinstance(data, str):
    183                    raise TypeError()
    184                status_type_1 = V1TaskGetByIdResponse200TaskStatusType1(data)
    185
    186
    187
    188                return status_type_1
    189            except: # noqa: E722
    190                pass
    191            try:
    192                if not isinstance(data, str):
    193                    raise TypeError()
    194                status_type_2 = V1TaskGetByIdResponse200TaskStatusType2(data)
    195
    196
    197
    198                return status_type_2
    199            except: # noqa: E722
    200                pass
    201            try:
    202                if not isinstance(data, str):
    203                    raise TypeError()
    204                status_type_3 = V1TaskGetByIdResponse200TaskStatusType3(data)
    205
    206
    207
    208                return status_type_3
    209            except: # noqa: E722
    210                pass
    211            try:
    212                if not isinstance(data, str):
    213                    raise TypeError()
    214                status_type_4 = V1TaskGetByIdResponse200TaskStatusType4(data)
    215
    216
    217
    218                return status_type_4
    219            except: # noqa: E722
    220                pass
    221            try:
    222                if not isinstance(data, str):
    223                    raise TypeError()
    224                status_type_5 = V1TaskGetByIdResponse200TaskStatusType5(data)
    225
    226
    227
    228                return status_type_5
    229            except: # noqa: E722
    230                pass
    231            try:
    232                if not isinstance(data, str):
    233                    raise TypeError()
    234                status_type_6 = V1TaskGetByIdResponse200TaskStatusType6(data)
    235
    236
    237
    238                return status_type_6
    239            except: # noqa: E722
    240                pass
    241            if not isinstance(data, dict):
    242                raise TypeError()
    243            status_type_7 = V1TaskGetByIdResponse200TaskStatusType7.from_dict(data)
    244
    245
    246
    247            return status_type_7
    248
    249        status = _parse_status(d.pop("status"))
    250
    251
    252        def _parse_flavor(data: object) -> Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]:
    253            try:
    254                if not isinstance(data, str):
    255                    raise TypeError()
    256                flavor_type_0 = V1TaskGetByIdResponse200TaskFlavorType0(data)
    257
    258
    259
    260                return flavor_type_0
    261            except: # noqa: E722
    262                pass
    263            try:
    264                if not isinstance(data, str):
    265                    raise TypeError()
    266                flavor_type_1 = V1TaskGetByIdResponse200TaskFlavorType1(data)
    267
    268
    269
    270                return flavor_type_1
    271            except: # noqa: E722
    272                pass
    273            if not isinstance(data, dict):
    274                raise TypeError()
    275            flavor_type_2 = V1TaskGetByIdResponse200TaskFlavorType2.from_dict(data)
    276
    277
    278
    279            return flavor_type_2
    280
    281        flavor = _parse_flavor(d.pop("flavor"))
    282
    283
    284        subject = d.pop("subject")
    285
    286        def _parse_task_type(data: object) -> Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]:
    287            try:
    288                if not isinstance(data, str):
    289                    raise TypeError()
    290                task_type_type_0 = V1TaskGetByIdResponse200TaskTaskTypeType0(data)
    291
    292
    293
    294                return task_type_type_0
    295            except: # noqa: E722
    296                pass
    297            try:
    298                if not isinstance(data, str):
    299                    raise TypeError()
    300                task_type_type_1 = V1TaskGetByIdResponse200TaskTaskTypeType1(data)
    301
    302
    303
    304                return task_type_type_1
    305            except: # noqa: E722
    306                pass
    307            try:
    308                if not isinstance(data, str):
    309                    raise TypeError()
    310                task_type_type_2 = V1TaskGetByIdResponse200TaskTaskTypeType2(data)
    311
    312
    313
    314                return task_type_type_2
    315            except: # noqa: E722
    316                pass
    317            if not isinstance(data, dict):
    318                raise TypeError()
    319            task_type_type_3 = V1TaskGetByIdResponse200TaskTaskTypeType3.from_dict(data)
    320
    321
    322
    323            return task_type_type_3
    324
    325        task_type = _parse_task_type(d.pop("task_type"))
    326
    327
    328        next_attempt = d.pop("next_attempt", UNSET)
    329
    330        attempt_output = []
    331        _attempt_output = d.pop("attempt_output", UNSET)
    332        for attempt_output_item_data in (_attempt_output or []):
    333            attempt_output_item = V1TaskGetByIdResponse200TaskAttemptOutputItem.from_dict(attempt_output_item_data)
    334
    335
    336
    337            attempt_output.append(attempt_output_item)
    338
    339
    340        v1_task_get_by_id_response_200_task = cls(
    341            id=id,
    342            status=status,
    343            flavor=flavor,
    344            subject=subject,
    345            task_type=task_type,
    346            next_attempt=next_attempt,
    347            attempt_output=attempt_output,
    348        )
    349
    350        v1_task_get_by_id_response_200_task.additional_properties = d
    351        return v1_task_get_by_id_response_200_task
    352
    353    @property
    354    def additional_keys(self) -> List[str]:
    355        return list(self.additional_properties.keys())
    356
    357    def __getitem__(self, key: str) -> Any:
    358        return self.additional_properties[key]
    359
    360    def __setitem__(self, key: str, value: Any) -> None:
    361        self.additional_properties[key] = value
    362
    363    def __delitem__(self, key: str) -> None:
    364        del self.additional_properties[key]
    365
    366    def __contains__(self, key: str) -> bool:
    367        return key in self.additional_properties

The task by it's given id

Attributes: id (str): status (Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]): flavor (Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]): subject (str): task_type (Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]): next_attempt (Union[Unset, None, int]): attempt_output (Union[Unset, None, List[V1TaskGetByIdResponse200TaskAttemptOutputItem]]):

V1TaskGetByIdResponse200Task( id: str, status: Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_0.V1TaskGetByIdResponse200TaskStatusType0, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_1.V1TaskGetByIdResponse200TaskStatusType1, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_2.V1TaskGetByIdResponse200TaskStatusType2, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_3.V1TaskGetByIdResponse200TaskStatusType3, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_4.V1TaskGetByIdResponse200TaskStatusType4, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_5.V1TaskGetByIdResponse200TaskStatusType5, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_6.V1TaskGetByIdResponse200TaskStatusType6, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_status_type_7.V1TaskGetByIdResponse200TaskStatusType7], flavor: Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_flavor_type_0.V1TaskGetByIdResponse200TaskFlavorType0, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_flavor_type_1.V1TaskGetByIdResponse200TaskFlavorType1, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_flavor_type_2.V1TaskGetByIdResponse200TaskFlavorType2], subject: str, task_type: Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_task_type_type_0.V1TaskGetByIdResponse200TaskTaskTypeType0, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_task_type_type_1.V1TaskGetByIdResponse200TaskTaskTypeType1, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_task_type_type_2.V1TaskGetByIdResponse200TaskTaskTypeType2, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_task_type_type_3.V1TaskGetByIdResponse200TaskTaskTypeType3], next_attempt: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, int] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, attempt_output: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_id_response_200_task_attempt_output_item.V1TaskGetByIdResponse200TaskAttemptOutputItem]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

     2def __init__(self, id, status, flavor, subject, task_type, next_attempt=attr_dict['next_attempt'].default, attempt_output=attr_dict['attempt_output'].default):
     3    self.id = id
     4    self.status = status
     5    self.flavor = flavor
     6    self.subject = subject
     7    self.task_type = task_type
     8    self.next_attempt = next_attempt
     9    self.attempt_output = attempt_output
    10    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1TaskGetByIdResponse200Task.

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

     71    def to_dict(self) -> Dict[str, Any]:
     72        id = self.id
     73        status: Union[Dict[str, Any], str]
     74
     75        if isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType0):
     76            status = self.status.value
     77
     78        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType1):
     79            status = self.status.value
     80
     81        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType2):
     82            status = self.status.value
     83
     84        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType3):
     85            status = self.status.value
     86
     87        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType4):
     88            status = self.status.value
     89
     90        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType5):
     91            status = self.status.value
     92
     93        elif isinstance(self.status, V1TaskGetByIdResponse200TaskStatusType6):
     94            status = self.status.value
     95
     96        else:
     97            status = self.status.to_dict()
     98
     99
    100
    101        flavor: Union[Dict[str, Any], str]
    102
    103        if isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType0):
    104            flavor = self.flavor.value
    105
    106        elif isinstance(self.flavor, V1TaskGetByIdResponse200TaskFlavorType1):
    107            flavor = self.flavor.value
    108
    109        else:
    110            flavor = self.flavor.to_dict()
    111
    112
    113
    114        subject = self.subject
    115        task_type: Union[Dict[str, Any], str]
    116
    117        if isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType0):
    118            task_type = self.task_type.value
    119
    120        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType1):
    121            task_type = self.task_type.value
    122
    123        elif isinstance(self.task_type, V1TaskGetByIdResponse200TaskTaskTypeType2):
    124            task_type = self.task_type.value
    125
    126        else:
    127            task_type = self.task_type.to_dict()
    128
    129
    130
    131        next_attempt = self.next_attempt
    132        attempt_output: Union[Unset, None, List[Dict[str, Any]]] = UNSET
    133        if not isinstance(self.attempt_output, Unset):
    134            if self.attempt_output is None:
    135                attempt_output = None
    136            else:
    137                attempt_output = []
    138                for attempt_output_item_data in self.attempt_output:
    139                    attempt_output_item = attempt_output_item_data.to_dict()
    140
    141                    attempt_output.append(attempt_output_item)
    142
    143
    144
    145
    146
    147        field_dict: Dict[str, Any] = {}
    148        field_dict.update(self.additional_properties)
    149        field_dict.update({
    150            "id": id,
    151            "status": status,
    152            "flavor": flavor,
    153            "subject": subject,
    154            "task_type": task_type,
    155        })
    156        if next_attempt is not UNSET:
    157            field_dict["next_attempt"] = next_attempt
    158        if attempt_output is not UNSET:
    159            field_dict["attempt_output"] = attempt_output
    160
    161        return field_dict

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

    165    @classmethod
    166    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    167        d = src_dict.copy()
    168        id = d.pop("id")
    169
    170        def _parse_status(data: object) -> Union[V1TaskGetByIdResponse200TaskStatusType0, V1TaskGetByIdResponse200TaskStatusType1, V1TaskGetByIdResponse200TaskStatusType2, V1TaskGetByIdResponse200TaskStatusType3, V1TaskGetByIdResponse200TaskStatusType4, V1TaskGetByIdResponse200TaskStatusType5, V1TaskGetByIdResponse200TaskStatusType6, V1TaskGetByIdResponse200TaskStatusType7]:
    171            try:
    172                if not isinstance(data, str):
    173                    raise TypeError()
    174                status_type_0 = V1TaskGetByIdResponse200TaskStatusType0(data)
    175
    176
    177
    178                return status_type_0
    179            except: # noqa: E722
    180                pass
    181            try:
    182                if not isinstance(data, str):
    183                    raise TypeError()
    184                status_type_1 = V1TaskGetByIdResponse200TaskStatusType1(data)
    185
    186
    187
    188                return status_type_1
    189            except: # noqa: E722
    190                pass
    191            try:
    192                if not isinstance(data, str):
    193                    raise TypeError()
    194                status_type_2 = V1TaskGetByIdResponse200TaskStatusType2(data)
    195
    196
    197
    198                return status_type_2
    199            except: # noqa: E722
    200                pass
    201            try:
    202                if not isinstance(data, str):
    203                    raise TypeError()
    204                status_type_3 = V1TaskGetByIdResponse200TaskStatusType3(data)
    205
    206
    207
    208                return status_type_3
    209            except: # noqa: E722
    210                pass
    211            try:
    212                if not isinstance(data, str):
    213                    raise TypeError()
    214                status_type_4 = V1TaskGetByIdResponse200TaskStatusType4(data)
    215
    216
    217
    218                return status_type_4
    219            except: # noqa: E722
    220                pass
    221            try:
    222                if not isinstance(data, str):
    223                    raise TypeError()
    224                status_type_5 = V1TaskGetByIdResponse200TaskStatusType5(data)
    225
    226
    227
    228                return status_type_5
    229            except: # noqa: E722
    230                pass
    231            try:
    232                if not isinstance(data, str):
    233                    raise TypeError()
    234                status_type_6 = V1TaskGetByIdResponse200TaskStatusType6(data)
    235
    236
    237
    238                return status_type_6
    239            except: # noqa: E722
    240                pass
    241            if not isinstance(data, dict):
    242                raise TypeError()
    243            status_type_7 = V1TaskGetByIdResponse200TaskStatusType7.from_dict(data)
    244
    245
    246
    247            return status_type_7
    248
    249        status = _parse_status(d.pop("status"))
    250
    251
    252        def _parse_flavor(data: object) -> Union[V1TaskGetByIdResponse200TaskFlavorType0, V1TaskGetByIdResponse200TaskFlavorType1, V1TaskGetByIdResponse200TaskFlavorType2]:
    253            try:
    254                if not isinstance(data, str):
    255                    raise TypeError()
    256                flavor_type_0 = V1TaskGetByIdResponse200TaskFlavorType0(data)
    257
    258
    259
    260                return flavor_type_0
    261            except: # noqa: E722
    262                pass
    263            try:
    264                if not isinstance(data, str):
    265                    raise TypeError()
    266                flavor_type_1 = V1TaskGetByIdResponse200TaskFlavorType1(data)
    267
    268
    269
    270                return flavor_type_1
    271            except: # noqa: E722
    272                pass
    273            if not isinstance(data, dict):
    274                raise TypeError()
    275            flavor_type_2 = V1TaskGetByIdResponse200TaskFlavorType2.from_dict(data)
    276
    277
    278
    279            return flavor_type_2
    280
    281        flavor = _parse_flavor(d.pop("flavor"))
    282
    283
    284        subject = d.pop("subject")
    285
    286        def _parse_task_type(data: object) -> Union[V1TaskGetByIdResponse200TaskTaskTypeType0, V1TaskGetByIdResponse200TaskTaskTypeType1, V1TaskGetByIdResponse200TaskTaskTypeType2, V1TaskGetByIdResponse200TaskTaskTypeType3]:
    287            try:
    288                if not isinstance(data, str):
    289                    raise TypeError()
    290                task_type_type_0 = V1TaskGetByIdResponse200TaskTaskTypeType0(data)
    291
    292
    293
    294                return task_type_type_0
    295            except: # noqa: E722
    296                pass
    297            try:
    298                if not isinstance(data, str):
    299                    raise TypeError()
    300                task_type_type_1 = V1TaskGetByIdResponse200TaskTaskTypeType1(data)
    301
    302
    303
    304                return task_type_type_1
    305            except: # noqa: E722
    306                pass
    307            try:
    308                if not isinstance(data, str):
    309                    raise TypeError()
    310                task_type_type_2 = V1TaskGetByIdResponse200TaskTaskTypeType2(data)
    311
    312
    313
    314                return task_type_type_2
    315            except: # noqa: E722
    316                pass
    317            if not isinstance(data, dict):
    318                raise TypeError()
    319            task_type_type_3 = V1TaskGetByIdResponse200TaskTaskTypeType3.from_dict(data)
    320
    321
    322
    323            return task_type_type_3
    324
    325        task_type = _parse_task_type(d.pop("task_type"))
    326
    327
    328        next_attempt = d.pop("next_attempt", UNSET)
    329
    330        attempt_output = []
    331        _attempt_output = d.pop("attempt_output", UNSET)
    332        for attempt_output_item_data in (_attempt_output or []):
    333            attempt_output_item = V1TaskGetByIdResponse200TaskAttemptOutputItem.from_dict(attempt_output_item_data)
    334
    335
    336
    337            attempt_output.append(attempt_output_item)
    338
    339
    340        v1_task_get_by_id_response_200_task = cls(
    341            id=id,
    342            status=status,
    343            flavor=flavor,
    344            subject=subject,
    345            task_type=task_type,
    346            next_attempt=next_attempt,
    347            attempt_output=attempt_output,
    348        )
    349
    350        v1_task_get_by_id_response_200_task.additional_properties = d
    351        return v1_task_get_by_id_response_200_task

additional_keys: List[str]