cyberdesk 1.10.0__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cyberdesk might be problematic. Click here for more details.

Files changed (51) hide show
  1. cyberdesk/__init__.py +1 -1
  2. cyberdesk/client.py +59 -0
  3. {cyberdesk-1.10.0.dist-info → cyberdesk-2.0.0.dist-info}/METADATA +1 -1
  4. {cyberdesk-1.10.0.dist-info → cyberdesk-2.0.0.dist-info}/RECORD +51 -47
  5. openapi_client/cyberdesk_cloud_client/api/connections/create_connection_v1_connections_post.py +4 -4
  6. openapi_client/cyberdesk_cloud_client/api/connections/delete_connection_v1_connections_connection_id_delete.py +4 -4
  7. openapi_client/cyberdesk_cloud_client/api/connections/get_connection_v1_connections_connection_id_get.py +4 -4
  8. openapi_client/cyberdesk_cloud_client/api/connections/list_connections_v1_connections_get.py +4 -4
  9. openapi_client/cyberdesk_cloud_client/api/connections/update_connection_v1_connections_connection_id_patch.py +4 -4
  10. openapi_client/cyberdesk_cloud_client/api/machines/create_machine_v1_machines_post.py +4 -4
  11. openapi_client/cyberdesk_cloud_client/api/machines/delete_machine_v1_machines_machine_id_delete.py +4 -4
  12. openapi_client/cyberdesk_cloud_client/api/machines/get_machine_v1_machines_machine_id_get.py +4 -4
  13. openapi_client/cyberdesk_cloud_client/api/machines/list_machines_v1_machines_get.py +4 -4
  14. openapi_client/cyberdesk_cloud_client/api/machines/update_machine_v1_machines_machine_id_patch.py +4 -4
  15. openapi_client/cyberdesk_cloud_client/api/request_logs/create_request_log_v1_request_logs_post.py +4 -4
  16. openapi_client/cyberdesk_cloud_client/api/request_logs/delete_request_log_v1_request_logs_log_id_delete.py +4 -4
  17. openapi_client/cyberdesk_cloud_client/api/request_logs/get_request_log_v1_request_logs_log_id_get.py +4 -4
  18. openapi_client/cyberdesk_cloud_client/api/request_logs/list_request_logs_v1_request_logs_get.py +4 -4
  19. openapi_client/cyberdesk_cloud_client/api/request_logs/update_request_log_v1_request_logs_log_id_patch.py +4 -4
  20. openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +4 -4
  21. openapi_client/cyberdesk_cloud_client/api/runs/bulk_create_runs_v1_runs_bulk_post.py +200 -0
  22. openapi_client/cyberdesk_cloud_client/api/runs/create_run_v1_runs_post.py +12 -8
  23. openapi_client/cyberdesk_cloud_client/api/runs/delete_run_v1_runs_run_id_delete.py +8 -4
  24. openapi_client/cyberdesk_cloud_client/api/runs/get_run_v1_runs_run_id_get.py +4 -4
  25. openapi_client/cyberdesk_cloud_client/api/runs/list_runs_v1_runs_get.py +4 -4
  26. openapi_client/cyberdesk_cloud_client/api/runs/update_run_v1_runs_run_id_patch.py +8 -12
  27. openapi_client/cyberdesk_cloud_client/api/trajectories/create_trajectory_v1_trajectories_post.py +4 -4
  28. openapi_client/cyberdesk_cloud_client/api/trajectories/delete_trajectory_v1_trajectories_trajectory_id_delete.py +4 -4
  29. openapi_client/cyberdesk_cloud_client/api/trajectories/get_latest_trajectory_for_workflow_v1_workflows_workflow_id_latest_trajectory_get.py +4 -4
  30. openapi_client/cyberdesk_cloud_client/api/trajectories/get_trajectory_v1_trajectories_trajectory_id_get.py +4 -4
  31. openapi_client/cyberdesk_cloud_client/api/trajectories/list_trajectories_v1_trajectories_get.py +4 -4
  32. openapi_client/cyberdesk_cloud_client/api/trajectories/update_trajectory_v1_trajectories_trajectory_id_patch.py +4 -4
  33. openapi_client/cyberdesk_cloud_client/api/workflows/create_workflow_v1_workflows_post.py +4 -4
  34. openapi_client/cyberdesk_cloud_client/api/workflows/delete_workflow_v1_workflows_workflow_id_delete.py +4 -4
  35. openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_v1_workflows_workflow_id_get.py +4 -4
  36. openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_versions_v1_workflows_workflow_id_versions_get.py +4 -4
  37. openapi_client/cyberdesk_cloud_client/api/workflows/list_workflows_v1_workflows_get.py +4 -4
  38. openapi_client/cyberdesk_cloud_client/api/workflows/update_workflow_v1_workflows_workflow_id_patch.py +4 -4
  39. openapi_client/cyberdesk_cloud_client/models/__init__.py +6 -0
  40. openapi_client/cyberdesk_cloud_client/models/machine_response.py +50 -8
  41. openapi_client/cyberdesk_cloud_client/models/request_log_response.py +20 -0
  42. openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +50 -8
  43. openapi_client/cyberdesk_cloud_client/models/run_bulk_create.py +181 -0
  44. openapi_client/cyberdesk_cloud_client/models/run_bulk_create_input_values_type_0.py +44 -0
  45. openapi_client/cyberdesk_cloud_client/models/run_bulk_create_response.py +96 -0
  46. openapi_client/cyberdesk_cloud_client/models/run_response.py +51 -8
  47. openapi_client/cyberdesk_cloud_client/models/trajectory_response.py +50 -8
  48. openapi_client/cyberdesk_cloud_client/models/workflow_response.py +50 -8
  49. {cyberdesk-1.10.0.dist-info → cyberdesk-2.0.0.dist-info}/WHEEL +0 -0
  50. {cyberdesk-1.10.0.dist-info → cyberdesk-2.0.0.dist-info}/licenses/LICENSE +0 -0
  51. {cyberdesk-1.10.0.dist-info → cyberdesk-2.0.0.dist-info}/top_level.txt +0 -0
@@ -22,13 +22,14 @@ class RunAttachmentResponse:
22
22
  content_type (str):
23
23
  attachment_type (AttachmentType):
24
24
  id (UUID):
25
- user_id (UUID):
26
25
  run_id (UUID):
27
26
  size_bytes (int):
28
27
  storage_path (str):
29
28
  created_at (datetime.datetime):
30
29
  target_path (Union[None, Unset, str]):
31
30
  cleanup_imports_after_run (Union[Unset, bool]): Default: False.
31
+ user_id (Union[None, UUID, Unset]):
32
+ organization_id (Union[None, Unset, str]):
32
33
  expires_at (Union[None, Unset, datetime.datetime]):
33
34
  """
34
35
 
@@ -36,13 +37,14 @@ class RunAttachmentResponse:
36
37
  content_type: str
37
38
  attachment_type: AttachmentType
38
39
  id: UUID
39
- user_id: UUID
40
40
  run_id: UUID
41
41
  size_bytes: int
42
42
  storage_path: str
43
43
  created_at: datetime.datetime
44
44
  target_path: Union[None, Unset, str] = UNSET
45
45
  cleanup_imports_after_run: Union[Unset, bool] = False
46
+ user_id: Union[None, UUID, Unset] = UNSET
47
+ organization_id: Union[None, Unset, str] = UNSET
46
48
  expires_at: Union[None, Unset, datetime.datetime] = UNSET
47
49
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
48
50
 
@@ -55,8 +57,6 @@ class RunAttachmentResponse:
55
57
 
56
58
  id = str(self.id)
57
59
 
58
- user_id = str(self.user_id)
59
-
60
60
  run_id = str(self.run_id)
61
61
 
62
62
  size_bytes = self.size_bytes
@@ -73,6 +73,20 @@ class RunAttachmentResponse:
73
73
 
74
74
  cleanup_imports_after_run = self.cleanup_imports_after_run
75
75
 
76
+ user_id: Union[None, Unset, str]
77
+ if isinstance(self.user_id, Unset):
78
+ user_id = UNSET
79
+ elif isinstance(self.user_id, UUID):
80
+ user_id = str(self.user_id)
81
+ else:
82
+ user_id = self.user_id
83
+
84
+ organization_id: Union[None, Unset, str]
85
+ if isinstance(self.organization_id, Unset):
86
+ organization_id = UNSET
87
+ else:
88
+ organization_id = self.organization_id
89
+
76
90
  expires_at: Union[None, Unset, str]
77
91
  if isinstance(self.expires_at, Unset):
78
92
  expires_at = UNSET
@@ -89,7 +103,6 @@ class RunAttachmentResponse:
89
103
  "content_type": content_type,
90
104
  "attachment_type": attachment_type,
91
105
  "id": id,
92
- "user_id": user_id,
93
106
  "run_id": run_id,
94
107
  "size_bytes": size_bytes,
95
108
  "storage_path": storage_path,
@@ -100,6 +113,10 @@ class RunAttachmentResponse:
100
113
  field_dict["target_path"] = target_path
101
114
  if cleanup_imports_after_run is not UNSET:
102
115
  field_dict["cleanup_imports_after_run"] = cleanup_imports_after_run
116
+ if user_id is not UNSET:
117
+ field_dict["user_id"] = user_id
118
+ if organization_id is not UNSET:
119
+ field_dict["organization_id"] = organization_id
103
120
  if expires_at is not UNSET:
104
121
  field_dict["expires_at"] = expires_at
105
122
 
@@ -116,8 +133,6 @@ class RunAttachmentResponse:
116
133
 
117
134
  id = UUID(d.pop("id"))
118
135
 
119
- user_id = UUID(d.pop("user_id"))
120
-
121
136
  run_id = UUID(d.pop("run_id"))
122
137
 
123
138
  size_bytes = d.pop("size_bytes")
@@ -137,6 +152,32 @@ class RunAttachmentResponse:
137
152
 
138
153
  cleanup_imports_after_run = d.pop("cleanup_imports_after_run", UNSET)
139
154
 
155
+ def _parse_user_id(data: object) -> Union[None, UUID, Unset]:
156
+ if data is None:
157
+ return data
158
+ if isinstance(data, Unset):
159
+ return data
160
+ try:
161
+ if not isinstance(data, str):
162
+ raise TypeError()
163
+ user_id_type_0 = UUID(data)
164
+
165
+ return user_id_type_0
166
+ except: # noqa: E722
167
+ pass
168
+ return cast(Union[None, UUID, Unset], data)
169
+
170
+ user_id = _parse_user_id(d.pop("user_id", UNSET))
171
+
172
+ def _parse_organization_id(data: object) -> Union[None, Unset, str]:
173
+ if data is None:
174
+ return data
175
+ if isinstance(data, Unset):
176
+ return data
177
+ return cast(Union[None, Unset, str], data)
178
+
179
+ organization_id = _parse_organization_id(d.pop("organization_id", UNSET))
180
+
140
181
  def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]:
141
182
  if data is None:
142
183
  return data
@@ -159,13 +200,14 @@ class RunAttachmentResponse:
159
200
  content_type=content_type,
160
201
  attachment_type=attachment_type,
161
202
  id=id,
162
- user_id=user_id,
163
203
  run_id=run_id,
164
204
  size_bytes=size_bytes,
165
205
  storage_path=storage_path,
166
206
  created_at=created_at,
167
207
  target_path=target_path,
168
208
  cleanup_imports_after_run=cleanup_imports_after_run,
209
+ user_id=user_id,
210
+ organization_id=organization_id,
169
211
  expires_at=expires_at,
170
212
  )
171
213
 
@@ -0,0 +1,181 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+ from uuid import UUID
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.file_input import FileInput
12
+ from ..models.run_bulk_create_input_values_type_0 import RunBulkCreateInputValuesType0
13
+
14
+
15
+ T = TypeVar("T", bound="RunBulkCreate")
16
+
17
+
18
+ @_attrs_define
19
+ class RunBulkCreate:
20
+ """Schema for bulk creating runs
21
+
22
+ Attributes:
23
+ workflow_id (UUID):
24
+ count (int): Number of runs to create (max 1000)
25
+ machine_id (Union[None, UUID, Unset]): Machine ID. If not provided, an available machine will be automatically
26
+ selected.
27
+ input_values (Union['RunBulkCreateInputValuesType0', None, Unset]): Input values for workflow variables
28
+ file_inputs (Union[None, Unset, list['FileInput']]): Files to upload to the machine
29
+ """
30
+
31
+ workflow_id: UUID
32
+ count: int
33
+ machine_id: Union[None, UUID, Unset] = UNSET
34
+ input_values: Union["RunBulkCreateInputValuesType0", None, Unset] = UNSET
35
+ file_inputs: Union[None, Unset, list["FileInput"]] = UNSET
36
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
+
38
+ def to_dict(self) -> dict[str, Any]:
39
+ from ..models.run_bulk_create_input_values_type_0 import RunBulkCreateInputValuesType0
40
+
41
+ workflow_id = str(self.workflow_id)
42
+
43
+ count = self.count
44
+
45
+ machine_id: Union[None, Unset, str]
46
+ if isinstance(self.machine_id, Unset):
47
+ machine_id = UNSET
48
+ elif isinstance(self.machine_id, UUID):
49
+ machine_id = str(self.machine_id)
50
+ else:
51
+ machine_id = self.machine_id
52
+
53
+ input_values: Union[None, Unset, dict[str, Any]]
54
+ if isinstance(self.input_values, Unset):
55
+ input_values = UNSET
56
+ elif isinstance(self.input_values, RunBulkCreateInputValuesType0):
57
+ input_values = self.input_values.to_dict()
58
+ else:
59
+ input_values = self.input_values
60
+
61
+ file_inputs: Union[None, Unset, list[dict[str, Any]]]
62
+ if isinstance(self.file_inputs, Unset):
63
+ file_inputs = UNSET
64
+ elif isinstance(self.file_inputs, list):
65
+ file_inputs = []
66
+ for file_inputs_type_0_item_data in self.file_inputs:
67
+ file_inputs_type_0_item = file_inputs_type_0_item_data.to_dict()
68
+ file_inputs.append(file_inputs_type_0_item)
69
+
70
+ else:
71
+ file_inputs = self.file_inputs
72
+
73
+ field_dict: dict[str, Any] = {}
74
+ field_dict.update(self.additional_properties)
75
+ field_dict.update(
76
+ {
77
+ "workflow_id": workflow_id,
78
+ "count": count,
79
+ }
80
+ )
81
+ if machine_id is not UNSET:
82
+ field_dict["machine_id"] = machine_id
83
+ if input_values is not UNSET:
84
+ field_dict["input_values"] = input_values
85
+ if file_inputs is not UNSET:
86
+ field_dict["file_inputs"] = file_inputs
87
+
88
+ return field_dict
89
+
90
+ @classmethod
91
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
92
+ from ..models.file_input import FileInput
93
+ from ..models.run_bulk_create_input_values_type_0 import RunBulkCreateInputValuesType0
94
+
95
+ d = dict(src_dict)
96
+ workflow_id = UUID(d.pop("workflow_id"))
97
+
98
+ count = d.pop("count")
99
+
100
+ def _parse_machine_id(data: object) -> Union[None, UUID, Unset]:
101
+ if data is None:
102
+ return data
103
+ if isinstance(data, Unset):
104
+ return data
105
+ try:
106
+ if not isinstance(data, str):
107
+ raise TypeError()
108
+ machine_id_type_0 = UUID(data)
109
+
110
+ return machine_id_type_0
111
+ except: # noqa: E722
112
+ pass
113
+ return cast(Union[None, UUID, Unset], data)
114
+
115
+ machine_id = _parse_machine_id(d.pop("machine_id", UNSET))
116
+
117
+ def _parse_input_values(data: object) -> Union["RunBulkCreateInputValuesType0", None, Unset]:
118
+ if data is None:
119
+ return data
120
+ if isinstance(data, Unset):
121
+ return data
122
+ try:
123
+ if not isinstance(data, dict):
124
+ raise TypeError()
125
+ input_values_type_0 = RunBulkCreateInputValuesType0.from_dict(data)
126
+
127
+ return input_values_type_0
128
+ except: # noqa: E722
129
+ pass
130
+ return cast(Union["RunBulkCreateInputValuesType0", None, Unset], data)
131
+
132
+ input_values = _parse_input_values(d.pop("input_values", UNSET))
133
+
134
+ def _parse_file_inputs(data: object) -> Union[None, Unset, list["FileInput"]]:
135
+ if data is None:
136
+ return data
137
+ if isinstance(data, Unset):
138
+ return data
139
+ try:
140
+ if not isinstance(data, list):
141
+ raise TypeError()
142
+ file_inputs_type_0 = []
143
+ _file_inputs_type_0 = data
144
+ for file_inputs_type_0_item_data in _file_inputs_type_0:
145
+ file_inputs_type_0_item = FileInput.from_dict(file_inputs_type_0_item_data)
146
+
147
+ file_inputs_type_0.append(file_inputs_type_0_item)
148
+
149
+ return file_inputs_type_0
150
+ except: # noqa: E722
151
+ pass
152
+ return cast(Union[None, Unset, list["FileInput"]], data)
153
+
154
+ file_inputs = _parse_file_inputs(d.pop("file_inputs", UNSET))
155
+
156
+ run_bulk_create = cls(
157
+ workflow_id=workflow_id,
158
+ count=count,
159
+ machine_id=machine_id,
160
+ input_values=input_values,
161
+ file_inputs=file_inputs,
162
+ )
163
+
164
+ run_bulk_create.additional_properties = d
165
+ return run_bulk_create
166
+
167
+ @property
168
+ def additional_keys(self) -> list[str]:
169
+ return list(self.additional_properties.keys())
170
+
171
+ def __getitem__(self, key: str) -> Any:
172
+ return self.additional_properties[key]
173
+
174
+ def __setitem__(self, key: str, value: Any) -> None:
175
+ self.additional_properties[key] = value
176
+
177
+ def __delitem__(self, key: str) -> None:
178
+ del self.additional_properties[key]
179
+
180
+ def __contains__(self, key: str) -> bool:
181
+ return key in self.additional_properties
@@ -0,0 +1,44 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="RunBulkCreateInputValuesType0")
8
+
9
+
10
+ @_attrs_define
11
+ class RunBulkCreateInputValuesType0:
12
+ """ """
13
+
14
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
+
16
+ def to_dict(self) -> dict[str, Any]:
17
+ field_dict: dict[str, Any] = {}
18
+ field_dict.update(self.additional_properties)
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
+ d = dict(src_dict)
25
+ run_bulk_create_input_values_type_0 = cls()
26
+
27
+ run_bulk_create_input_values_type_0.additional_properties = d
28
+ return run_bulk_create_input_values_type_0
29
+
30
+ @property
31
+ def additional_keys(self) -> list[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -0,0 +1,96 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.run_response import RunResponse
11
+
12
+
13
+ T = TypeVar("T", bound="RunBulkCreateResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class RunBulkCreateResponse:
18
+ """Response for bulk run creation
19
+
20
+ Attributes:
21
+ created_runs (list['RunResponse']):
22
+ failed_count (Union[Unset, int]): Default: 0.
23
+ errors (Union[Unset, list[str]]):
24
+ """
25
+
26
+ created_runs: list["RunResponse"]
27
+ failed_count: Union[Unset, int] = 0
28
+ errors: Union[Unset, list[str]] = UNSET
29
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
30
+
31
+ def to_dict(self) -> dict[str, Any]:
32
+ created_runs = []
33
+ for created_runs_item_data in self.created_runs:
34
+ created_runs_item = created_runs_item_data.to_dict()
35
+ created_runs.append(created_runs_item)
36
+
37
+ failed_count = self.failed_count
38
+
39
+ errors: Union[Unset, list[str]] = UNSET
40
+ if not isinstance(self.errors, Unset):
41
+ errors = self.errors
42
+
43
+ field_dict: dict[str, Any] = {}
44
+ field_dict.update(self.additional_properties)
45
+ field_dict.update(
46
+ {
47
+ "created_runs": created_runs,
48
+ }
49
+ )
50
+ if failed_count is not UNSET:
51
+ field_dict["failed_count"] = failed_count
52
+ if errors is not UNSET:
53
+ field_dict["errors"] = errors
54
+
55
+ return field_dict
56
+
57
+ @classmethod
58
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
59
+ from ..models.run_response import RunResponse
60
+
61
+ d = dict(src_dict)
62
+ created_runs = []
63
+ _created_runs = d.pop("created_runs")
64
+ for created_runs_item_data in _created_runs:
65
+ created_runs_item = RunResponse.from_dict(created_runs_item_data)
66
+
67
+ created_runs.append(created_runs_item)
68
+
69
+ failed_count = d.pop("failed_count", UNSET)
70
+
71
+ errors = cast(list[str], d.pop("errors", UNSET))
72
+
73
+ run_bulk_create_response = cls(
74
+ created_runs=created_runs,
75
+ failed_count=failed_count,
76
+ errors=errors,
77
+ )
78
+
79
+ run_bulk_create_response.additional_properties = d
80
+ return run_bulk_create_response
81
+
82
+ @property
83
+ def additional_keys(self) -> list[str]:
84
+ return list(self.additional_properties.keys())
85
+
86
+ def __getitem__(self, key: str) -> Any:
87
+ return self.additional_properties[key]
88
+
89
+ def __setitem__(self, key: str, value: Any) -> None:
90
+ self.additional_properties[key] = value
91
+
92
+ def __delitem__(self, key: str) -> None:
93
+ del self.additional_properties[key]
94
+
95
+ def __contains__(self, key: str) -> bool:
96
+ return key in self.additional_properties
@@ -8,6 +8,7 @@ from attrs import field as _attrs_field
8
8
  from dateutil.parser import isoparse
9
9
 
10
10
  from ..models.run_status import RunStatus
11
+ from ..types import UNSET, Unset
11
12
 
12
13
  if TYPE_CHECKING:
13
14
  from ..models.run_response_input_values_type_0 import RunResponseInputValuesType0
@@ -26,7 +27,6 @@ class RunResponse:
26
27
  workflow_id (UUID):
27
28
  machine_id (Union[None, UUID]):
28
29
  id (UUID):
29
- user_id (UUID):
30
30
  status (RunStatus):
31
31
  error (Union[None, list[str]]):
32
32
  output_data (Union['RunResponseOutputDataType0', None]):
@@ -35,12 +35,13 @@ class RunResponse:
35
35
  run_message_history (Union[None, list['RunResponseRunMessageHistoryType0Item']]):
36
36
  input_values (Union['RunResponseInputValuesType0', None]):
37
37
  created_at (datetime.datetime):
38
+ user_id (Union[None, UUID, Unset]):
39
+ organization_id (Union[None, Unset, str]):
38
40
  """
39
41
 
40
42
  workflow_id: UUID
41
43
  machine_id: Union[None, UUID]
42
44
  id: UUID
43
- user_id: UUID
44
45
  status: RunStatus
45
46
  error: Union[None, list[str]]
46
47
  output_data: Union["RunResponseOutputDataType0", None]
@@ -49,6 +50,8 @@ class RunResponse:
49
50
  run_message_history: Union[None, list["RunResponseRunMessageHistoryType0Item"]]
50
51
  input_values: Union["RunResponseInputValuesType0", None]
51
52
  created_at: datetime.datetime
53
+ user_id: Union[None, UUID, Unset] = UNSET
54
+ organization_id: Union[None, Unset, str] = UNSET
52
55
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
53
56
 
54
57
  def to_dict(self) -> dict[str, Any]:
@@ -65,8 +68,6 @@ class RunResponse:
65
68
 
66
69
  id = str(self.id)
67
70
 
68
- user_id = str(self.user_id)
69
-
70
71
  status = self.status.value
71
72
 
72
73
  error: Union[None, list[str]]
@@ -114,6 +115,20 @@ class RunResponse:
114
115
 
115
116
  created_at = self.created_at.isoformat()
116
117
 
118
+ user_id: Union[None, Unset, str]
119
+ if isinstance(self.user_id, Unset):
120
+ user_id = UNSET
121
+ elif isinstance(self.user_id, UUID):
122
+ user_id = str(self.user_id)
123
+ else:
124
+ user_id = self.user_id
125
+
126
+ organization_id: Union[None, Unset, str]
127
+ if isinstance(self.organization_id, Unset):
128
+ organization_id = UNSET
129
+ else:
130
+ organization_id = self.organization_id
131
+
117
132
  field_dict: dict[str, Any] = {}
118
133
  field_dict.update(self.additional_properties)
119
134
  field_dict.update(
@@ -121,7 +136,6 @@ class RunResponse:
121
136
  "workflow_id": workflow_id,
122
137
  "machine_id": machine_id,
123
138
  "id": id,
124
- "user_id": user_id,
125
139
  "status": status,
126
140
  "error": error,
127
141
  "output_data": output_data,
@@ -132,6 +146,10 @@ class RunResponse:
132
146
  "created_at": created_at,
133
147
  }
134
148
  )
149
+ if user_id is not UNSET:
150
+ field_dict["user_id"] = user_id
151
+ if organization_id is not UNSET:
152
+ field_dict["organization_id"] = organization_id
135
153
 
136
154
  return field_dict
137
155
 
@@ -161,8 +179,6 @@ class RunResponse:
161
179
 
162
180
  id = UUID(d.pop("id"))
163
181
 
164
- user_id = UUID(d.pop("user_id"))
165
-
166
182
  status = RunStatus(d.pop("status"))
167
183
 
168
184
  def _parse_error(data: object) -> Union[None, list[str]]:
@@ -264,11 +280,36 @@ class RunResponse:
264
280
 
265
281
  created_at = isoparse(d.pop("created_at"))
266
282
 
283
+ def _parse_user_id(data: object) -> Union[None, UUID, Unset]:
284
+ if data is None:
285
+ return data
286
+ if isinstance(data, Unset):
287
+ return data
288
+ try:
289
+ if not isinstance(data, str):
290
+ raise TypeError()
291
+ user_id_type_0 = UUID(data)
292
+
293
+ return user_id_type_0
294
+ except: # noqa: E722
295
+ pass
296
+ return cast(Union[None, UUID, Unset], data)
297
+
298
+ user_id = _parse_user_id(d.pop("user_id", UNSET))
299
+
300
+ def _parse_organization_id(data: object) -> Union[None, Unset, str]:
301
+ if data is None:
302
+ return data
303
+ if isinstance(data, Unset):
304
+ return data
305
+ return cast(Union[None, Unset, str], data)
306
+
307
+ organization_id = _parse_organization_id(d.pop("organization_id", UNSET))
308
+
267
309
  run_response = cls(
268
310
  workflow_id=workflow_id,
269
311
  machine_id=machine_id,
270
312
  id=id,
271
- user_id=user_id,
272
313
  status=status,
273
314
  error=error,
274
315
  output_data=output_data,
@@ -277,6 +318,8 @@ class RunResponse:
277
318
  run_message_history=run_message_history,
278
319
  input_values=input_values,
279
320
  created_at=created_at,
321
+ user_id=user_id,
322
+ organization_id=organization_id,
280
323
  )
281
324
 
282
325
  run_response.additional_properties = d