daytona_api_client 0.21.3a0__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 daytona_api_client might be problematic. Click here for more details.

Files changed (117) hide show
  1. daytona_api_client/__init__.py +129 -0
  2. daytona_api_client/api/__init__.py +15 -0
  3. daytona_api_client/api/api_keys_api.py +1234 -0
  4. daytona_api_client/api/docker_registry_api.py +1741 -0
  5. daytona_api_client/api/object_storage_api.py +268 -0
  6. daytona_api_client/api/organizations_api.py +5792 -0
  7. daytona_api_client/api/preview_api.py +715 -0
  8. daytona_api_client/api/runners_api.py +664 -0
  9. daytona_api_client/api/sandbox_api.py +3584 -0
  10. daytona_api_client/api/snapshots_api.py +1830 -0
  11. daytona_api_client/api/toolbox_api.py +10545 -0
  12. daytona_api_client/api/users_api.py +1733 -0
  13. daytona_api_client/api/volumes_api.py +1267 -0
  14. daytona_api_client/api/workspace_api.py +3626 -0
  15. daytona_api_client/api_client.py +696 -0
  16. daytona_api_client/api_response.py +20 -0
  17. daytona_api_client/configuration.py +586 -0
  18. daytona_api_client/exceptions.py +216 -0
  19. daytona_api_client/models/__init__.py +101 -0
  20. daytona_api_client/models/account_provider.py +101 -0
  21. daytona_api_client/models/account_provider_dto.py +101 -0
  22. daytona_api_client/models/api_key_list.py +149 -0
  23. daytona_api_client/models/api_key_response.py +142 -0
  24. daytona_api_client/models/build_info.py +115 -0
  25. daytona_api_client/models/build_snapshot.py +118 -0
  26. daytona_api_client/models/command.py +104 -0
  27. daytona_api_client/models/completion_context.py +103 -0
  28. daytona_api_client/models/completion_item.py +124 -0
  29. daytona_api_client/models/completion_list.py +116 -0
  30. daytona_api_client/models/create_api_key.py +134 -0
  31. daytona_api_client/models/create_build_info.py +107 -0
  32. daytona_api_client/models/create_docker_registry.py +123 -0
  33. daytona_api_client/models/create_linked_account.py +101 -0
  34. daytona_api_client/models/create_organization.py +100 -0
  35. daytona_api_client/models/create_organization_invitation.py +122 -0
  36. daytona_api_client/models/create_organization_quota.py +130 -0
  37. daytona_api_client/models/create_organization_role.py +126 -0
  38. daytona_api_client/models/create_runner.py +150 -0
  39. daytona_api_client/models/create_sandbox.py +198 -0
  40. daytona_api_client/models/create_session_request.py +100 -0
  41. daytona_api_client/models/create_snapshot.py +138 -0
  42. daytona_api_client/models/create_user.py +132 -0
  43. daytona_api_client/models/create_volume.py +100 -0
  44. daytona_api_client/models/create_workspace.py +196 -0
  45. daytona_api_client/models/docker_registry.py +135 -0
  46. daytona_api_client/models/execute_request.py +104 -0
  47. daytona_api_client/models/execute_response.py +101 -0
  48. daytona_api_client/models/file_info.py +118 -0
  49. daytona_api_client/models/file_status.py +110 -0
  50. daytona_api_client/models/get_build_logs400_response.py +101 -0
  51. daytona_api_client/models/git_add_request.py +101 -0
  52. daytona_api_client/models/git_branch_request.py +101 -0
  53. daytona_api_client/models/git_checkout_request.py +101 -0
  54. daytona_api_client/models/git_clone_request.py +114 -0
  55. daytona_api_client/models/git_commit_info.py +112 -0
  56. daytona_api_client/models/git_commit_request.py +110 -0
  57. daytona_api_client/models/git_commit_response.py +100 -0
  58. daytona_api_client/models/git_delete_branch_request.py +101 -0
  59. daytona_api_client/models/git_repo_request.py +104 -0
  60. daytona_api_client/models/git_status.py +122 -0
  61. daytona_api_client/models/list_branch_response.py +100 -0
  62. daytona_api_client/models/lsp_completion_params.py +120 -0
  63. daytona_api_client/models/lsp_document_request.py +104 -0
  64. daytona_api_client/models/lsp_location.py +107 -0
  65. daytona_api_client/models/lsp_server_request.py +101 -0
  66. daytona_api_client/models/lsp_symbol.py +112 -0
  67. daytona_api_client/models/match.py +102 -0
  68. daytona_api_client/models/organization.py +134 -0
  69. daytona_api_client/models/organization_invitation.py +161 -0
  70. daytona_api_client/models/organization_role.py +147 -0
  71. daytona_api_client/models/organization_suspension.py +102 -0
  72. daytona_api_client/models/organization_user.py +145 -0
  73. daytona_api_client/models/paginated_snapshots_dto.py +120 -0
  74. daytona_api_client/models/port_preview_url.py +101 -0
  75. daytona_api_client/models/position.py +101 -0
  76. daytona_api_client/models/project_dir_response.py +100 -0
  77. daytona_api_client/models/range.py +113 -0
  78. daytona_api_client/models/registry_push_access_dto.py +114 -0
  79. daytona_api_client/models/replace_request.py +104 -0
  80. daytona_api_client/models/replace_result.py +102 -0
  81. daytona_api_client/models/sandbox.py +226 -0
  82. daytona_api_client/models/sandbox_info.py +110 -0
  83. daytona_api_client/models/sandbox_labels.py +100 -0
  84. daytona_api_client/models/sandbox_state.py +50 -0
  85. daytona_api_client/models/sandbox_volume.py +101 -0
  86. daytona_api_client/models/search_files_response.py +100 -0
  87. daytona_api_client/models/session.py +121 -0
  88. daytona_api_client/models/session_execute_request.py +110 -0
  89. daytona_api_client/models/session_execute_response.py +106 -0
  90. daytona_api_client/models/set_snapshot_general_status_dto.py +100 -0
  91. daytona_api_client/models/snapshot_dto.py +185 -0
  92. daytona_api_client/models/snapshot_state.py +44 -0
  93. daytona_api_client/models/storage_access_dto.py +121 -0
  94. daytona_api_client/models/toggle_state.py +100 -0
  95. daytona_api_client/models/update_assigned_organization_roles.py +100 -0
  96. daytona_api_client/models/update_docker_registry.py +104 -0
  97. daytona_api_client/models/update_organization_invitation.py +114 -0
  98. daytona_api_client/models/update_organization_member_role.py +107 -0
  99. daytona_api_client/models/update_organization_quota.py +175 -0
  100. daytona_api_client/models/update_organization_role.py +126 -0
  101. daytona_api_client/models/upload_file.py +101 -0
  102. daytona_api_client/models/upload_file_dto.py +101 -0
  103. daytona_api_client/models/upload_file_request_file.py +159 -0
  104. daytona_api_client/models/upload_files_multi_request_files_inner.py +101 -0
  105. daytona_api_client/models/usage_overview.py +124 -0
  106. daytona_api_client/models/user.py +120 -0
  107. daytona_api_client/models/user_public_key.py +101 -0
  108. daytona_api_client/models/volume.py +133 -0
  109. daytona_api_client/models/volume_dto.py +138 -0
  110. daytona_api_client/models/volume_state.py +41 -0
  111. daytona_api_client/models/workspace.py +259 -0
  112. daytona_api_client/py.typed +0 -0
  113. daytona_api_client/rest.py +208 -0
  114. daytona_api_client-0.21.3a0.dist-info/METADATA +23 -0
  115. daytona_api_client-0.21.3a0.dist-info/RECORD +117 -0
  116. daytona_api_client-0.21.3a0.dist-info/WHEEL +5 -0
  117. daytona_api_client-0.21.3a0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3584 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr
21
+ from typing import List, Optional, Union
22
+ from typing_extensions import Annotated
23
+ from daytona_api_client.models.create_sandbox import CreateSandbox
24
+ from daytona_api_client.models.port_preview_url import PortPreviewUrl
25
+ from daytona_api_client.models.sandbox import Sandbox
26
+ from daytona_api_client.models.sandbox_labels import SandboxLabels
27
+
28
+ from daytona_api_client.api_client import ApiClient, RequestSerialized
29
+ from daytona_api_client.api_response import ApiResponse
30
+ from daytona_api_client.rest import RESTResponseType
31
+
32
+
33
+ class SandboxApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+ @validate_call
46
+ def archive_sandbox(
47
+ self,
48
+ sandbox_id: StrictStr,
49
+ x_daytona_organization_id: Annotated[
50
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
51
+ ] = None,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> None:
62
+ """Archive sandbox
63
+
64
+
65
+ :param sandbox_id: (required)
66
+ :type sandbox_id: str
67
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
68
+ :type x_daytona_organization_id: str
69
+ :param _request_timeout: timeout setting for this request. If one
70
+ number provided, it will be total request
71
+ timeout. It can also be a pair (tuple) of
72
+ (connection, read) timeouts.
73
+ :type _request_timeout: int, tuple(int, int), optional
74
+ :param _request_auth: set to override the auth_settings for an a single
75
+ request; this effectively ignores the
76
+ authentication in the spec for a single request.
77
+ :type _request_auth: dict, optional
78
+ :param _content_type: force content-type for the request.
79
+ :type _content_type: str, Optional
80
+ :param _headers: set to override the headers for a single
81
+ request; this effectively ignores the headers
82
+ in the spec for a single request.
83
+ :type _headers: dict, optional
84
+ :param _host_index: set to override the host_index for a single
85
+ request; this effectively ignores the host_index
86
+ in the spec for a single request.
87
+ :type _host_index: int, optional
88
+ :return: Returns the result object.
89
+ """ # noqa: E501
90
+
91
+ _param = self._archive_sandbox_serialize(
92
+ sandbox_id=sandbox_id,
93
+ x_daytona_organization_id=x_daytona_organization_id,
94
+ _request_auth=_request_auth,
95
+ _content_type=_content_type,
96
+ _headers=_headers,
97
+ _host_index=_host_index,
98
+ )
99
+
100
+ _response_types_map: Dict[str, Optional[str]] = {
101
+ "200": None,
102
+ }
103
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
104
+ response_data.read()
105
+ return self.api_client.response_deserialize(
106
+ response_data=response_data,
107
+ response_types_map=_response_types_map,
108
+ ).data
109
+
110
+ @validate_call
111
+ def archive_sandbox_with_http_info(
112
+ self,
113
+ sandbox_id: StrictStr,
114
+ x_daytona_organization_id: Annotated[
115
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
116
+ ] = None,
117
+ _request_timeout: Union[
118
+ None,
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
121
+ ] = None,
122
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
123
+ _content_type: Optional[StrictStr] = None,
124
+ _headers: Optional[Dict[StrictStr, Any]] = None,
125
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
126
+ ) -> ApiResponse[None]:
127
+ """Archive sandbox
128
+
129
+
130
+ :param sandbox_id: (required)
131
+ :type sandbox_id: str
132
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
133
+ :type x_daytona_organization_id: str
134
+ :param _request_timeout: timeout setting for this request. If one
135
+ number provided, it will be total request
136
+ timeout. It can also be a pair (tuple) of
137
+ (connection, read) timeouts.
138
+ :type _request_timeout: int, tuple(int, int), optional
139
+ :param _request_auth: set to override the auth_settings for an a single
140
+ request; this effectively ignores the
141
+ authentication in the spec for a single request.
142
+ :type _request_auth: dict, optional
143
+ :param _content_type: force content-type for the request.
144
+ :type _content_type: str, Optional
145
+ :param _headers: set to override the headers for a single
146
+ request; this effectively ignores the headers
147
+ in the spec for a single request.
148
+ :type _headers: dict, optional
149
+ :param _host_index: set to override the host_index for a single
150
+ request; this effectively ignores the host_index
151
+ in the spec for a single request.
152
+ :type _host_index: int, optional
153
+ :return: Returns the result object.
154
+ """ # noqa: E501
155
+
156
+ _param = self._archive_sandbox_serialize(
157
+ sandbox_id=sandbox_id,
158
+ x_daytona_organization_id=x_daytona_organization_id,
159
+ _request_auth=_request_auth,
160
+ _content_type=_content_type,
161
+ _headers=_headers,
162
+ _host_index=_host_index,
163
+ )
164
+
165
+ _response_types_map: Dict[str, Optional[str]] = {
166
+ "200": None,
167
+ }
168
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
169
+ response_data.read()
170
+ return self.api_client.response_deserialize(
171
+ response_data=response_data,
172
+ response_types_map=_response_types_map,
173
+ )
174
+
175
+ @validate_call
176
+ def archive_sandbox_without_preload_content(
177
+ self,
178
+ sandbox_id: StrictStr,
179
+ x_daytona_organization_id: Annotated[
180
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
181
+ ] = None,
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
186
+ ] = None,
187
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
188
+ _content_type: Optional[StrictStr] = None,
189
+ _headers: Optional[Dict[StrictStr, Any]] = None,
190
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
191
+ ) -> RESTResponseType:
192
+ """Archive sandbox
193
+
194
+
195
+ :param sandbox_id: (required)
196
+ :type sandbox_id: str
197
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
198
+ :type x_daytona_organization_id: str
199
+ :param _request_timeout: timeout setting for this request. If one
200
+ number provided, it will be total request
201
+ timeout. It can also be a pair (tuple) of
202
+ (connection, read) timeouts.
203
+ :type _request_timeout: int, tuple(int, int), optional
204
+ :param _request_auth: set to override the auth_settings for an a single
205
+ request; this effectively ignores the
206
+ authentication in the spec for a single request.
207
+ :type _request_auth: dict, optional
208
+ :param _content_type: force content-type for the request.
209
+ :type _content_type: str, Optional
210
+ :param _headers: set to override the headers for a single
211
+ request; this effectively ignores the headers
212
+ in the spec for a single request.
213
+ :type _headers: dict, optional
214
+ :param _host_index: set to override the host_index for a single
215
+ request; this effectively ignores the host_index
216
+ in the spec for a single request.
217
+ :type _host_index: int, optional
218
+ :return: Returns the result object.
219
+ """ # noqa: E501
220
+
221
+ _param = self._archive_sandbox_serialize(
222
+ sandbox_id=sandbox_id,
223
+ x_daytona_organization_id=x_daytona_organization_id,
224
+ _request_auth=_request_auth,
225
+ _content_type=_content_type,
226
+ _headers=_headers,
227
+ _host_index=_host_index,
228
+ )
229
+
230
+ _response_types_map: Dict[str, Optional[str]] = {
231
+ "200": None,
232
+ }
233
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
234
+ return response_data.response
235
+
236
+ def _archive_sandbox_serialize(
237
+ self,
238
+ sandbox_id,
239
+ x_daytona_organization_id,
240
+ _request_auth,
241
+ _content_type,
242
+ _headers,
243
+ _host_index,
244
+ ) -> RequestSerialized:
245
+ _host = None
246
+
247
+ _collection_formats: Dict[str, str] = {}
248
+
249
+ _path_params: Dict[str, str] = {}
250
+ _query_params: List[Tuple[str, str]] = []
251
+ _header_params: Dict[str, Optional[str]] = _headers or {}
252
+ _form_params: List[Tuple[str, str]] = []
253
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
254
+ _body_params: Optional[bytes] = None
255
+
256
+ # process the path parameters
257
+ if sandbox_id is not None:
258
+ _path_params["sandboxId"] = sandbox_id
259
+ # process the query parameters
260
+ # process the header parameters
261
+ if x_daytona_organization_id is not None:
262
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
263
+ # process the form parameters
264
+ # process the body parameter
265
+
266
+ # authentication setting
267
+ _auth_settings: List[str] = ["bearer", "oauth2"]
268
+
269
+ return self.api_client.param_serialize(
270
+ method="POST",
271
+ resource_path="/sandbox/{sandboxId}/archive",
272
+ path_params=_path_params,
273
+ query_params=_query_params,
274
+ header_params=_header_params,
275
+ body=_body_params,
276
+ post_params=_form_params,
277
+ files=_files,
278
+ auth_settings=_auth_settings,
279
+ collection_formats=_collection_formats,
280
+ _host=_host,
281
+ _request_auth=_request_auth,
282
+ )
283
+
284
+ @validate_call
285
+ def create_backup(
286
+ self,
287
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
288
+ x_daytona_organization_id: Annotated[
289
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
290
+ ] = None,
291
+ _request_timeout: Union[
292
+ None,
293
+ Annotated[StrictFloat, Field(gt=0)],
294
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
295
+ ] = None,
296
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
297
+ _content_type: Optional[StrictStr] = None,
298
+ _headers: Optional[Dict[StrictStr, Any]] = None,
299
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
300
+ ) -> Sandbox:
301
+ """Create sandbox backup
302
+
303
+
304
+ :param sandbox_id: ID of the sandbox (required)
305
+ :type sandbox_id: str
306
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
307
+ :type x_daytona_organization_id: str
308
+ :param _request_timeout: timeout setting for this request. If one
309
+ number provided, it will be total request
310
+ timeout. It can also be a pair (tuple) of
311
+ (connection, read) timeouts.
312
+ :type _request_timeout: int, tuple(int, int), optional
313
+ :param _request_auth: set to override the auth_settings for an a single
314
+ request; this effectively ignores the
315
+ authentication in the spec for a single request.
316
+ :type _request_auth: dict, optional
317
+ :param _content_type: force content-type for the request.
318
+ :type _content_type: str, Optional
319
+ :param _headers: set to override the headers for a single
320
+ request; this effectively ignores the headers
321
+ in the spec for a single request.
322
+ :type _headers: dict, optional
323
+ :param _host_index: set to override the host_index for a single
324
+ request; this effectively ignores the host_index
325
+ in the spec for a single request.
326
+ :type _host_index: int, optional
327
+ :return: Returns the result object.
328
+ """ # noqa: E501
329
+
330
+ _param = self._create_backup_serialize(
331
+ sandbox_id=sandbox_id,
332
+ x_daytona_organization_id=x_daytona_organization_id,
333
+ _request_auth=_request_auth,
334
+ _content_type=_content_type,
335
+ _headers=_headers,
336
+ _host_index=_host_index,
337
+ )
338
+
339
+ _response_types_map: Dict[str, Optional[str]] = {
340
+ "200": "Sandbox",
341
+ }
342
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
343
+ response_data.read()
344
+ return self.api_client.response_deserialize(
345
+ response_data=response_data,
346
+ response_types_map=_response_types_map,
347
+ ).data
348
+
349
+ @validate_call
350
+ def create_backup_with_http_info(
351
+ self,
352
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
353
+ x_daytona_organization_id: Annotated[
354
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
355
+ ] = None,
356
+ _request_timeout: Union[
357
+ None,
358
+ Annotated[StrictFloat, Field(gt=0)],
359
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
360
+ ] = None,
361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
362
+ _content_type: Optional[StrictStr] = None,
363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
365
+ ) -> ApiResponse[Sandbox]:
366
+ """Create sandbox backup
367
+
368
+
369
+ :param sandbox_id: ID of the sandbox (required)
370
+ :type sandbox_id: str
371
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
372
+ :type x_daytona_organization_id: str
373
+ :param _request_timeout: timeout setting for this request. If one
374
+ number provided, it will be total request
375
+ timeout. It can also be a pair (tuple) of
376
+ (connection, read) timeouts.
377
+ :type _request_timeout: int, tuple(int, int), optional
378
+ :param _request_auth: set to override the auth_settings for an a single
379
+ request; this effectively ignores the
380
+ authentication in the spec for a single request.
381
+ :type _request_auth: dict, optional
382
+ :param _content_type: force content-type for the request.
383
+ :type _content_type: str, Optional
384
+ :param _headers: set to override the headers for a single
385
+ request; this effectively ignores the headers
386
+ in the spec for a single request.
387
+ :type _headers: dict, optional
388
+ :param _host_index: set to override the host_index for a single
389
+ request; this effectively ignores the host_index
390
+ in the spec for a single request.
391
+ :type _host_index: int, optional
392
+ :return: Returns the result object.
393
+ """ # noqa: E501
394
+
395
+ _param = self._create_backup_serialize(
396
+ sandbox_id=sandbox_id,
397
+ x_daytona_organization_id=x_daytona_organization_id,
398
+ _request_auth=_request_auth,
399
+ _content_type=_content_type,
400
+ _headers=_headers,
401
+ _host_index=_host_index,
402
+ )
403
+
404
+ _response_types_map: Dict[str, Optional[str]] = {
405
+ "200": "Sandbox",
406
+ }
407
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
408
+ response_data.read()
409
+ return self.api_client.response_deserialize(
410
+ response_data=response_data,
411
+ response_types_map=_response_types_map,
412
+ )
413
+
414
+ @validate_call
415
+ def create_backup_without_preload_content(
416
+ self,
417
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
418
+ x_daytona_organization_id: Annotated[
419
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
420
+ ] = None,
421
+ _request_timeout: Union[
422
+ None,
423
+ Annotated[StrictFloat, Field(gt=0)],
424
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
425
+ ] = None,
426
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
427
+ _content_type: Optional[StrictStr] = None,
428
+ _headers: Optional[Dict[StrictStr, Any]] = None,
429
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
430
+ ) -> RESTResponseType:
431
+ """Create sandbox backup
432
+
433
+
434
+ :param sandbox_id: ID of the sandbox (required)
435
+ :type sandbox_id: str
436
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
437
+ :type x_daytona_organization_id: str
438
+ :param _request_timeout: timeout setting for this request. If one
439
+ number provided, it will be total request
440
+ timeout. It can also be a pair (tuple) of
441
+ (connection, read) timeouts.
442
+ :type _request_timeout: int, tuple(int, int), optional
443
+ :param _request_auth: set to override the auth_settings for an a single
444
+ request; this effectively ignores the
445
+ authentication in the spec for a single request.
446
+ :type _request_auth: dict, optional
447
+ :param _content_type: force content-type for the request.
448
+ :type _content_type: str, Optional
449
+ :param _headers: set to override the headers for a single
450
+ request; this effectively ignores the headers
451
+ in the spec for a single request.
452
+ :type _headers: dict, optional
453
+ :param _host_index: set to override the host_index for a single
454
+ request; this effectively ignores the host_index
455
+ in the spec for a single request.
456
+ :type _host_index: int, optional
457
+ :return: Returns the result object.
458
+ """ # noqa: E501
459
+
460
+ _param = self._create_backup_serialize(
461
+ sandbox_id=sandbox_id,
462
+ x_daytona_organization_id=x_daytona_organization_id,
463
+ _request_auth=_request_auth,
464
+ _content_type=_content_type,
465
+ _headers=_headers,
466
+ _host_index=_host_index,
467
+ )
468
+
469
+ _response_types_map: Dict[str, Optional[str]] = {
470
+ "200": "Sandbox",
471
+ }
472
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
473
+ return response_data.response
474
+
475
+ def _create_backup_serialize(
476
+ self,
477
+ sandbox_id,
478
+ x_daytona_organization_id,
479
+ _request_auth,
480
+ _content_type,
481
+ _headers,
482
+ _host_index,
483
+ ) -> RequestSerialized:
484
+ _host = None
485
+
486
+ _collection_formats: Dict[str, str] = {}
487
+
488
+ _path_params: Dict[str, str] = {}
489
+ _query_params: List[Tuple[str, str]] = []
490
+ _header_params: Dict[str, Optional[str]] = _headers or {}
491
+ _form_params: List[Tuple[str, str]] = []
492
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
493
+ _body_params: Optional[bytes] = None
494
+
495
+ # process the path parameters
496
+ if sandbox_id is not None:
497
+ _path_params["sandboxId"] = sandbox_id
498
+ # process the query parameters
499
+ # process the header parameters
500
+ if x_daytona_organization_id is not None:
501
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
502
+ # process the form parameters
503
+ # process the body parameter
504
+
505
+ # set the HTTP header `Accept`
506
+ if "Accept" not in _header_params:
507
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
508
+
509
+ # authentication setting
510
+ _auth_settings: List[str] = ["bearer", "oauth2"]
511
+
512
+ return self.api_client.param_serialize(
513
+ method="POST",
514
+ resource_path="/sandbox/{sandboxId}/backup",
515
+ path_params=_path_params,
516
+ query_params=_query_params,
517
+ header_params=_header_params,
518
+ body=_body_params,
519
+ post_params=_form_params,
520
+ files=_files,
521
+ auth_settings=_auth_settings,
522
+ collection_formats=_collection_formats,
523
+ _host=_host,
524
+ _request_auth=_request_auth,
525
+ )
526
+
527
+ @validate_call
528
+ def create_sandbox(
529
+ self,
530
+ create_sandbox: CreateSandbox,
531
+ x_daytona_organization_id: Annotated[
532
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
533
+ ] = None,
534
+ _request_timeout: Union[
535
+ None,
536
+ Annotated[StrictFloat, Field(gt=0)],
537
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
538
+ ] = None,
539
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
540
+ _content_type: Optional[StrictStr] = None,
541
+ _headers: Optional[Dict[StrictStr, Any]] = None,
542
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
543
+ ) -> Sandbox:
544
+ """Create a new sandbox
545
+
546
+
547
+ :param create_sandbox: (required)
548
+ :type create_sandbox: CreateSandbox
549
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
550
+ :type x_daytona_organization_id: str
551
+ :param _request_timeout: timeout setting for this request. If one
552
+ number provided, it will be total request
553
+ timeout. It can also be a pair (tuple) of
554
+ (connection, read) timeouts.
555
+ :type _request_timeout: int, tuple(int, int), optional
556
+ :param _request_auth: set to override the auth_settings for an a single
557
+ request; this effectively ignores the
558
+ authentication in the spec for a single request.
559
+ :type _request_auth: dict, optional
560
+ :param _content_type: force content-type for the request.
561
+ :type _content_type: str, Optional
562
+ :param _headers: set to override the headers for a single
563
+ request; this effectively ignores the headers
564
+ in the spec for a single request.
565
+ :type _headers: dict, optional
566
+ :param _host_index: set to override the host_index for a single
567
+ request; this effectively ignores the host_index
568
+ in the spec for a single request.
569
+ :type _host_index: int, optional
570
+ :return: Returns the result object.
571
+ """ # noqa: E501
572
+
573
+ _param = self._create_sandbox_serialize(
574
+ create_sandbox=create_sandbox,
575
+ x_daytona_organization_id=x_daytona_organization_id,
576
+ _request_auth=_request_auth,
577
+ _content_type=_content_type,
578
+ _headers=_headers,
579
+ _host_index=_host_index,
580
+ )
581
+
582
+ _response_types_map: Dict[str, Optional[str]] = {
583
+ "200": "Sandbox",
584
+ }
585
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
586
+ response_data.read()
587
+ return self.api_client.response_deserialize(
588
+ response_data=response_data,
589
+ response_types_map=_response_types_map,
590
+ ).data
591
+
592
+ @validate_call
593
+ def create_sandbox_with_http_info(
594
+ self,
595
+ create_sandbox: CreateSandbox,
596
+ x_daytona_organization_id: Annotated[
597
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
598
+ ] = None,
599
+ _request_timeout: Union[
600
+ None,
601
+ Annotated[StrictFloat, Field(gt=0)],
602
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
603
+ ] = None,
604
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
605
+ _content_type: Optional[StrictStr] = None,
606
+ _headers: Optional[Dict[StrictStr, Any]] = None,
607
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
608
+ ) -> ApiResponse[Sandbox]:
609
+ """Create a new sandbox
610
+
611
+
612
+ :param create_sandbox: (required)
613
+ :type create_sandbox: CreateSandbox
614
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
615
+ :type x_daytona_organization_id: str
616
+ :param _request_timeout: timeout setting for this request. If one
617
+ number provided, it will be total request
618
+ timeout. It can also be a pair (tuple) of
619
+ (connection, read) timeouts.
620
+ :type _request_timeout: int, tuple(int, int), optional
621
+ :param _request_auth: set to override the auth_settings for an a single
622
+ request; this effectively ignores the
623
+ authentication in the spec for a single request.
624
+ :type _request_auth: dict, optional
625
+ :param _content_type: force content-type for the request.
626
+ :type _content_type: str, Optional
627
+ :param _headers: set to override the headers for a single
628
+ request; this effectively ignores the headers
629
+ in the spec for a single request.
630
+ :type _headers: dict, optional
631
+ :param _host_index: set to override the host_index for a single
632
+ request; this effectively ignores the host_index
633
+ in the spec for a single request.
634
+ :type _host_index: int, optional
635
+ :return: Returns the result object.
636
+ """ # noqa: E501
637
+
638
+ _param = self._create_sandbox_serialize(
639
+ create_sandbox=create_sandbox,
640
+ x_daytona_organization_id=x_daytona_organization_id,
641
+ _request_auth=_request_auth,
642
+ _content_type=_content_type,
643
+ _headers=_headers,
644
+ _host_index=_host_index,
645
+ )
646
+
647
+ _response_types_map: Dict[str, Optional[str]] = {
648
+ "200": "Sandbox",
649
+ }
650
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
651
+ response_data.read()
652
+ return self.api_client.response_deserialize(
653
+ response_data=response_data,
654
+ response_types_map=_response_types_map,
655
+ )
656
+
657
+ @validate_call
658
+ def create_sandbox_without_preload_content(
659
+ self,
660
+ create_sandbox: CreateSandbox,
661
+ x_daytona_organization_id: Annotated[
662
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
663
+ ] = None,
664
+ _request_timeout: Union[
665
+ None,
666
+ Annotated[StrictFloat, Field(gt=0)],
667
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
668
+ ] = None,
669
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
670
+ _content_type: Optional[StrictStr] = None,
671
+ _headers: Optional[Dict[StrictStr, Any]] = None,
672
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
673
+ ) -> RESTResponseType:
674
+ """Create a new sandbox
675
+
676
+
677
+ :param create_sandbox: (required)
678
+ :type create_sandbox: CreateSandbox
679
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
680
+ :type x_daytona_organization_id: str
681
+ :param _request_timeout: timeout setting for this request. If one
682
+ number provided, it will be total request
683
+ timeout. It can also be a pair (tuple) of
684
+ (connection, read) timeouts.
685
+ :type _request_timeout: int, tuple(int, int), optional
686
+ :param _request_auth: set to override the auth_settings for an a single
687
+ request; this effectively ignores the
688
+ authentication in the spec for a single request.
689
+ :type _request_auth: dict, optional
690
+ :param _content_type: force content-type for the request.
691
+ :type _content_type: str, Optional
692
+ :param _headers: set to override the headers for a single
693
+ request; this effectively ignores the headers
694
+ in the spec for a single request.
695
+ :type _headers: dict, optional
696
+ :param _host_index: set to override the host_index for a single
697
+ request; this effectively ignores the host_index
698
+ in the spec for a single request.
699
+ :type _host_index: int, optional
700
+ :return: Returns the result object.
701
+ """ # noqa: E501
702
+
703
+ _param = self._create_sandbox_serialize(
704
+ create_sandbox=create_sandbox,
705
+ x_daytona_organization_id=x_daytona_organization_id,
706
+ _request_auth=_request_auth,
707
+ _content_type=_content_type,
708
+ _headers=_headers,
709
+ _host_index=_host_index,
710
+ )
711
+
712
+ _response_types_map: Dict[str, Optional[str]] = {
713
+ "200": "Sandbox",
714
+ }
715
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
716
+ return response_data.response
717
+
718
+ def _create_sandbox_serialize(
719
+ self,
720
+ create_sandbox,
721
+ x_daytona_organization_id,
722
+ _request_auth,
723
+ _content_type,
724
+ _headers,
725
+ _host_index,
726
+ ) -> RequestSerialized:
727
+ _host = None
728
+
729
+ _collection_formats: Dict[str, str] = {}
730
+
731
+ _path_params: Dict[str, str] = {}
732
+ _query_params: List[Tuple[str, str]] = []
733
+ _header_params: Dict[str, Optional[str]] = _headers or {}
734
+ _form_params: List[Tuple[str, str]] = []
735
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
736
+ _body_params: Optional[bytes] = None
737
+
738
+ # process the path parameters
739
+ # process the query parameters
740
+ # process the header parameters
741
+ if x_daytona_organization_id is not None:
742
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
743
+ # process the form parameters
744
+ # process the body parameter
745
+ if create_sandbox is not None:
746
+ _body_params = create_sandbox
747
+
748
+ # set the HTTP header `Accept`
749
+ if "Accept" not in _header_params:
750
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
751
+
752
+ # set the HTTP header `Content-Type`
753
+ if _content_type:
754
+ _header_params["Content-Type"] = _content_type
755
+ else:
756
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
757
+ if _default_content_type is not None:
758
+ _header_params["Content-Type"] = _default_content_type
759
+
760
+ # authentication setting
761
+ _auth_settings: List[str] = ["bearer", "oauth2"]
762
+
763
+ return self.api_client.param_serialize(
764
+ method="POST",
765
+ resource_path="/sandbox",
766
+ path_params=_path_params,
767
+ query_params=_query_params,
768
+ header_params=_header_params,
769
+ body=_body_params,
770
+ post_params=_form_params,
771
+ files=_files,
772
+ auth_settings=_auth_settings,
773
+ collection_formats=_collection_formats,
774
+ _host=_host,
775
+ _request_auth=_request_auth,
776
+ )
777
+
778
+ @validate_call
779
+ def delete_sandbox(
780
+ self,
781
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
782
+ force: StrictBool,
783
+ x_daytona_organization_id: Annotated[
784
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
785
+ ] = None,
786
+ _request_timeout: Union[
787
+ None,
788
+ Annotated[StrictFloat, Field(gt=0)],
789
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
790
+ ] = None,
791
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
792
+ _content_type: Optional[StrictStr] = None,
793
+ _headers: Optional[Dict[StrictStr, Any]] = None,
794
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
795
+ ) -> None:
796
+ """Delete sandbox
797
+
798
+
799
+ :param sandbox_id: ID of the sandbox (required)
800
+ :type sandbox_id: str
801
+ :param force: (required)
802
+ :type force: bool
803
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
804
+ :type x_daytona_organization_id: str
805
+ :param _request_timeout: timeout setting for this request. If one
806
+ number provided, it will be total request
807
+ timeout. It can also be a pair (tuple) of
808
+ (connection, read) timeouts.
809
+ :type _request_timeout: int, tuple(int, int), optional
810
+ :param _request_auth: set to override the auth_settings for an a single
811
+ request; this effectively ignores the
812
+ authentication in the spec for a single request.
813
+ :type _request_auth: dict, optional
814
+ :param _content_type: force content-type for the request.
815
+ :type _content_type: str, Optional
816
+ :param _headers: set to override the headers for a single
817
+ request; this effectively ignores the headers
818
+ in the spec for a single request.
819
+ :type _headers: dict, optional
820
+ :param _host_index: set to override the host_index for a single
821
+ request; this effectively ignores the host_index
822
+ in the spec for a single request.
823
+ :type _host_index: int, optional
824
+ :return: Returns the result object.
825
+ """ # noqa: E501
826
+
827
+ _param = self._delete_sandbox_serialize(
828
+ sandbox_id=sandbox_id,
829
+ force=force,
830
+ x_daytona_organization_id=x_daytona_organization_id,
831
+ _request_auth=_request_auth,
832
+ _content_type=_content_type,
833
+ _headers=_headers,
834
+ _host_index=_host_index,
835
+ )
836
+
837
+ _response_types_map: Dict[str, Optional[str]] = {
838
+ "200": None,
839
+ }
840
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
841
+ response_data.read()
842
+ return self.api_client.response_deserialize(
843
+ response_data=response_data,
844
+ response_types_map=_response_types_map,
845
+ ).data
846
+
847
+ @validate_call
848
+ def delete_sandbox_with_http_info(
849
+ self,
850
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
851
+ force: StrictBool,
852
+ x_daytona_organization_id: Annotated[
853
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
854
+ ] = None,
855
+ _request_timeout: Union[
856
+ None,
857
+ Annotated[StrictFloat, Field(gt=0)],
858
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
859
+ ] = None,
860
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
861
+ _content_type: Optional[StrictStr] = None,
862
+ _headers: Optional[Dict[StrictStr, Any]] = None,
863
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
864
+ ) -> ApiResponse[None]:
865
+ """Delete sandbox
866
+
867
+
868
+ :param sandbox_id: ID of the sandbox (required)
869
+ :type sandbox_id: str
870
+ :param force: (required)
871
+ :type force: bool
872
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
873
+ :type x_daytona_organization_id: str
874
+ :param _request_timeout: timeout setting for this request. If one
875
+ number provided, it will be total request
876
+ timeout. It can also be a pair (tuple) of
877
+ (connection, read) timeouts.
878
+ :type _request_timeout: int, tuple(int, int), optional
879
+ :param _request_auth: set to override the auth_settings for an a single
880
+ request; this effectively ignores the
881
+ authentication in the spec for a single request.
882
+ :type _request_auth: dict, optional
883
+ :param _content_type: force content-type for the request.
884
+ :type _content_type: str, Optional
885
+ :param _headers: set to override the headers for a single
886
+ request; this effectively ignores the headers
887
+ in the spec for a single request.
888
+ :type _headers: dict, optional
889
+ :param _host_index: set to override the host_index for a single
890
+ request; this effectively ignores the host_index
891
+ in the spec for a single request.
892
+ :type _host_index: int, optional
893
+ :return: Returns the result object.
894
+ """ # noqa: E501
895
+
896
+ _param = self._delete_sandbox_serialize(
897
+ sandbox_id=sandbox_id,
898
+ force=force,
899
+ x_daytona_organization_id=x_daytona_organization_id,
900
+ _request_auth=_request_auth,
901
+ _content_type=_content_type,
902
+ _headers=_headers,
903
+ _host_index=_host_index,
904
+ )
905
+
906
+ _response_types_map: Dict[str, Optional[str]] = {
907
+ "200": None,
908
+ }
909
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
910
+ response_data.read()
911
+ return self.api_client.response_deserialize(
912
+ response_data=response_data,
913
+ response_types_map=_response_types_map,
914
+ )
915
+
916
+ @validate_call
917
+ def delete_sandbox_without_preload_content(
918
+ self,
919
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
920
+ force: StrictBool,
921
+ x_daytona_organization_id: Annotated[
922
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
923
+ ] = None,
924
+ _request_timeout: Union[
925
+ None,
926
+ Annotated[StrictFloat, Field(gt=0)],
927
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
928
+ ] = None,
929
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
930
+ _content_type: Optional[StrictStr] = None,
931
+ _headers: Optional[Dict[StrictStr, Any]] = None,
932
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
933
+ ) -> RESTResponseType:
934
+ """Delete sandbox
935
+
936
+
937
+ :param sandbox_id: ID of the sandbox (required)
938
+ :type sandbox_id: str
939
+ :param force: (required)
940
+ :type force: bool
941
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
942
+ :type x_daytona_organization_id: str
943
+ :param _request_timeout: timeout setting for this request. If one
944
+ number provided, it will be total request
945
+ timeout. It can also be a pair (tuple) of
946
+ (connection, read) timeouts.
947
+ :type _request_timeout: int, tuple(int, int), optional
948
+ :param _request_auth: set to override the auth_settings for an a single
949
+ request; this effectively ignores the
950
+ authentication in the spec for a single request.
951
+ :type _request_auth: dict, optional
952
+ :param _content_type: force content-type for the request.
953
+ :type _content_type: str, Optional
954
+ :param _headers: set to override the headers for a single
955
+ request; this effectively ignores the headers
956
+ in the spec for a single request.
957
+ :type _headers: dict, optional
958
+ :param _host_index: set to override the host_index for a single
959
+ request; this effectively ignores the host_index
960
+ in the spec for a single request.
961
+ :type _host_index: int, optional
962
+ :return: Returns the result object.
963
+ """ # noqa: E501
964
+
965
+ _param = self._delete_sandbox_serialize(
966
+ sandbox_id=sandbox_id,
967
+ force=force,
968
+ x_daytona_organization_id=x_daytona_organization_id,
969
+ _request_auth=_request_auth,
970
+ _content_type=_content_type,
971
+ _headers=_headers,
972
+ _host_index=_host_index,
973
+ )
974
+
975
+ _response_types_map: Dict[str, Optional[str]] = {
976
+ "200": None,
977
+ }
978
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
979
+ return response_data.response
980
+
981
+ def _delete_sandbox_serialize(
982
+ self,
983
+ sandbox_id,
984
+ force,
985
+ x_daytona_organization_id,
986
+ _request_auth,
987
+ _content_type,
988
+ _headers,
989
+ _host_index,
990
+ ) -> RequestSerialized:
991
+ _host = None
992
+
993
+ _collection_formats: Dict[str, str] = {}
994
+
995
+ _path_params: Dict[str, str] = {}
996
+ _query_params: List[Tuple[str, str]] = []
997
+ _header_params: Dict[str, Optional[str]] = _headers or {}
998
+ _form_params: List[Tuple[str, str]] = []
999
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1000
+ _body_params: Optional[bytes] = None
1001
+
1002
+ # process the path parameters
1003
+ if sandbox_id is not None:
1004
+ _path_params["sandboxId"] = sandbox_id
1005
+ # process the query parameters
1006
+ if force is not None:
1007
+ _query_params.append(("force", force))
1008
+
1009
+ # process the header parameters
1010
+ if x_daytona_organization_id is not None:
1011
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
1012
+ # process the form parameters
1013
+ # process the body parameter
1014
+
1015
+ # authentication setting
1016
+ _auth_settings: List[str] = ["bearer", "oauth2"]
1017
+
1018
+ return self.api_client.param_serialize(
1019
+ method="DELETE",
1020
+ resource_path="/sandbox/{sandboxId}",
1021
+ path_params=_path_params,
1022
+ query_params=_query_params,
1023
+ header_params=_header_params,
1024
+ body=_body_params,
1025
+ post_params=_form_params,
1026
+ files=_files,
1027
+ auth_settings=_auth_settings,
1028
+ collection_formats=_collection_formats,
1029
+ _host=_host,
1030
+ _request_auth=_request_auth,
1031
+ )
1032
+
1033
+ @validate_call
1034
+ def get_build_logs(
1035
+ self,
1036
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1037
+ x_daytona_organization_id: Annotated[
1038
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1039
+ ] = None,
1040
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
1041
+ _request_timeout: Union[
1042
+ None,
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1045
+ ] = None,
1046
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1047
+ _content_type: Optional[StrictStr] = None,
1048
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1049
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1050
+ ) -> None:
1051
+ """Get build logs
1052
+
1053
+
1054
+ :param sandbox_id: ID of the sandbox (required)
1055
+ :type sandbox_id: str
1056
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1057
+ :type x_daytona_organization_id: str
1058
+ :param follow: Whether to follow the logs stream
1059
+ :type follow: bool
1060
+ :param _request_timeout: timeout setting for this request. If one
1061
+ number provided, it will be total request
1062
+ timeout. It can also be a pair (tuple) of
1063
+ (connection, read) timeouts.
1064
+ :type _request_timeout: int, tuple(int, int), optional
1065
+ :param _request_auth: set to override the auth_settings for an a single
1066
+ request; this effectively ignores the
1067
+ authentication in the spec for a single request.
1068
+ :type _request_auth: dict, optional
1069
+ :param _content_type: force content-type for the request.
1070
+ :type _content_type: str, Optional
1071
+ :param _headers: set to override the headers for a single
1072
+ request; this effectively ignores the headers
1073
+ in the spec for a single request.
1074
+ :type _headers: dict, optional
1075
+ :param _host_index: set to override the host_index for a single
1076
+ request; this effectively ignores the host_index
1077
+ in the spec for a single request.
1078
+ :type _host_index: int, optional
1079
+ :return: Returns the result object.
1080
+ """ # noqa: E501
1081
+
1082
+ _param = self._get_build_logs_serialize(
1083
+ sandbox_id=sandbox_id,
1084
+ x_daytona_organization_id=x_daytona_organization_id,
1085
+ follow=follow,
1086
+ _request_auth=_request_auth,
1087
+ _content_type=_content_type,
1088
+ _headers=_headers,
1089
+ _host_index=_host_index,
1090
+ )
1091
+
1092
+ _response_types_map: Dict[str, Optional[str]] = {
1093
+ "200": None,
1094
+ }
1095
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1096
+ response_data.read()
1097
+ return self.api_client.response_deserialize(
1098
+ response_data=response_data,
1099
+ response_types_map=_response_types_map,
1100
+ ).data
1101
+
1102
+ @validate_call
1103
+ def get_build_logs_with_http_info(
1104
+ self,
1105
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1106
+ x_daytona_organization_id: Annotated[
1107
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1108
+ ] = None,
1109
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
1110
+ _request_timeout: Union[
1111
+ None,
1112
+ Annotated[StrictFloat, Field(gt=0)],
1113
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1114
+ ] = None,
1115
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1116
+ _content_type: Optional[StrictStr] = None,
1117
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1118
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1119
+ ) -> ApiResponse[None]:
1120
+ """Get build logs
1121
+
1122
+
1123
+ :param sandbox_id: ID of the sandbox (required)
1124
+ :type sandbox_id: str
1125
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1126
+ :type x_daytona_organization_id: str
1127
+ :param follow: Whether to follow the logs stream
1128
+ :type follow: bool
1129
+ :param _request_timeout: timeout setting for this request. If one
1130
+ number provided, it will be total request
1131
+ timeout. It can also be a pair (tuple) of
1132
+ (connection, read) timeouts.
1133
+ :type _request_timeout: int, tuple(int, int), optional
1134
+ :param _request_auth: set to override the auth_settings for an a single
1135
+ request; this effectively ignores the
1136
+ authentication in the spec for a single request.
1137
+ :type _request_auth: dict, optional
1138
+ :param _content_type: force content-type for the request.
1139
+ :type _content_type: str, Optional
1140
+ :param _headers: set to override the headers for a single
1141
+ request; this effectively ignores the headers
1142
+ in the spec for a single request.
1143
+ :type _headers: dict, optional
1144
+ :param _host_index: set to override the host_index for a single
1145
+ request; this effectively ignores the host_index
1146
+ in the spec for a single request.
1147
+ :type _host_index: int, optional
1148
+ :return: Returns the result object.
1149
+ """ # noqa: E501
1150
+
1151
+ _param = self._get_build_logs_serialize(
1152
+ sandbox_id=sandbox_id,
1153
+ x_daytona_organization_id=x_daytona_organization_id,
1154
+ follow=follow,
1155
+ _request_auth=_request_auth,
1156
+ _content_type=_content_type,
1157
+ _headers=_headers,
1158
+ _host_index=_host_index,
1159
+ )
1160
+
1161
+ _response_types_map: Dict[str, Optional[str]] = {
1162
+ "200": None,
1163
+ }
1164
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1165
+ response_data.read()
1166
+ return self.api_client.response_deserialize(
1167
+ response_data=response_data,
1168
+ response_types_map=_response_types_map,
1169
+ )
1170
+
1171
+ @validate_call
1172
+ def get_build_logs_without_preload_content(
1173
+ self,
1174
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1175
+ x_daytona_organization_id: Annotated[
1176
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1177
+ ] = None,
1178
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
1179
+ _request_timeout: Union[
1180
+ None,
1181
+ Annotated[StrictFloat, Field(gt=0)],
1182
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1183
+ ] = None,
1184
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1185
+ _content_type: Optional[StrictStr] = None,
1186
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1187
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1188
+ ) -> RESTResponseType:
1189
+ """Get build logs
1190
+
1191
+
1192
+ :param sandbox_id: ID of the sandbox (required)
1193
+ :type sandbox_id: str
1194
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1195
+ :type x_daytona_organization_id: str
1196
+ :param follow: Whether to follow the logs stream
1197
+ :type follow: bool
1198
+ :param _request_timeout: timeout setting for this request. If one
1199
+ number provided, it will be total request
1200
+ timeout. It can also be a pair (tuple) of
1201
+ (connection, read) timeouts.
1202
+ :type _request_timeout: int, tuple(int, int), optional
1203
+ :param _request_auth: set to override the auth_settings for an a single
1204
+ request; this effectively ignores the
1205
+ authentication in the spec for a single request.
1206
+ :type _request_auth: dict, optional
1207
+ :param _content_type: force content-type for the request.
1208
+ :type _content_type: str, Optional
1209
+ :param _headers: set to override the headers for a single
1210
+ request; this effectively ignores the headers
1211
+ in the spec for a single request.
1212
+ :type _headers: dict, optional
1213
+ :param _host_index: set to override the host_index for a single
1214
+ request; this effectively ignores the host_index
1215
+ in the spec for a single request.
1216
+ :type _host_index: int, optional
1217
+ :return: Returns the result object.
1218
+ """ # noqa: E501
1219
+
1220
+ _param = self._get_build_logs_serialize(
1221
+ sandbox_id=sandbox_id,
1222
+ x_daytona_organization_id=x_daytona_organization_id,
1223
+ follow=follow,
1224
+ _request_auth=_request_auth,
1225
+ _content_type=_content_type,
1226
+ _headers=_headers,
1227
+ _host_index=_host_index,
1228
+ )
1229
+
1230
+ _response_types_map: Dict[str, Optional[str]] = {
1231
+ "200": None,
1232
+ }
1233
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1234
+ return response_data.response
1235
+
1236
+ def _get_build_logs_serialize(
1237
+ self,
1238
+ sandbox_id,
1239
+ x_daytona_organization_id,
1240
+ follow,
1241
+ _request_auth,
1242
+ _content_type,
1243
+ _headers,
1244
+ _host_index,
1245
+ ) -> RequestSerialized:
1246
+ _host = None
1247
+
1248
+ _collection_formats: Dict[str, str] = {}
1249
+
1250
+ _path_params: Dict[str, str] = {}
1251
+ _query_params: List[Tuple[str, str]] = []
1252
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1253
+ _form_params: List[Tuple[str, str]] = []
1254
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1255
+ _body_params: Optional[bytes] = None
1256
+
1257
+ # process the path parameters
1258
+ if sandbox_id is not None:
1259
+ _path_params["sandboxId"] = sandbox_id
1260
+ # process the query parameters
1261
+ if follow is not None:
1262
+ _query_params.append(("follow", follow))
1263
+
1264
+ # process the header parameters
1265
+ if x_daytona_organization_id is not None:
1266
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
1267
+ # process the form parameters
1268
+ # process the body parameter
1269
+
1270
+ # authentication setting
1271
+ _auth_settings: List[str] = ["bearer", "oauth2"]
1272
+
1273
+ return self.api_client.param_serialize(
1274
+ method="GET",
1275
+ resource_path="/sandbox/{sandboxId}/build-logs",
1276
+ path_params=_path_params,
1277
+ query_params=_query_params,
1278
+ header_params=_header_params,
1279
+ body=_body_params,
1280
+ post_params=_form_params,
1281
+ files=_files,
1282
+ auth_settings=_auth_settings,
1283
+ collection_formats=_collection_formats,
1284
+ _host=_host,
1285
+ _request_auth=_request_auth,
1286
+ )
1287
+
1288
+ @validate_call
1289
+ def get_port_preview_url(
1290
+ self,
1291
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1292
+ port: Annotated[Union[StrictFloat, StrictInt], Field(description="Port number to get preview URL for")],
1293
+ x_daytona_organization_id: Annotated[
1294
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1295
+ ] = None,
1296
+ _request_timeout: Union[
1297
+ None,
1298
+ Annotated[StrictFloat, Field(gt=0)],
1299
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1300
+ ] = None,
1301
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1302
+ _content_type: Optional[StrictStr] = None,
1303
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1304
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1305
+ ) -> PortPreviewUrl:
1306
+ """Get preview URL for a sandbox port
1307
+
1308
+
1309
+ :param sandbox_id: ID of the sandbox (required)
1310
+ :type sandbox_id: str
1311
+ :param port: Port number to get preview URL for (required)
1312
+ :type port: float
1313
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1314
+ :type x_daytona_organization_id: str
1315
+ :param _request_timeout: timeout setting for this request. If one
1316
+ number provided, it will be total request
1317
+ timeout. It can also be a pair (tuple) of
1318
+ (connection, read) timeouts.
1319
+ :type _request_timeout: int, tuple(int, int), optional
1320
+ :param _request_auth: set to override the auth_settings for an a single
1321
+ request; this effectively ignores the
1322
+ authentication in the spec for a single request.
1323
+ :type _request_auth: dict, optional
1324
+ :param _content_type: force content-type for the request.
1325
+ :type _content_type: str, Optional
1326
+ :param _headers: set to override the headers for a single
1327
+ request; this effectively ignores the headers
1328
+ in the spec for a single request.
1329
+ :type _headers: dict, optional
1330
+ :param _host_index: set to override the host_index for a single
1331
+ request; this effectively ignores the host_index
1332
+ in the spec for a single request.
1333
+ :type _host_index: int, optional
1334
+ :return: Returns the result object.
1335
+ """ # noqa: E501
1336
+
1337
+ _param = self._get_port_preview_url_serialize(
1338
+ sandbox_id=sandbox_id,
1339
+ port=port,
1340
+ x_daytona_organization_id=x_daytona_organization_id,
1341
+ _request_auth=_request_auth,
1342
+ _content_type=_content_type,
1343
+ _headers=_headers,
1344
+ _host_index=_host_index,
1345
+ )
1346
+
1347
+ _response_types_map: Dict[str, Optional[str]] = {
1348
+ "200": "PortPreviewUrl",
1349
+ }
1350
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1351
+ response_data.read()
1352
+ return self.api_client.response_deserialize(
1353
+ response_data=response_data,
1354
+ response_types_map=_response_types_map,
1355
+ ).data
1356
+
1357
+ @validate_call
1358
+ def get_port_preview_url_with_http_info(
1359
+ self,
1360
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1361
+ port: Annotated[Union[StrictFloat, StrictInt], Field(description="Port number to get preview URL for")],
1362
+ x_daytona_organization_id: Annotated[
1363
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1364
+ ] = None,
1365
+ _request_timeout: Union[
1366
+ None,
1367
+ Annotated[StrictFloat, Field(gt=0)],
1368
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1369
+ ] = None,
1370
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1371
+ _content_type: Optional[StrictStr] = None,
1372
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1373
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1374
+ ) -> ApiResponse[PortPreviewUrl]:
1375
+ """Get preview URL for a sandbox port
1376
+
1377
+
1378
+ :param sandbox_id: ID of the sandbox (required)
1379
+ :type sandbox_id: str
1380
+ :param port: Port number to get preview URL for (required)
1381
+ :type port: float
1382
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1383
+ :type x_daytona_organization_id: str
1384
+ :param _request_timeout: timeout setting for this request. If one
1385
+ number provided, it will be total request
1386
+ timeout. It can also be a pair (tuple) of
1387
+ (connection, read) timeouts.
1388
+ :type _request_timeout: int, tuple(int, int), optional
1389
+ :param _request_auth: set to override the auth_settings for an a single
1390
+ request; this effectively ignores the
1391
+ authentication in the spec for a single request.
1392
+ :type _request_auth: dict, optional
1393
+ :param _content_type: force content-type for the request.
1394
+ :type _content_type: str, Optional
1395
+ :param _headers: set to override the headers for a single
1396
+ request; this effectively ignores the headers
1397
+ in the spec for a single request.
1398
+ :type _headers: dict, optional
1399
+ :param _host_index: set to override the host_index for a single
1400
+ request; this effectively ignores the host_index
1401
+ in the spec for a single request.
1402
+ :type _host_index: int, optional
1403
+ :return: Returns the result object.
1404
+ """ # noqa: E501
1405
+
1406
+ _param = self._get_port_preview_url_serialize(
1407
+ sandbox_id=sandbox_id,
1408
+ port=port,
1409
+ x_daytona_organization_id=x_daytona_organization_id,
1410
+ _request_auth=_request_auth,
1411
+ _content_type=_content_type,
1412
+ _headers=_headers,
1413
+ _host_index=_host_index,
1414
+ )
1415
+
1416
+ _response_types_map: Dict[str, Optional[str]] = {
1417
+ "200": "PortPreviewUrl",
1418
+ }
1419
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1420
+ response_data.read()
1421
+ return self.api_client.response_deserialize(
1422
+ response_data=response_data,
1423
+ response_types_map=_response_types_map,
1424
+ )
1425
+
1426
+ @validate_call
1427
+ def get_port_preview_url_without_preload_content(
1428
+ self,
1429
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1430
+ port: Annotated[Union[StrictFloat, StrictInt], Field(description="Port number to get preview URL for")],
1431
+ x_daytona_organization_id: Annotated[
1432
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1433
+ ] = None,
1434
+ _request_timeout: Union[
1435
+ None,
1436
+ Annotated[StrictFloat, Field(gt=0)],
1437
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1438
+ ] = None,
1439
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1440
+ _content_type: Optional[StrictStr] = None,
1441
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1442
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1443
+ ) -> RESTResponseType:
1444
+ """Get preview URL for a sandbox port
1445
+
1446
+
1447
+ :param sandbox_id: ID of the sandbox (required)
1448
+ :type sandbox_id: str
1449
+ :param port: Port number to get preview URL for (required)
1450
+ :type port: float
1451
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1452
+ :type x_daytona_organization_id: str
1453
+ :param _request_timeout: timeout setting for this request. If one
1454
+ number provided, it will be total request
1455
+ timeout. It can also be a pair (tuple) of
1456
+ (connection, read) timeouts.
1457
+ :type _request_timeout: int, tuple(int, int), optional
1458
+ :param _request_auth: set to override the auth_settings for an a single
1459
+ request; this effectively ignores the
1460
+ authentication in the spec for a single request.
1461
+ :type _request_auth: dict, optional
1462
+ :param _content_type: force content-type for the request.
1463
+ :type _content_type: str, Optional
1464
+ :param _headers: set to override the headers for a single
1465
+ request; this effectively ignores the headers
1466
+ in the spec for a single request.
1467
+ :type _headers: dict, optional
1468
+ :param _host_index: set to override the host_index for a single
1469
+ request; this effectively ignores the host_index
1470
+ in the spec for a single request.
1471
+ :type _host_index: int, optional
1472
+ :return: Returns the result object.
1473
+ """ # noqa: E501
1474
+
1475
+ _param = self._get_port_preview_url_serialize(
1476
+ sandbox_id=sandbox_id,
1477
+ port=port,
1478
+ x_daytona_organization_id=x_daytona_organization_id,
1479
+ _request_auth=_request_auth,
1480
+ _content_type=_content_type,
1481
+ _headers=_headers,
1482
+ _host_index=_host_index,
1483
+ )
1484
+
1485
+ _response_types_map: Dict[str, Optional[str]] = {
1486
+ "200": "PortPreviewUrl",
1487
+ }
1488
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1489
+ return response_data.response
1490
+
1491
+ def _get_port_preview_url_serialize(
1492
+ self,
1493
+ sandbox_id,
1494
+ port,
1495
+ x_daytona_organization_id,
1496
+ _request_auth,
1497
+ _content_type,
1498
+ _headers,
1499
+ _host_index,
1500
+ ) -> RequestSerialized:
1501
+ _host = None
1502
+
1503
+ _collection_formats: Dict[str, str] = {}
1504
+
1505
+ _path_params: Dict[str, str] = {}
1506
+ _query_params: List[Tuple[str, str]] = []
1507
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1508
+ _form_params: List[Tuple[str, str]] = []
1509
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1510
+ _body_params: Optional[bytes] = None
1511
+
1512
+ # process the path parameters
1513
+ if sandbox_id is not None:
1514
+ _path_params["sandboxId"] = sandbox_id
1515
+ if port is not None:
1516
+ _path_params["port"] = port
1517
+ # process the query parameters
1518
+ # process the header parameters
1519
+ if x_daytona_organization_id is not None:
1520
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
1521
+ # process the form parameters
1522
+ # process the body parameter
1523
+
1524
+ # set the HTTP header `Accept`
1525
+ if "Accept" not in _header_params:
1526
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1527
+
1528
+ # authentication setting
1529
+ _auth_settings: List[str] = ["bearer", "oauth2"]
1530
+
1531
+ return self.api_client.param_serialize(
1532
+ method="GET",
1533
+ resource_path="/sandbox/{sandboxId}/ports/{port}/preview-url",
1534
+ path_params=_path_params,
1535
+ query_params=_query_params,
1536
+ header_params=_header_params,
1537
+ body=_body_params,
1538
+ post_params=_form_params,
1539
+ files=_files,
1540
+ auth_settings=_auth_settings,
1541
+ collection_formats=_collection_formats,
1542
+ _host=_host,
1543
+ _request_auth=_request_auth,
1544
+ )
1545
+
1546
+ @validate_call
1547
+ def get_sandbox(
1548
+ self,
1549
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1550
+ x_daytona_organization_id: Annotated[
1551
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1552
+ ] = None,
1553
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1554
+ _request_timeout: Union[
1555
+ None,
1556
+ Annotated[StrictFloat, Field(gt=0)],
1557
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1558
+ ] = None,
1559
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1560
+ _content_type: Optional[StrictStr] = None,
1561
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1562
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1563
+ ) -> Sandbox:
1564
+ """Get sandbox details
1565
+
1566
+
1567
+ :param sandbox_id: ID of the sandbox (required)
1568
+ :type sandbox_id: str
1569
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1570
+ :type x_daytona_organization_id: str
1571
+ :param verbose: Include verbose output
1572
+ :type verbose: bool
1573
+ :param _request_timeout: timeout setting for this request. If one
1574
+ number provided, it will be total request
1575
+ timeout. It can also be a pair (tuple) of
1576
+ (connection, read) timeouts.
1577
+ :type _request_timeout: int, tuple(int, int), optional
1578
+ :param _request_auth: set to override the auth_settings for an a single
1579
+ request; this effectively ignores the
1580
+ authentication in the spec for a single request.
1581
+ :type _request_auth: dict, optional
1582
+ :param _content_type: force content-type for the request.
1583
+ :type _content_type: str, Optional
1584
+ :param _headers: set to override the headers for a single
1585
+ request; this effectively ignores the headers
1586
+ in the spec for a single request.
1587
+ :type _headers: dict, optional
1588
+ :param _host_index: set to override the host_index for a single
1589
+ request; this effectively ignores the host_index
1590
+ in the spec for a single request.
1591
+ :type _host_index: int, optional
1592
+ :return: Returns the result object.
1593
+ """ # noqa: E501
1594
+
1595
+ _param = self._get_sandbox_serialize(
1596
+ sandbox_id=sandbox_id,
1597
+ x_daytona_organization_id=x_daytona_organization_id,
1598
+ verbose=verbose,
1599
+ _request_auth=_request_auth,
1600
+ _content_type=_content_type,
1601
+ _headers=_headers,
1602
+ _host_index=_host_index,
1603
+ )
1604
+
1605
+ _response_types_map: Dict[str, Optional[str]] = {
1606
+ "200": "Sandbox",
1607
+ }
1608
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1609
+ response_data.read()
1610
+ return self.api_client.response_deserialize(
1611
+ response_data=response_data,
1612
+ response_types_map=_response_types_map,
1613
+ ).data
1614
+
1615
+ @validate_call
1616
+ def get_sandbox_with_http_info(
1617
+ self,
1618
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1619
+ x_daytona_organization_id: Annotated[
1620
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1621
+ ] = None,
1622
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1623
+ _request_timeout: Union[
1624
+ None,
1625
+ Annotated[StrictFloat, Field(gt=0)],
1626
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1627
+ ] = None,
1628
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1629
+ _content_type: Optional[StrictStr] = None,
1630
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1631
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1632
+ ) -> ApiResponse[Sandbox]:
1633
+ """Get sandbox details
1634
+
1635
+
1636
+ :param sandbox_id: ID of the sandbox (required)
1637
+ :type sandbox_id: str
1638
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1639
+ :type x_daytona_organization_id: str
1640
+ :param verbose: Include verbose output
1641
+ :type verbose: bool
1642
+ :param _request_timeout: timeout setting for this request. If one
1643
+ number provided, it will be total request
1644
+ timeout. It can also be a pair (tuple) of
1645
+ (connection, read) timeouts.
1646
+ :type _request_timeout: int, tuple(int, int), optional
1647
+ :param _request_auth: set to override the auth_settings for an a single
1648
+ request; this effectively ignores the
1649
+ authentication in the spec for a single request.
1650
+ :type _request_auth: dict, optional
1651
+ :param _content_type: force content-type for the request.
1652
+ :type _content_type: str, Optional
1653
+ :param _headers: set to override the headers for a single
1654
+ request; this effectively ignores the headers
1655
+ in the spec for a single request.
1656
+ :type _headers: dict, optional
1657
+ :param _host_index: set to override the host_index for a single
1658
+ request; this effectively ignores the host_index
1659
+ in the spec for a single request.
1660
+ :type _host_index: int, optional
1661
+ :return: Returns the result object.
1662
+ """ # noqa: E501
1663
+
1664
+ _param = self._get_sandbox_serialize(
1665
+ sandbox_id=sandbox_id,
1666
+ x_daytona_organization_id=x_daytona_organization_id,
1667
+ verbose=verbose,
1668
+ _request_auth=_request_auth,
1669
+ _content_type=_content_type,
1670
+ _headers=_headers,
1671
+ _host_index=_host_index,
1672
+ )
1673
+
1674
+ _response_types_map: Dict[str, Optional[str]] = {
1675
+ "200": "Sandbox",
1676
+ }
1677
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1678
+ response_data.read()
1679
+ return self.api_client.response_deserialize(
1680
+ response_data=response_data,
1681
+ response_types_map=_response_types_map,
1682
+ )
1683
+
1684
+ @validate_call
1685
+ def get_sandbox_without_preload_content(
1686
+ self,
1687
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1688
+ x_daytona_organization_id: Annotated[
1689
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1690
+ ] = None,
1691
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1692
+ _request_timeout: Union[
1693
+ None,
1694
+ Annotated[StrictFloat, Field(gt=0)],
1695
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1696
+ ] = None,
1697
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1698
+ _content_type: Optional[StrictStr] = None,
1699
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1700
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1701
+ ) -> RESTResponseType:
1702
+ """Get sandbox details
1703
+
1704
+
1705
+ :param sandbox_id: ID of the sandbox (required)
1706
+ :type sandbox_id: str
1707
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1708
+ :type x_daytona_organization_id: str
1709
+ :param verbose: Include verbose output
1710
+ :type verbose: bool
1711
+ :param _request_timeout: timeout setting for this request. If one
1712
+ number provided, it will be total request
1713
+ timeout. It can also be a pair (tuple) of
1714
+ (connection, read) timeouts.
1715
+ :type _request_timeout: int, tuple(int, int), optional
1716
+ :param _request_auth: set to override the auth_settings for an a single
1717
+ request; this effectively ignores the
1718
+ authentication in the spec for a single request.
1719
+ :type _request_auth: dict, optional
1720
+ :param _content_type: force content-type for the request.
1721
+ :type _content_type: str, Optional
1722
+ :param _headers: set to override the headers for a single
1723
+ request; this effectively ignores the headers
1724
+ in the spec for a single request.
1725
+ :type _headers: dict, optional
1726
+ :param _host_index: set to override the host_index for a single
1727
+ request; this effectively ignores the host_index
1728
+ in the spec for a single request.
1729
+ :type _host_index: int, optional
1730
+ :return: Returns the result object.
1731
+ """ # noqa: E501
1732
+
1733
+ _param = self._get_sandbox_serialize(
1734
+ sandbox_id=sandbox_id,
1735
+ x_daytona_organization_id=x_daytona_organization_id,
1736
+ verbose=verbose,
1737
+ _request_auth=_request_auth,
1738
+ _content_type=_content_type,
1739
+ _headers=_headers,
1740
+ _host_index=_host_index,
1741
+ )
1742
+
1743
+ _response_types_map: Dict[str, Optional[str]] = {
1744
+ "200": "Sandbox",
1745
+ }
1746
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1747
+ return response_data.response
1748
+
1749
+ def _get_sandbox_serialize(
1750
+ self,
1751
+ sandbox_id,
1752
+ x_daytona_organization_id,
1753
+ verbose,
1754
+ _request_auth,
1755
+ _content_type,
1756
+ _headers,
1757
+ _host_index,
1758
+ ) -> RequestSerialized:
1759
+ _host = None
1760
+
1761
+ _collection_formats: Dict[str, str] = {}
1762
+
1763
+ _path_params: Dict[str, str] = {}
1764
+ _query_params: List[Tuple[str, str]] = []
1765
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1766
+ _form_params: List[Tuple[str, str]] = []
1767
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
1768
+ _body_params: Optional[bytes] = None
1769
+
1770
+ # process the path parameters
1771
+ if sandbox_id is not None:
1772
+ _path_params["sandboxId"] = sandbox_id
1773
+ # process the query parameters
1774
+ if verbose is not None:
1775
+ _query_params.append(("verbose", verbose))
1776
+
1777
+ # process the header parameters
1778
+ if x_daytona_organization_id is not None:
1779
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
1780
+ # process the form parameters
1781
+ # process the body parameter
1782
+
1783
+ # set the HTTP header `Accept`
1784
+ if "Accept" not in _header_params:
1785
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1786
+
1787
+ # authentication setting
1788
+ _auth_settings: List[str] = ["bearer", "oauth2"]
1789
+
1790
+ return self.api_client.param_serialize(
1791
+ method="GET",
1792
+ resource_path="/sandbox/{sandboxId}",
1793
+ path_params=_path_params,
1794
+ query_params=_query_params,
1795
+ header_params=_header_params,
1796
+ body=_body_params,
1797
+ post_params=_form_params,
1798
+ files=_files,
1799
+ auth_settings=_auth_settings,
1800
+ collection_formats=_collection_formats,
1801
+ _host=_host,
1802
+ _request_auth=_request_auth,
1803
+ )
1804
+
1805
+ @validate_call
1806
+ def list_sandboxes(
1807
+ self,
1808
+ x_daytona_organization_id: Annotated[
1809
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1810
+ ] = None,
1811
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1812
+ labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
1813
+ _request_timeout: Union[
1814
+ None,
1815
+ Annotated[StrictFloat, Field(gt=0)],
1816
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1817
+ ] = None,
1818
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1819
+ _content_type: Optional[StrictStr] = None,
1820
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1821
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1822
+ ) -> List[Sandbox]:
1823
+ """List all sandboxes
1824
+
1825
+
1826
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1827
+ :type x_daytona_organization_id: str
1828
+ :param verbose: Include verbose output
1829
+ :type verbose: bool
1830
+ :param labels: JSON encoded labels to filter by
1831
+ :type labels: str
1832
+ :param _request_timeout: timeout setting for this request. If one
1833
+ number provided, it will be total request
1834
+ timeout. It can also be a pair (tuple) of
1835
+ (connection, read) timeouts.
1836
+ :type _request_timeout: int, tuple(int, int), optional
1837
+ :param _request_auth: set to override the auth_settings for an a single
1838
+ request; this effectively ignores the
1839
+ authentication in the spec for a single request.
1840
+ :type _request_auth: dict, optional
1841
+ :param _content_type: force content-type for the request.
1842
+ :type _content_type: str, Optional
1843
+ :param _headers: set to override the headers for a single
1844
+ request; this effectively ignores the headers
1845
+ in the spec for a single request.
1846
+ :type _headers: dict, optional
1847
+ :param _host_index: set to override the host_index for a single
1848
+ request; this effectively ignores the host_index
1849
+ in the spec for a single request.
1850
+ :type _host_index: int, optional
1851
+ :return: Returns the result object.
1852
+ """ # noqa: E501
1853
+
1854
+ _param = self._list_sandboxes_serialize(
1855
+ x_daytona_organization_id=x_daytona_organization_id,
1856
+ verbose=verbose,
1857
+ labels=labels,
1858
+ _request_auth=_request_auth,
1859
+ _content_type=_content_type,
1860
+ _headers=_headers,
1861
+ _host_index=_host_index,
1862
+ )
1863
+
1864
+ _response_types_map: Dict[str, Optional[str]] = {
1865
+ "200": "List[Sandbox]",
1866
+ }
1867
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1868
+ response_data.read()
1869
+ return self.api_client.response_deserialize(
1870
+ response_data=response_data,
1871
+ response_types_map=_response_types_map,
1872
+ ).data
1873
+
1874
+ @validate_call
1875
+ def list_sandboxes_with_http_info(
1876
+ self,
1877
+ x_daytona_organization_id: Annotated[
1878
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1879
+ ] = None,
1880
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1881
+ labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
1882
+ _request_timeout: Union[
1883
+ None,
1884
+ Annotated[StrictFloat, Field(gt=0)],
1885
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1886
+ ] = None,
1887
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1888
+ _content_type: Optional[StrictStr] = None,
1889
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1890
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1891
+ ) -> ApiResponse[List[Sandbox]]:
1892
+ """List all sandboxes
1893
+
1894
+
1895
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1896
+ :type x_daytona_organization_id: str
1897
+ :param verbose: Include verbose output
1898
+ :type verbose: bool
1899
+ :param labels: JSON encoded labels to filter by
1900
+ :type labels: str
1901
+ :param _request_timeout: timeout setting for this request. If one
1902
+ number provided, it will be total request
1903
+ timeout. It can also be a pair (tuple) of
1904
+ (connection, read) timeouts.
1905
+ :type _request_timeout: int, tuple(int, int), optional
1906
+ :param _request_auth: set to override the auth_settings for an a single
1907
+ request; this effectively ignores the
1908
+ authentication in the spec for a single request.
1909
+ :type _request_auth: dict, optional
1910
+ :param _content_type: force content-type for the request.
1911
+ :type _content_type: str, Optional
1912
+ :param _headers: set to override the headers for a single
1913
+ request; this effectively ignores the headers
1914
+ in the spec for a single request.
1915
+ :type _headers: dict, optional
1916
+ :param _host_index: set to override the host_index for a single
1917
+ request; this effectively ignores the host_index
1918
+ in the spec for a single request.
1919
+ :type _host_index: int, optional
1920
+ :return: Returns the result object.
1921
+ """ # noqa: E501
1922
+
1923
+ _param = self._list_sandboxes_serialize(
1924
+ x_daytona_organization_id=x_daytona_organization_id,
1925
+ verbose=verbose,
1926
+ labels=labels,
1927
+ _request_auth=_request_auth,
1928
+ _content_type=_content_type,
1929
+ _headers=_headers,
1930
+ _host_index=_host_index,
1931
+ )
1932
+
1933
+ _response_types_map: Dict[str, Optional[str]] = {
1934
+ "200": "List[Sandbox]",
1935
+ }
1936
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1937
+ response_data.read()
1938
+ return self.api_client.response_deserialize(
1939
+ response_data=response_data,
1940
+ response_types_map=_response_types_map,
1941
+ )
1942
+
1943
+ @validate_call
1944
+ def list_sandboxes_without_preload_content(
1945
+ self,
1946
+ x_daytona_organization_id: Annotated[
1947
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
1948
+ ] = None,
1949
+ verbose: Annotated[Optional[StrictBool], Field(description="Include verbose output")] = None,
1950
+ labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
1951
+ _request_timeout: Union[
1952
+ None,
1953
+ Annotated[StrictFloat, Field(gt=0)],
1954
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1955
+ ] = None,
1956
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1957
+ _content_type: Optional[StrictStr] = None,
1958
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1959
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1960
+ ) -> RESTResponseType:
1961
+ """List all sandboxes
1962
+
1963
+
1964
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1965
+ :type x_daytona_organization_id: str
1966
+ :param verbose: Include verbose output
1967
+ :type verbose: bool
1968
+ :param labels: JSON encoded labels to filter by
1969
+ :type labels: str
1970
+ :param _request_timeout: timeout setting for this request. If one
1971
+ number provided, it will be total request
1972
+ timeout. It can also be a pair (tuple) of
1973
+ (connection, read) timeouts.
1974
+ :type _request_timeout: int, tuple(int, int), optional
1975
+ :param _request_auth: set to override the auth_settings for an a single
1976
+ request; this effectively ignores the
1977
+ authentication in the spec for a single request.
1978
+ :type _request_auth: dict, optional
1979
+ :param _content_type: force content-type for the request.
1980
+ :type _content_type: str, Optional
1981
+ :param _headers: set to override the headers for a single
1982
+ request; this effectively ignores the headers
1983
+ in the spec for a single request.
1984
+ :type _headers: dict, optional
1985
+ :param _host_index: set to override the host_index for a single
1986
+ request; this effectively ignores the host_index
1987
+ in the spec for a single request.
1988
+ :type _host_index: int, optional
1989
+ :return: Returns the result object.
1990
+ """ # noqa: E501
1991
+
1992
+ _param = self._list_sandboxes_serialize(
1993
+ x_daytona_organization_id=x_daytona_organization_id,
1994
+ verbose=verbose,
1995
+ labels=labels,
1996
+ _request_auth=_request_auth,
1997
+ _content_type=_content_type,
1998
+ _headers=_headers,
1999
+ _host_index=_host_index,
2000
+ )
2001
+
2002
+ _response_types_map: Dict[str, Optional[str]] = {
2003
+ "200": "List[Sandbox]",
2004
+ }
2005
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2006
+ return response_data.response
2007
+
2008
+ def _list_sandboxes_serialize(
2009
+ self,
2010
+ x_daytona_organization_id,
2011
+ verbose,
2012
+ labels,
2013
+ _request_auth,
2014
+ _content_type,
2015
+ _headers,
2016
+ _host_index,
2017
+ ) -> RequestSerialized:
2018
+ _host = None
2019
+
2020
+ _collection_formats: Dict[str, str] = {}
2021
+
2022
+ _path_params: Dict[str, str] = {}
2023
+ _query_params: List[Tuple[str, str]] = []
2024
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2025
+ _form_params: List[Tuple[str, str]] = []
2026
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2027
+ _body_params: Optional[bytes] = None
2028
+
2029
+ # process the path parameters
2030
+ # process the query parameters
2031
+ if verbose is not None:
2032
+ _query_params.append(("verbose", verbose))
2033
+
2034
+ if labels is not None:
2035
+ _query_params.append(("labels", labels))
2036
+
2037
+ # process the header parameters
2038
+ if x_daytona_organization_id is not None:
2039
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
2040
+ # process the form parameters
2041
+ # process the body parameter
2042
+
2043
+ # set the HTTP header `Accept`
2044
+ if "Accept" not in _header_params:
2045
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2046
+
2047
+ # authentication setting
2048
+ _auth_settings: List[str] = ["bearer", "oauth2"]
2049
+
2050
+ return self.api_client.param_serialize(
2051
+ method="GET",
2052
+ resource_path="/sandbox",
2053
+ path_params=_path_params,
2054
+ query_params=_query_params,
2055
+ header_params=_header_params,
2056
+ body=_body_params,
2057
+ post_params=_form_params,
2058
+ files=_files,
2059
+ auth_settings=_auth_settings,
2060
+ collection_formats=_collection_formats,
2061
+ _host=_host,
2062
+ _request_auth=_request_auth,
2063
+ )
2064
+
2065
+ @validate_call
2066
+ def replace_labels(
2067
+ self,
2068
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2069
+ sandbox_labels: SandboxLabels,
2070
+ x_daytona_organization_id: Annotated[
2071
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2072
+ ] = None,
2073
+ _request_timeout: Union[
2074
+ None,
2075
+ Annotated[StrictFloat, Field(gt=0)],
2076
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2077
+ ] = None,
2078
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2079
+ _content_type: Optional[StrictStr] = None,
2080
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2081
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2082
+ ) -> SandboxLabels:
2083
+ """Replace sandbox labels
2084
+
2085
+
2086
+ :param sandbox_id: ID of the sandbox (required)
2087
+ :type sandbox_id: str
2088
+ :param sandbox_labels: (required)
2089
+ :type sandbox_labels: SandboxLabels
2090
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2091
+ :type x_daytona_organization_id: str
2092
+ :param _request_timeout: timeout setting for this request. If one
2093
+ number provided, it will be total request
2094
+ timeout. It can also be a pair (tuple) of
2095
+ (connection, read) timeouts.
2096
+ :type _request_timeout: int, tuple(int, int), optional
2097
+ :param _request_auth: set to override the auth_settings for an a single
2098
+ request; this effectively ignores the
2099
+ authentication in the spec for a single request.
2100
+ :type _request_auth: dict, optional
2101
+ :param _content_type: force content-type for the request.
2102
+ :type _content_type: str, Optional
2103
+ :param _headers: set to override the headers for a single
2104
+ request; this effectively ignores the headers
2105
+ in the spec for a single request.
2106
+ :type _headers: dict, optional
2107
+ :param _host_index: set to override the host_index for a single
2108
+ request; this effectively ignores the host_index
2109
+ in the spec for a single request.
2110
+ :type _host_index: int, optional
2111
+ :return: Returns the result object.
2112
+ """ # noqa: E501
2113
+
2114
+ _param = self._replace_labels_serialize(
2115
+ sandbox_id=sandbox_id,
2116
+ sandbox_labels=sandbox_labels,
2117
+ x_daytona_organization_id=x_daytona_organization_id,
2118
+ _request_auth=_request_auth,
2119
+ _content_type=_content_type,
2120
+ _headers=_headers,
2121
+ _host_index=_host_index,
2122
+ )
2123
+
2124
+ _response_types_map: Dict[str, Optional[str]] = {
2125
+ "200": "SandboxLabels",
2126
+ }
2127
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2128
+ response_data.read()
2129
+ return self.api_client.response_deserialize(
2130
+ response_data=response_data,
2131
+ response_types_map=_response_types_map,
2132
+ ).data
2133
+
2134
+ @validate_call
2135
+ def replace_labels_with_http_info(
2136
+ self,
2137
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2138
+ sandbox_labels: SandboxLabels,
2139
+ x_daytona_organization_id: Annotated[
2140
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2141
+ ] = None,
2142
+ _request_timeout: Union[
2143
+ None,
2144
+ Annotated[StrictFloat, Field(gt=0)],
2145
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2146
+ ] = None,
2147
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2148
+ _content_type: Optional[StrictStr] = None,
2149
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2150
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2151
+ ) -> ApiResponse[SandboxLabels]:
2152
+ """Replace sandbox labels
2153
+
2154
+
2155
+ :param sandbox_id: ID of the sandbox (required)
2156
+ :type sandbox_id: str
2157
+ :param sandbox_labels: (required)
2158
+ :type sandbox_labels: SandboxLabels
2159
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2160
+ :type x_daytona_organization_id: str
2161
+ :param _request_timeout: timeout setting for this request. If one
2162
+ number provided, it will be total request
2163
+ timeout. It can also be a pair (tuple) of
2164
+ (connection, read) timeouts.
2165
+ :type _request_timeout: int, tuple(int, int), optional
2166
+ :param _request_auth: set to override the auth_settings for an a single
2167
+ request; this effectively ignores the
2168
+ authentication in the spec for a single request.
2169
+ :type _request_auth: dict, optional
2170
+ :param _content_type: force content-type for the request.
2171
+ :type _content_type: str, Optional
2172
+ :param _headers: set to override the headers for a single
2173
+ request; this effectively ignores the headers
2174
+ in the spec for a single request.
2175
+ :type _headers: dict, optional
2176
+ :param _host_index: set to override the host_index for a single
2177
+ request; this effectively ignores the host_index
2178
+ in the spec for a single request.
2179
+ :type _host_index: int, optional
2180
+ :return: Returns the result object.
2181
+ """ # noqa: E501
2182
+
2183
+ _param = self._replace_labels_serialize(
2184
+ sandbox_id=sandbox_id,
2185
+ sandbox_labels=sandbox_labels,
2186
+ x_daytona_organization_id=x_daytona_organization_id,
2187
+ _request_auth=_request_auth,
2188
+ _content_type=_content_type,
2189
+ _headers=_headers,
2190
+ _host_index=_host_index,
2191
+ )
2192
+
2193
+ _response_types_map: Dict[str, Optional[str]] = {
2194
+ "200": "SandboxLabels",
2195
+ }
2196
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2197
+ response_data.read()
2198
+ return self.api_client.response_deserialize(
2199
+ response_data=response_data,
2200
+ response_types_map=_response_types_map,
2201
+ )
2202
+
2203
+ @validate_call
2204
+ def replace_labels_without_preload_content(
2205
+ self,
2206
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2207
+ sandbox_labels: SandboxLabels,
2208
+ x_daytona_organization_id: Annotated[
2209
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2210
+ ] = None,
2211
+ _request_timeout: Union[
2212
+ None,
2213
+ Annotated[StrictFloat, Field(gt=0)],
2214
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2215
+ ] = None,
2216
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2217
+ _content_type: Optional[StrictStr] = None,
2218
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2219
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2220
+ ) -> RESTResponseType:
2221
+ """Replace sandbox labels
2222
+
2223
+
2224
+ :param sandbox_id: ID of the sandbox (required)
2225
+ :type sandbox_id: str
2226
+ :param sandbox_labels: (required)
2227
+ :type sandbox_labels: SandboxLabels
2228
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2229
+ :type x_daytona_organization_id: str
2230
+ :param _request_timeout: timeout setting for this request. If one
2231
+ number provided, it will be total request
2232
+ timeout. It can also be a pair (tuple) of
2233
+ (connection, read) timeouts.
2234
+ :type _request_timeout: int, tuple(int, int), optional
2235
+ :param _request_auth: set to override the auth_settings for an a single
2236
+ request; this effectively ignores the
2237
+ authentication in the spec for a single request.
2238
+ :type _request_auth: dict, optional
2239
+ :param _content_type: force content-type for the request.
2240
+ :type _content_type: str, Optional
2241
+ :param _headers: set to override the headers for a single
2242
+ request; this effectively ignores the headers
2243
+ in the spec for a single request.
2244
+ :type _headers: dict, optional
2245
+ :param _host_index: set to override the host_index for a single
2246
+ request; this effectively ignores the host_index
2247
+ in the spec for a single request.
2248
+ :type _host_index: int, optional
2249
+ :return: Returns the result object.
2250
+ """ # noqa: E501
2251
+
2252
+ _param = self._replace_labels_serialize(
2253
+ sandbox_id=sandbox_id,
2254
+ sandbox_labels=sandbox_labels,
2255
+ x_daytona_organization_id=x_daytona_organization_id,
2256
+ _request_auth=_request_auth,
2257
+ _content_type=_content_type,
2258
+ _headers=_headers,
2259
+ _host_index=_host_index,
2260
+ )
2261
+
2262
+ _response_types_map: Dict[str, Optional[str]] = {
2263
+ "200": "SandboxLabels",
2264
+ }
2265
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2266
+ return response_data.response
2267
+
2268
+ def _replace_labels_serialize(
2269
+ self,
2270
+ sandbox_id,
2271
+ sandbox_labels,
2272
+ x_daytona_organization_id,
2273
+ _request_auth,
2274
+ _content_type,
2275
+ _headers,
2276
+ _host_index,
2277
+ ) -> RequestSerialized:
2278
+ _host = None
2279
+
2280
+ _collection_formats: Dict[str, str] = {}
2281
+
2282
+ _path_params: Dict[str, str] = {}
2283
+ _query_params: List[Tuple[str, str]] = []
2284
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2285
+ _form_params: List[Tuple[str, str]] = []
2286
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2287
+ _body_params: Optional[bytes] = None
2288
+
2289
+ # process the path parameters
2290
+ if sandbox_id is not None:
2291
+ _path_params["sandboxId"] = sandbox_id
2292
+ # process the query parameters
2293
+ # process the header parameters
2294
+ if x_daytona_organization_id is not None:
2295
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
2296
+ # process the form parameters
2297
+ # process the body parameter
2298
+ if sandbox_labels is not None:
2299
+ _body_params = sandbox_labels
2300
+
2301
+ # set the HTTP header `Accept`
2302
+ if "Accept" not in _header_params:
2303
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2304
+
2305
+ # set the HTTP header `Content-Type`
2306
+ if _content_type:
2307
+ _header_params["Content-Type"] = _content_type
2308
+ else:
2309
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
2310
+ if _default_content_type is not None:
2311
+ _header_params["Content-Type"] = _default_content_type
2312
+
2313
+ # authentication setting
2314
+ _auth_settings: List[str] = ["bearer", "oauth2"]
2315
+
2316
+ return self.api_client.param_serialize(
2317
+ method="PUT",
2318
+ resource_path="/sandbox/{sandboxId}/labels",
2319
+ path_params=_path_params,
2320
+ query_params=_query_params,
2321
+ header_params=_header_params,
2322
+ body=_body_params,
2323
+ post_params=_form_params,
2324
+ files=_files,
2325
+ auth_settings=_auth_settings,
2326
+ collection_formats=_collection_formats,
2327
+ _host=_host,
2328
+ _request_auth=_request_auth,
2329
+ )
2330
+
2331
+ @validate_call
2332
+ def set_auto_archive_interval(
2333
+ self,
2334
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2335
+ interval: Annotated[
2336
+ Union[StrictFloat, StrictInt],
2337
+ Field(description="Auto-archive interval in minutes (0 means the maximum interval will be used)"),
2338
+ ],
2339
+ x_daytona_organization_id: Annotated[
2340
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2341
+ ] = None,
2342
+ _request_timeout: Union[
2343
+ None,
2344
+ Annotated[StrictFloat, Field(gt=0)],
2345
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2346
+ ] = None,
2347
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2348
+ _content_type: Optional[StrictStr] = None,
2349
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2350
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2351
+ ) -> None:
2352
+ """Set sandbox auto-archive interval
2353
+
2354
+
2355
+ :param sandbox_id: ID of the sandbox (required)
2356
+ :type sandbox_id: str
2357
+ :param interval: Auto-archive interval in minutes (0 means the maximum interval will be used) (required)
2358
+ :type interval: float
2359
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2360
+ :type x_daytona_organization_id: str
2361
+ :param _request_timeout: timeout setting for this request. If one
2362
+ number provided, it will be total request
2363
+ timeout. It can also be a pair (tuple) of
2364
+ (connection, read) timeouts.
2365
+ :type _request_timeout: int, tuple(int, int), optional
2366
+ :param _request_auth: set to override the auth_settings for an a single
2367
+ request; this effectively ignores the
2368
+ authentication in the spec for a single request.
2369
+ :type _request_auth: dict, optional
2370
+ :param _content_type: force content-type for the request.
2371
+ :type _content_type: str, Optional
2372
+ :param _headers: set to override the headers for a single
2373
+ request; this effectively ignores the headers
2374
+ in the spec for a single request.
2375
+ :type _headers: dict, optional
2376
+ :param _host_index: set to override the host_index for a single
2377
+ request; this effectively ignores the host_index
2378
+ in the spec for a single request.
2379
+ :type _host_index: int, optional
2380
+ :return: Returns the result object.
2381
+ """ # noqa: E501
2382
+
2383
+ _param = self._set_auto_archive_interval_serialize(
2384
+ sandbox_id=sandbox_id,
2385
+ interval=interval,
2386
+ x_daytona_organization_id=x_daytona_organization_id,
2387
+ _request_auth=_request_auth,
2388
+ _content_type=_content_type,
2389
+ _headers=_headers,
2390
+ _host_index=_host_index,
2391
+ )
2392
+
2393
+ _response_types_map: Dict[str, Optional[str]] = {
2394
+ "200": None,
2395
+ }
2396
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2397
+ response_data.read()
2398
+ return self.api_client.response_deserialize(
2399
+ response_data=response_data,
2400
+ response_types_map=_response_types_map,
2401
+ ).data
2402
+
2403
+ @validate_call
2404
+ def set_auto_archive_interval_with_http_info(
2405
+ self,
2406
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2407
+ interval: Annotated[
2408
+ Union[StrictFloat, StrictInt],
2409
+ Field(description="Auto-archive interval in minutes (0 means the maximum interval will be used)"),
2410
+ ],
2411
+ x_daytona_organization_id: Annotated[
2412
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2413
+ ] = None,
2414
+ _request_timeout: Union[
2415
+ None,
2416
+ Annotated[StrictFloat, Field(gt=0)],
2417
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2418
+ ] = None,
2419
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2420
+ _content_type: Optional[StrictStr] = None,
2421
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2422
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2423
+ ) -> ApiResponse[None]:
2424
+ """Set sandbox auto-archive interval
2425
+
2426
+
2427
+ :param sandbox_id: ID of the sandbox (required)
2428
+ :type sandbox_id: str
2429
+ :param interval: Auto-archive interval in minutes (0 means the maximum interval will be used) (required)
2430
+ :type interval: float
2431
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2432
+ :type x_daytona_organization_id: str
2433
+ :param _request_timeout: timeout setting for this request. If one
2434
+ number provided, it will be total request
2435
+ timeout. It can also be a pair (tuple) of
2436
+ (connection, read) timeouts.
2437
+ :type _request_timeout: int, tuple(int, int), optional
2438
+ :param _request_auth: set to override the auth_settings for an a single
2439
+ request; this effectively ignores the
2440
+ authentication in the spec for a single request.
2441
+ :type _request_auth: dict, optional
2442
+ :param _content_type: force content-type for the request.
2443
+ :type _content_type: str, Optional
2444
+ :param _headers: set to override the headers for a single
2445
+ request; this effectively ignores the headers
2446
+ in the spec for a single request.
2447
+ :type _headers: dict, optional
2448
+ :param _host_index: set to override the host_index for a single
2449
+ request; this effectively ignores the host_index
2450
+ in the spec for a single request.
2451
+ :type _host_index: int, optional
2452
+ :return: Returns the result object.
2453
+ """ # noqa: E501
2454
+
2455
+ _param = self._set_auto_archive_interval_serialize(
2456
+ sandbox_id=sandbox_id,
2457
+ interval=interval,
2458
+ x_daytona_organization_id=x_daytona_organization_id,
2459
+ _request_auth=_request_auth,
2460
+ _content_type=_content_type,
2461
+ _headers=_headers,
2462
+ _host_index=_host_index,
2463
+ )
2464
+
2465
+ _response_types_map: Dict[str, Optional[str]] = {
2466
+ "200": None,
2467
+ }
2468
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2469
+ response_data.read()
2470
+ return self.api_client.response_deserialize(
2471
+ response_data=response_data,
2472
+ response_types_map=_response_types_map,
2473
+ )
2474
+
2475
+ @validate_call
2476
+ def set_auto_archive_interval_without_preload_content(
2477
+ self,
2478
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2479
+ interval: Annotated[
2480
+ Union[StrictFloat, StrictInt],
2481
+ Field(description="Auto-archive interval in minutes (0 means the maximum interval will be used)"),
2482
+ ],
2483
+ x_daytona_organization_id: Annotated[
2484
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2485
+ ] = None,
2486
+ _request_timeout: Union[
2487
+ None,
2488
+ Annotated[StrictFloat, Field(gt=0)],
2489
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2490
+ ] = None,
2491
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2492
+ _content_type: Optional[StrictStr] = None,
2493
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2494
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2495
+ ) -> RESTResponseType:
2496
+ """Set sandbox auto-archive interval
2497
+
2498
+
2499
+ :param sandbox_id: ID of the sandbox (required)
2500
+ :type sandbox_id: str
2501
+ :param interval: Auto-archive interval in minutes (0 means the maximum interval will be used) (required)
2502
+ :type interval: float
2503
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2504
+ :type x_daytona_organization_id: str
2505
+ :param _request_timeout: timeout setting for this request. If one
2506
+ number provided, it will be total request
2507
+ timeout. It can also be a pair (tuple) of
2508
+ (connection, read) timeouts.
2509
+ :type _request_timeout: int, tuple(int, int), optional
2510
+ :param _request_auth: set to override the auth_settings for an a single
2511
+ request; this effectively ignores the
2512
+ authentication in the spec for a single request.
2513
+ :type _request_auth: dict, optional
2514
+ :param _content_type: force content-type for the request.
2515
+ :type _content_type: str, Optional
2516
+ :param _headers: set to override the headers for a single
2517
+ request; this effectively ignores the headers
2518
+ in the spec for a single request.
2519
+ :type _headers: dict, optional
2520
+ :param _host_index: set to override the host_index for a single
2521
+ request; this effectively ignores the host_index
2522
+ in the spec for a single request.
2523
+ :type _host_index: int, optional
2524
+ :return: Returns the result object.
2525
+ """ # noqa: E501
2526
+
2527
+ _param = self._set_auto_archive_interval_serialize(
2528
+ sandbox_id=sandbox_id,
2529
+ interval=interval,
2530
+ x_daytona_organization_id=x_daytona_organization_id,
2531
+ _request_auth=_request_auth,
2532
+ _content_type=_content_type,
2533
+ _headers=_headers,
2534
+ _host_index=_host_index,
2535
+ )
2536
+
2537
+ _response_types_map: Dict[str, Optional[str]] = {
2538
+ "200": None,
2539
+ }
2540
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2541
+ return response_data.response
2542
+
2543
+ def _set_auto_archive_interval_serialize(
2544
+ self,
2545
+ sandbox_id,
2546
+ interval,
2547
+ x_daytona_organization_id,
2548
+ _request_auth,
2549
+ _content_type,
2550
+ _headers,
2551
+ _host_index,
2552
+ ) -> RequestSerialized:
2553
+ _host = None
2554
+
2555
+ _collection_formats: Dict[str, str] = {}
2556
+
2557
+ _path_params: Dict[str, str] = {}
2558
+ _query_params: List[Tuple[str, str]] = []
2559
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2560
+ _form_params: List[Tuple[str, str]] = []
2561
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2562
+ _body_params: Optional[bytes] = None
2563
+
2564
+ # process the path parameters
2565
+ if sandbox_id is not None:
2566
+ _path_params["sandboxId"] = sandbox_id
2567
+ if interval is not None:
2568
+ _path_params["interval"] = interval
2569
+ # process the query parameters
2570
+ # process the header parameters
2571
+ if x_daytona_organization_id is not None:
2572
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
2573
+ # process the form parameters
2574
+ # process the body parameter
2575
+
2576
+ # authentication setting
2577
+ _auth_settings: List[str] = ["bearer", "oauth2"]
2578
+
2579
+ return self.api_client.param_serialize(
2580
+ method="POST",
2581
+ resource_path="/sandbox/{sandboxId}/autoarchive/{interval}",
2582
+ path_params=_path_params,
2583
+ query_params=_query_params,
2584
+ header_params=_header_params,
2585
+ body=_body_params,
2586
+ post_params=_form_params,
2587
+ files=_files,
2588
+ auth_settings=_auth_settings,
2589
+ collection_formats=_collection_formats,
2590
+ _host=_host,
2591
+ _request_auth=_request_auth,
2592
+ )
2593
+
2594
+ @validate_call
2595
+ def set_autostop_interval(
2596
+ self,
2597
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2598
+ interval: Annotated[
2599
+ Union[StrictFloat, StrictInt], Field(description="Auto-stop interval in minutes (0 to disable)")
2600
+ ],
2601
+ x_daytona_organization_id: Annotated[
2602
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2603
+ ] = None,
2604
+ _request_timeout: Union[
2605
+ None,
2606
+ Annotated[StrictFloat, Field(gt=0)],
2607
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2608
+ ] = None,
2609
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2610
+ _content_type: Optional[StrictStr] = None,
2611
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2612
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2613
+ ) -> None:
2614
+ """Set sandbox auto-stop interval
2615
+
2616
+
2617
+ :param sandbox_id: ID of the sandbox (required)
2618
+ :type sandbox_id: str
2619
+ :param interval: Auto-stop interval in minutes (0 to disable) (required)
2620
+ :type interval: float
2621
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2622
+ :type x_daytona_organization_id: str
2623
+ :param _request_timeout: timeout setting for this request. If one
2624
+ number provided, it will be total request
2625
+ timeout. It can also be a pair (tuple) of
2626
+ (connection, read) timeouts.
2627
+ :type _request_timeout: int, tuple(int, int), optional
2628
+ :param _request_auth: set to override the auth_settings for an a single
2629
+ request; this effectively ignores the
2630
+ authentication in the spec for a single request.
2631
+ :type _request_auth: dict, optional
2632
+ :param _content_type: force content-type for the request.
2633
+ :type _content_type: str, Optional
2634
+ :param _headers: set to override the headers for a single
2635
+ request; this effectively ignores the headers
2636
+ in the spec for a single request.
2637
+ :type _headers: dict, optional
2638
+ :param _host_index: set to override the host_index for a single
2639
+ request; this effectively ignores the host_index
2640
+ in the spec for a single request.
2641
+ :type _host_index: int, optional
2642
+ :return: Returns the result object.
2643
+ """ # noqa: E501
2644
+
2645
+ _param = self._set_autostop_interval_serialize(
2646
+ sandbox_id=sandbox_id,
2647
+ interval=interval,
2648
+ x_daytona_organization_id=x_daytona_organization_id,
2649
+ _request_auth=_request_auth,
2650
+ _content_type=_content_type,
2651
+ _headers=_headers,
2652
+ _host_index=_host_index,
2653
+ )
2654
+
2655
+ _response_types_map: Dict[str, Optional[str]] = {
2656
+ "200": None,
2657
+ }
2658
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2659
+ response_data.read()
2660
+ return self.api_client.response_deserialize(
2661
+ response_data=response_data,
2662
+ response_types_map=_response_types_map,
2663
+ ).data
2664
+
2665
+ @validate_call
2666
+ def set_autostop_interval_with_http_info(
2667
+ self,
2668
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2669
+ interval: Annotated[
2670
+ Union[StrictFloat, StrictInt], Field(description="Auto-stop interval in minutes (0 to disable)")
2671
+ ],
2672
+ x_daytona_organization_id: Annotated[
2673
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2674
+ ] = None,
2675
+ _request_timeout: Union[
2676
+ None,
2677
+ Annotated[StrictFloat, Field(gt=0)],
2678
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2679
+ ] = None,
2680
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2681
+ _content_type: Optional[StrictStr] = None,
2682
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2683
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2684
+ ) -> ApiResponse[None]:
2685
+ """Set sandbox auto-stop interval
2686
+
2687
+
2688
+ :param sandbox_id: ID of the sandbox (required)
2689
+ :type sandbox_id: str
2690
+ :param interval: Auto-stop interval in minutes (0 to disable) (required)
2691
+ :type interval: float
2692
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2693
+ :type x_daytona_organization_id: str
2694
+ :param _request_timeout: timeout setting for this request. If one
2695
+ number provided, it will be total request
2696
+ timeout. It can also be a pair (tuple) of
2697
+ (connection, read) timeouts.
2698
+ :type _request_timeout: int, tuple(int, int), optional
2699
+ :param _request_auth: set to override the auth_settings for an a single
2700
+ request; this effectively ignores the
2701
+ authentication in the spec for a single request.
2702
+ :type _request_auth: dict, optional
2703
+ :param _content_type: force content-type for the request.
2704
+ :type _content_type: str, Optional
2705
+ :param _headers: set to override the headers for a single
2706
+ request; this effectively ignores the headers
2707
+ in the spec for a single request.
2708
+ :type _headers: dict, optional
2709
+ :param _host_index: set to override the host_index for a single
2710
+ request; this effectively ignores the host_index
2711
+ in the spec for a single request.
2712
+ :type _host_index: int, optional
2713
+ :return: Returns the result object.
2714
+ """ # noqa: E501
2715
+
2716
+ _param = self._set_autostop_interval_serialize(
2717
+ sandbox_id=sandbox_id,
2718
+ interval=interval,
2719
+ x_daytona_organization_id=x_daytona_organization_id,
2720
+ _request_auth=_request_auth,
2721
+ _content_type=_content_type,
2722
+ _headers=_headers,
2723
+ _host_index=_host_index,
2724
+ )
2725
+
2726
+ _response_types_map: Dict[str, Optional[str]] = {
2727
+ "200": None,
2728
+ }
2729
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2730
+ response_data.read()
2731
+ return self.api_client.response_deserialize(
2732
+ response_data=response_data,
2733
+ response_types_map=_response_types_map,
2734
+ )
2735
+
2736
+ @validate_call
2737
+ def set_autostop_interval_without_preload_content(
2738
+ self,
2739
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2740
+ interval: Annotated[
2741
+ Union[StrictFloat, StrictInt], Field(description="Auto-stop interval in minutes (0 to disable)")
2742
+ ],
2743
+ x_daytona_organization_id: Annotated[
2744
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2745
+ ] = None,
2746
+ _request_timeout: Union[
2747
+ None,
2748
+ Annotated[StrictFloat, Field(gt=0)],
2749
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2750
+ ] = None,
2751
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2752
+ _content_type: Optional[StrictStr] = None,
2753
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2754
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2755
+ ) -> RESTResponseType:
2756
+ """Set sandbox auto-stop interval
2757
+
2758
+
2759
+ :param sandbox_id: ID of the sandbox (required)
2760
+ :type sandbox_id: str
2761
+ :param interval: Auto-stop interval in minutes (0 to disable) (required)
2762
+ :type interval: float
2763
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2764
+ :type x_daytona_organization_id: str
2765
+ :param _request_timeout: timeout setting for this request. If one
2766
+ number provided, it will be total request
2767
+ timeout. It can also be a pair (tuple) of
2768
+ (connection, read) timeouts.
2769
+ :type _request_timeout: int, tuple(int, int), optional
2770
+ :param _request_auth: set to override the auth_settings for an a single
2771
+ request; this effectively ignores the
2772
+ authentication in the spec for a single request.
2773
+ :type _request_auth: dict, optional
2774
+ :param _content_type: force content-type for the request.
2775
+ :type _content_type: str, Optional
2776
+ :param _headers: set to override the headers for a single
2777
+ request; this effectively ignores the headers
2778
+ in the spec for a single request.
2779
+ :type _headers: dict, optional
2780
+ :param _host_index: set to override the host_index for a single
2781
+ request; this effectively ignores the host_index
2782
+ in the spec for a single request.
2783
+ :type _host_index: int, optional
2784
+ :return: Returns the result object.
2785
+ """ # noqa: E501
2786
+
2787
+ _param = self._set_autostop_interval_serialize(
2788
+ sandbox_id=sandbox_id,
2789
+ interval=interval,
2790
+ x_daytona_organization_id=x_daytona_organization_id,
2791
+ _request_auth=_request_auth,
2792
+ _content_type=_content_type,
2793
+ _headers=_headers,
2794
+ _host_index=_host_index,
2795
+ )
2796
+
2797
+ _response_types_map: Dict[str, Optional[str]] = {
2798
+ "200": None,
2799
+ }
2800
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2801
+ return response_data.response
2802
+
2803
+ def _set_autostop_interval_serialize(
2804
+ self,
2805
+ sandbox_id,
2806
+ interval,
2807
+ x_daytona_organization_id,
2808
+ _request_auth,
2809
+ _content_type,
2810
+ _headers,
2811
+ _host_index,
2812
+ ) -> RequestSerialized:
2813
+ _host = None
2814
+
2815
+ _collection_formats: Dict[str, str] = {}
2816
+
2817
+ _path_params: Dict[str, str] = {}
2818
+ _query_params: List[Tuple[str, str]] = []
2819
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2820
+ _form_params: List[Tuple[str, str]] = []
2821
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
2822
+ _body_params: Optional[bytes] = None
2823
+
2824
+ # process the path parameters
2825
+ if sandbox_id is not None:
2826
+ _path_params["sandboxId"] = sandbox_id
2827
+ if interval is not None:
2828
+ _path_params["interval"] = interval
2829
+ # process the query parameters
2830
+ # process the header parameters
2831
+ if x_daytona_organization_id is not None:
2832
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
2833
+ # process the form parameters
2834
+ # process the body parameter
2835
+
2836
+ # authentication setting
2837
+ _auth_settings: List[str] = ["bearer", "oauth2"]
2838
+
2839
+ return self.api_client.param_serialize(
2840
+ method="POST",
2841
+ resource_path="/sandbox/{sandboxId}/autostop/{interval}",
2842
+ path_params=_path_params,
2843
+ query_params=_query_params,
2844
+ header_params=_header_params,
2845
+ body=_body_params,
2846
+ post_params=_form_params,
2847
+ files=_files,
2848
+ auth_settings=_auth_settings,
2849
+ collection_formats=_collection_formats,
2850
+ _host=_host,
2851
+ _request_auth=_request_auth,
2852
+ )
2853
+
2854
+ @validate_call
2855
+ def start_sandbox(
2856
+ self,
2857
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2858
+ x_daytona_organization_id: Annotated[
2859
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2860
+ ] = None,
2861
+ _request_timeout: Union[
2862
+ None,
2863
+ Annotated[StrictFloat, Field(gt=0)],
2864
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2865
+ ] = None,
2866
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2867
+ _content_type: Optional[StrictStr] = None,
2868
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2869
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2870
+ ) -> None:
2871
+ """Start sandbox
2872
+
2873
+
2874
+ :param sandbox_id: ID of the sandbox (required)
2875
+ :type sandbox_id: str
2876
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2877
+ :type x_daytona_organization_id: str
2878
+ :param _request_timeout: timeout setting for this request. If one
2879
+ number provided, it will be total request
2880
+ timeout. It can also be a pair (tuple) of
2881
+ (connection, read) timeouts.
2882
+ :type _request_timeout: int, tuple(int, int), optional
2883
+ :param _request_auth: set to override the auth_settings for an a single
2884
+ request; this effectively ignores the
2885
+ authentication in the spec for a single request.
2886
+ :type _request_auth: dict, optional
2887
+ :param _content_type: force content-type for the request.
2888
+ :type _content_type: str, Optional
2889
+ :param _headers: set to override the headers for a single
2890
+ request; this effectively ignores the headers
2891
+ in the spec for a single request.
2892
+ :type _headers: dict, optional
2893
+ :param _host_index: set to override the host_index for a single
2894
+ request; this effectively ignores the host_index
2895
+ in the spec for a single request.
2896
+ :type _host_index: int, optional
2897
+ :return: Returns the result object.
2898
+ """ # noqa: E501
2899
+
2900
+ _param = self._start_sandbox_serialize(
2901
+ sandbox_id=sandbox_id,
2902
+ x_daytona_organization_id=x_daytona_organization_id,
2903
+ _request_auth=_request_auth,
2904
+ _content_type=_content_type,
2905
+ _headers=_headers,
2906
+ _host_index=_host_index,
2907
+ )
2908
+
2909
+ _response_types_map: Dict[str, Optional[str]] = {
2910
+ "200": None,
2911
+ }
2912
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2913
+ response_data.read()
2914
+ return self.api_client.response_deserialize(
2915
+ response_data=response_data,
2916
+ response_types_map=_response_types_map,
2917
+ ).data
2918
+
2919
+ @validate_call
2920
+ def start_sandbox_with_http_info(
2921
+ self,
2922
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2923
+ x_daytona_organization_id: Annotated[
2924
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2925
+ ] = None,
2926
+ _request_timeout: Union[
2927
+ None,
2928
+ Annotated[StrictFloat, Field(gt=0)],
2929
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2930
+ ] = None,
2931
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2932
+ _content_type: Optional[StrictStr] = None,
2933
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2934
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2935
+ ) -> ApiResponse[None]:
2936
+ """Start sandbox
2937
+
2938
+
2939
+ :param sandbox_id: ID of the sandbox (required)
2940
+ :type sandbox_id: str
2941
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
2942
+ :type x_daytona_organization_id: str
2943
+ :param _request_timeout: timeout setting for this request. If one
2944
+ number provided, it will be total request
2945
+ timeout. It can also be a pair (tuple) of
2946
+ (connection, read) timeouts.
2947
+ :type _request_timeout: int, tuple(int, int), optional
2948
+ :param _request_auth: set to override the auth_settings for an a single
2949
+ request; this effectively ignores the
2950
+ authentication in the spec for a single request.
2951
+ :type _request_auth: dict, optional
2952
+ :param _content_type: force content-type for the request.
2953
+ :type _content_type: str, Optional
2954
+ :param _headers: set to override the headers for a single
2955
+ request; this effectively ignores the headers
2956
+ in the spec for a single request.
2957
+ :type _headers: dict, optional
2958
+ :param _host_index: set to override the host_index for a single
2959
+ request; this effectively ignores the host_index
2960
+ in the spec for a single request.
2961
+ :type _host_index: int, optional
2962
+ :return: Returns the result object.
2963
+ """ # noqa: E501
2964
+
2965
+ _param = self._start_sandbox_serialize(
2966
+ sandbox_id=sandbox_id,
2967
+ x_daytona_organization_id=x_daytona_organization_id,
2968
+ _request_auth=_request_auth,
2969
+ _content_type=_content_type,
2970
+ _headers=_headers,
2971
+ _host_index=_host_index,
2972
+ )
2973
+
2974
+ _response_types_map: Dict[str, Optional[str]] = {
2975
+ "200": None,
2976
+ }
2977
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2978
+ response_data.read()
2979
+ return self.api_client.response_deserialize(
2980
+ response_data=response_data,
2981
+ response_types_map=_response_types_map,
2982
+ )
2983
+
2984
+ @validate_call
2985
+ def start_sandbox_without_preload_content(
2986
+ self,
2987
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
2988
+ x_daytona_organization_id: Annotated[
2989
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
2990
+ ] = None,
2991
+ _request_timeout: Union[
2992
+ None,
2993
+ Annotated[StrictFloat, Field(gt=0)],
2994
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2995
+ ] = None,
2996
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2997
+ _content_type: Optional[StrictStr] = None,
2998
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2999
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3000
+ ) -> RESTResponseType:
3001
+ """Start sandbox
3002
+
3003
+
3004
+ :param sandbox_id: ID of the sandbox (required)
3005
+ :type sandbox_id: str
3006
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3007
+ :type x_daytona_organization_id: str
3008
+ :param _request_timeout: timeout setting for this request. If one
3009
+ number provided, it will be total request
3010
+ timeout. It can also be a pair (tuple) of
3011
+ (connection, read) timeouts.
3012
+ :type _request_timeout: int, tuple(int, int), optional
3013
+ :param _request_auth: set to override the auth_settings for an a single
3014
+ request; this effectively ignores the
3015
+ authentication in the spec for a single request.
3016
+ :type _request_auth: dict, optional
3017
+ :param _content_type: force content-type for the request.
3018
+ :type _content_type: str, Optional
3019
+ :param _headers: set to override the headers for a single
3020
+ request; this effectively ignores the headers
3021
+ in the spec for a single request.
3022
+ :type _headers: dict, optional
3023
+ :param _host_index: set to override the host_index for a single
3024
+ request; this effectively ignores the host_index
3025
+ in the spec for a single request.
3026
+ :type _host_index: int, optional
3027
+ :return: Returns the result object.
3028
+ """ # noqa: E501
3029
+
3030
+ _param = self._start_sandbox_serialize(
3031
+ sandbox_id=sandbox_id,
3032
+ x_daytona_organization_id=x_daytona_organization_id,
3033
+ _request_auth=_request_auth,
3034
+ _content_type=_content_type,
3035
+ _headers=_headers,
3036
+ _host_index=_host_index,
3037
+ )
3038
+
3039
+ _response_types_map: Dict[str, Optional[str]] = {
3040
+ "200": None,
3041
+ }
3042
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3043
+ return response_data.response
3044
+
3045
+ def _start_sandbox_serialize(
3046
+ self,
3047
+ sandbox_id,
3048
+ x_daytona_organization_id,
3049
+ _request_auth,
3050
+ _content_type,
3051
+ _headers,
3052
+ _host_index,
3053
+ ) -> RequestSerialized:
3054
+ _host = None
3055
+
3056
+ _collection_formats: Dict[str, str] = {}
3057
+
3058
+ _path_params: Dict[str, str] = {}
3059
+ _query_params: List[Tuple[str, str]] = []
3060
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3061
+ _form_params: List[Tuple[str, str]] = []
3062
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3063
+ _body_params: Optional[bytes] = None
3064
+
3065
+ # process the path parameters
3066
+ if sandbox_id is not None:
3067
+ _path_params["sandboxId"] = sandbox_id
3068
+ # process the query parameters
3069
+ # process the header parameters
3070
+ if x_daytona_organization_id is not None:
3071
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
3072
+ # process the form parameters
3073
+ # process the body parameter
3074
+
3075
+ # authentication setting
3076
+ _auth_settings: List[str] = ["bearer", "oauth2"]
3077
+
3078
+ return self.api_client.param_serialize(
3079
+ method="POST",
3080
+ resource_path="/sandbox/{sandboxId}/start",
3081
+ path_params=_path_params,
3082
+ query_params=_query_params,
3083
+ header_params=_header_params,
3084
+ body=_body_params,
3085
+ post_params=_form_params,
3086
+ files=_files,
3087
+ auth_settings=_auth_settings,
3088
+ collection_formats=_collection_formats,
3089
+ _host=_host,
3090
+ _request_auth=_request_auth,
3091
+ )
3092
+
3093
+ @validate_call
3094
+ def stop_sandbox(
3095
+ self,
3096
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3097
+ x_daytona_organization_id: Annotated[
3098
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3099
+ ] = None,
3100
+ _request_timeout: Union[
3101
+ None,
3102
+ Annotated[StrictFloat, Field(gt=0)],
3103
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3104
+ ] = None,
3105
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3106
+ _content_type: Optional[StrictStr] = None,
3107
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3108
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3109
+ ) -> None:
3110
+ """Stop sandbox
3111
+
3112
+
3113
+ :param sandbox_id: ID of the sandbox (required)
3114
+ :type sandbox_id: str
3115
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3116
+ :type x_daytona_organization_id: str
3117
+ :param _request_timeout: timeout setting for this request. If one
3118
+ number provided, it will be total request
3119
+ timeout. It can also be a pair (tuple) of
3120
+ (connection, read) timeouts.
3121
+ :type _request_timeout: int, tuple(int, int), optional
3122
+ :param _request_auth: set to override the auth_settings for an a single
3123
+ request; this effectively ignores the
3124
+ authentication in the spec for a single request.
3125
+ :type _request_auth: dict, optional
3126
+ :param _content_type: force content-type for the request.
3127
+ :type _content_type: str, Optional
3128
+ :param _headers: set to override the headers for a single
3129
+ request; this effectively ignores the headers
3130
+ in the spec for a single request.
3131
+ :type _headers: dict, optional
3132
+ :param _host_index: set to override the host_index for a single
3133
+ request; this effectively ignores the host_index
3134
+ in the spec for a single request.
3135
+ :type _host_index: int, optional
3136
+ :return: Returns the result object.
3137
+ """ # noqa: E501
3138
+
3139
+ _param = self._stop_sandbox_serialize(
3140
+ sandbox_id=sandbox_id,
3141
+ x_daytona_organization_id=x_daytona_organization_id,
3142
+ _request_auth=_request_auth,
3143
+ _content_type=_content_type,
3144
+ _headers=_headers,
3145
+ _host_index=_host_index,
3146
+ )
3147
+
3148
+ _response_types_map: Dict[str, Optional[str]] = {
3149
+ "200": None,
3150
+ }
3151
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3152
+ response_data.read()
3153
+ return self.api_client.response_deserialize(
3154
+ response_data=response_data,
3155
+ response_types_map=_response_types_map,
3156
+ ).data
3157
+
3158
+ @validate_call
3159
+ def stop_sandbox_with_http_info(
3160
+ self,
3161
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3162
+ x_daytona_organization_id: Annotated[
3163
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3164
+ ] = None,
3165
+ _request_timeout: Union[
3166
+ None,
3167
+ Annotated[StrictFloat, Field(gt=0)],
3168
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3169
+ ] = None,
3170
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3171
+ _content_type: Optional[StrictStr] = None,
3172
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3173
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3174
+ ) -> ApiResponse[None]:
3175
+ """Stop sandbox
3176
+
3177
+
3178
+ :param sandbox_id: ID of the sandbox (required)
3179
+ :type sandbox_id: str
3180
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3181
+ :type x_daytona_organization_id: str
3182
+ :param _request_timeout: timeout setting for this request. If one
3183
+ number provided, it will be total request
3184
+ timeout. It can also be a pair (tuple) of
3185
+ (connection, read) timeouts.
3186
+ :type _request_timeout: int, tuple(int, int), optional
3187
+ :param _request_auth: set to override the auth_settings for an a single
3188
+ request; this effectively ignores the
3189
+ authentication in the spec for a single request.
3190
+ :type _request_auth: dict, optional
3191
+ :param _content_type: force content-type for the request.
3192
+ :type _content_type: str, Optional
3193
+ :param _headers: set to override the headers for a single
3194
+ request; this effectively ignores the headers
3195
+ in the spec for a single request.
3196
+ :type _headers: dict, optional
3197
+ :param _host_index: set to override the host_index for a single
3198
+ request; this effectively ignores the host_index
3199
+ in the spec for a single request.
3200
+ :type _host_index: int, optional
3201
+ :return: Returns the result object.
3202
+ """ # noqa: E501
3203
+
3204
+ _param = self._stop_sandbox_serialize(
3205
+ sandbox_id=sandbox_id,
3206
+ x_daytona_organization_id=x_daytona_organization_id,
3207
+ _request_auth=_request_auth,
3208
+ _content_type=_content_type,
3209
+ _headers=_headers,
3210
+ _host_index=_host_index,
3211
+ )
3212
+
3213
+ _response_types_map: Dict[str, Optional[str]] = {
3214
+ "200": None,
3215
+ }
3216
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3217
+ response_data.read()
3218
+ return self.api_client.response_deserialize(
3219
+ response_data=response_data,
3220
+ response_types_map=_response_types_map,
3221
+ )
3222
+
3223
+ @validate_call
3224
+ def stop_sandbox_without_preload_content(
3225
+ self,
3226
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3227
+ x_daytona_organization_id: Annotated[
3228
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3229
+ ] = None,
3230
+ _request_timeout: Union[
3231
+ None,
3232
+ Annotated[StrictFloat, Field(gt=0)],
3233
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3234
+ ] = None,
3235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3236
+ _content_type: Optional[StrictStr] = None,
3237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3239
+ ) -> RESTResponseType:
3240
+ """Stop sandbox
3241
+
3242
+
3243
+ :param sandbox_id: ID of the sandbox (required)
3244
+ :type sandbox_id: str
3245
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3246
+ :type x_daytona_organization_id: str
3247
+ :param _request_timeout: timeout setting for this request. If one
3248
+ number provided, it will be total request
3249
+ timeout. It can also be a pair (tuple) of
3250
+ (connection, read) timeouts.
3251
+ :type _request_timeout: int, tuple(int, int), optional
3252
+ :param _request_auth: set to override the auth_settings for an a single
3253
+ request; this effectively ignores the
3254
+ authentication in the spec for a single request.
3255
+ :type _request_auth: dict, optional
3256
+ :param _content_type: force content-type for the request.
3257
+ :type _content_type: str, Optional
3258
+ :param _headers: set to override the headers for a single
3259
+ request; this effectively ignores the headers
3260
+ in the spec for a single request.
3261
+ :type _headers: dict, optional
3262
+ :param _host_index: set to override the host_index for a single
3263
+ request; this effectively ignores the host_index
3264
+ in the spec for a single request.
3265
+ :type _host_index: int, optional
3266
+ :return: Returns the result object.
3267
+ """ # noqa: E501
3268
+
3269
+ _param = self._stop_sandbox_serialize(
3270
+ sandbox_id=sandbox_id,
3271
+ x_daytona_organization_id=x_daytona_organization_id,
3272
+ _request_auth=_request_auth,
3273
+ _content_type=_content_type,
3274
+ _headers=_headers,
3275
+ _host_index=_host_index,
3276
+ )
3277
+
3278
+ _response_types_map: Dict[str, Optional[str]] = {
3279
+ "200": None,
3280
+ }
3281
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3282
+ return response_data.response
3283
+
3284
+ def _stop_sandbox_serialize(
3285
+ self,
3286
+ sandbox_id,
3287
+ x_daytona_organization_id,
3288
+ _request_auth,
3289
+ _content_type,
3290
+ _headers,
3291
+ _host_index,
3292
+ ) -> RequestSerialized:
3293
+ _host = None
3294
+
3295
+ _collection_formats: Dict[str, str] = {}
3296
+
3297
+ _path_params: Dict[str, str] = {}
3298
+ _query_params: List[Tuple[str, str]] = []
3299
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3300
+ _form_params: List[Tuple[str, str]] = []
3301
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3302
+ _body_params: Optional[bytes] = None
3303
+
3304
+ # process the path parameters
3305
+ if sandbox_id is not None:
3306
+ _path_params["sandboxId"] = sandbox_id
3307
+ # process the query parameters
3308
+ # process the header parameters
3309
+ if x_daytona_organization_id is not None:
3310
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
3311
+ # process the form parameters
3312
+ # process the body parameter
3313
+
3314
+ # authentication setting
3315
+ _auth_settings: List[str] = ["bearer", "oauth2"]
3316
+
3317
+ return self.api_client.param_serialize(
3318
+ method="POST",
3319
+ resource_path="/sandbox/{sandboxId}/stop",
3320
+ path_params=_path_params,
3321
+ query_params=_query_params,
3322
+ header_params=_header_params,
3323
+ body=_body_params,
3324
+ post_params=_form_params,
3325
+ files=_files,
3326
+ auth_settings=_auth_settings,
3327
+ collection_formats=_collection_formats,
3328
+ _host=_host,
3329
+ _request_auth=_request_auth,
3330
+ )
3331
+
3332
+ @validate_call
3333
+ def update_public_status(
3334
+ self,
3335
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3336
+ is_public: Annotated[StrictBool, Field(description="Public status to set")],
3337
+ x_daytona_organization_id: Annotated[
3338
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3339
+ ] = None,
3340
+ _request_timeout: Union[
3341
+ None,
3342
+ Annotated[StrictFloat, Field(gt=0)],
3343
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3344
+ ] = None,
3345
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3346
+ _content_type: Optional[StrictStr] = None,
3347
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3348
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3349
+ ) -> None:
3350
+ """Update public status
3351
+
3352
+
3353
+ :param sandbox_id: ID of the sandbox (required)
3354
+ :type sandbox_id: str
3355
+ :param is_public: Public status to set (required)
3356
+ :type is_public: bool
3357
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3358
+ :type x_daytona_organization_id: str
3359
+ :param _request_timeout: timeout setting for this request. If one
3360
+ number provided, it will be total request
3361
+ timeout. It can also be a pair (tuple) of
3362
+ (connection, read) timeouts.
3363
+ :type _request_timeout: int, tuple(int, int), optional
3364
+ :param _request_auth: set to override the auth_settings for an a single
3365
+ request; this effectively ignores the
3366
+ authentication in the spec for a single request.
3367
+ :type _request_auth: dict, optional
3368
+ :param _content_type: force content-type for the request.
3369
+ :type _content_type: str, Optional
3370
+ :param _headers: set to override the headers for a single
3371
+ request; this effectively ignores the headers
3372
+ in the spec for a single request.
3373
+ :type _headers: dict, optional
3374
+ :param _host_index: set to override the host_index for a single
3375
+ request; this effectively ignores the host_index
3376
+ in the spec for a single request.
3377
+ :type _host_index: int, optional
3378
+ :return: Returns the result object.
3379
+ """ # noqa: E501
3380
+
3381
+ _param = self._update_public_status_serialize(
3382
+ sandbox_id=sandbox_id,
3383
+ is_public=is_public,
3384
+ x_daytona_organization_id=x_daytona_organization_id,
3385
+ _request_auth=_request_auth,
3386
+ _content_type=_content_type,
3387
+ _headers=_headers,
3388
+ _host_index=_host_index,
3389
+ )
3390
+
3391
+ _response_types_map: Dict[str, Optional[str]] = {
3392
+ "201": None,
3393
+ }
3394
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3395
+ response_data.read()
3396
+ return self.api_client.response_deserialize(
3397
+ response_data=response_data,
3398
+ response_types_map=_response_types_map,
3399
+ ).data
3400
+
3401
+ @validate_call
3402
+ def update_public_status_with_http_info(
3403
+ self,
3404
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3405
+ is_public: Annotated[StrictBool, Field(description="Public status to set")],
3406
+ x_daytona_organization_id: Annotated[
3407
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3408
+ ] = None,
3409
+ _request_timeout: Union[
3410
+ None,
3411
+ Annotated[StrictFloat, Field(gt=0)],
3412
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3413
+ ] = None,
3414
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3415
+ _content_type: Optional[StrictStr] = None,
3416
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3417
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3418
+ ) -> ApiResponse[None]:
3419
+ """Update public status
3420
+
3421
+
3422
+ :param sandbox_id: ID of the sandbox (required)
3423
+ :type sandbox_id: str
3424
+ :param is_public: Public status to set (required)
3425
+ :type is_public: bool
3426
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3427
+ :type x_daytona_organization_id: str
3428
+ :param _request_timeout: timeout setting for this request. If one
3429
+ number provided, it will be total request
3430
+ timeout. It can also be a pair (tuple) of
3431
+ (connection, read) timeouts.
3432
+ :type _request_timeout: int, tuple(int, int), optional
3433
+ :param _request_auth: set to override the auth_settings for an a single
3434
+ request; this effectively ignores the
3435
+ authentication in the spec for a single request.
3436
+ :type _request_auth: dict, optional
3437
+ :param _content_type: force content-type for the request.
3438
+ :type _content_type: str, Optional
3439
+ :param _headers: set to override the headers for a single
3440
+ request; this effectively ignores the headers
3441
+ in the spec for a single request.
3442
+ :type _headers: dict, optional
3443
+ :param _host_index: set to override the host_index for a single
3444
+ request; this effectively ignores the host_index
3445
+ in the spec for a single request.
3446
+ :type _host_index: int, optional
3447
+ :return: Returns the result object.
3448
+ """ # noqa: E501
3449
+
3450
+ _param = self._update_public_status_serialize(
3451
+ sandbox_id=sandbox_id,
3452
+ is_public=is_public,
3453
+ x_daytona_organization_id=x_daytona_organization_id,
3454
+ _request_auth=_request_auth,
3455
+ _content_type=_content_type,
3456
+ _headers=_headers,
3457
+ _host_index=_host_index,
3458
+ )
3459
+
3460
+ _response_types_map: Dict[str, Optional[str]] = {
3461
+ "201": None,
3462
+ }
3463
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3464
+ response_data.read()
3465
+ return self.api_client.response_deserialize(
3466
+ response_data=response_data,
3467
+ response_types_map=_response_types_map,
3468
+ )
3469
+
3470
+ @validate_call
3471
+ def update_public_status_without_preload_content(
3472
+ self,
3473
+ sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
3474
+ is_public: Annotated[StrictBool, Field(description="Public status to set")],
3475
+ x_daytona_organization_id: Annotated[
3476
+ Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")
3477
+ ] = None,
3478
+ _request_timeout: Union[
3479
+ None,
3480
+ Annotated[StrictFloat, Field(gt=0)],
3481
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3482
+ ] = None,
3483
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3484
+ _content_type: Optional[StrictStr] = None,
3485
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3486
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3487
+ ) -> RESTResponseType:
3488
+ """Update public status
3489
+
3490
+
3491
+ :param sandbox_id: ID of the sandbox (required)
3492
+ :type sandbox_id: str
3493
+ :param is_public: Public status to set (required)
3494
+ :type is_public: bool
3495
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
3496
+ :type x_daytona_organization_id: str
3497
+ :param _request_timeout: timeout setting for this request. If one
3498
+ number provided, it will be total request
3499
+ timeout. It can also be a pair (tuple) of
3500
+ (connection, read) timeouts.
3501
+ :type _request_timeout: int, tuple(int, int), optional
3502
+ :param _request_auth: set to override the auth_settings for an a single
3503
+ request; this effectively ignores the
3504
+ authentication in the spec for a single request.
3505
+ :type _request_auth: dict, optional
3506
+ :param _content_type: force content-type for the request.
3507
+ :type _content_type: str, Optional
3508
+ :param _headers: set to override the headers for a single
3509
+ request; this effectively ignores the headers
3510
+ in the spec for a single request.
3511
+ :type _headers: dict, optional
3512
+ :param _host_index: set to override the host_index for a single
3513
+ request; this effectively ignores the host_index
3514
+ in the spec for a single request.
3515
+ :type _host_index: int, optional
3516
+ :return: Returns the result object.
3517
+ """ # noqa: E501
3518
+
3519
+ _param = self._update_public_status_serialize(
3520
+ sandbox_id=sandbox_id,
3521
+ is_public=is_public,
3522
+ x_daytona_organization_id=x_daytona_organization_id,
3523
+ _request_auth=_request_auth,
3524
+ _content_type=_content_type,
3525
+ _headers=_headers,
3526
+ _host_index=_host_index,
3527
+ )
3528
+
3529
+ _response_types_map: Dict[str, Optional[str]] = {
3530
+ "201": None,
3531
+ }
3532
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3533
+ return response_data.response
3534
+
3535
+ def _update_public_status_serialize(
3536
+ self,
3537
+ sandbox_id,
3538
+ is_public,
3539
+ x_daytona_organization_id,
3540
+ _request_auth,
3541
+ _content_type,
3542
+ _headers,
3543
+ _host_index,
3544
+ ) -> RequestSerialized:
3545
+ _host = None
3546
+
3547
+ _collection_formats: Dict[str, str] = {}
3548
+
3549
+ _path_params: Dict[str, str] = {}
3550
+ _query_params: List[Tuple[str, str]] = []
3551
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3552
+ _form_params: List[Tuple[str, str]] = []
3553
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3554
+ _body_params: Optional[bytes] = None
3555
+
3556
+ # process the path parameters
3557
+ if sandbox_id is not None:
3558
+ _path_params["sandboxId"] = sandbox_id
3559
+ if is_public is not None:
3560
+ _path_params["isPublic"] = is_public
3561
+ # process the query parameters
3562
+ # process the header parameters
3563
+ if x_daytona_organization_id is not None:
3564
+ _header_params["X-Daytona-Organization-ID"] = x_daytona_organization_id
3565
+ # process the form parameters
3566
+ # process the body parameter
3567
+
3568
+ # authentication setting
3569
+ _auth_settings: List[str] = ["bearer", "oauth2"]
3570
+
3571
+ return self.api_client.param_serialize(
3572
+ method="POST",
3573
+ resource_path="/sandbox/{sandboxId}/public/{isPublic}",
3574
+ path_params=_path_params,
3575
+ query_params=_query_params,
3576
+ header_params=_header_params,
3577
+ body=_body_params,
3578
+ post_params=_form_params,
3579
+ files=_files,
3580
+ auth_settings=_auth_settings,
3581
+ collection_formats=_collection_formats,
3582
+ _host=_host,
3583
+ _request_auth=_request_auth,
3584
+ )