wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_status_and_workspace_response_200

 1from typing import Any, Dict, List, Type, TypeVar
 2
 3import attr
 4
 5from ..models.v1_task_get_by_status_and_workspace_response_200_tasks_item import \
 6    V1TaskGetByStatusAndWorkspaceResponse200TasksItem
 7
 8T = TypeVar("T", bound="V1TaskGetByStatusAndWorkspaceResponse200")
 9
10@attr.s(auto_attribs=True)
11class V1TaskGetByStatusAndWorkspaceResponse200:
12    """ Response body of /tasks/get_by_status_and_workspace
13
14    Attributes:
15        tasks (List[V1TaskGetByStatusAndWorkspaceResponse200TasksItem]):  A list of tasks matching the specified status
16            and workspace.
17    """
18
19    tasks: List[V1TaskGetByStatusAndWorkspaceResponse200TasksItem]
20    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
21
22
23    def to_dict(self) -> Dict[str, Any]:
24        tasks = []
25        for tasks_item_data in self.tasks:
26            tasks_item = tasks_item_data.to_dict()
27
28            tasks.append(tasks_item)
29
30
31
32
33
34        field_dict: Dict[str, Any] = {}
35        field_dict.update(self.additional_properties)
36        field_dict.update({
37            "tasks": tasks,
38        })
39
40        return field_dict
41
42
43
44    @classmethod
45    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
46        d = src_dict.copy()
47        tasks = []
48        _tasks = d.pop("tasks")
49        for tasks_item_data in (_tasks):
50            tasks_item = V1TaskGetByStatusAndWorkspaceResponse200TasksItem.from_dict(tasks_item_data)
51
52
53
54            tasks.append(tasks_item)
55
56
57        v1_task_get_by_status_and_workspace_response_200 = cls(
58            tasks=tasks,
59        )
60
61        v1_task_get_by_status_and_workspace_response_200.additional_properties = d
62        return v1_task_get_by_status_and_workspace_response_200
63
64    @property
65    def additional_keys(self) -> List[str]:
66        return list(self.additional_properties.keys())
67
68    def __getitem__(self, key: str) -> Any:
69        return self.additional_properties[key]
70
71    def __setitem__(self, key: str, value: Any) -> None:
72        self.additional_properties[key] = value
73
74    def __delitem__(self, key: str) -> None:
75        del self.additional_properties[key]
76
77    def __contains__(self, key: str) -> bool:
78        return key in self.additional_properties
@attr.s(auto_attribs=True)
class V1TaskGetByStatusAndWorkspaceResponse200:
11@attr.s(auto_attribs=True)
12class V1TaskGetByStatusAndWorkspaceResponse200:
13    """ Response body of /tasks/get_by_status_and_workspace
14
15    Attributes:
16        tasks (List[V1TaskGetByStatusAndWorkspaceResponse200TasksItem]):  A list of tasks matching the specified status
17            and workspace.
18    """
19
20    tasks: List[V1TaskGetByStatusAndWorkspaceResponse200TasksItem]
21    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
22
23
24    def to_dict(self) -> Dict[str, Any]:
25        tasks = []
26        for tasks_item_data in self.tasks:
27            tasks_item = tasks_item_data.to_dict()
28
29            tasks.append(tasks_item)
30
31
32
33
34
35        field_dict: Dict[str, Any] = {}
36        field_dict.update(self.additional_properties)
37        field_dict.update({
38            "tasks": tasks,
39        })
40
41        return field_dict
42
43
44
45    @classmethod
46    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
47        d = src_dict.copy()
48        tasks = []
49        _tasks = d.pop("tasks")
50        for tasks_item_data in (_tasks):
51            tasks_item = V1TaskGetByStatusAndWorkspaceResponse200TasksItem.from_dict(tasks_item_data)
52
53
54
55            tasks.append(tasks_item)
56
57
58        v1_task_get_by_status_and_workspace_response_200 = cls(
59            tasks=tasks,
60        )
61
62        v1_task_get_by_status_and_workspace_response_200.additional_properties = d
63        return v1_task_get_by_status_and_workspace_response_200
64
65    @property
66    def additional_keys(self) -> List[str]:
67        return list(self.additional_properties.keys())
68
69    def __getitem__(self, key: str) -> Any:
70        return self.additional_properties[key]
71
72    def __setitem__(self, key: str, value: Any) -> None:
73        self.additional_properties[key] = value
74
75    def __delitem__(self, key: str) -> None:
76        del self.additional_properties[key]
77
78    def __contains__(self, key: str) -> bool:
79        return key in self.additional_properties

Response body of /tasks/get_by_status_and_workspace

Attributes: tasks (List[V1TaskGetByStatusAndWorkspaceResponse200TasksItem]): A list of tasks matching the specified status and workspace.

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

Method generated by attrs for class V1TaskGetByStatusAndWorkspaceResponse200.

def to_dict(self) -> Dict[str, Any]:
24    def to_dict(self) -> Dict[str, Any]:
25        tasks = []
26        for tasks_item_data in self.tasks:
27            tasks_item = tasks_item_data.to_dict()
28
29            tasks.append(tasks_item)
30
31
32
33
34
35        field_dict: Dict[str, Any] = {}
36        field_dict.update(self.additional_properties)
37        field_dict.update({
38            "tasks": tasks,
39        })
40
41        return field_dict
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
45    @classmethod
46    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
47        d = src_dict.copy()
48        tasks = []
49        _tasks = d.pop("tasks")
50        for tasks_item_data in (_tasks):
51            tasks_item = V1TaskGetByStatusAndWorkspaceResponse200TasksItem.from_dict(tasks_item_data)
52
53
54
55            tasks.append(tasks_item)
56
57
58        v1_task_get_by_status_and_workspace_response_200 = cls(
59            tasks=tasks,
60        )
61
62        v1_task_get_by_status_and_workspace_response_200.additional_properties = d
63        return v1_task_get_by_status_and_workspace_response_200
additional_keys: List[str]