cyberdesk 1.10.0__py3-none-any.whl → 1.11.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.
- cyberdesk/__init__.py +1 -1
- cyberdesk/client.py +59 -0
- {cyberdesk-1.10.0.dist-info → cyberdesk-1.11.0.dist-info}/METADATA +1 -1
- {cyberdesk-1.10.0.dist-info → cyberdesk-1.11.0.dist-info}/RECORD +12 -8
- openapi_client/cyberdesk_cloud_client/api/runs/bulk_create_runs_v1_runs_bulk_post.py +200 -0
- openapi_client/cyberdesk_cloud_client/models/__init__.py +6 -0
- openapi_client/cyberdesk_cloud_client/models/run_bulk_create.py +181 -0
- openapi_client/cyberdesk_cloud_client/models/run_bulk_create_input_values_type_0.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/run_bulk_create_response.py +96 -0
- {cyberdesk-1.10.0.dist-info → cyberdesk-1.11.0.dist-info}/WHEEL +0 -0
- {cyberdesk-1.10.0.dist-info → cyberdesk-1.11.0.dist-info}/licenses/LICENSE +0 -0
- {cyberdesk-1.10.0.dist-info → cyberdesk-1.11.0.dist-info}/top_level.txt +0 -0
cyberdesk/__init__.py
CHANGED
cyberdesk/client.py
CHANGED
|
@@ -28,6 +28,7 @@ from openapi_client.cyberdesk_cloud_client.api.runs import (
|
|
|
28
28
|
get_run_v1_runs_run_id_get,
|
|
29
29
|
update_run_v1_runs_run_id_patch,
|
|
30
30
|
delete_run_v1_runs_run_id_delete,
|
|
31
|
+
bulk_create_runs_v1_runs_bulk_post,
|
|
31
32
|
)
|
|
32
33
|
from openapi_client.cyberdesk_cloud_client.api.connections import (
|
|
33
34
|
list_connections_v1_connections_get,
|
|
@@ -64,6 +65,8 @@ from openapi_client.cyberdesk_cloud_client.models import (
|
|
|
64
65
|
RunUpdate,
|
|
65
66
|
RunResponse,
|
|
66
67
|
RunStatus,
|
|
68
|
+
RunBulkCreate,
|
|
69
|
+
RunBulkCreateResponse,
|
|
67
70
|
FileInput,
|
|
68
71
|
ConnectionCreate,
|
|
69
72
|
ConnectionResponse,
|
|
@@ -98,6 +101,8 @@ __all__ = [
|
|
|
98
101
|
"RunUpdate",
|
|
99
102
|
"RunResponse",
|
|
100
103
|
"RunStatus",
|
|
104
|
+
"RunBulkCreate",
|
|
105
|
+
"RunBulkCreateResponse",
|
|
101
106
|
"FileInput",
|
|
102
107
|
"ConnectionCreate",
|
|
103
108
|
"ConnectionResponse",
|
|
@@ -527,6 +532,60 @@ class RunsAPI:
|
|
|
527
532
|
return ApiResponse(data={"success": True})
|
|
528
533
|
except Exception as e:
|
|
529
534
|
return ApiResponse(error=e)
|
|
535
|
+
|
|
536
|
+
async def bulk_create(self, data: RunBulkCreate) -> ApiResponse:
|
|
537
|
+
"""Create multiple runs with the same configuration.
|
|
538
|
+
|
|
539
|
+
This method efficiently creates multiple runs:
|
|
540
|
+
- All runs are created in a single database transaction
|
|
541
|
+
- Temporal workflows are started asynchronously
|
|
542
|
+
- Returns immediately with created run details
|
|
543
|
+
|
|
544
|
+
Args:
|
|
545
|
+
data: RunBulkCreate object containing workflow_id, machine_id,
|
|
546
|
+
input_values, file_inputs, and count (max 1000)
|
|
547
|
+
|
|
548
|
+
Returns:
|
|
549
|
+
ApiResponse with RunBulkCreateResponse containing:
|
|
550
|
+
- created_runs: List of created RunResponse objects
|
|
551
|
+
- failed_count: Number of runs that failed to create
|
|
552
|
+
- errors: List of error messages for failed runs
|
|
553
|
+
"""
|
|
554
|
+
try:
|
|
555
|
+
response = await bulk_create_runs_v1_runs_bulk_post.asyncio(
|
|
556
|
+
client=self.client,
|
|
557
|
+
body=data
|
|
558
|
+
)
|
|
559
|
+
return ApiResponse(data=response)
|
|
560
|
+
except Exception as e:
|
|
561
|
+
return ApiResponse(error=e)
|
|
562
|
+
|
|
563
|
+
def bulk_create_sync(self, data: RunBulkCreate) -> ApiResponse:
|
|
564
|
+
"""Create multiple runs with the same configuration (synchronous).
|
|
565
|
+
|
|
566
|
+
This method efficiently creates multiple runs:
|
|
567
|
+
- All runs are created in a single database transaction
|
|
568
|
+
- Temporal workflows are started asynchronously
|
|
569
|
+
- Returns immediately with created run details
|
|
570
|
+
|
|
571
|
+
Args:
|
|
572
|
+
data: RunBulkCreate object containing workflow_id, machine_id,
|
|
573
|
+
input_values, file_inputs, and count (max 1000)
|
|
574
|
+
|
|
575
|
+
Returns:
|
|
576
|
+
ApiResponse with RunBulkCreateResponse containing:
|
|
577
|
+
- created_runs: List of created RunResponse objects
|
|
578
|
+
- failed_count: Number of runs that failed to create
|
|
579
|
+
- errors: List of error messages for failed runs
|
|
580
|
+
"""
|
|
581
|
+
try:
|
|
582
|
+
response = bulk_create_runs_v1_runs_bulk_post.sync(
|
|
583
|
+
client=self.client,
|
|
584
|
+
body=data
|
|
585
|
+
)
|
|
586
|
+
return ApiResponse(data=response)
|
|
587
|
+
except Exception as e:
|
|
588
|
+
return ApiResponse(error=e)
|
|
530
589
|
|
|
531
590
|
|
|
532
591
|
class ConnectionsAPI:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
cyberdesk/__init__.py,sha256=
|
|
2
|
-
cyberdesk/client.py,sha256=
|
|
3
|
-
cyberdesk-1.
|
|
1
|
+
cyberdesk/__init__.py,sha256=DvzhtlhtYTy3_hWYIrSCHUjI8yX3BeBp-v_agpI_W8s,1158
|
|
2
|
+
cyberdesk/client.py,sha256=UkpItVaLFrhM7VoBndT1vBiZk6RrECy9segb4QCj9j4,44114
|
|
3
|
+
cyberdesk-1.11.0.dist-info/licenses/LICENSE,sha256=06Op63FCwGhuUOz__M8IZW5sxd29WxyGC4X5-Uih7IQ,1071
|
|
4
4
|
openapi_client/cyberdesk_cloud_client/__init__.py,sha256=r_uVkNUL-SOK8j7-KiGMIKdinES5X8K1Q250ySX2F-A,158
|
|
5
5
|
openapi_client/cyberdesk_cloud_client/client.py,sha256=o_mdLqyBCQstu5tS1WZFwqIEbGwkvWQ7eQjuCJw_5VY,12419
|
|
6
6
|
openapi_client/cyberdesk_cloud_client/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
|
|
@@ -52,6 +52,7 @@ openapi_client/cyberdesk_cloud_client/api/run_attachments/get_run_attachment_v1_
|
|
|
52
52
|
openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py,sha256=LGcoHCLkujfTHgwzapuYV8Ve8y4yw_VZ3jkSK5Rt91o,7783
|
|
53
53
|
openapi_client/cyberdesk_cloud_client/api/run_attachments/update_run_attachment_v1_run_attachments_attachment_id_put.py,sha256=4jsIek-Z4U5hbKHRMBsnJr0DgfOoY5B2sC22d5Af-UU,5395
|
|
54
54
|
openapi_client/cyberdesk_cloud_client/api/runs/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
|
|
55
|
+
openapi_client/cyberdesk_cloud_client/api/runs/bulk_create_runs_v1_runs_bulk_post.py,sha256=e89ThcQxPj-PZBzyieS4SC4kswup9aKBSsc3K8btN3U,5809
|
|
55
56
|
openapi_client/cyberdesk_cloud_client/api/runs/create_run_v1_runs_post.py,sha256=WarcoB_UIzZsTcvFGWAYZhjA0LsIY4wcP89wILtsTZs,5343
|
|
56
57
|
openapi_client/cyberdesk_cloud_client/api/runs/delete_run_v1_runs_run_id_delete.py,sha256=ux5K74BTi5jarECVfTc5AxgAhDPfuFkt1XmaWWmRdLE,4116
|
|
57
58
|
openapi_client/cyberdesk_cloud_client/api/runs/get_run_v1_runs_run_id_get.py,sha256=tWXVlLtiWl3XmAPQf4_V0SzPoenVKazWSiL4afDEmwE,4562
|
|
@@ -73,7 +74,7 @@ openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_v1_workflows_wo
|
|
|
73
74
|
openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_versions_v1_workflows_workflow_id_versions_get.py,sha256=jBJJwJQfKBBYTX1FhSe7qWFxK0ZvYD_QKcrxTgo361U,5857
|
|
74
75
|
openapi_client/cyberdesk_cloud_client/api/workflows/list_workflows_v1_workflows_get.py,sha256=xM1Ex78PdeJK2IrQ10ghKqk93FwNGOnVOPt666hUhwE,5626
|
|
75
76
|
openapi_client/cyberdesk_cloud_client/api/workflows/update_workflow_v1_workflows_workflow_id_patch.py,sha256=G6l9aClbapqjCmDsjK01447iqRKhRFp9CnJDLHV8OBc,5705
|
|
76
|
-
openapi_client/cyberdesk_cloud_client/models/__init__.py,sha256=
|
|
77
|
+
openapi_client/cyberdesk_cloud_client/models/__init__.py,sha256=U7j2ivyaahQBknJMcN6FCPn0ppqnA69qtm98imKxtgk,8373
|
|
77
78
|
openapi_client/cyberdesk_cloud_client/models/attachment_type.py,sha256=zqPOsSd2AmxGNqb5HQ6ZYBAYL8k-0UbWHhfAJYNHoro,161
|
|
78
79
|
openapi_client/cyberdesk_cloud_client/models/connection_create.py,sha256=gCI36DmjJDZxzGFPbykyYw9k4QEf_4dVNz9b-xZfLo4,3288
|
|
79
80
|
openapi_client/cyberdesk_cloud_client/models/connection_response.py,sha256=aFxqJX75wSEw5dZ-kvh3Wgv_haJ6xYJ7o72vSAbEtHY,5247
|
|
@@ -116,6 +117,9 @@ openapi_client/cyberdesk_cloud_client/models/run_attachment_create.py,sha256=w58
|
|
|
116
117
|
openapi_client/cyberdesk_cloud_client/models/run_attachment_download_url_response.py,sha256=CUeh3Zas29uwfpH5oMbQ_hhkpsZ_RH7ZA_RyfRsf8mY,1864
|
|
117
118
|
openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py,sha256=LZEFltiyC_bBVNlz3LM1H5MXFoBkVzk-CzNuvlTumJ4,5769
|
|
118
119
|
openapi_client/cyberdesk_cloud_client/models/run_attachment_update.py,sha256=rGXcB21waSTXG0-mt0XhNcwoJI1PhBpBDUkLfp8mM-0,2573
|
|
120
|
+
openapi_client/cyberdesk_cloud_client/models/run_bulk_create.py,sha256=Mlz19LHQTwutkX1rddfSMCgQOZV1mc6SE4kDQyKplao,6350
|
|
121
|
+
openapi_client/cyberdesk_cloud_client/models/run_bulk_create_input_values_type_0.py,sha256=JxGOOYKueFx5NtvnXgf9z_sXbMByQrsjjQ3AmU8qG30,1305
|
|
122
|
+
openapi_client/cyberdesk_cloud_client/models/run_bulk_create_response.py,sha256=N9sMykvm6pC2fMMH_XVQI8wVc6-53qAHMb_qbNBo9-c,2886
|
|
119
123
|
openapi_client/cyberdesk_cloud_client/models/run_create.py,sha256=hUMuozdNHMQwndTl-mCfQ8hGwPeJ_EkPeZEmAUQWMHc,6083
|
|
120
124
|
openapi_client/cyberdesk_cloud_client/models/run_create_input_values_type_0.py,sha256=APV4O0GduU3fhHoJHMMOBk-h92Hf21c1ZU-pIsJoZpg,1282
|
|
121
125
|
openapi_client/cyberdesk_cloud_client/models/run_response.py,sha256=zZUNgMVc8-Lmm_X3t_XzWdY1x_B7f3JixPWebfwl_40,10689
|
|
@@ -142,7 +146,7 @@ openapi_client/cyberdesk_cloud_client/models/workflow_create.py,sha256=Z7XG8k1js
|
|
|
142
146
|
openapi_client/cyberdesk_cloud_client/models/workflow_response.py,sha256=kC_ZGUweaiogKqyRS1yjByHuYqZW0jzxuEyM9CIfFsc,6937
|
|
143
147
|
openapi_client/cyberdesk_cloud_client/models/workflow_response_old_versions_type_0_item.py,sha256=W9AxxlBlN3rUwLDcoUx5H7MUiYA9UztfX9iEpNGlgAs,1340
|
|
144
148
|
openapi_client/cyberdesk_cloud_client/models/workflow_update.py,sha256=_zMo2mJbYdKILygBXwebAD37SJJCUZOTkJkMOCzeNTA,4439
|
|
145
|
-
cyberdesk-1.
|
|
146
|
-
cyberdesk-1.
|
|
147
|
-
cyberdesk-1.
|
|
148
|
-
cyberdesk-1.
|
|
149
|
+
cyberdesk-1.11.0.dist-info/METADATA,sha256=hk52QX5D5EjIW-pAoe08_Jywz5nnbfngJsGAdK3efGc,6792
|
|
150
|
+
cyberdesk-1.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
151
|
+
cyberdesk-1.11.0.dist-info/top_level.txt,sha256=qTYHZHVHh3VClNPQsiFFA8p8tmJgFGhq9G1COd-pX_A,25
|
|
152
|
+
cyberdesk-1.11.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.run_bulk_create import RunBulkCreate
|
|
10
|
+
from ...models.run_bulk_create_response import RunBulkCreateResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: RunBulkCreate,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/v1/runs/bulk",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Optional[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
36
|
+
if response.status_code == 201:
|
|
37
|
+
response_201 = RunBulkCreateResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_201
|
|
40
|
+
if response.status_code == 422:
|
|
41
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_422
|
|
44
|
+
if client.raise_on_unexpected_status:
|
|
45
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
46
|
+
else:
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _build_response(
|
|
51
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
52
|
+
) -> Response[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
53
|
+
return Response(
|
|
54
|
+
status_code=HTTPStatus(response.status_code),
|
|
55
|
+
content=response.content,
|
|
56
|
+
headers=response.headers,
|
|
57
|
+
parsed=_parse_response(client=client, response=response),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def sync_detailed(
|
|
62
|
+
*,
|
|
63
|
+
client: AuthenticatedClient,
|
|
64
|
+
body: RunBulkCreate,
|
|
65
|
+
) -> Response[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
66
|
+
"""Bulk Create Runs
|
|
67
|
+
|
|
68
|
+
Create multiple runs with the same configuration.
|
|
69
|
+
|
|
70
|
+
This endpoint creates multiple runs efficiently:
|
|
71
|
+
- All runs are created in a single database transaction
|
|
72
|
+
- Temporal workflows are started asynchronously
|
|
73
|
+
- Returns immediately with created run details
|
|
74
|
+
|
|
75
|
+
Maximum 1000 runs can be created in a single request.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
body (RunBulkCreate): Schema for bulk creating runs
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[Union[HTTPValidationError, RunBulkCreateResponse]]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = _get_kwargs(
|
|
89
|
+
body=body,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
response = client.get_httpx_client().request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
return _build_response(client=client, response=response)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync(
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient,
|
|
102
|
+
body: RunBulkCreate,
|
|
103
|
+
) -> Optional[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
104
|
+
"""Bulk Create Runs
|
|
105
|
+
|
|
106
|
+
Create multiple runs with the same configuration.
|
|
107
|
+
|
|
108
|
+
This endpoint creates multiple runs efficiently:
|
|
109
|
+
- All runs are created in a single database transaction
|
|
110
|
+
- Temporal workflows are started asynchronously
|
|
111
|
+
- Returns immediately with created run details
|
|
112
|
+
|
|
113
|
+
Maximum 1000 runs can be created in a single request.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
body (RunBulkCreate): Schema for bulk creating runs
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Union[HTTPValidationError, RunBulkCreateResponse]
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
return sync_detailed(
|
|
127
|
+
client=client,
|
|
128
|
+
body=body,
|
|
129
|
+
).parsed
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def asyncio_detailed(
|
|
133
|
+
*,
|
|
134
|
+
client: AuthenticatedClient,
|
|
135
|
+
body: RunBulkCreate,
|
|
136
|
+
) -> Response[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
137
|
+
"""Bulk Create Runs
|
|
138
|
+
|
|
139
|
+
Create multiple runs with the same configuration.
|
|
140
|
+
|
|
141
|
+
This endpoint creates multiple runs efficiently:
|
|
142
|
+
- All runs are created in a single database transaction
|
|
143
|
+
- Temporal workflows are started asynchronously
|
|
144
|
+
- Returns immediately with created run details
|
|
145
|
+
|
|
146
|
+
Maximum 1000 runs can be created in a single request.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
body (RunBulkCreate): Schema for bulk creating runs
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Response[Union[HTTPValidationError, RunBulkCreateResponse]]
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
kwargs = _get_kwargs(
|
|
160
|
+
body=body,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
164
|
+
|
|
165
|
+
return _build_response(client=client, response=response)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
async def asyncio(
|
|
169
|
+
*,
|
|
170
|
+
client: AuthenticatedClient,
|
|
171
|
+
body: RunBulkCreate,
|
|
172
|
+
) -> Optional[Union[HTTPValidationError, RunBulkCreateResponse]]:
|
|
173
|
+
"""Bulk Create Runs
|
|
174
|
+
|
|
175
|
+
Create multiple runs with the same configuration.
|
|
176
|
+
|
|
177
|
+
This endpoint creates multiple runs efficiently:
|
|
178
|
+
- All runs are created in a single database transaction
|
|
179
|
+
- Temporal workflows are started asynchronously
|
|
180
|
+
- Returns immediately with created run details
|
|
181
|
+
|
|
182
|
+
Maximum 1000 runs can be created in a single request.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
body (RunBulkCreate): Schema for bulk creating runs
|
|
186
|
+
|
|
187
|
+
Raises:
|
|
188
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
189
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
Union[HTTPValidationError, RunBulkCreateResponse]
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
await asyncio_detailed(
|
|
197
|
+
client=client,
|
|
198
|
+
body=body,
|
|
199
|
+
)
|
|
200
|
+
).parsed
|
|
@@ -60,6 +60,9 @@ from .run_attachment_create import RunAttachmentCreate
|
|
|
60
60
|
from .run_attachment_download_url_response import RunAttachmentDownloadUrlResponse
|
|
61
61
|
from .run_attachment_response import RunAttachmentResponse
|
|
62
62
|
from .run_attachment_update import RunAttachmentUpdate
|
|
63
|
+
from .run_bulk_create import RunBulkCreate
|
|
64
|
+
from .run_bulk_create_input_values_type_0 import RunBulkCreateInputValuesType0
|
|
65
|
+
from .run_bulk_create_response import RunBulkCreateResponse
|
|
63
66
|
from .run_create import RunCreate
|
|
64
67
|
from .run_create_input_values_type_0 import RunCreateInputValuesType0
|
|
65
68
|
from .run_response import RunResponse
|
|
@@ -130,6 +133,9 @@ __all__ = (
|
|
|
130
133
|
"RunAttachmentDownloadUrlResponse",
|
|
131
134
|
"RunAttachmentResponse",
|
|
132
135
|
"RunAttachmentUpdate",
|
|
136
|
+
"RunBulkCreate",
|
|
137
|
+
"RunBulkCreateInputValuesType0",
|
|
138
|
+
"RunBulkCreateResponse",
|
|
133
139
|
"RunCreate",
|
|
134
140
|
"RunCreateInputValuesType0",
|
|
135
141
|
"RunResponse",
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|