wallaroo.wallaroo_ml_ops_api_client.models.v1_task_get_by_workspace_response_200

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

Response body of /tasks/get_by_workspace

Attributes: tasks (List[V1TaskGetByWorkspaceResponse200TasksItem]): List of tasks owned by this workspace.

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

Method generated by attrs for class V1TaskGetByWorkspaceResponse200.

def to_dict(self) -> Dict[str, Any]:
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
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
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 = V1TaskGetByWorkspaceResponse200TasksItem.from_dict(tasks_item_data)
51
52
53
54            tasks.append(tasks_item)
55
56
57        v1_task_get_by_workspace_response_200 = cls(
58            tasks=tasks,
59        )
60
61        v1_task_get_by_workspace_response_200.additional_properties = d
62        return v1_task_get_by_workspace_response_200
additional_keys: List[str]