wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union
      2
      3import attr
      4
      5from ..models.v1_task_get_by_status_json_body_task_status_type_0 import \
      6    V1TaskGetByStatusJsonBodyTaskStatusType0
      7from ..models.v1_task_get_by_status_json_body_task_status_type_1 import \
      8    V1TaskGetByStatusJsonBodyTaskStatusType1
      9from ..models.v1_task_get_by_status_json_body_task_status_type_2 import \
     10    V1TaskGetByStatusJsonBodyTaskStatusType2
     11from ..models.v1_task_get_by_status_json_body_task_status_type_3 import \
     12    V1TaskGetByStatusJsonBodyTaskStatusType3
     13from ..models.v1_task_get_by_status_json_body_task_status_type_4 import \
     14    V1TaskGetByStatusJsonBodyTaskStatusType4
     15from ..models.v1_task_get_by_status_json_body_task_status_type_5 import \
     16    V1TaskGetByStatusJsonBodyTaskStatusType5
     17from ..models.v1_task_get_by_status_json_body_task_status_type_6 import \
     18    V1TaskGetByStatusJsonBodyTaskStatusType6
     19from ..models.v1_task_get_by_status_json_body_task_status_type_7 import \
     20    V1TaskGetByStatusJsonBodyTaskStatusType7
     21
     22T = TypeVar("T", bound="V1TaskGetByStatusJsonBody")
     23
     24@attr.s(auto_attribs=True)
     25class V1TaskGetByStatusJsonBody:
     26    """ Body for request to /tasks/get_by_status
     27
     28    Attributes:
     29        task_status (Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1,
     30            V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3,
     31            V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5,
     32            V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]):  The task status to query
     33            for i.e. Failing
     34    """
     35
     36    task_status: Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]
     37    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     38
     39
     40    def to_dict(self) -> Dict[str, Any]:
     41        task_status: Union[Dict[str, Any], str]
     42
     43        if isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType0):
     44            task_status = self.task_status.value
     45
     46        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType1):
     47            task_status = self.task_status.value
     48
     49        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType2):
     50            task_status = self.task_status.value
     51
     52        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType3):
     53            task_status = self.task_status.value
     54
     55        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType4):
     56            task_status = self.task_status.value
     57
     58        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType5):
     59            task_status = self.task_status.value
     60
     61        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType6):
     62            task_status = self.task_status.value
     63
     64        else:
     65            task_status = self.task_status.to_dict()
     66
     67
     68
     69
     70        field_dict: Dict[str, Any] = {}
     71        field_dict.update(self.additional_properties)
     72        field_dict.update({
     73            "task_status": task_status,
     74        })
     75
     76        return field_dict
     77
     78
     79
     80    @classmethod
     81    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     82        d = src_dict.copy()
     83        def _parse_task_status(data: object) -> Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]:
     84            try:
     85                if not isinstance(data, str):
     86                    raise TypeError()
     87                task_status_type_0 = V1TaskGetByStatusJsonBodyTaskStatusType0(data)
     88
     89
     90
     91                return task_status_type_0
     92            except: # noqa: E722
     93                pass
     94            try:
     95                if not isinstance(data, str):
     96                    raise TypeError()
     97                task_status_type_1 = V1TaskGetByStatusJsonBodyTaskStatusType1(data)
     98
     99
    100
    101                return task_status_type_1
    102            except: # noqa: E722
    103                pass
    104            try:
    105                if not isinstance(data, str):
    106                    raise TypeError()
    107                task_status_type_2 = V1TaskGetByStatusJsonBodyTaskStatusType2(data)
    108
    109
    110
    111                return task_status_type_2
    112            except: # noqa: E722
    113                pass
    114            try:
    115                if not isinstance(data, str):
    116                    raise TypeError()
    117                task_status_type_3 = V1TaskGetByStatusJsonBodyTaskStatusType3(data)
    118
    119
    120
    121                return task_status_type_3
    122            except: # noqa: E722
    123                pass
    124            try:
    125                if not isinstance(data, str):
    126                    raise TypeError()
    127                task_status_type_4 = V1TaskGetByStatusJsonBodyTaskStatusType4(data)
    128
    129
    130
    131                return task_status_type_4
    132            except: # noqa: E722
    133                pass
    134            try:
    135                if not isinstance(data, str):
    136                    raise TypeError()
    137                task_status_type_5 = V1TaskGetByStatusJsonBodyTaskStatusType5(data)
    138
    139
    140
    141                return task_status_type_5
    142            except: # noqa: E722
    143                pass
    144            try:
    145                if not isinstance(data, str):
    146                    raise TypeError()
    147                task_status_type_6 = V1TaskGetByStatusJsonBodyTaskStatusType6(data)
    148
    149
    150
    151                return task_status_type_6
    152            except: # noqa: E722
    153                pass
    154            if not isinstance(data, dict):
    155                raise TypeError()
    156            task_status_type_7 = V1TaskGetByStatusJsonBodyTaskStatusType7.from_dict(data)
    157
    158
    159
    160            return task_status_type_7
    161
    162        task_status = _parse_task_status(d.pop("task_status"))
    163
    164
    165        v1_task_get_by_status_json_body = cls(
    166            task_status=task_status,
    167        )
    168
    169        v1_task_get_by_status_json_body.additional_properties = d
    170        return v1_task_get_by_status_json_body
    171
    172    @property
    173    def additional_keys(self) -> List[str]:
    174        return list(self.additional_properties.keys())
    175
    176    def __getitem__(self, key: str) -> Any:
    177        return self.additional_properties[key]
    178
    179    def __setitem__(self, key: str, value: Any) -> None:
    180        self.additional_properties[key] = value
    181
    182    def __delitem__(self, key: str) -> None:
    183        del self.additional_properties[key]
    184
    185    def __contains__(self, key: str) -> bool:
    186        return key in self.additional_properties

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

     25@attr.s(auto_attribs=True)
     26class V1TaskGetByStatusJsonBody:
     27    """ Body for request to /tasks/get_by_status
     28
     29    Attributes:
     30        task_status (Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1,
     31            V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3,
     32            V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5,
     33            V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]):  The task status to query
     34            for i.e. Failing
     35    """
     36
     37    task_status: Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]
     38    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     39
     40
     41    def to_dict(self) -> Dict[str, Any]:
     42        task_status: Union[Dict[str, Any], str]
     43
     44        if isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType0):
     45            task_status = self.task_status.value
     46
     47        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType1):
     48            task_status = self.task_status.value
     49
     50        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType2):
     51            task_status = self.task_status.value
     52
     53        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType3):
     54            task_status = self.task_status.value
     55
     56        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType4):
     57            task_status = self.task_status.value
     58
     59        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType5):
     60            task_status = self.task_status.value
     61
     62        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType6):
     63            task_status = self.task_status.value
     64
     65        else:
     66            task_status = self.task_status.to_dict()
     67
     68
     69
     70
     71        field_dict: Dict[str, Any] = {}
     72        field_dict.update(self.additional_properties)
     73        field_dict.update({
     74            "task_status": task_status,
     75        })
     76
     77        return field_dict
     78
     79
     80
     81    @classmethod
     82    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     83        d = src_dict.copy()
     84        def _parse_task_status(data: object) -> Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]:
     85            try:
     86                if not isinstance(data, str):
     87                    raise TypeError()
     88                task_status_type_0 = V1TaskGetByStatusJsonBodyTaskStatusType0(data)
     89
     90
     91
     92                return task_status_type_0
     93            except: # noqa: E722
     94                pass
     95            try:
     96                if not isinstance(data, str):
     97                    raise TypeError()
     98                task_status_type_1 = V1TaskGetByStatusJsonBodyTaskStatusType1(data)
     99
    100
    101
    102                return task_status_type_1
    103            except: # noqa: E722
    104                pass
    105            try:
    106                if not isinstance(data, str):
    107                    raise TypeError()
    108                task_status_type_2 = V1TaskGetByStatusJsonBodyTaskStatusType2(data)
    109
    110
    111
    112                return task_status_type_2
    113            except: # noqa: E722
    114                pass
    115            try:
    116                if not isinstance(data, str):
    117                    raise TypeError()
    118                task_status_type_3 = V1TaskGetByStatusJsonBodyTaskStatusType3(data)
    119
    120
    121
    122                return task_status_type_3
    123            except: # noqa: E722
    124                pass
    125            try:
    126                if not isinstance(data, str):
    127                    raise TypeError()
    128                task_status_type_4 = V1TaskGetByStatusJsonBodyTaskStatusType4(data)
    129
    130
    131
    132                return task_status_type_4
    133            except: # noqa: E722
    134                pass
    135            try:
    136                if not isinstance(data, str):
    137                    raise TypeError()
    138                task_status_type_5 = V1TaskGetByStatusJsonBodyTaskStatusType5(data)
    139
    140
    141
    142                return task_status_type_5
    143            except: # noqa: E722
    144                pass
    145            try:
    146                if not isinstance(data, str):
    147                    raise TypeError()
    148                task_status_type_6 = V1TaskGetByStatusJsonBodyTaskStatusType6(data)
    149
    150
    151
    152                return task_status_type_6
    153            except: # noqa: E722
    154                pass
    155            if not isinstance(data, dict):
    156                raise TypeError()
    157            task_status_type_7 = V1TaskGetByStatusJsonBodyTaskStatusType7.from_dict(data)
    158
    159
    160
    161            return task_status_type_7
    162
    163        task_status = _parse_task_status(d.pop("task_status"))
    164
    165
    166        v1_task_get_by_status_json_body = cls(
    167            task_status=task_status,
    168        )
    169
    170        v1_task_get_by_status_json_body.additional_properties = d
    171        return v1_task_get_by_status_json_body
    172
    173    @property
    174    def additional_keys(self) -> List[str]:
    175        return list(self.additional_properties.keys())
    176
    177    def __getitem__(self, key: str) -> Any:
    178        return self.additional_properties[key]
    179
    180    def __setitem__(self, key: str, value: Any) -> None:
    181        self.additional_properties[key] = value
    182
    183    def __delitem__(self, key: str) -> None:
    184        del self.additional_properties[key]
    185
    186    def __contains__(self, key: str) -> bool:
    187        return key in self.additional_properties

Body for request to /tasks/get_by_status

Attributes: task_status (Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]): The task status to query for i.e. Failing

V1TaskGetByStatusJsonBody( task_status: Union[wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_0.V1TaskGetByStatusJsonBodyTaskStatusType0, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_1.V1TaskGetByStatusJsonBodyTaskStatusType1, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_2.V1TaskGetByStatusJsonBodyTaskStatusType2, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_3.V1TaskGetByStatusJsonBodyTaskStatusType3, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_4.V1TaskGetByStatusJsonBodyTaskStatusType4, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_5.V1TaskGetByStatusJsonBodyTaskStatusType5, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_6.V1TaskGetByStatusJsonBodyTaskStatusType6, wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_json_body_task_status_type_7.V1TaskGetByStatusJsonBodyTaskStatusType7]) View Source

    2def __init__(self, task_status):
    3    self.task_status = task_status
    4    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1TaskGetByStatusJsonBody.

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

    41    def to_dict(self) -> Dict[str, Any]:
    42        task_status: Union[Dict[str, Any], str]
    43
    44        if isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType0):
    45            task_status = self.task_status.value
    46
    47        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType1):
    48            task_status = self.task_status.value
    49
    50        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType2):
    51            task_status = self.task_status.value
    52
    53        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType3):
    54            task_status = self.task_status.value
    55
    56        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType4):
    57            task_status = self.task_status.value
    58
    59        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType5):
    60            task_status = self.task_status.value
    61
    62        elif isinstance(self.task_status, V1TaskGetByStatusJsonBodyTaskStatusType6):
    63            task_status = self.task_status.value
    64
    65        else:
    66            task_status = self.task_status.to_dict()
    67
    68
    69
    70
    71        field_dict: Dict[str, Any] = {}
    72        field_dict.update(self.additional_properties)
    73        field_dict.update({
    74            "task_status": task_status,
    75        })
    76
    77        return field_dict

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

     81    @classmethod
     82    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     83        d = src_dict.copy()
     84        def _parse_task_status(data: object) -> Union[V1TaskGetByStatusJsonBodyTaskStatusType0, V1TaskGetByStatusJsonBodyTaskStatusType1, V1TaskGetByStatusJsonBodyTaskStatusType2, V1TaskGetByStatusJsonBodyTaskStatusType3, V1TaskGetByStatusJsonBodyTaskStatusType4, V1TaskGetByStatusJsonBodyTaskStatusType5, V1TaskGetByStatusJsonBodyTaskStatusType6, V1TaskGetByStatusJsonBodyTaskStatusType7]:
     85            try:
     86                if not isinstance(data, str):
     87                    raise TypeError()
     88                task_status_type_0 = V1TaskGetByStatusJsonBodyTaskStatusType0(data)
     89
     90
     91
     92                return task_status_type_0
     93            except: # noqa: E722
     94                pass
     95            try:
     96                if not isinstance(data, str):
     97                    raise TypeError()
     98                task_status_type_1 = V1TaskGetByStatusJsonBodyTaskStatusType1(data)
     99
    100
    101
    102                return task_status_type_1
    103            except: # noqa: E722
    104                pass
    105            try:
    106                if not isinstance(data, str):
    107                    raise TypeError()
    108                task_status_type_2 = V1TaskGetByStatusJsonBodyTaskStatusType2(data)
    109
    110
    111
    112                return task_status_type_2
    113            except: # noqa: E722
    114                pass
    115            try:
    116                if not isinstance(data, str):
    117                    raise TypeError()
    118                task_status_type_3 = V1TaskGetByStatusJsonBodyTaskStatusType3(data)
    119
    120
    121
    122                return task_status_type_3
    123            except: # noqa: E722
    124                pass
    125            try:
    126                if not isinstance(data, str):
    127                    raise TypeError()
    128                task_status_type_4 = V1TaskGetByStatusJsonBodyTaskStatusType4(data)
    129
    130
    131
    132                return task_status_type_4
    133            except: # noqa: E722
    134                pass
    135            try:
    136                if not isinstance(data, str):
    137                    raise TypeError()
    138                task_status_type_5 = V1TaskGetByStatusJsonBodyTaskStatusType5(data)
    139
    140
    141
    142                return task_status_type_5
    143            except: # noqa: E722
    144                pass
    145            try:
    146                if not isinstance(data, str):
    147                    raise TypeError()
    148                task_status_type_6 = V1TaskGetByStatusJsonBodyTaskStatusType6(data)
    149
    150
    151
    152                return task_status_type_6
    153            except: # noqa: E722
    154                pass
    155            if not isinstance(data, dict):
    156                raise TypeError()
    157            task_status_type_7 = V1TaskGetByStatusJsonBodyTaskStatusType7.from_dict(data)
    158
    159
    160
    161            return task_status_type_7
    162
    163        task_status = _parse_task_status(d.pop("task_status"))
    164
    165
    166        v1_task_get_by_status_json_body = cls(
    167            task_status=task_status,
    168        )
    169
    170        v1_task_get_by_status_json_body.additional_properties = d
    171        return v1_task_get_by_status_json_body

additional_keys: List[str]