moru 0.1.0__py3-none-any.whl → 0.2.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 (72) hide show
  1. moru/__init__.py +8 -0
  2. moru/api/__init__.py +4 -0
  3. moru/api/client/__init__.py +1 -1
  4. moru/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +4 -0
  5. moru/api/client/api/sandboxes/get_sandboxes.py +4 -0
  6. moru/api/client/api/sandboxes/get_sandboxes_metrics.py +5 -1
  7. moru/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +4 -0
  8. moru/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +67 -23
  9. moru/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +5 -0
  10. moru/api/client/api/sandboxes/get_v2_sandbox_runs.py +218 -0
  11. moru/api/client/api/sandboxes/get_v2_sandboxes.py +5 -2
  12. moru/api/client/api/sandboxes/post_sandboxes.py +4 -0
  13. moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +6 -0
  14. moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +5 -0
  15. moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +3 -0
  16. moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +5 -0
  17. moru/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +4 -0
  18. moru/api/client/api/templates/delete_templates_template_id.py +3 -0
  19. moru/api/client/api/templates/get_templates.py +3 -0
  20. moru/api/client/api/templates/get_templates_template_id.py +3 -0
  21. moru/api/client/api/templates/get_templates_template_id_builds_build_id_logs.py +276 -0
  22. moru/api/client/api/templates/get_templates_template_id_builds_build_id_status.py +23 -4
  23. moru/api/client/api/templates/get_templates_template_id_files_hash.py +5 -0
  24. moru/api/client/api/templates/patch_templates_template_id.py +4 -0
  25. moru/api/client/api/templates/post_templates.py +4 -0
  26. moru/api/client/api/templates/post_templates_template_id.py +3 -0
  27. moru/api/client/api/templates/post_templates_template_id_builds_build_id.py +3 -0
  28. moru/api/client/api/templates/post_v2_templates.py +4 -0
  29. moru/api/client/api/templates/post_v3_templates.py +4 -0
  30. moru/api/client/api/templates/post_v_2_templates_template_id_builds_build_id.py +3 -0
  31. moru/api/client/models/__init__.py +30 -0
  32. moru/api/client/models/admin_sandbox_kill_result.py +67 -0
  33. moru/api/client/models/build_log_entry.py +1 -1
  34. moru/api/client/models/create_volume_request.py +59 -0
  35. moru/api/client/models/file_info.py +105 -0
  36. moru/api/client/models/file_info_type.py +9 -0
  37. moru/api/client/models/file_list_response.py +84 -0
  38. moru/api/client/models/logs_direction.py +9 -0
  39. moru/api/client/models/logs_source.py +9 -0
  40. moru/api/client/models/machine_info.py +83 -0
  41. moru/api/client/models/new_sandbox.py +19 -0
  42. moru/api/client/models/node.py +10 -0
  43. moru/api/client/models/node_detail.py +10 -0
  44. moru/api/client/models/sandbox_log_entry.py +9 -9
  45. moru/api/client/models/sandbox_log_event_type.py +11 -0
  46. moru/api/client/models/sandbox_run.py +130 -0
  47. moru/api/client/models/sandbox_run_end_reason.py +11 -0
  48. moru/api/client/models/sandbox_run_status.py +10 -0
  49. moru/api/client/models/template_build_logs_response.py +73 -0
  50. moru/api/client/models/upload_response.py +67 -0
  51. moru/api/client/models/volume.py +105 -0
  52. moru/sandbox/mcp.py +835 -6
  53. moru/sandbox_async/commands/command.py +5 -1
  54. moru/sandbox_async/filesystem/filesystem.py +5 -1
  55. moru/sandbox_async/main.py +21 -0
  56. moru/sandbox_async/sandbox_api.py +17 -11
  57. moru/sandbox_sync/filesystem/filesystem.py +5 -1
  58. moru/sandbox_sync/main.py +21 -0
  59. moru/sandbox_sync/sandbox_api.py +17 -11
  60. moru/volume/__init__.py +11 -0
  61. moru/volume/types.py +83 -0
  62. moru/volume/volume_api.py +330 -0
  63. moru/volume_async/__init__.py +5 -0
  64. moru/volume_async/main.py +327 -0
  65. moru/volume_async/volume_api.py +290 -0
  66. moru/volume_sync/__init__.py +5 -0
  67. moru/volume_sync/main.py +325 -0
  68. moru-0.2.0.dist-info/METADATA +122 -0
  69. {moru-0.1.0.dist-info → moru-0.2.0.dist-info}/RECORD +71 -46
  70. {moru-0.1.0.dist-info → moru-0.2.0.dist-info}/WHEEL +1 -1
  71. moru-0.1.0.dist-info/METADATA +0 -63
  72. {moru-0.1.0.dist-info/licenses → moru-0.2.0.dist-info}/LICENSE +0 -0
moru/__init__.py CHANGED
@@ -97,6 +97,9 @@ from .template.readycmd import (
97
97
  from .template.types import BuildInfo, CopyItem
98
98
  from .template_async.main import AsyncTemplate
99
99
  from .template_sync.main import Template
100
+ from .volume.types import FileInfo as VolumeFileInfo, VolumeInfo
101
+ from .volume_async.main import AsyncVolume
102
+ from .volume_sync.main import Volume
100
103
 
101
104
  __all__ = [
102
105
  # API
@@ -171,4 +174,9 @@ __all__ = [
171
174
  "McpServer",
172
175
  "GitHubMcpServer",
173
176
  "GitHubMcpServerConfig",
177
+ # Volumes
178
+ "Volume",
179
+ "AsyncVolume",
180
+ "VolumeInfo",
181
+ "VolumeFileInfo",
174
182
  ]
moru/api/__init__.py CHANGED
@@ -40,6 +40,10 @@ def handle_api_exception(
40
40
  default_exception_class: type[Exception] = SandboxException,
41
41
  stack_trace: Optional[TracebackType] = None,
42
42
  ):
43
+ # Success codes - no exception to return
44
+ if 200 <= e.status_code < 300:
45
+ return None
46
+
43
47
  try:
44
48
  body = json.loads(e.content) if e.content else {}
45
49
  except json.JSONDecodeError:
@@ -1,4 +1,4 @@
1
- """A client library for accessing Moru API"""
1
+ """A client library for accessing Moru Sandbox API"""
2
2
 
3
3
  from .client import AuthenticatedClient, Client
4
4
 
@@ -26,18 +26,22 @@ def _parse_response(
26
26
  if response.status_code == 204:
27
27
  response_204 = cast(Any, None)
28
28
  return response_204
29
+
29
30
  if response.status_code == 401:
30
31
  response_401 = Error.from_dict(response.json())
31
32
 
32
33
  return response_401
34
+
33
35
  if response.status_code == 404:
34
36
  response_404 = Error.from_dict(response.json())
35
37
 
36
38
  return response_404
39
+
37
40
  if response.status_code == 500:
38
41
  response_500 = Error.from_dict(response.json())
39
42
 
40
43
  return response_500
44
+
41
45
  if client.raise_on_unexpected_status:
42
46
  raise errors.UnexpectedStatus(response.status_code, response.content)
43
47
  else:
@@ -41,18 +41,22 @@ def _parse_response(
41
41
  response_200.append(response_200_item)
42
42
 
43
43
  return response_200
44
+
44
45
  if response.status_code == 400:
45
46
  response_400 = Error.from_dict(response.json())
46
47
 
47
48
  return response_400
49
+
48
50
  if response.status_code == 401:
49
51
  response_401 = Error.from_dict(response.json())
50
52
 
51
53
  return response_401
54
+
52
55
  if response.status_code == 500:
53
56
  response_500 = Error.from_dict(response.json())
54
57
 
55
58
  return response_500
59
+
56
60
  if client.raise_on_unexpected_status:
57
61
  raise errors.UnexpectedStatus(response.status_code, response.content)
58
62
  else:
@@ -18,7 +18,7 @@ def _get_kwargs(
18
18
 
19
19
  json_sandbox_ids = sandbox_ids
20
20
 
21
- params["sandbox_ids"] = ",".join(str(item) for item in json_sandbox_ids)
21
+ params["sandbox_ids"] = json_sandbox_ids
22
22
 
23
23
  params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
24
24
 
@@ -38,18 +38,22 @@ def _parse_response(
38
38
  response_200 = SandboxesWithMetrics.from_dict(response.json())
39
39
 
40
40
  return response_200
41
+
41
42
  if response.status_code == 400:
42
43
  response_400 = Error.from_dict(response.json())
43
44
 
44
45
  return response_400
46
+
45
47
  if response.status_code == 401:
46
48
  response_401 = Error.from_dict(response.json())
47
49
 
48
50
  return response_401
51
+
49
52
  if response.status_code == 500:
50
53
  response_500 = Error.from_dict(response.json())
51
54
 
52
55
  return response_500
56
+
53
57
  if client.raise_on_unexpected_status:
54
58
  raise errors.UnexpectedStatus(response.status_code, response.content)
55
59
  else:
@@ -28,18 +28,22 @@ def _parse_response(
28
28
  response_200 = SandboxDetail.from_dict(response.json())
29
29
 
30
30
  return response_200
31
+
31
32
  if response.status_code == 401:
32
33
  response_401 = Error.from_dict(response.json())
33
34
 
34
35
  return response_401
36
+
35
37
  if response.status_code == 404:
36
38
  response_404 = Error.from_dict(response.json())
37
39
 
38
40
  return response_404
41
+
39
42
  if response.status_code == 500:
40
43
  response_500 = Error.from_dict(response.json())
41
44
 
42
45
  return response_500
46
+
43
47
  if client.raise_on_unexpected_status:
44
48
  raise errors.UnexpectedStatus(response.status_code, response.content)
45
49
  else:
@@ -6,6 +6,8 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.error import Error
9
+ from ...models.logs_direction import LogsDirection
10
+ from ...models.sandbox_log_event_type import SandboxLogEventType
9
11
  from ...models.sandbox_logs import SandboxLogs
10
12
  from ...types import UNSET, Response, Unset
11
13
 
@@ -13,15 +15,29 @@ from ...types import UNSET, Response, Unset
13
15
  def _get_kwargs(
14
16
  sandbox_id: str,
15
17
  *,
16
- start: Union[Unset, int] = UNSET,
17
- limit: Union[Unset, int] = 1000,
18
+ cursor: Union[Unset, int] = UNSET,
19
+ limit: Union[Unset, int] = 100,
20
+ direction: Union[Unset, LogsDirection] = UNSET,
21
+ event_type: Union[Unset, SandboxLogEventType] = UNSET,
18
22
  ) -> dict[str, Any]:
19
23
  params: dict[str, Any] = {}
20
24
 
21
- params["start"] = start
25
+ params["cursor"] = cursor
22
26
 
23
27
  params["limit"] = limit
24
28
 
29
+ json_direction: Union[Unset, str] = UNSET
30
+ if not isinstance(direction, Unset):
31
+ json_direction = direction.value
32
+
33
+ params["direction"] = json_direction
34
+
35
+ json_event_type: Union[Unset, str] = UNSET
36
+ if not isinstance(event_type, Unset):
37
+ json_event_type = event_type.value
38
+
39
+ params["eventType"] = json_event_type
40
+
25
41
  params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
26
42
 
27
43
  _kwargs: dict[str, Any] = {
@@ -40,18 +56,22 @@ def _parse_response(
40
56
  response_200 = SandboxLogs.from_dict(response.json())
41
57
 
42
58
  return response_200
59
+
43
60
  if response.status_code == 401:
44
61
  response_401 = Error.from_dict(response.json())
45
62
 
46
63
  return response_401
64
+
47
65
  if response.status_code == 404:
48
66
  response_404 = Error.from_dict(response.json())
49
67
 
50
68
  return response_404
69
+
51
70
  if response.status_code == 500:
52
71
  response_500 = Error.from_dict(response.json())
53
72
 
54
73
  return response_500
74
+
55
75
  if client.raise_on_unexpected_status:
56
76
  raise errors.UnexpectedStatus(response.status_code, response.content)
57
77
  else:
@@ -73,15 +93,19 @@ def sync_detailed(
73
93
  sandbox_id: str,
74
94
  *,
75
95
  client: AuthenticatedClient,
76
- start: Union[Unset, int] = UNSET,
77
- limit: Union[Unset, int] = 1000,
96
+ cursor: Union[Unset, int] = UNSET,
97
+ limit: Union[Unset, int] = 100,
98
+ direction: Union[Unset, LogsDirection] = UNSET,
99
+ event_type: Union[Unset, SandboxLogEventType] = UNSET,
78
100
  ) -> Response[Union[Error, SandboxLogs]]:
79
101
  """Get sandbox logs
80
102
 
81
103
  Args:
82
104
  sandbox_id (str):
83
- start (Union[Unset, int]):
84
- limit (Union[Unset, int]): Default: 1000.
105
+ cursor (Union[Unset, int]):
106
+ limit (Union[Unset, int]): Default: 100.
107
+ direction (Union[Unset, LogsDirection]): Direction of the logs that should be returned
108
+ event_type (Union[Unset, SandboxLogEventType]): Type of sandbox log event
85
109
 
86
110
  Raises:
87
111
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -93,8 +117,10 @@ def sync_detailed(
93
117
 
94
118
  kwargs = _get_kwargs(
95
119
  sandbox_id=sandbox_id,
96
- start=start,
120
+ cursor=cursor,
97
121
  limit=limit,
122
+ direction=direction,
123
+ event_type=event_type,
98
124
  )
99
125
 
100
126
  response = client.get_httpx_client().request(
@@ -108,15 +134,19 @@ def sync(
108
134
  sandbox_id: str,
109
135
  *,
110
136
  client: AuthenticatedClient,
111
- start: Union[Unset, int] = UNSET,
112
- limit: Union[Unset, int] = 1000,
137
+ cursor: Union[Unset, int] = UNSET,
138
+ limit: Union[Unset, int] = 100,
139
+ direction: Union[Unset, LogsDirection] = UNSET,
140
+ event_type: Union[Unset, SandboxLogEventType] = UNSET,
113
141
  ) -> Optional[Union[Error, SandboxLogs]]:
114
142
  """Get sandbox logs
115
143
 
116
144
  Args:
117
145
  sandbox_id (str):
118
- start (Union[Unset, int]):
119
- limit (Union[Unset, int]): Default: 1000.
146
+ cursor (Union[Unset, int]):
147
+ limit (Union[Unset, int]): Default: 100.
148
+ direction (Union[Unset, LogsDirection]): Direction of the logs that should be returned
149
+ event_type (Union[Unset, SandboxLogEventType]): Type of sandbox log event
120
150
 
121
151
  Raises:
122
152
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -129,8 +159,10 @@ def sync(
129
159
  return sync_detailed(
130
160
  sandbox_id=sandbox_id,
131
161
  client=client,
132
- start=start,
162
+ cursor=cursor,
133
163
  limit=limit,
164
+ direction=direction,
165
+ event_type=event_type,
134
166
  ).parsed
135
167
 
136
168
 
@@ -138,15 +170,19 @@ async def asyncio_detailed(
138
170
  sandbox_id: str,
139
171
  *,
140
172
  client: AuthenticatedClient,
141
- start: Union[Unset, int] = UNSET,
142
- limit: Union[Unset, int] = 1000,
173
+ cursor: Union[Unset, int] = UNSET,
174
+ limit: Union[Unset, int] = 100,
175
+ direction: Union[Unset, LogsDirection] = UNSET,
176
+ event_type: Union[Unset, SandboxLogEventType] = UNSET,
143
177
  ) -> Response[Union[Error, SandboxLogs]]:
144
178
  """Get sandbox logs
145
179
 
146
180
  Args:
147
181
  sandbox_id (str):
148
- start (Union[Unset, int]):
149
- limit (Union[Unset, int]): Default: 1000.
182
+ cursor (Union[Unset, int]):
183
+ limit (Union[Unset, int]): Default: 100.
184
+ direction (Union[Unset, LogsDirection]): Direction of the logs that should be returned
185
+ event_type (Union[Unset, SandboxLogEventType]): Type of sandbox log event
150
186
 
151
187
  Raises:
152
188
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -158,8 +194,10 @@ async def asyncio_detailed(
158
194
 
159
195
  kwargs = _get_kwargs(
160
196
  sandbox_id=sandbox_id,
161
- start=start,
197
+ cursor=cursor,
162
198
  limit=limit,
199
+ direction=direction,
200
+ event_type=event_type,
163
201
  )
164
202
 
165
203
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -171,15 +209,19 @@ async def asyncio(
171
209
  sandbox_id: str,
172
210
  *,
173
211
  client: AuthenticatedClient,
174
- start: Union[Unset, int] = UNSET,
175
- limit: Union[Unset, int] = 1000,
212
+ cursor: Union[Unset, int] = UNSET,
213
+ limit: Union[Unset, int] = 100,
214
+ direction: Union[Unset, LogsDirection] = UNSET,
215
+ event_type: Union[Unset, SandboxLogEventType] = UNSET,
176
216
  ) -> Optional[Union[Error, SandboxLogs]]:
177
217
  """Get sandbox logs
178
218
 
179
219
  Args:
180
220
  sandbox_id (str):
181
- start (Union[Unset, int]):
182
- limit (Union[Unset, int]): Default: 1000.
221
+ cursor (Union[Unset, int]):
222
+ limit (Union[Unset, int]): Default: 100.
223
+ direction (Union[Unset, LogsDirection]): Direction of the logs that should be returned
224
+ event_type (Union[Unset, SandboxLogEventType]): Type of sandbox log event
183
225
 
184
226
  Raises:
185
227
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -193,7 +235,9 @@ async def asyncio(
193
235
  await asyncio_detailed(
194
236
  sandbox_id=sandbox_id,
195
237
  client=client,
196
- start=start,
238
+ cursor=cursor,
197
239
  limit=limit,
240
+ direction=direction,
241
+ event_type=event_type,
198
242
  )
199
243
  ).parsed
@@ -45,22 +45,27 @@ def _parse_response(
45
45
  response_200.append(response_200_item)
46
46
 
47
47
  return response_200
48
+
48
49
  if response.status_code == 400:
49
50
  response_400 = Error.from_dict(response.json())
50
51
 
51
52
  return response_400
53
+
52
54
  if response.status_code == 401:
53
55
  response_401 = Error.from_dict(response.json())
54
56
 
55
57
  return response_401
58
+
56
59
  if response.status_code == 404:
57
60
  response_404 = Error.from_dict(response.json())
58
61
 
59
62
  return response_404
63
+
60
64
  if response.status_code == 500:
61
65
  response_500 = Error.from_dict(response.json())
62
66
 
63
67
  return response_500
68
+
64
69
  if client.raise_on_unexpected_status:
65
70
  raise errors.UnexpectedStatus(response.status_code, response.content)
66
71
  else:
@@ -0,0 +1,218 @@
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.error import Error
9
+ from ...models.sandbox_run import SandboxRun
10
+ from ...models.sandbox_run_status import SandboxRunStatus
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ status: Union[Unset, list[SandboxRunStatus]] = UNSET,
17
+ next_token: Union[Unset, str] = UNSET,
18
+ limit: Union[Unset, int] = 100,
19
+ ) -> dict[str, Any]:
20
+ params: dict[str, Any] = {}
21
+
22
+ json_status: Union[Unset, list[str]] = UNSET
23
+ if not isinstance(status, Unset):
24
+ json_status = []
25
+ for status_item_data in status:
26
+ status_item = status_item_data.value
27
+ json_status.append(status_item)
28
+
29
+ params["status"] = json_status
30
+
31
+ params["nextToken"] = next_token
32
+
33
+ params["limit"] = limit
34
+
35
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
36
+
37
+ _kwargs: dict[str, Any] = {
38
+ "method": "get",
39
+ "url": "/v2/sandbox-runs",
40
+ "params": params,
41
+ }
42
+
43
+ return _kwargs
44
+
45
+
46
+ def _parse_response(
47
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
48
+ ) -> Optional[Union[Error, list["SandboxRun"]]]:
49
+ if response.status_code == 200:
50
+ response_200 = []
51
+ _response_200 = response.json()
52
+ for response_200_item_data in _response_200:
53
+ response_200_item = SandboxRun.from_dict(response_200_item_data)
54
+
55
+ response_200.append(response_200_item)
56
+
57
+ return response_200
58
+
59
+ if response.status_code == 400:
60
+ response_400 = Error.from_dict(response.json())
61
+
62
+ return response_400
63
+
64
+ if response.status_code == 401:
65
+ response_401 = Error.from_dict(response.json())
66
+
67
+ return response_401
68
+
69
+ if response.status_code == 500:
70
+ response_500 = Error.from_dict(response.json())
71
+
72
+ return response_500
73
+
74
+ if client.raise_on_unexpected_status:
75
+ raise errors.UnexpectedStatus(response.status_code, response.content)
76
+ else:
77
+ return None
78
+
79
+
80
+ def _build_response(
81
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
82
+ ) -> Response[Union[Error, list["SandboxRun"]]]:
83
+ return Response(
84
+ status_code=HTTPStatus(response.status_code),
85
+ content=response.content,
86
+ headers=response.headers,
87
+ parsed=_parse_response(client=client, response=response),
88
+ )
89
+
90
+
91
+ def sync_detailed(
92
+ *,
93
+ client: AuthenticatedClient,
94
+ status: Union[Unset, list[SandboxRunStatus]] = UNSET,
95
+ next_token: Union[Unset, str] = UNSET,
96
+ limit: Union[Unset, int] = 100,
97
+ ) -> Response[Union[Error, list["SandboxRun"]]]:
98
+ """List sandbox runs (including stopped/historical)
99
+
100
+ Args:
101
+ status (Union[Unset, list[SandboxRunStatus]]):
102
+ next_token (Union[Unset, str]):
103
+ limit (Union[Unset, int]): Default: 100.
104
+
105
+ Raises:
106
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
107
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
108
+
109
+ Returns:
110
+ Response[Union[Error, list['SandboxRun']]]
111
+ """
112
+
113
+ kwargs = _get_kwargs(
114
+ status=status,
115
+ next_token=next_token,
116
+ limit=limit,
117
+ )
118
+
119
+ response = client.get_httpx_client().request(
120
+ **kwargs,
121
+ )
122
+
123
+ return _build_response(client=client, response=response)
124
+
125
+
126
+ def sync(
127
+ *,
128
+ client: AuthenticatedClient,
129
+ status: Union[Unset, list[SandboxRunStatus]] = UNSET,
130
+ next_token: Union[Unset, str] = UNSET,
131
+ limit: Union[Unset, int] = 100,
132
+ ) -> Optional[Union[Error, list["SandboxRun"]]]:
133
+ """List sandbox runs (including stopped/historical)
134
+
135
+ Args:
136
+ status (Union[Unset, list[SandboxRunStatus]]):
137
+ next_token (Union[Unset, str]):
138
+ limit (Union[Unset, int]): Default: 100.
139
+
140
+ Raises:
141
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
143
+
144
+ Returns:
145
+ Union[Error, list['SandboxRun']]
146
+ """
147
+
148
+ return sync_detailed(
149
+ client=client,
150
+ status=status,
151
+ next_token=next_token,
152
+ limit=limit,
153
+ ).parsed
154
+
155
+
156
+ async def asyncio_detailed(
157
+ *,
158
+ client: AuthenticatedClient,
159
+ status: Union[Unset, list[SandboxRunStatus]] = UNSET,
160
+ next_token: Union[Unset, str] = UNSET,
161
+ limit: Union[Unset, int] = 100,
162
+ ) -> Response[Union[Error, list["SandboxRun"]]]:
163
+ """List sandbox runs (including stopped/historical)
164
+
165
+ Args:
166
+ status (Union[Unset, list[SandboxRunStatus]]):
167
+ next_token (Union[Unset, str]):
168
+ limit (Union[Unset, int]): Default: 100.
169
+
170
+ Raises:
171
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
172
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
173
+
174
+ Returns:
175
+ Response[Union[Error, list['SandboxRun']]]
176
+ """
177
+
178
+ kwargs = _get_kwargs(
179
+ status=status,
180
+ next_token=next_token,
181
+ limit=limit,
182
+ )
183
+
184
+ response = await client.get_async_httpx_client().request(**kwargs)
185
+
186
+ return _build_response(client=client, response=response)
187
+
188
+
189
+ async def asyncio(
190
+ *,
191
+ client: AuthenticatedClient,
192
+ status: Union[Unset, list[SandboxRunStatus]] = UNSET,
193
+ next_token: Union[Unset, str] = UNSET,
194
+ limit: Union[Unset, int] = 100,
195
+ ) -> Optional[Union[Error, list["SandboxRun"]]]:
196
+ """List sandbox runs (including stopped/historical)
197
+
198
+ Args:
199
+ status (Union[Unset, list[SandboxRunStatus]]):
200
+ next_token (Union[Unset, str]):
201
+ limit (Union[Unset, int]): Default: 100.
202
+
203
+ Raises:
204
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
205
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
206
+
207
+ Returns:
208
+ Union[Error, list['SandboxRun']]
209
+ """
210
+
211
+ return (
212
+ await asyncio_detailed(
213
+ client=client,
214
+ status=status,
215
+ next_token=next_token,
216
+ limit=limit,
217
+ )
218
+ ).parsed
@@ -29,8 +29,7 @@ def _get_kwargs(
29
29
  state_item = state_item_data.value
30
30
  json_state.append(state_item)
31
31
 
32
- if not isinstance(json_state, Unset):
33
- params["state"] = ",".join(str(item) for item in json_state)
32
+ params["state"] = json_state
34
33
 
35
34
  params["nextToken"] = next_token
36
35
 
@@ -59,18 +58,22 @@ def _parse_response(
59
58
  response_200.append(response_200_item)
60
59
 
61
60
  return response_200
61
+
62
62
  if response.status_code == 400:
63
63
  response_400 = Error.from_dict(response.json())
64
64
 
65
65
  return response_400
66
+
66
67
  if response.status_code == 401:
67
68
  response_401 = Error.from_dict(response.json())
68
69
 
69
70
  return response_401
71
+
70
72
  if response.status_code == 500:
71
73
  response_500 = Error.from_dict(response.json())
72
74
 
73
75
  return response_500
76
+
74
77
  if client.raise_on_unexpected_status:
75
78
  raise errors.UnexpectedStatus(response.status_code, response.content)
76
79
  else:
@@ -37,18 +37,22 @@ def _parse_response(
37
37
  response_201 = Sandbox.from_dict(response.json())
38
38
 
39
39
  return response_201
40
+
40
41
  if response.status_code == 400:
41
42
  response_400 = Error.from_dict(response.json())
42
43
 
43
44
  return response_400
45
+
44
46
  if response.status_code == 401:
45
47
  response_401 = Error.from_dict(response.json())
46
48
 
47
49
  return response_401
50
+
48
51
  if response.status_code == 500:
49
52
  response_500 = Error.from_dict(response.json())
50
53
 
51
54
  return response_500
55
+
52
56
  if client.raise_on_unexpected_status:
53
57
  raise errors.UnexpectedStatus(response.status_code, response.content)
54
58
  else:
@@ -38,26 +38,32 @@ def _parse_response(
38
38
  response_200 = Sandbox.from_dict(response.json())
39
39
 
40
40
  return response_200
41
+
41
42
  if response.status_code == 201:
42
43
  response_201 = Sandbox.from_dict(response.json())
43
44
 
44
45
  return response_201
46
+
45
47
  if response.status_code == 400:
46
48
  response_400 = Error.from_dict(response.json())
47
49
 
48
50
  return response_400
51
+
49
52
  if response.status_code == 401:
50
53
  response_401 = Error.from_dict(response.json())
51
54
 
52
55
  return response_401
56
+
53
57
  if response.status_code == 404:
54
58
  response_404 = Error.from_dict(response.json())
55
59
 
56
60
  return response_404
61
+
57
62
  if response.status_code == 500:
58
63
  response_500 = Error.from_dict(response.json())
59
64
 
60
65
  return response_500
66
+
61
67
  if client.raise_on_unexpected_status:
62
68
  raise errors.UnexpectedStatus(response.status_code, response.content)
63
69
  else: