asteroid-odyssey 0.1.22__py3-none-any.whl → 1.0.1__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.
- asteroid_odyssey/__init__.py +20 -34
- asteroid_odyssey/client.py +387 -337
- asteroid_odyssey/openapi_client/__init__.py +73 -0
- asteroid_odyssey/openapi_client/api/__init__.py +7 -0
- asteroid_odyssey/openapi_client/api/api_api.py +516 -0
- asteroid_odyssey/openapi_client/api/execution_api.py +335 -0
- asteroid_odyssey/openapi_client/api/sdk_api.py +1434 -0
- asteroid_odyssey/openapi_client/api_client.py +801 -0
- asteroid_odyssey/openapi_client/api_response.py +21 -0
- asteroid_odyssey/openapi_client/configuration.py +606 -0
- asteroid_odyssey/openapi_client/exceptions.py +216 -0
- asteroid_odyssey/openapi_client/models/__init__.py +27 -0
- asteroid_odyssey/openapi_client/models/browser_session_recording_response.py +87 -0
- asteroid_odyssey/openapi_client/models/error_response.py +87 -0
- asteroid_odyssey/openapi_client/models/execution_response.py +87 -0
- asteroid_odyssey/openapi_client/models/execution_result.py +101 -0
- asteroid_odyssey/openapi_client/models/execution_result_response.py +100 -0
- asteroid_odyssey/openapi_client/models/execution_status_response.py +95 -0
- asteroid_odyssey/openapi_client/models/health_check200_response.py +87 -0
- asteroid_odyssey/openapi_client/models/health_check500_response.py +87 -0
- asteroid_odyssey/openapi_client/models/status.py +43 -0
- asteroid_odyssey/openapi_client/models/structured_agent_execution_request.py +89 -0
- asteroid_odyssey/openapi_client/models/upload_execution_files200_response.py +89 -0
- asteroid_odyssey/openapi_client/rest.py +258 -0
- asteroid_odyssey-1.0.1.dist-info/METADATA +208 -0
- asteroid_odyssey-1.0.1.dist-info/RECORD +29 -0
- {asteroid_odyssey-0.1.22.dist-info → asteroid_odyssey-1.0.1.dist-info}/WHEEL +1 -1
- asteroid_odyssey/api/generated/asteroid_agents_api_client/__init__.py +0 -8
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/__init__.py +0 -1
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/agent/get_agents.py +0 -127
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/get_open_api.py +0 -79
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/health_check.py +0 -131
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/get_credentials_public_key.py +0 -127
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/delete_execution.py +0 -156
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_browser_session.py +0 -154
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution.py +0 -154
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_files.py +0 -159
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_progress.py +0 -159
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_executions_for_workflow.py +0 -156
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/update_execution_status.py +0 -115
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/set_slack_channel.py +0 -107
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/queue_optimisation_job.py +0 -103
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/__init__.py +0 -0
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/add_workflow_credential.py +0 -111
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/create_workflow.py +0 -174
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow.py +0 -156
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow_credentials.py +0 -96
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/execute_workflow.py +0 -179
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_agent_workflow_executions.py +0 -155
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow.py +0 -154
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_credentials.py +0 -154
- asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_versions.py +0 -159
- asteroid_odyssey/api/generated/asteroid_agents_api_client/client.py +0 -268
- asteroid_odyssey/api/generated/asteroid_agents_api_client/errors.py +0 -16
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/__init__.py +0 -61
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/agent.py +0 -90
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/browser_session.py +0 -136
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request.py +0 -126
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_fields.py +0 -48
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_provider.py +0 -9
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credential.py +0 -66
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_request.py +0 -72
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_response.py +0 -80
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_200.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_404.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_200.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_404.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution.py +0 -147
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_dynamic_data.py +0 -48
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_result.py +0 -43
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_status.py +0 -89
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/file.py +0 -127
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_200.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_500.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/optimisation_request.py +0 -59
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/progress_update.py +0 -77
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/result_schema.py +0 -51
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/slack_channel_request.py +0 -58
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/status.py +0 -13
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow.py +0 -152
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution.py +0 -82
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution_request.py +0 -48
- asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_fields.py +0 -48
- asteroid_odyssey/api/generated/asteroid_agents_api_client/py.typed +0 -1
- asteroid_odyssey/api/generated/asteroid_agents_api_client/types.py +0 -45
- asteroid_odyssey/exceptions.py +0 -15
- asteroid_odyssey-0.1.22.dist-info/METADATA +0 -31
- asteroid_odyssey-0.1.22.dist-info/RECORD +0 -72
- asteroid_odyssey-0.1.22.dist-info/entry_points.txt +0 -2
- /asteroid_odyssey/{api/generated/asteroid_agents_api_client/api/agent/__init__.py → openapi_client/py.typed} +0 -0
- {asteroid_odyssey-0.1.22.dist-info → asteroid_odyssey-1.0.1.dist-info}/top_level.txt +0 -0
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Dict, Optional, Union, cast
|
|
3
|
-
from uuid import UUID
|
|
4
|
-
|
|
5
|
-
import httpx
|
|
6
|
-
|
|
7
|
-
from ... import errors
|
|
8
|
-
from ...client import AuthenticatedClient, Client
|
|
9
|
-
from ...models.workflow import Workflow
|
|
10
|
-
from ...types import Response
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _get_kwargs(
|
|
14
|
-
workflow_id: UUID,
|
|
15
|
-
) -> Dict[str, Any]:
|
|
16
|
-
_kwargs: Dict[str, Any] = {
|
|
17
|
-
"method": "get",
|
|
18
|
-
"url": f"/workflow/{workflow_id}",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return _kwargs
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _parse_response(
|
|
25
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
-
) -> Optional[Union[Any, Workflow]]:
|
|
27
|
-
if response.status_code == 200:
|
|
28
|
-
response_200 = Workflow.from_dict(response.json())
|
|
29
|
-
|
|
30
|
-
return response_200
|
|
31
|
-
if response.status_code == 404:
|
|
32
|
-
response_404 = cast(Any, None)
|
|
33
|
-
return response_404
|
|
34
|
-
if client.raise_on_unexpected_status:
|
|
35
|
-
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
36
|
-
else:
|
|
37
|
-
return None
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _build_response(
|
|
41
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
42
|
-
) -> Response[Union[Any, Workflow]]:
|
|
43
|
-
return Response(
|
|
44
|
-
status_code=HTTPStatus(response.status_code),
|
|
45
|
-
content=response.content,
|
|
46
|
-
headers=response.headers,
|
|
47
|
-
parsed=_parse_response(client=client, response=response),
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def sync_detailed(
|
|
52
|
-
workflow_id: UUID,
|
|
53
|
-
*,
|
|
54
|
-
client: Union[AuthenticatedClient, Client],
|
|
55
|
-
) -> Response[Union[Any, Workflow]]:
|
|
56
|
-
"""Get a workflow
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
workflow_id (UUID):
|
|
60
|
-
|
|
61
|
-
Raises:
|
|
62
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
63
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
64
|
-
|
|
65
|
-
Returns:
|
|
66
|
-
Response[Union[Any, Workflow]]
|
|
67
|
-
"""
|
|
68
|
-
|
|
69
|
-
kwargs = _get_kwargs(
|
|
70
|
-
workflow_id=workflow_id,
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
response = client.get_httpx_client().request(
|
|
74
|
-
**kwargs,
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
return _build_response(client=client, response=response)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def sync(
|
|
81
|
-
workflow_id: UUID,
|
|
82
|
-
*,
|
|
83
|
-
client: Union[AuthenticatedClient, Client],
|
|
84
|
-
) -> Optional[Union[Any, Workflow]]:
|
|
85
|
-
"""Get a workflow
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
workflow_id (UUID):
|
|
89
|
-
|
|
90
|
-
Raises:
|
|
91
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
92
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
Union[Any, Workflow]
|
|
96
|
-
"""
|
|
97
|
-
|
|
98
|
-
return sync_detailed(
|
|
99
|
-
workflow_id=workflow_id,
|
|
100
|
-
client=client,
|
|
101
|
-
).parsed
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
async def asyncio_detailed(
|
|
105
|
-
workflow_id: UUID,
|
|
106
|
-
*,
|
|
107
|
-
client: Union[AuthenticatedClient, Client],
|
|
108
|
-
) -> Response[Union[Any, Workflow]]:
|
|
109
|
-
"""Get a workflow
|
|
110
|
-
|
|
111
|
-
Args:
|
|
112
|
-
workflow_id (UUID):
|
|
113
|
-
|
|
114
|
-
Raises:
|
|
115
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
-
|
|
118
|
-
Returns:
|
|
119
|
-
Response[Union[Any, Workflow]]
|
|
120
|
-
"""
|
|
121
|
-
|
|
122
|
-
kwargs = _get_kwargs(
|
|
123
|
-
workflow_id=workflow_id,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
response = await client.get_async_httpx_client().request(**kwargs)
|
|
127
|
-
|
|
128
|
-
return _build_response(client=client, response=response)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
async def asyncio(
|
|
132
|
-
workflow_id: UUID,
|
|
133
|
-
*,
|
|
134
|
-
client: Union[AuthenticatedClient, Client],
|
|
135
|
-
) -> Optional[Union[Any, Workflow]]:
|
|
136
|
-
"""Get a workflow
|
|
137
|
-
|
|
138
|
-
Args:
|
|
139
|
-
workflow_id (UUID):
|
|
140
|
-
|
|
141
|
-
Raises:
|
|
142
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
143
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
144
|
-
|
|
145
|
-
Returns:
|
|
146
|
-
Union[Any, Workflow]
|
|
147
|
-
"""
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
await asyncio_detailed(
|
|
151
|
-
workflow_id=workflow_id,
|
|
152
|
-
client=client,
|
|
153
|
-
)
|
|
154
|
-
).parsed
|
asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_credentials.py
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Dict, Optional, Union, cast
|
|
3
|
-
from uuid import UUID
|
|
4
|
-
|
|
5
|
-
import httpx
|
|
6
|
-
|
|
7
|
-
from ... import errors
|
|
8
|
-
from ...client import AuthenticatedClient, Client
|
|
9
|
-
from ...models.credentials_response import CredentialsResponse
|
|
10
|
-
from ...types import Response
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _get_kwargs(
|
|
14
|
-
workflow_id: UUID,
|
|
15
|
-
) -> Dict[str, Any]:
|
|
16
|
-
_kwargs: Dict[str, Any] = {
|
|
17
|
-
"method": "get",
|
|
18
|
-
"url": f"/workflow/{workflow_id}/credentials",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return _kwargs
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _parse_response(
|
|
25
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
-
) -> Optional[Union[Any, CredentialsResponse]]:
|
|
27
|
-
if response.status_code == 200:
|
|
28
|
-
response_200 = CredentialsResponse.from_dict(response.json())
|
|
29
|
-
|
|
30
|
-
return response_200
|
|
31
|
-
if response.status_code == 404:
|
|
32
|
-
response_404 = cast(Any, None)
|
|
33
|
-
return response_404
|
|
34
|
-
if client.raise_on_unexpected_status:
|
|
35
|
-
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
36
|
-
else:
|
|
37
|
-
return None
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _build_response(
|
|
41
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
42
|
-
) -> Response[Union[Any, CredentialsResponse]]:
|
|
43
|
-
return Response(
|
|
44
|
-
status_code=HTTPStatus(response.status_code),
|
|
45
|
-
content=response.content,
|
|
46
|
-
headers=response.headers,
|
|
47
|
-
parsed=_parse_response(client=client, response=response),
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def sync_detailed(
|
|
52
|
-
workflow_id: UUID,
|
|
53
|
-
*,
|
|
54
|
-
client: Union[AuthenticatedClient, Client],
|
|
55
|
-
) -> Response[Union[Any, CredentialsResponse]]:
|
|
56
|
-
"""Get credentials for a workflow (and all prior versions of the workflow)
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
workflow_id (UUID):
|
|
60
|
-
|
|
61
|
-
Raises:
|
|
62
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
63
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
64
|
-
|
|
65
|
-
Returns:
|
|
66
|
-
Response[Union[Any, CredentialsResponse]]
|
|
67
|
-
"""
|
|
68
|
-
|
|
69
|
-
kwargs = _get_kwargs(
|
|
70
|
-
workflow_id=workflow_id,
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
response = client.get_httpx_client().request(
|
|
74
|
-
**kwargs,
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
return _build_response(client=client, response=response)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def sync(
|
|
81
|
-
workflow_id: UUID,
|
|
82
|
-
*,
|
|
83
|
-
client: Union[AuthenticatedClient, Client],
|
|
84
|
-
) -> Optional[Union[Any, CredentialsResponse]]:
|
|
85
|
-
"""Get credentials for a workflow (and all prior versions of the workflow)
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
workflow_id (UUID):
|
|
89
|
-
|
|
90
|
-
Raises:
|
|
91
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
92
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
Union[Any, CredentialsResponse]
|
|
96
|
-
"""
|
|
97
|
-
|
|
98
|
-
return sync_detailed(
|
|
99
|
-
workflow_id=workflow_id,
|
|
100
|
-
client=client,
|
|
101
|
-
).parsed
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
async def asyncio_detailed(
|
|
105
|
-
workflow_id: UUID,
|
|
106
|
-
*,
|
|
107
|
-
client: Union[AuthenticatedClient, Client],
|
|
108
|
-
) -> Response[Union[Any, CredentialsResponse]]:
|
|
109
|
-
"""Get credentials for a workflow (and all prior versions of the workflow)
|
|
110
|
-
|
|
111
|
-
Args:
|
|
112
|
-
workflow_id (UUID):
|
|
113
|
-
|
|
114
|
-
Raises:
|
|
115
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
-
|
|
118
|
-
Returns:
|
|
119
|
-
Response[Union[Any, CredentialsResponse]]
|
|
120
|
-
"""
|
|
121
|
-
|
|
122
|
-
kwargs = _get_kwargs(
|
|
123
|
-
workflow_id=workflow_id,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
response = await client.get_async_httpx_client().request(**kwargs)
|
|
127
|
-
|
|
128
|
-
return _build_response(client=client, response=response)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
async def asyncio(
|
|
132
|
-
workflow_id: UUID,
|
|
133
|
-
*,
|
|
134
|
-
client: Union[AuthenticatedClient, Client],
|
|
135
|
-
) -> Optional[Union[Any, CredentialsResponse]]:
|
|
136
|
-
"""Get credentials for a workflow (and all prior versions of the workflow)
|
|
137
|
-
|
|
138
|
-
Args:
|
|
139
|
-
workflow_id (UUID):
|
|
140
|
-
|
|
141
|
-
Raises:
|
|
142
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
143
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
144
|
-
|
|
145
|
-
Returns:
|
|
146
|
-
Union[Any, CredentialsResponse]
|
|
147
|
-
"""
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
await asyncio_detailed(
|
|
151
|
-
workflow_id=workflow_id,
|
|
152
|
-
client=client,
|
|
153
|
-
)
|
|
154
|
-
).parsed
|
asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_versions.py
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Dict, List, Optional, Union, cast
|
|
3
|
-
from uuid import UUID
|
|
4
|
-
|
|
5
|
-
import httpx
|
|
6
|
-
|
|
7
|
-
from ... import errors
|
|
8
|
-
from ...client import AuthenticatedClient, Client
|
|
9
|
-
from ...models.workflow import Workflow
|
|
10
|
-
from ...types import Response
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _get_kwargs(
|
|
14
|
-
workflow_id: UUID,
|
|
15
|
-
) -> Dict[str, Any]:
|
|
16
|
-
_kwargs: Dict[str, Any] = {
|
|
17
|
-
"method": "get",
|
|
18
|
-
"url": f"/workflow/{workflow_id}/versions",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return _kwargs
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _parse_response(
|
|
25
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
-
) -> Optional[Union[Any, List["Workflow"]]]:
|
|
27
|
-
if response.status_code == 200:
|
|
28
|
-
response_200 = []
|
|
29
|
-
_response_200 = response.json()
|
|
30
|
-
for response_200_item_data in _response_200:
|
|
31
|
-
response_200_item = Workflow.from_dict(response_200_item_data)
|
|
32
|
-
|
|
33
|
-
response_200.append(response_200_item)
|
|
34
|
-
|
|
35
|
-
return response_200
|
|
36
|
-
if response.status_code == 404:
|
|
37
|
-
response_404 = cast(Any, None)
|
|
38
|
-
return response_404
|
|
39
|
-
if client.raise_on_unexpected_status:
|
|
40
|
-
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
41
|
-
else:
|
|
42
|
-
return None
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def _build_response(
|
|
46
|
-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
47
|
-
) -> Response[Union[Any, List["Workflow"]]]:
|
|
48
|
-
return Response(
|
|
49
|
-
status_code=HTTPStatus(response.status_code),
|
|
50
|
-
content=response.content,
|
|
51
|
-
headers=response.headers,
|
|
52
|
-
parsed=_parse_response(client=client, response=response),
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def sync_detailed(
|
|
57
|
-
workflow_id: UUID,
|
|
58
|
-
*,
|
|
59
|
-
client: Union[AuthenticatedClient, Client],
|
|
60
|
-
) -> Response[Union[Any, List["Workflow"]]]:
|
|
61
|
-
"""Get all versions of a workflow
|
|
62
|
-
|
|
63
|
-
Args:
|
|
64
|
-
workflow_id (UUID):
|
|
65
|
-
|
|
66
|
-
Raises:
|
|
67
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
68
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
69
|
-
|
|
70
|
-
Returns:
|
|
71
|
-
Response[Union[Any, List['Workflow']]]
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
kwargs = _get_kwargs(
|
|
75
|
-
workflow_id=workflow_id,
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
response = client.get_httpx_client().request(
|
|
79
|
-
**kwargs,
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
return _build_response(client=client, response=response)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def sync(
|
|
86
|
-
workflow_id: UUID,
|
|
87
|
-
*,
|
|
88
|
-
client: Union[AuthenticatedClient, Client],
|
|
89
|
-
) -> Optional[Union[Any, List["Workflow"]]]:
|
|
90
|
-
"""Get all versions of a workflow
|
|
91
|
-
|
|
92
|
-
Args:
|
|
93
|
-
workflow_id (UUID):
|
|
94
|
-
|
|
95
|
-
Raises:
|
|
96
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
97
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
98
|
-
|
|
99
|
-
Returns:
|
|
100
|
-
Union[Any, List['Workflow']]
|
|
101
|
-
"""
|
|
102
|
-
|
|
103
|
-
return sync_detailed(
|
|
104
|
-
workflow_id=workflow_id,
|
|
105
|
-
client=client,
|
|
106
|
-
).parsed
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
async def asyncio_detailed(
|
|
110
|
-
workflow_id: UUID,
|
|
111
|
-
*,
|
|
112
|
-
client: Union[AuthenticatedClient, Client],
|
|
113
|
-
) -> Response[Union[Any, List["Workflow"]]]:
|
|
114
|
-
"""Get all versions of a workflow
|
|
115
|
-
|
|
116
|
-
Args:
|
|
117
|
-
workflow_id (UUID):
|
|
118
|
-
|
|
119
|
-
Raises:
|
|
120
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
121
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
122
|
-
|
|
123
|
-
Returns:
|
|
124
|
-
Response[Union[Any, List['Workflow']]]
|
|
125
|
-
"""
|
|
126
|
-
|
|
127
|
-
kwargs = _get_kwargs(
|
|
128
|
-
workflow_id=workflow_id,
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
response = await client.get_async_httpx_client().request(**kwargs)
|
|
132
|
-
|
|
133
|
-
return _build_response(client=client, response=response)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
async def asyncio(
|
|
137
|
-
workflow_id: UUID,
|
|
138
|
-
*,
|
|
139
|
-
client: Union[AuthenticatedClient, Client],
|
|
140
|
-
) -> Optional[Union[Any, List["Workflow"]]]:
|
|
141
|
-
"""Get all versions of a workflow
|
|
142
|
-
|
|
143
|
-
Args:
|
|
144
|
-
workflow_id (UUID):
|
|
145
|
-
|
|
146
|
-
Raises:
|
|
147
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
-
|
|
150
|
-
Returns:
|
|
151
|
-
Union[Any, List['Workflow']]
|
|
152
|
-
"""
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
await asyncio_detailed(
|
|
156
|
-
workflow_id=workflow_id,
|
|
157
|
-
client=client,
|
|
158
|
-
)
|
|
159
|
-
).parsed
|