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