daytona_api_client_async 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_async might be problematic. Click here for more details.

Files changed (123) hide show
  1. daytona_api_client_async/__init__.py +129 -0
  2. daytona_api_client_async/api/__init__.py +16 -0
  3. daytona_api_client_async/api/api_keys_api.py +1391 -0
  4. daytona_api_client_async/api/docker_registry_api.py +1965 -0
  5. daytona_api_client_async/api/images_api.py +2350 -0
  6. daytona_api_client_async/api/nodes_api.py +792 -0
  7. daytona_api_client_async/api/object_storage_api.py +298 -0
  8. daytona_api_client_async/api/organizations_api.py +6762 -0
  9. daytona_api_client_async/api/preview_api.py +819 -0
  10. daytona_api_client_async/api/runners_api.py +792 -0
  11. daytona_api_client_async/api/sandbox_api.py +3994 -0
  12. daytona_api_client_async/api/snapshots_api.py +2059 -0
  13. daytona_api_client_async/api/toolbox_api.py +11819 -0
  14. daytona_api_client_async/api/users_api.py +2075 -0
  15. daytona_api_client_async/api/volumes_api.py +1419 -0
  16. daytona_api_client_async/api/workspace_api.py +4036 -0
  17. daytona_api_client_async/api_client.py +801 -0
  18. daytona_api_client_async/api_response.py +21 -0
  19. daytona_api_client_async/configuration.py +579 -0
  20. daytona_api_client_async/exceptions.py +217 -0
  21. daytona_api_client_async/models/__init__.py +101 -0
  22. daytona_api_client_async/models/account_provider.py +103 -0
  23. daytona_api_client_async/models/api_key_list.py +130 -0
  24. daytona_api_client_async/models/api_key_response.py +123 -0
  25. daytona_api_client_async/models/build_image.py +107 -0
  26. daytona_api_client_async/models/build_info.py +108 -0
  27. daytona_api_client_async/models/build_snapshot.py +115 -0
  28. daytona_api_client_async/models/command.py +105 -0
  29. daytona_api_client_async/models/completion_context.py +103 -0
  30. daytona_api_client_async/models/completion_item.py +113 -0
  31. daytona_api_client_async/models/completion_list.py +111 -0
  32. daytona_api_client_async/models/create_api_key.py +119 -0
  33. daytona_api_client_async/models/create_build_info.py +103 -0
  34. daytona_api_client_async/models/create_docker_registry.py +120 -0
  35. daytona_api_client_async/models/create_image.py +105 -0
  36. daytona_api_client_async/models/create_linked_account.py +103 -0
  37. daytona_api_client_async/models/create_node.py +135 -0
  38. daytona_api_client_async/models/create_organization.py +101 -0
  39. daytona_api_client_async/models/create_organization_invitation.py +115 -0
  40. daytona_api_client_async/models/create_organization_quota.py +117 -0
  41. daytona_api_client_async/models/create_organization_role.py +113 -0
  42. daytona_api_client_async/models/create_runner.py +135 -0
  43. daytona_api_client_async/models/create_sandbox.py +161 -0
  44. daytona_api_client_async/models/create_session_request.py +101 -0
  45. daytona_api_client_async/models/create_snapshot.py +121 -0
  46. daytona_api_client_async/models/create_user.py +125 -0
  47. daytona_api_client_async/models/create_volume.py +101 -0
  48. daytona_api_client_async/models/create_workspace.py +161 -0
  49. daytona_api_client_async/models/docker_registry.py +123 -0
  50. daytona_api_client_async/models/execute_request.py +105 -0
  51. daytona_api_client_async/models/execute_response.py +103 -0
  52. daytona_api_client_async/models/file_info.py +115 -0
  53. daytona_api_client_async/models/file_status.py +107 -0
  54. daytona_api_client_async/models/git_add_request.py +103 -0
  55. daytona_api_client_async/models/git_branch_request.py +103 -0
  56. daytona_api_client_async/models/git_checkout_request.py +103 -0
  57. daytona_api_client_async/models/git_clone_request.py +111 -0
  58. daytona_api_client_async/models/git_commit_info.py +109 -0
  59. daytona_api_client_async/models/git_commit_request.py +107 -0
  60. daytona_api_client_async/models/git_commit_response.py +101 -0
  61. daytona_api_client_async/models/git_delete_branch_request.py +103 -0
  62. daytona_api_client_async/models/git_repo_request.py +105 -0
  63. daytona_api_client_async/models/git_status.py +117 -0
  64. daytona_api_client_async/models/image_dto.py +145 -0
  65. daytona_api_client_async/models/image_state.py +45 -0
  66. daytona_api_client_async/models/list_branch_response.py +101 -0
  67. daytona_api_client_async/models/lsp_completion_params.py +117 -0
  68. daytona_api_client_async/models/lsp_document_request.py +105 -0
  69. daytona_api_client_async/models/lsp_location.py +107 -0
  70. daytona_api_client_async/models/lsp_server_request.py +103 -0
  71. daytona_api_client_async/models/lsp_symbol.py +109 -0
  72. daytona_api_client_async/models/match.py +105 -0
  73. daytona_api_client_async/models/organization.py +120 -0
  74. daytona_api_client_async/models/organization_invitation.py +144 -0
  75. daytona_api_client_async/models/organization_role.py +122 -0
  76. daytona_api_client_async/models/organization_suspension.py +104 -0
  77. daytona_api_client_async/models/organization_user.py +131 -0
  78. daytona_api_client_async/models/paginated_images_dto.py +115 -0
  79. daytona_api_client_async/models/paginated_snapshots_dto.py +115 -0
  80. daytona_api_client_async/models/port_preview_url.py +103 -0
  81. daytona_api_client_async/models/position.py +103 -0
  82. daytona_api_client_async/models/project_dir_response.py +101 -0
  83. daytona_api_client_async/models/range.py +110 -0
  84. daytona_api_client_async/models/registry_push_access_dto.py +111 -0
  85. daytona_api_client_async/models/replace_request.py +105 -0
  86. daytona_api_client_async/models/replace_result.py +105 -0
  87. daytona_api_client_async/models/sandbox.py +180 -0
  88. daytona_api_client_async/models/sandbox_info.py +105 -0
  89. daytona_api_client_async/models/sandbox_labels.py +101 -0
  90. daytona_api_client_async/models/sandbox_state.py +52 -0
  91. daytona_api_client_async/models/sandbox_volume.py +103 -0
  92. daytona_api_client_async/models/search_files_response.py +101 -0
  93. daytona_api_client_async/models/session.py +116 -0
  94. daytona_api_client_async/models/session_execute_request.py +105 -0
  95. daytona_api_client_async/models/session_execute_response.py +105 -0
  96. daytona_api_client_async/models/set_image_general_status.py +101 -0
  97. daytona_api_client_async/models/set_snapshot_general_status_dto.py +101 -0
  98. daytona_api_client_async/models/snapshot_dto.py +161 -0
  99. daytona_api_client_async/models/snapshot_state.py +46 -0
  100. daytona_api_client_async/models/storage_access_dto.py +111 -0
  101. daytona_api_client_async/models/toggle_state.py +101 -0
  102. daytona_api_client_async/models/update_assigned_organization_roles.py +101 -0
  103. daytona_api_client_async/models/update_docker_registry.py +105 -0
  104. daytona_api_client_async/models/update_organization_invitation.py +113 -0
  105. daytona_api_client_async/models/update_organization_member_role.py +108 -0
  106. daytona_api_client_async/models/update_organization_quota.py +162 -0
  107. daytona_api_client_async/models/update_organization_role.py +113 -0
  108. daytona_api_client_async/models/usage_overview.py +113 -0
  109. daytona_api_client_async/models/user.py +115 -0
  110. daytona_api_client_async/models/user_public_key.py +103 -0
  111. daytona_api_client_async/models/volume_dto.py +126 -0
  112. daytona_api_client_async/models/volume_state.py +43 -0
  113. daytona_api_client_async/models/workspace.py +204 -0
  114. daytona_api_client_async/models/workspace_info.py +105 -0
  115. daytona_api_client_async/models/workspace_labels.py +101 -0
  116. daytona_api_client_async/models/workspace_state.py +51 -0
  117. daytona_api_client_async/models/workspace_volume.py +103 -0
  118. daytona_api_client_async/py.typed +0 -0
  119. daytona_api_client_async/rest.py +214 -0
  120. daytona_api_client_async-0.21.3a0.dist-info/METADATA +25 -0
  121. daytona_api_client_async-0.21.3a0.dist-info/RECORD +123 -0
  122. daytona_api_client_async-0.21.3a0.dist-info/WHEEL +5 -0
  123. daytona_api_client_async-0.21.3a0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2059 @@
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 Optional, Union
22
+ from typing_extensions import Annotated
23
+ from daytona_api_client_async.models.create_snapshot import CreateSnapshot
24
+ from daytona_api_client_async.models.paginated_snapshots_dto import PaginatedSnapshotsDto
25
+ from daytona_api_client_async.models.set_snapshot_general_status_dto import SetSnapshotGeneralStatusDto
26
+ from daytona_api_client_async.models.snapshot_dto import SnapshotDto
27
+ from daytona_api_client_async.models.toggle_state import ToggleState
28
+
29
+ from daytona_api_client_async.api_client import ApiClient, RequestSerialized
30
+ from daytona_api_client_async.api_response import ApiResponse
31
+ from daytona_api_client_async.rest import RESTResponseType
32
+
33
+
34
+ class SnapshotsApi:
35
+ """NOTE: This class is auto generated by OpenAPI Generator
36
+ Ref: https://openapi-generator.tech
37
+
38
+ Do not edit the class manually.
39
+ """
40
+
41
+ def __init__(self, api_client=None) -> None:
42
+ if api_client is None:
43
+ api_client = ApiClient.get_default()
44
+ self.api_client = api_client
45
+
46
+
47
+ @validate_call
48
+ async def create_snapshot(
49
+ self,
50
+ create_snapshot: CreateSnapshot,
51
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> SnapshotDto:
65
+ """Create a new snapshot
66
+
67
+
68
+ :param create_snapshot: (required)
69
+ :type create_snapshot: CreateSnapshot
70
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
71
+ :type x_daytona_organization_id: str
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._create_snapshot_serialize(
95
+ create_snapshot=create_snapshot,
96
+ x_daytona_organization_id=x_daytona_organization_id,
97
+ _request_auth=_request_auth,
98
+ _content_type=_content_type,
99
+ _headers=_headers,
100
+ _host_index=_host_index
101
+ )
102
+
103
+ _response_types_map: Dict[str, Optional[str]] = {
104
+ '200': "SnapshotDto",
105
+ '400': None,
106
+ }
107
+ response_data = await self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ await response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ async def create_snapshot_with_http_info(
120
+ self,
121
+ create_snapshot: CreateSnapshot,
122
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
123
+ _request_timeout: Union[
124
+ None,
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Tuple[
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Annotated[StrictFloat, Field(gt=0)]
129
+ ]
130
+ ] = None,
131
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
+ _content_type: Optional[StrictStr] = None,
133
+ _headers: Optional[Dict[StrictStr, Any]] = None,
134
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
+ ) -> ApiResponse[SnapshotDto]:
136
+ """Create a new snapshot
137
+
138
+
139
+ :param create_snapshot: (required)
140
+ :type create_snapshot: CreateSnapshot
141
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
142
+ :type x_daytona_organization_id: str
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_snapshot_serialize(
166
+ create_snapshot=create_snapshot,
167
+ x_daytona_organization_id=x_daytona_organization_id,
168
+ _request_auth=_request_auth,
169
+ _content_type=_content_type,
170
+ _headers=_headers,
171
+ _host_index=_host_index
172
+ )
173
+
174
+ _response_types_map: Dict[str, Optional[str]] = {
175
+ '200': "SnapshotDto",
176
+ '400': None,
177
+ }
178
+ response_data = await self.api_client.call_api(
179
+ *_param,
180
+ _request_timeout=_request_timeout
181
+ )
182
+ await response_data.read()
183
+ return self.api_client.response_deserialize(
184
+ response_data=response_data,
185
+ response_types_map=_response_types_map,
186
+ )
187
+
188
+
189
+ @validate_call
190
+ async def create_snapshot_without_preload_content(
191
+ self,
192
+ create_snapshot: CreateSnapshot,
193
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
194
+ _request_timeout: Union[
195
+ None,
196
+ Annotated[StrictFloat, Field(gt=0)],
197
+ Tuple[
198
+ Annotated[StrictFloat, Field(gt=0)],
199
+ Annotated[StrictFloat, Field(gt=0)]
200
+ ]
201
+ ] = None,
202
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
203
+ _content_type: Optional[StrictStr] = None,
204
+ _headers: Optional[Dict[StrictStr, Any]] = None,
205
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
206
+ ) -> RESTResponseType:
207
+ """Create a new snapshot
208
+
209
+
210
+ :param create_snapshot: (required)
211
+ :type create_snapshot: CreateSnapshot
212
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
213
+ :type x_daytona_organization_id: str
214
+ :param _request_timeout: timeout setting for this request. If one
215
+ number provided, it will be total request
216
+ timeout. It can also be a pair (tuple) of
217
+ (connection, read) timeouts.
218
+ :type _request_timeout: int, tuple(int, int), optional
219
+ :param _request_auth: set to override the auth_settings for an a single
220
+ request; this effectively ignores the
221
+ authentication in the spec for a single request.
222
+ :type _request_auth: dict, optional
223
+ :param _content_type: force content-type for the request.
224
+ :type _content_type: str, Optional
225
+ :param _headers: set to override the headers for a single
226
+ request; this effectively ignores the headers
227
+ in the spec for a single request.
228
+ :type _headers: dict, optional
229
+ :param _host_index: set to override the host_index for a single
230
+ request; this effectively ignores the host_index
231
+ in the spec for a single request.
232
+ :type _host_index: int, optional
233
+ :return: Returns the result object.
234
+ """ # noqa: E501
235
+
236
+ _param = self._create_snapshot_serialize(
237
+ create_snapshot=create_snapshot,
238
+ x_daytona_organization_id=x_daytona_organization_id,
239
+ _request_auth=_request_auth,
240
+ _content_type=_content_type,
241
+ _headers=_headers,
242
+ _host_index=_host_index
243
+ )
244
+
245
+ _response_types_map: Dict[str, Optional[str]] = {
246
+ '200': "SnapshotDto",
247
+ '400': None,
248
+ }
249
+ response_data = await self.api_client.call_api(
250
+ *_param,
251
+ _request_timeout=_request_timeout
252
+ )
253
+ return response_data.response
254
+
255
+
256
+ def _create_snapshot_serialize(
257
+ self,
258
+ create_snapshot,
259
+ x_daytona_organization_id,
260
+ _request_auth,
261
+ _content_type,
262
+ _headers,
263
+ _host_index,
264
+ ) -> RequestSerialized:
265
+
266
+ _host = None
267
+
268
+ _collection_formats: Dict[str, str] = {
269
+ }
270
+
271
+ _path_params: Dict[str, str] = {}
272
+ _query_params: List[Tuple[str, str]] = []
273
+ _header_params: Dict[str, Optional[str]] = _headers or {}
274
+ _form_params: List[Tuple[str, str]] = []
275
+ _files: Dict[
276
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
277
+ ] = {}
278
+ _body_params: Optional[bytes] = None
279
+
280
+ # process the path parameters
281
+ # process the query parameters
282
+ # process the header parameters
283
+ if x_daytona_organization_id is not None:
284
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
285
+ # process the form parameters
286
+ # process the body parameter
287
+ if create_snapshot is not None:
288
+ _body_params = create_snapshot
289
+
290
+
291
+ # set the HTTP header `Accept`
292
+ if 'Accept' not in _header_params:
293
+ _header_params['Accept'] = self.api_client.select_header_accept(
294
+ [
295
+ 'application/json'
296
+ ]
297
+ )
298
+
299
+ # set the HTTP header `Content-Type`
300
+ if _content_type:
301
+ _header_params['Content-Type'] = _content_type
302
+ else:
303
+ _default_content_type = (
304
+ self.api_client.select_header_content_type(
305
+ [
306
+ 'application/json'
307
+ ]
308
+ )
309
+ )
310
+ if _default_content_type is not None:
311
+ _header_params['Content-Type'] = _default_content_type
312
+
313
+ # authentication setting
314
+ _auth_settings: List[str] = [
315
+ 'bearer',
316
+ 'oauth2'
317
+ ]
318
+
319
+ return self.api_client.param_serialize(
320
+ method='POST',
321
+ resource_path='/snapshots',
322
+ path_params=_path_params,
323
+ query_params=_query_params,
324
+ header_params=_header_params,
325
+ body=_body_params,
326
+ post_params=_form_params,
327
+ files=_files,
328
+ auth_settings=_auth_settings,
329
+ collection_formats=_collection_formats,
330
+ _host=_host,
331
+ _request_auth=_request_auth
332
+ )
333
+
334
+
335
+
336
+
337
+ @validate_call
338
+ async def get_all_snapshots(
339
+ self,
340
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
341
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page")] = None,
342
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number")] = None,
343
+ _request_timeout: Union[
344
+ None,
345
+ Annotated[StrictFloat, Field(gt=0)],
346
+ Tuple[
347
+ Annotated[StrictFloat, Field(gt=0)],
348
+ Annotated[StrictFloat, Field(gt=0)]
349
+ ]
350
+ ] = None,
351
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
352
+ _content_type: Optional[StrictStr] = None,
353
+ _headers: Optional[Dict[StrictStr, Any]] = None,
354
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
355
+ ) -> PaginatedSnapshotsDto:
356
+ """List all snapshots
357
+
358
+
359
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
360
+ :type x_daytona_organization_id: str
361
+ :param limit: Number of items per page
362
+ :type limit: float
363
+ :param page: Page number
364
+ :type page: float
365
+ :param _request_timeout: timeout setting for this request. If one
366
+ number provided, it will be total request
367
+ timeout. It can also be a pair (tuple) of
368
+ (connection, read) timeouts.
369
+ :type _request_timeout: int, tuple(int, int), optional
370
+ :param _request_auth: set to override the auth_settings for an a single
371
+ request; this effectively ignores the
372
+ authentication in the spec for a single request.
373
+ :type _request_auth: dict, optional
374
+ :param _content_type: force content-type for the request.
375
+ :type _content_type: str, Optional
376
+ :param _headers: set to override the headers for a single
377
+ request; this effectively ignores the headers
378
+ in the spec for a single request.
379
+ :type _headers: dict, optional
380
+ :param _host_index: set to override the host_index for a single
381
+ request; this effectively ignores the host_index
382
+ in the spec for a single request.
383
+ :type _host_index: int, optional
384
+ :return: Returns the result object.
385
+ """ # noqa: E501
386
+
387
+ _param = self._get_all_snapshots_serialize(
388
+ x_daytona_organization_id=x_daytona_organization_id,
389
+ limit=limit,
390
+ page=page,
391
+ _request_auth=_request_auth,
392
+ _content_type=_content_type,
393
+ _headers=_headers,
394
+ _host_index=_host_index
395
+ )
396
+
397
+ _response_types_map: Dict[str, Optional[str]] = {
398
+ '200': "PaginatedSnapshotsDto",
399
+ }
400
+ response_data = await self.api_client.call_api(
401
+ *_param,
402
+ _request_timeout=_request_timeout
403
+ )
404
+ await response_data.read()
405
+ return self.api_client.response_deserialize(
406
+ response_data=response_data,
407
+ response_types_map=_response_types_map,
408
+ ).data
409
+
410
+
411
+ @validate_call
412
+ async def get_all_snapshots_with_http_info(
413
+ self,
414
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
415
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page")] = None,
416
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number")] = None,
417
+ _request_timeout: Union[
418
+ None,
419
+ Annotated[StrictFloat, Field(gt=0)],
420
+ Tuple[
421
+ Annotated[StrictFloat, Field(gt=0)],
422
+ Annotated[StrictFloat, Field(gt=0)]
423
+ ]
424
+ ] = None,
425
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
426
+ _content_type: Optional[StrictStr] = None,
427
+ _headers: Optional[Dict[StrictStr, Any]] = None,
428
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
429
+ ) -> ApiResponse[PaginatedSnapshotsDto]:
430
+ """List all snapshots
431
+
432
+
433
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
434
+ :type x_daytona_organization_id: str
435
+ :param limit: Number of items per page
436
+ :type limit: float
437
+ :param page: Page number
438
+ :type page: float
439
+ :param _request_timeout: timeout setting for this request. If one
440
+ number provided, it will be total request
441
+ timeout. It can also be a pair (tuple) of
442
+ (connection, read) timeouts.
443
+ :type _request_timeout: int, tuple(int, int), optional
444
+ :param _request_auth: set to override the auth_settings for an a single
445
+ request; this effectively ignores the
446
+ authentication in the spec for a single request.
447
+ :type _request_auth: dict, optional
448
+ :param _content_type: force content-type for the request.
449
+ :type _content_type: str, Optional
450
+ :param _headers: set to override the headers for a single
451
+ request; this effectively ignores the headers
452
+ in the spec for a single request.
453
+ :type _headers: dict, optional
454
+ :param _host_index: set to override the host_index for a single
455
+ request; this effectively ignores the host_index
456
+ in the spec for a single request.
457
+ :type _host_index: int, optional
458
+ :return: Returns the result object.
459
+ """ # noqa: E501
460
+
461
+ _param = self._get_all_snapshots_serialize(
462
+ x_daytona_organization_id=x_daytona_organization_id,
463
+ limit=limit,
464
+ page=page,
465
+ _request_auth=_request_auth,
466
+ _content_type=_content_type,
467
+ _headers=_headers,
468
+ _host_index=_host_index
469
+ )
470
+
471
+ _response_types_map: Dict[str, Optional[str]] = {
472
+ '200': "PaginatedSnapshotsDto",
473
+ }
474
+ response_data = await self.api_client.call_api(
475
+ *_param,
476
+ _request_timeout=_request_timeout
477
+ )
478
+ await response_data.read()
479
+ return self.api_client.response_deserialize(
480
+ response_data=response_data,
481
+ response_types_map=_response_types_map,
482
+ )
483
+
484
+
485
+ @validate_call
486
+ async def get_all_snapshots_without_preload_content(
487
+ self,
488
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
489
+ limit: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Number of items per page")] = None,
490
+ page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number")] = None,
491
+ _request_timeout: Union[
492
+ None,
493
+ Annotated[StrictFloat, Field(gt=0)],
494
+ Tuple[
495
+ Annotated[StrictFloat, Field(gt=0)],
496
+ Annotated[StrictFloat, Field(gt=0)]
497
+ ]
498
+ ] = None,
499
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
500
+ _content_type: Optional[StrictStr] = None,
501
+ _headers: Optional[Dict[StrictStr, Any]] = None,
502
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
503
+ ) -> RESTResponseType:
504
+ """List all snapshots
505
+
506
+
507
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
508
+ :type x_daytona_organization_id: str
509
+ :param limit: Number of items per page
510
+ :type limit: float
511
+ :param page: Page number
512
+ :type page: float
513
+ :param _request_timeout: timeout setting for this request. If one
514
+ number provided, it will be total request
515
+ timeout. It can also be a pair (tuple) of
516
+ (connection, read) timeouts.
517
+ :type _request_timeout: int, tuple(int, int), optional
518
+ :param _request_auth: set to override the auth_settings for an a single
519
+ request; this effectively ignores the
520
+ authentication in the spec for a single request.
521
+ :type _request_auth: dict, optional
522
+ :param _content_type: force content-type for the request.
523
+ :type _content_type: str, Optional
524
+ :param _headers: set to override the headers for a single
525
+ request; this effectively ignores the headers
526
+ in the spec for a single request.
527
+ :type _headers: dict, optional
528
+ :param _host_index: set to override the host_index for a single
529
+ request; this effectively ignores the host_index
530
+ in the spec for a single request.
531
+ :type _host_index: int, optional
532
+ :return: Returns the result object.
533
+ """ # noqa: E501
534
+
535
+ _param = self._get_all_snapshots_serialize(
536
+ x_daytona_organization_id=x_daytona_organization_id,
537
+ limit=limit,
538
+ page=page,
539
+ _request_auth=_request_auth,
540
+ _content_type=_content_type,
541
+ _headers=_headers,
542
+ _host_index=_host_index
543
+ )
544
+
545
+ _response_types_map: Dict[str, Optional[str]] = {
546
+ '200': "PaginatedSnapshotsDto",
547
+ }
548
+ response_data = await self.api_client.call_api(
549
+ *_param,
550
+ _request_timeout=_request_timeout
551
+ )
552
+ return response_data.response
553
+
554
+
555
+ def _get_all_snapshots_serialize(
556
+ self,
557
+ x_daytona_organization_id,
558
+ limit,
559
+ page,
560
+ _request_auth,
561
+ _content_type,
562
+ _headers,
563
+ _host_index,
564
+ ) -> RequestSerialized:
565
+
566
+ _host = None
567
+
568
+ _collection_formats: Dict[str, str] = {
569
+ }
570
+
571
+ _path_params: Dict[str, str] = {}
572
+ _query_params: List[Tuple[str, str]] = []
573
+ _header_params: Dict[str, Optional[str]] = _headers or {}
574
+ _form_params: List[Tuple[str, str]] = []
575
+ _files: Dict[
576
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
577
+ ] = {}
578
+ _body_params: Optional[bytes] = None
579
+
580
+ # process the path parameters
581
+ # process the query parameters
582
+ if limit is not None:
583
+
584
+ _query_params.append(('limit', limit))
585
+
586
+ if page is not None:
587
+
588
+ _query_params.append(('page', page))
589
+
590
+ # process the header parameters
591
+ if x_daytona_organization_id is not None:
592
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
593
+ # process the form parameters
594
+ # process the body parameter
595
+
596
+
597
+ # set the HTTP header `Accept`
598
+ if 'Accept' not in _header_params:
599
+ _header_params['Accept'] = self.api_client.select_header_accept(
600
+ [
601
+ 'application/json'
602
+ ]
603
+ )
604
+
605
+
606
+ # authentication setting
607
+ _auth_settings: List[str] = [
608
+ 'bearer',
609
+ 'oauth2'
610
+ ]
611
+
612
+ return self.api_client.param_serialize(
613
+ method='GET',
614
+ resource_path='/snapshots',
615
+ path_params=_path_params,
616
+ query_params=_query_params,
617
+ header_params=_header_params,
618
+ body=_body_params,
619
+ post_params=_form_params,
620
+ files=_files,
621
+ auth_settings=_auth_settings,
622
+ collection_formats=_collection_formats,
623
+ _host=_host,
624
+ _request_auth=_request_auth
625
+ )
626
+
627
+
628
+
629
+
630
+ @validate_call
631
+ async def get_snapshot(
632
+ self,
633
+ id: Annotated[StrictStr, Field(description="Snapshot ID or name")],
634
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
635
+ _request_timeout: Union[
636
+ None,
637
+ Annotated[StrictFloat, Field(gt=0)],
638
+ Tuple[
639
+ Annotated[StrictFloat, Field(gt=0)],
640
+ Annotated[StrictFloat, Field(gt=0)]
641
+ ]
642
+ ] = None,
643
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
644
+ _content_type: Optional[StrictStr] = None,
645
+ _headers: Optional[Dict[StrictStr, Any]] = None,
646
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
647
+ ) -> SnapshotDto:
648
+ """Get snapshot by ID or name
649
+
650
+
651
+ :param id: Snapshot ID or name (required)
652
+ :type id: str
653
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
654
+ :type x_daytona_organization_id: str
655
+ :param _request_timeout: timeout setting for this request. If one
656
+ number provided, it will be total request
657
+ timeout. It can also be a pair (tuple) of
658
+ (connection, read) timeouts.
659
+ :type _request_timeout: int, tuple(int, int), optional
660
+ :param _request_auth: set to override the auth_settings for an a single
661
+ request; this effectively ignores the
662
+ authentication in the spec for a single request.
663
+ :type _request_auth: dict, optional
664
+ :param _content_type: force content-type for the request.
665
+ :type _content_type: str, Optional
666
+ :param _headers: set to override the headers for a single
667
+ request; this effectively ignores the headers
668
+ in the spec for a single request.
669
+ :type _headers: dict, optional
670
+ :param _host_index: set to override the host_index for a single
671
+ request; this effectively ignores the host_index
672
+ in the spec for a single request.
673
+ :type _host_index: int, optional
674
+ :return: Returns the result object.
675
+ """ # noqa: E501
676
+
677
+ _param = self._get_snapshot_serialize(
678
+ id=id,
679
+ x_daytona_organization_id=x_daytona_organization_id,
680
+ _request_auth=_request_auth,
681
+ _content_type=_content_type,
682
+ _headers=_headers,
683
+ _host_index=_host_index
684
+ )
685
+
686
+ _response_types_map: Dict[str, Optional[str]] = {
687
+ '200': "SnapshotDto",
688
+ '404': None,
689
+ }
690
+ response_data = await self.api_client.call_api(
691
+ *_param,
692
+ _request_timeout=_request_timeout
693
+ )
694
+ await response_data.read()
695
+ return self.api_client.response_deserialize(
696
+ response_data=response_data,
697
+ response_types_map=_response_types_map,
698
+ ).data
699
+
700
+
701
+ @validate_call
702
+ async def get_snapshot_with_http_info(
703
+ self,
704
+ id: Annotated[StrictStr, Field(description="Snapshot ID or name")],
705
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
706
+ _request_timeout: Union[
707
+ None,
708
+ Annotated[StrictFloat, Field(gt=0)],
709
+ Tuple[
710
+ Annotated[StrictFloat, Field(gt=0)],
711
+ Annotated[StrictFloat, Field(gt=0)]
712
+ ]
713
+ ] = None,
714
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
715
+ _content_type: Optional[StrictStr] = None,
716
+ _headers: Optional[Dict[StrictStr, Any]] = None,
717
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
718
+ ) -> ApiResponse[SnapshotDto]:
719
+ """Get snapshot by ID or name
720
+
721
+
722
+ :param id: Snapshot ID or name (required)
723
+ :type id: str
724
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
725
+ :type x_daytona_organization_id: str
726
+ :param _request_timeout: timeout setting for this request. If one
727
+ number provided, it will be total request
728
+ timeout. It can also be a pair (tuple) of
729
+ (connection, read) timeouts.
730
+ :type _request_timeout: int, tuple(int, int), optional
731
+ :param _request_auth: set to override the auth_settings for an a single
732
+ request; this effectively ignores the
733
+ authentication in the spec for a single request.
734
+ :type _request_auth: dict, optional
735
+ :param _content_type: force content-type for the request.
736
+ :type _content_type: str, Optional
737
+ :param _headers: set to override the headers for a single
738
+ request; this effectively ignores the headers
739
+ in the spec for a single request.
740
+ :type _headers: dict, optional
741
+ :param _host_index: set to override the host_index for a single
742
+ request; this effectively ignores the host_index
743
+ in the spec for a single request.
744
+ :type _host_index: int, optional
745
+ :return: Returns the result object.
746
+ """ # noqa: E501
747
+
748
+ _param = self._get_snapshot_serialize(
749
+ id=id,
750
+ x_daytona_organization_id=x_daytona_organization_id,
751
+ _request_auth=_request_auth,
752
+ _content_type=_content_type,
753
+ _headers=_headers,
754
+ _host_index=_host_index
755
+ )
756
+
757
+ _response_types_map: Dict[str, Optional[str]] = {
758
+ '200': "SnapshotDto",
759
+ '404': None,
760
+ }
761
+ response_data = await self.api_client.call_api(
762
+ *_param,
763
+ _request_timeout=_request_timeout
764
+ )
765
+ await response_data.read()
766
+ return self.api_client.response_deserialize(
767
+ response_data=response_data,
768
+ response_types_map=_response_types_map,
769
+ )
770
+
771
+
772
+ @validate_call
773
+ async def get_snapshot_without_preload_content(
774
+ self,
775
+ id: Annotated[StrictStr, Field(description="Snapshot ID or name")],
776
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
777
+ _request_timeout: Union[
778
+ None,
779
+ Annotated[StrictFloat, Field(gt=0)],
780
+ Tuple[
781
+ Annotated[StrictFloat, Field(gt=0)],
782
+ Annotated[StrictFloat, Field(gt=0)]
783
+ ]
784
+ ] = None,
785
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
786
+ _content_type: Optional[StrictStr] = None,
787
+ _headers: Optional[Dict[StrictStr, Any]] = None,
788
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
789
+ ) -> RESTResponseType:
790
+ """Get snapshot by ID or name
791
+
792
+
793
+ :param id: Snapshot ID or name (required)
794
+ :type id: str
795
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
796
+ :type x_daytona_organization_id: str
797
+ :param _request_timeout: timeout setting for this request. If one
798
+ number provided, it will be total request
799
+ timeout. It can also be a pair (tuple) of
800
+ (connection, read) timeouts.
801
+ :type _request_timeout: int, tuple(int, int), optional
802
+ :param _request_auth: set to override the auth_settings for an a single
803
+ request; this effectively ignores the
804
+ authentication in the spec for a single request.
805
+ :type _request_auth: dict, optional
806
+ :param _content_type: force content-type for the request.
807
+ :type _content_type: str, Optional
808
+ :param _headers: set to override the headers for a single
809
+ request; this effectively ignores the headers
810
+ in the spec for a single request.
811
+ :type _headers: dict, optional
812
+ :param _host_index: set to override the host_index for a single
813
+ request; this effectively ignores the host_index
814
+ in the spec for a single request.
815
+ :type _host_index: int, optional
816
+ :return: Returns the result object.
817
+ """ # noqa: E501
818
+
819
+ _param = self._get_snapshot_serialize(
820
+ id=id,
821
+ x_daytona_organization_id=x_daytona_organization_id,
822
+ _request_auth=_request_auth,
823
+ _content_type=_content_type,
824
+ _headers=_headers,
825
+ _host_index=_host_index
826
+ )
827
+
828
+ _response_types_map: Dict[str, Optional[str]] = {
829
+ '200': "SnapshotDto",
830
+ '404': None,
831
+ }
832
+ response_data = await self.api_client.call_api(
833
+ *_param,
834
+ _request_timeout=_request_timeout
835
+ )
836
+ return response_data.response
837
+
838
+
839
+ def _get_snapshot_serialize(
840
+ self,
841
+ id,
842
+ x_daytona_organization_id,
843
+ _request_auth,
844
+ _content_type,
845
+ _headers,
846
+ _host_index,
847
+ ) -> RequestSerialized:
848
+
849
+ _host = None
850
+
851
+ _collection_formats: Dict[str, str] = {
852
+ }
853
+
854
+ _path_params: Dict[str, str] = {}
855
+ _query_params: List[Tuple[str, str]] = []
856
+ _header_params: Dict[str, Optional[str]] = _headers or {}
857
+ _form_params: List[Tuple[str, str]] = []
858
+ _files: Dict[
859
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
860
+ ] = {}
861
+ _body_params: Optional[bytes] = None
862
+
863
+ # process the path parameters
864
+ if id is not None:
865
+ _path_params['id'] = id
866
+ # process the query parameters
867
+ # process the header parameters
868
+ if x_daytona_organization_id is not None:
869
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
870
+ # process the form parameters
871
+ # process the body parameter
872
+
873
+
874
+ # set the HTTP header `Accept`
875
+ if 'Accept' not in _header_params:
876
+ _header_params['Accept'] = self.api_client.select_header_accept(
877
+ [
878
+ 'application/json'
879
+ ]
880
+ )
881
+
882
+
883
+ # authentication setting
884
+ _auth_settings: List[str] = [
885
+ 'bearer',
886
+ 'oauth2'
887
+ ]
888
+
889
+ return self.api_client.param_serialize(
890
+ method='GET',
891
+ resource_path='/snapshots/{id}',
892
+ path_params=_path_params,
893
+ query_params=_query_params,
894
+ header_params=_header_params,
895
+ body=_body_params,
896
+ post_params=_form_params,
897
+ files=_files,
898
+ auth_settings=_auth_settings,
899
+ collection_formats=_collection_formats,
900
+ _host=_host,
901
+ _request_auth=_request_auth
902
+ )
903
+
904
+
905
+
906
+
907
+ @validate_call
908
+ async def get_snapshot_build_logs(
909
+ self,
910
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
911
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
912
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
913
+ _request_timeout: Union[
914
+ None,
915
+ Annotated[StrictFloat, Field(gt=0)],
916
+ Tuple[
917
+ Annotated[StrictFloat, Field(gt=0)],
918
+ Annotated[StrictFloat, Field(gt=0)]
919
+ ]
920
+ ] = None,
921
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
922
+ _content_type: Optional[StrictStr] = None,
923
+ _headers: Optional[Dict[StrictStr, Any]] = None,
924
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
925
+ ) -> None:
926
+ """Get snapshot build logs
927
+
928
+
929
+ :param id: Snapshot ID (required)
930
+ :type id: str
931
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
932
+ :type x_daytona_organization_id: str
933
+ :param follow: Whether to follow the logs stream
934
+ :type follow: bool
935
+ :param _request_timeout: timeout setting for this request. If one
936
+ number provided, it will be total request
937
+ timeout. It can also be a pair (tuple) of
938
+ (connection, read) timeouts.
939
+ :type _request_timeout: int, tuple(int, int), optional
940
+ :param _request_auth: set to override the auth_settings for an a single
941
+ request; this effectively ignores the
942
+ authentication in the spec for a single request.
943
+ :type _request_auth: dict, optional
944
+ :param _content_type: force content-type for the request.
945
+ :type _content_type: str, Optional
946
+ :param _headers: set to override the headers for a single
947
+ request; this effectively ignores the headers
948
+ in the spec for a single request.
949
+ :type _headers: dict, optional
950
+ :param _host_index: set to override the host_index for a single
951
+ request; this effectively ignores the host_index
952
+ in the spec for a single request.
953
+ :type _host_index: int, optional
954
+ :return: Returns the result object.
955
+ """ # noqa: E501
956
+
957
+ _param = self._get_snapshot_build_logs_serialize(
958
+ id=id,
959
+ x_daytona_organization_id=x_daytona_organization_id,
960
+ follow=follow,
961
+ _request_auth=_request_auth,
962
+ _content_type=_content_type,
963
+ _headers=_headers,
964
+ _host_index=_host_index
965
+ )
966
+
967
+ _response_types_map: Dict[str, Optional[str]] = {
968
+ '200': None,
969
+ }
970
+ response_data = await self.api_client.call_api(
971
+ *_param,
972
+ _request_timeout=_request_timeout
973
+ )
974
+ await response_data.read()
975
+ return self.api_client.response_deserialize(
976
+ response_data=response_data,
977
+ response_types_map=_response_types_map,
978
+ ).data
979
+
980
+
981
+ @validate_call
982
+ async def get_snapshot_build_logs_with_http_info(
983
+ self,
984
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
985
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
986
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
987
+ _request_timeout: Union[
988
+ None,
989
+ Annotated[StrictFloat, Field(gt=0)],
990
+ Tuple[
991
+ Annotated[StrictFloat, Field(gt=0)],
992
+ Annotated[StrictFloat, Field(gt=0)]
993
+ ]
994
+ ] = None,
995
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
996
+ _content_type: Optional[StrictStr] = None,
997
+ _headers: Optional[Dict[StrictStr, Any]] = None,
998
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
999
+ ) -> ApiResponse[None]:
1000
+ """Get snapshot build logs
1001
+
1002
+
1003
+ :param id: Snapshot ID (required)
1004
+ :type id: str
1005
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1006
+ :type x_daytona_organization_id: str
1007
+ :param follow: Whether to follow the logs stream
1008
+ :type follow: bool
1009
+ :param _request_timeout: timeout setting for this request. If one
1010
+ number provided, it will be total request
1011
+ timeout. It can also be a pair (tuple) of
1012
+ (connection, read) timeouts.
1013
+ :type _request_timeout: int, tuple(int, int), optional
1014
+ :param _request_auth: set to override the auth_settings for an a single
1015
+ request; this effectively ignores the
1016
+ authentication in the spec for a single request.
1017
+ :type _request_auth: dict, optional
1018
+ :param _content_type: force content-type for the request.
1019
+ :type _content_type: str, Optional
1020
+ :param _headers: set to override the headers for a single
1021
+ request; this effectively ignores the headers
1022
+ in the spec for a single request.
1023
+ :type _headers: dict, optional
1024
+ :param _host_index: set to override the host_index for a single
1025
+ request; this effectively ignores the host_index
1026
+ in the spec for a single request.
1027
+ :type _host_index: int, optional
1028
+ :return: Returns the result object.
1029
+ """ # noqa: E501
1030
+
1031
+ _param = self._get_snapshot_build_logs_serialize(
1032
+ id=id,
1033
+ x_daytona_organization_id=x_daytona_organization_id,
1034
+ follow=follow,
1035
+ _request_auth=_request_auth,
1036
+ _content_type=_content_type,
1037
+ _headers=_headers,
1038
+ _host_index=_host_index
1039
+ )
1040
+
1041
+ _response_types_map: Dict[str, Optional[str]] = {
1042
+ '200': None,
1043
+ }
1044
+ response_data = await self.api_client.call_api(
1045
+ *_param,
1046
+ _request_timeout=_request_timeout
1047
+ )
1048
+ await response_data.read()
1049
+ return self.api_client.response_deserialize(
1050
+ response_data=response_data,
1051
+ response_types_map=_response_types_map,
1052
+ )
1053
+
1054
+
1055
+ @validate_call
1056
+ async def get_snapshot_build_logs_without_preload_content(
1057
+ self,
1058
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1059
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1060
+ follow: Annotated[Optional[StrictBool], Field(description="Whether to follow the logs stream")] = None,
1061
+ _request_timeout: Union[
1062
+ None,
1063
+ Annotated[StrictFloat, Field(gt=0)],
1064
+ Tuple[
1065
+ Annotated[StrictFloat, Field(gt=0)],
1066
+ Annotated[StrictFloat, Field(gt=0)]
1067
+ ]
1068
+ ] = None,
1069
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1070
+ _content_type: Optional[StrictStr] = None,
1071
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1072
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1073
+ ) -> RESTResponseType:
1074
+ """Get snapshot build logs
1075
+
1076
+
1077
+ :param id: Snapshot ID (required)
1078
+ :type id: str
1079
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1080
+ :type x_daytona_organization_id: str
1081
+ :param follow: Whether to follow the logs stream
1082
+ :type follow: bool
1083
+ :param _request_timeout: timeout setting for this request. If one
1084
+ number provided, it will be total request
1085
+ timeout. It can also be a pair (tuple) of
1086
+ (connection, read) timeouts.
1087
+ :type _request_timeout: int, tuple(int, int), optional
1088
+ :param _request_auth: set to override the auth_settings for an a single
1089
+ request; this effectively ignores the
1090
+ authentication in the spec for a single request.
1091
+ :type _request_auth: dict, optional
1092
+ :param _content_type: force content-type for the request.
1093
+ :type _content_type: str, Optional
1094
+ :param _headers: set to override the headers for a single
1095
+ request; this effectively ignores the headers
1096
+ in the spec for a single request.
1097
+ :type _headers: dict, optional
1098
+ :param _host_index: set to override the host_index for a single
1099
+ request; this effectively ignores the host_index
1100
+ in the spec for a single request.
1101
+ :type _host_index: int, optional
1102
+ :return: Returns the result object.
1103
+ """ # noqa: E501
1104
+
1105
+ _param = self._get_snapshot_build_logs_serialize(
1106
+ id=id,
1107
+ x_daytona_organization_id=x_daytona_organization_id,
1108
+ follow=follow,
1109
+ _request_auth=_request_auth,
1110
+ _content_type=_content_type,
1111
+ _headers=_headers,
1112
+ _host_index=_host_index
1113
+ )
1114
+
1115
+ _response_types_map: Dict[str, Optional[str]] = {
1116
+ '200': None,
1117
+ }
1118
+ response_data = await self.api_client.call_api(
1119
+ *_param,
1120
+ _request_timeout=_request_timeout
1121
+ )
1122
+ return response_data.response
1123
+
1124
+
1125
+ def _get_snapshot_build_logs_serialize(
1126
+ self,
1127
+ id,
1128
+ x_daytona_organization_id,
1129
+ follow,
1130
+ _request_auth,
1131
+ _content_type,
1132
+ _headers,
1133
+ _host_index,
1134
+ ) -> RequestSerialized:
1135
+
1136
+ _host = None
1137
+
1138
+ _collection_formats: Dict[str, str] = {
1139
+ }
1140
+
1141
+ _path_params: Dict[str, str] = {}
1142
+ _query_params: List[Tuple[str, str]] = []
1143
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1144
+ _form_params: List[Tuple[str, str]] = []
1145
+ _files: Dict[
1146
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1147
+ ] = {}
1148
+ _body_params: Optional[bytes] = None
1149
+
1150
+ # process the path parameters
1151
+ if id is not None:
1152
+ _path_params['id'] = id
1153
+ # process the query parameters
1154
+ if follow is not None:
1155
+
1156
+ _query_params.append(('follow', follow))
1157
+
1158
+ # process the header parameters
1159
+ if x_daytona_organization_id is not None:
1160
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
1161
+ # process the form parameters
1162
+ # process the body parameter
1163
+
1164
+
1165
+
1166
+
1167
+ # authentication setting
1168
+ _auth_settings: List[str] = [
1169
+ 'bearer',
1170
+ 'oauth2'
1171
+ ]
1172
+
1173
+ return self.api_client.param_serialize(
1174
+ method='GET',
1175
+ resource_path='/snapshots/{id}/build-logs',
1176
+ path_params=_path_params,
1177
+ query_params=_query_params,
1178
+ header_params=_header_params,
1179
+ body=_body_params,
1180
+ post_params=_form_params,
1181
+ files=_files,
1182
+ auth_settings=_auth_settings,
1183
+ collection_formats=_collection_formats,
1184
+ _host=_host,
1185
+ _request_auth=_request_auth
1186
+ )
1187
+
1188
+
1189
+
1190
+
1191
+ @validate_call
1192
+ async def remove_snapshot(
1193
+ self,
1194
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1195
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1196
+ _request_timeout: Union[
1197
+ None,
1198
+ Annotated[StrictFloat, Field(gt=0)],
1199
+ Tuple[
1200
+ Annotated[StrictFloat, Field(gt=0)],
1201
+ Annotated[StrictFloat, Field(gt=0)]
1202
+ ]
1203
+ ] = None,
1204
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1205
+ _content_type: Optional[StrictStr] = None,
1206
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1207
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1208
+ ) -> None:
1209
+ """Delete snapshot
1210
+
1211
+
1212
+ :param id: Snapshot ID (required)
1213
+ :type id: str
1214
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1215
+ :type x_daytona_organization_id: str
1216
+ :param _request_timeout: timeout setting for this request. If one
1217
+ number provided, it will be total request
1218
+ timeout. It can also be a pair (tuple) of
1219
+ (connection, read) timeouts.
1220
+ :type _request_timeout: int, tuple(int, int), optional
1221
+ :param _request_auth: set to override the auth_settings for an a single
1222
+ request; this effectively ignores the
1223
+ authentication in the spec for a single request.
1224
+ :type _request_auth: dict, optional
1225
+ :param _content_type: force content-type for the request.
1226
+ :type _content_type: str, Optional
1227
+ :param _headers: set to override the headers for a single
1228
+ request; this effectively ignores the headers
1229
+ in the spec for a single request.
1230
+ :type _headers: dict, optional
1231
+ :param _host_index: set to override the host_index for a single
1232
+ request; this effectively ignores the host_index
1233
+ in the spec for a single request.
1234
+ :type _host_index: int, optional
1235
+ :return: Returns the result object.
1236
+ """ # noqa: E501
1237
+
1238
+ _param = self._remove_snapshot_serialize(
1239
+ id=id,
1240
+ x_daytona_organization_id=x_daytona_organization_id,
1241
+ _request_auth=_request_auth,
1242
+ _content_type=_content_type,
1243
+ _headers=_headers,
1244
+ _host_index=_host_index
1245
+ )
1246
+
1247
+ _response_types_map: Dict[str, Optional[str]] = {
1248
+ '200': None,
1249
+ }
1250
+ response_data = await self.api_client.call_api(
1251
+ *_param,
1252
+ _request_timeout=_request_timeout
1253
+ )
1254
+ await response_data.read()
1255
+ return self.api_client.response_deserialize(
1256
+ response_data=response_data,
1257
+ response_types_map=_response_types_map,
1258
+ ).data
1259
+
1260
+
1261
+ @validate_call
1262
+ async def remove_snapshot_with_http_info(
1263
+ self,
1264
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1265
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1266
+ _request_timeout: Union[
1267
+ None,
1268
+ Annotated[StrictFloat, Field(gt=0)],
1269
+ Tuple[
1270
+ Annotated[StrictFloat, Field(gt=0)],
1271
+ Annotated[StrictFloat, Field(gt=0)]
1272
+ ]
1273
+ ] = None,
1274
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1275
+ _content_type: Optional[StrictStr] = None,
1276
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1277
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1278
+ ) -> ApiResponse[None]:
1279
+ """Delete snapshot
1280
+
1281
+
1282
+ :param id: Snapshot ID (required)
1283
+ :type id: str
1284
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1285
+ :type x_daytona_organization_id: str
1286
+ :param _request_timeout: timeout setting for this request. If one
1287
+ number provided, it will be total request
1288
+ timeout. It can also be a pair (tuple) of
1289
+ (connection, read) timeouts.
1290
+ :type _request_timeout: int, tuple(int, int), optional
1291
+ :param _request_auth: set to override the auth_settings for an a single
1292
+ request; this effectively ignores the
1293
+ authentication in the spec for a single request.
1294
+ :type _request_auth: dict, optional
1295
+ :param _content_type: force content-type for the request.
1296
+ :type _content_type: str, Optional
1297
+ :param _headers: set to override the headers for a single
1298
+ request; this effectively ignores the headers
1299
+ in the spec for a single request.
1300
+ :type _headers: dict, optional
1301
+ :param _host_index: set to override the host_index for a single
1302
+ request; this effectively ignores the host_index
1303
+ in the spec for a single request.
1304
+ :type _host_index: int, optional
1305
+ :return: Returns the result object.
1306
+ """ # noqa: E501
1307
+
1308
+ _param = self._remove_snapshot_serialize(
1309
+ id=id,
1310
+ x_daytona_organization_id=x_daytona_organization_id,
1311
+ _request_auth=_request_auth,
1312
+ _content_type=_content_type,
1313
+ _headers=_headers,
1314
+ _host_index=_host_index
1315
+ )
1316
+
1317
+ _response_types_map: Dict[str, Optional[str]] = {
1318
+ '200': None,
1319
+ }
1320
+ response_data = await self.api_client.call_api(
1321
+ *_param,
1322
+ _request_timeout=_request_timeout
1323
+ )
1324
+ await response_data.read()
1325
+ return self.api_client.response_deserialize(
1326
+ response_data=response_data,
1327
+ response_types_map=_response_types_map,
1328
+ )
1329
+
1330
+
1331
+ @validate_call
1332
+ async def remove_snapshot_without_preload_content(
1333
+ self,
1334
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1335
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1336
+ _request_timeout: Union[
1337
+ None,
1338
+ Annotated[StrictFloat, Field(gt=0)],
1339
+ Tuple[
1340
+ Annotated[StrictFloat, Field(gt=0)],
1341
+ Annotated[StrictFloat, Field(gt=0)]
1342
+ ]
1343
+ ] = None,
1344
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1345
+ _content_type: Optional[StrictStr] = None,
1346
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1347
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1348
+ ) -> RESTResponseType:
1349
+ """Delete snapshot
1350
+
1351
+
1352
+ :param id: Snapshot ID (required)
1353
+ :type id: str
1354
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1355
+ :type x_daytona_organization_id: str
1356
+ :param _request_timeout: timeout setting for this request. If one
1357
+ number provided, it will be total request
1358
+ timeout. It can also be a pair (tuple) of
1359
+ (connection, read) timeouts.
1360
+ :type _request_timeout: int, tuple(int, int), optional
1361
+ :param _request_auth: set to override the auth_settings for an a single
1362
+ request; this effectively ignores the
1363
+ authentication in the spec for a single request.
1364
+ :type _request_auth: dict, optional
1365
+ :param _content_type: force content-type for the request.
1366
+ :type _content_type: str, Optional
1367
+ :param _headers: set to override the headers for a single
1368
+ request; this effectively ignores the headers
1369
+ in the spec for a single request.
1370
+ :type _headers: dict, optional
1371
+ :param _host_index: set to override the host_index for a single
1372
+ request; this effectively ignores the host_index
1373
+ in the spec for a single request.
1374
+ :type _host_index: int, optional
1375
+ :return: Returns the result object.
1376
+ """ # noqa: E501
1377
+
1378
+ _param = self._remove_snapshot_serialize(
1379
+ id=id,
1380
+ x_daytona_organization_id=x_daytona_organization_id,
1381
+ _request_auth=_request_auth,
1382
+ _content_type=_content_type,
1383
+ _headers=_headers,
1384
+ _host_index=_host_index
1385
+ )
1386
+
1387
+ _response_types_map: Dict[str, Optional[str]] = {
1388
+ '200': None,
1389
+ }
1390
+ response_data = await self.api_client.call_api(
1391
+ *_param,
1392
+ _request_timeout=_request_timeout
1393
+ )
1394
+ return response_data.response
1395
+
1396
+
1397
+ def _remove_snapshot_serialize(
1398
+ self,
1399
+ id,
1400
+ x_daytona_organization_id,
1401
+ _request_auth,
1402
+ _content_type,
1403
+ _headers,
1404
+ _host_index,
1405
+ ) -> RequestSerialized:
1406
+
1407
+ _host = None
1408
+
1409
+ _collection_formats: Dict[str, str] = {
1410
+ }
1411
+
1412
+ _path_params: Dict[str, str] = {}
1413
+ _query_params: List[Tuple[str, str]] = []
1414
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1415
+ _form_params: List[Tuple[str, str]] = []
1416
+ _files: Dict[
1417
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1418
+ ] = {}
1419
+ _body_params: Optional[bytes] = None
1420
+
1421
+ # process the path parameters
1422
+ if id is not None:
1423
+ _path_params['id'] = id
1424
+ # process the query parameters
1425
+ # process the header parameters
1426
+ if x_daytona_organization_id is not None:
1427
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
1428
+ # process the form parameters
1429
+ # process the body parameter
1430
+
1431
+
1432
+
1433
+
1434
+ # authentication setting
1435
+ _auth_settings: List[str] = [
1436
+ 'bearer',
1437
+ 'oauth2'
1438
+ ]
1439
+
1440
+ return self.api_client.param_serialize(
1441
+ method='DELETE',
1442
+ resource_path='/snapshots/{id}',
1443
+ path_params=_path_params,
1444
+ query_params=_query_params,
1445
+ header_params=_header_params,
1446
+ body=_body_params,
1447
+ post_params=_form_params,
1448
+ files=_files,
1449
+ auth_settings=_auth_settings,
1450
+ collection_formats=_collection_formats,
1451
+ _host=_host,
1452
+ _request_auth=_request_auth
1453
+ )
1454
+
1455
+
1456
+
1457
+
1458
+ @validate_call
1459
+ async def set_snapshot_general_status(
1460
+ self,
1461
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1462
+ set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto,
1463
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1464
+ _request_timeout: Union[
1465
+ None,
1466
+ Annotated[StrictFloat, Field(gt=0)],
1467
+ Tuple[
1468
+ Annotated[StrictFloat, Field(gt=0)],
1469
+ Annotated[StrictFloat, Field(gt=0)]
1470
+ ]
1471
+ ] = None,
1472
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1473
+ _content_type: Optional[StrictStr] = None,
1474
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1475
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1476
+ ) -> SnapshotDto:
1477
+ """Set snapshot general status
1478
+
1479
+
1480
+ :param id: Snapshot ID (required)
1481
+ :type id: str
1482
+ :param set_snapshot_general_status_dto: (required)
1483
+ :type set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto
1484
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1485
+ :type x_daytona_organization_id: str
1486
+ :param _request_timeout: timeout setting for this request. If one
1487
+ number provided, it will be total request
1488
+ timeout. It can also be a pair (tuple) of
1489
+ (connection, read) timeouts.
1490
+ :type _request_timeout: int, tuple(int, int), optional
1491
+ :param _request_auth: set to override the auth_settings for an a single
1492
+ request; this effectively ignores the
1493
+ authentication in the spec for a single request.
1494
+ :type _request_auth: dict, optional
1495
+ :param _content_type: force content-type for the request.
1496
+ :type _content_type: str, Optional
1497
+ :param _headers: set to override the headers for a single
1498
+ request; this effectively ignores the headers
1499
+ in the spec for a single request.
1500
+ :type _headers: dict, optional
1501
+ :param _host_index: set to override the host_index for a single
1502
+ request; this effectively ignores the host_index
1503
+ in the spec for a single request.
1504
+ :type _host_index: int, optional
1505
+ :return: Returns the result object.
1506
+ """ # noqa: E501
1507
+
1508
+ _param = self._set_snapshot_general_status_serialize(
1509
+ id=id,
1510
+ set_snapshot_general_status_dto=set_snapshot_general_status_dto,
1511
+ x_daytona_organization_id=x_daytona_organization_id,
1512
+ _request_auth=_request_auth,
1513
+ _content_type=_content_type,
1514
+ _headers=_headers,
1515
+ _host_index=_host_index
1516
+ )
1517
+
1518
+ _response_types_map: Dict[str, Optional[str]] = {
1519
+ '200': "SnapshotDto",
1520
+ }
1521
+ response_data = await self.api_client.call_api(
1522
+ *_param,
1523
+ _request_timeout=_request_timeout
1524
+ )
1525
+ await response_data.read()
1526
+ return self.api_client.response_deserialize(
1527
+ response_data=response_data,
1528
+ response_types_map=_response_types_map,
1529
+ ).data
1530
+
1531
+
1532
+ @validate_call
1533
+ async def set_snapshot_general_status_with_http_info(
1534
+ self,
1535
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1536
+ set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto,
1537
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1538
+ _request_timeout: Union[
1539
+ None,
1540
+ Annotated[StrictFloat, Field(gt=0)],
1541
+ Tuple[
1542
+ Annotated[StrictFloat, Field(gt=0)],
1543
+ Annotated[StrictFloat, Field(gt=0)]
1544
+ ]
1545
+ ] = None,
1546
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1547
+ _content_type: Optional[StrictStr] = None,
1548
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1549
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1550
+ ) -> ApiResponse[SnapshotDto]:
1551
+ """Set snapshot general status
1552
+
1553
+
1554
+ :param id: Snapshot ID (required)
1555
+ :type id: str
1556
+ :param set_snapshot_general_status_dto: (required)
1557
+ :type set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto
1558
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1559
+ :type x_daytona_organization_id: str
1560
+ :param _request_timeout: timeout setting for this request. If one
1561
+ number provided, it will be total request
1562
+ timeout. It can also be a pair (tuple) of
1563
+ (connection, read) timeouts.
1564
+ :type _request_timeout: int, tuple(int, int), optional
1565
+ :param _request_auth: set to override the auth_settings for an a single
1566
+ request; this effectively ignores the
1567
+ authentication in the spec for a single request.
1568
+ :type _request_auth: dict, optional
1569
+ :param _content_type: force content-type for the request.
1570
+ :type _content_type: str, Optional
1571
+ :param _headers: set to override the headers for a single
1572
+ request; this effectively ignores the headers
1573
+ in the spec for a single request.
1574
+ :type _headers: dict, optional
1575
+ :param _host_index: set to override the host_index for a single
1576
+ request; this effectively ignores the host_index
1577
+ in the spec for a single request.
1578
+ :type _host_index: int, optional
1579
+ :return: Returns the result object.
1580
+ """ # noqa: E501
1581
+
1582
+ _param = self._set_snapshot_general_status_serialize(
1583
+ id=id,
1584
+ set_snapshot_general_status_dto=set_snapshot_general_status_dto,
1585
+ x_daytona_organization_id=x_daytona_organization_id,
1586
+ _request_auth=_request_auth,
1587
+ _content_type=_content_type,
1588
+ _headers=_headers,
1589
+ _host_index=_host_index
1590
+ )
1591
+
1592
+ _response_types_map: Dict[str, Optional[str]] = {
1593
+ '200': "SnapshotDto",
1594
+ }
1595
+ response_data = await self.api_client.call_api(
1596
+ *_param,
1597
+ _request_timeout=_request_timeout
1598
+ )
1599
+ await response_data.read()
1600
+ return self.api_client.response_deserialize(
1601
+ response_data=response_data,
1602
+ response_types_map=_response_types_map,
1603
+ )
1604
+
1605
+
1606
+ @validate_call
1607
+ async def set_snapshot_general_status_without_preload_content(
1608
+ self,
1609
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1610
+ set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto,
1611
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1612
+ _request_timeout: Union[
1613
+ None,
1614
+ Annotated[StrictFloat, Field(gt=0)],
1615
+ Tuple[
1616
+ Annotated[StrictFloat, Field(gt=0)],
1617
+ Annotated[StrictFloat, Field(gt=0)]
1618
+ ]
1619
+ ] = None,
1620
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1621
+ _content_type: Optional[StrictStr] = None,
1622
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1623
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1624
+ ) -> RESTResponseType:
1625
+ """Set snapshot general status
1626
+
1627
+
1628
+ :param id: Snapshot ID (required)
1629
+ :type id: str
1630
+ :param set_snapshot_general_status_dto: (required)
1631
+ :type set_snapshot_general_status_dto: SetSnapshotGeneralStatusDto
1632
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1633
+ :type x_daytona_organization_id: str
1634
+ :param _request_timeout: timeout setting for this request. If one
1635
+ number provided, it will be total request
1636
+ timeout. It can also be a pair (tuple) of
1637
+ (connection, read) timeouts.
1638
+ :type _request_timeout: int, tuple(int, int), optional
1639
+ :param _request_auth: set to override the auth_settings for an a single
1640
+ request; this effectively ignores the
1641
+ authentication in the spec for a single request.
1642
+ :type _request_auth: dict, optional
1643
+ :param _content_type: force content-type for the request.
1644
+ :type _content_type: str, Optional
1645
+ :param _headers: set to override the headers for a single
1646
+ request; this effectively ignores the headers
1647
+ in the spec for a single request.
1648
+ :type _headers: dict, optional
1649
+ :param _host_index: set to override the host_index for a single
1650
+ request; this effectively ignores the host_index
1651
+ in the spec for a single request.
1652
+ :type _host_index: int, optional
1653
+ :return: Returns the result object.
1654
+ """ # noqa: E501
1655
+
1656
+ _param = self._set_snapshot_general_status_serialize(
1657
+ id=id,
1658
+ set_snapshot_general_status_dto=set_snapshot_general_status_dto,
1659
+ x_daytona_organization_id=x_daytona_organization_id,
1660
+ _request_auth=_request_auth,
1661
+ _content_type=_content_type,
1662
+ _headers=_headers,
1663
+ _host_index=_host_index
1664
+ )
1665
+
1666
+ _response_types_map: Dict[str, Optional[str]] = {
1667
+ '200': "SnapshotDto",
1668
+ }
1669
+ response_data = await self.api_client.call_api(
1670
+ *_param,
1671
+ _request_timeout=_request_timeout
1672
+ )
1673
+ return response_data.response
1674
+
1675
+
1676
+ def _set_snapshot_general_status_serialize(
1677
+ self,
1678
+ id,
1679
+ set_snapshot_general_status_dto,
1680
+ x_daytona_organization_id,
1681
+ _request_auth,
1682
+ _content_type,
1683
+ _headers,
1684
+ _host_index,
1685
+ ) -> RequestSerialized:
1686
+
1687
+ _host = None
1688
+
1689
+ _collection_formats: Dict[str, str] = {
1690
+ }
1691
+
1692
+ _path_params: Dict[str, str] = {}
1693
+ _query_params: List[Tuple[str, str]] = []
1694
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1695
+ _form_params: List[Tuple[str, str]] = []
1696
+ _files: Dict[
1697
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1698
+ ] = {}
1699
+ _body_params: Optional[bytes] = None
1700
+
1701
+ # process the path parameters
1702
+ if id is not None:
1703
+ _path_params['id'] = id
1704
+ # process the query parameters
1705
+ # process the header parameters
1706
+ if x_daytona_organization_id is not None:
1707
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
1708
+ # process the form parameters
1709
+ # process the body parameter
1710
+ if set_snapshot_general_status_dto is not None:
1711
+ _body_params = set_snapshot_general_status_dto
1712
+
1713
+
1714
+ # set the HTTP header `Accept`
1715
+ if 'Accept' not in _header_params:
1716
+ _header_params['Accept'] = self.api_client.select_header_accept(
1717
+ [
1718
+ 'application/json'
1719
+ ]
1720
+ )
1721
+
1722
+ # set the HTTP header `Content-Type`
1723
+ if _content_type:
1724
+ _header_params['Content-Type'] = _content_type
1725
+ else:
1726
+ _default_content_type = (
1727
+ self.api_client.select_header_content_type(
1728
+ [
1729
+ 'application/json'
1730
+ ]
1731
+ )
1732
+ )
1733
+ if _default_content_type is not None:
1734
+ _header_params['Content-Type'] = _default_content_type
1735
+
1736
+ # authentication setting
1737
+ _auth_settings: List[str] = [
1738
+ 'bearer',
1739
+ 'oauth2'
1740
+ ]
1741
+
1742
+ return self.api_client.param_serialize(
1743
+ method='PATCH',
1744
+ resource_path='/snapshots/{id}/general',
1745
+ path_params=_path_params,
1746
+ query_params=_query_params,
1747
+ header_params=_header_params,
1748
+ body=_body_params,
1749
+ post_params=_form_params,
1750
+ files=_files,
1751
+ auth_settings=_auth_settings,
1752
+ collection_formats=_collection_formats,
1753
+ _host=_host,
1754
+ _request_auth=_request_auth
1755
+ )
1756
+
1757
+
1758
+
1759
+
1760
+ @validate_call
1761
+ async def toggle_snapshot_state(
1762
+ self,
1763
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1764
+ toggle_state: ToggleState,
1765
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1766
+ _request_timeout: Union[
1767
+ None,
1768
+ Annotated[StrictFloat, Field(gt=0)],
1769
+ Tuple[
1770
+ Annotated[StrictFloat, Field(gt=0)],
1771
+ Annotated[StrictFloat, Field(gt=0)]
1772
+ ]
1773
+ ] = None,
1774
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1775
+ _content_type: Optional[StrictStr] = None,
1776
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1777
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1778
+ ) -> SnapshotDto:
1779
+ """Toggle snapshot state
1780
+
1781
+
1782
+ :param id: Snapshot ID (required)
1783
+ :type id: str
1784
+ :param toggle_state: (required)
1785
+ :type toggle_state: ToggleState
1786
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1787
+ :type x_daytona_organization_id: str
1788
+ :param _request_timeout: timeout setting for this request. If one
1789
+ number provided, it will be total request
1790
+ timeout. It can also be a pair (tuple) of
1791
+ (connection, read) timeouts.
1792
+ :type _request_timeout: int, tuple(int, int), optional
1793
+ :param _request_auth: set to override the auth_settings for an a single
1794
+ request; this effectively ignores the
1795
+ authentication in the spec for a single request.
1796
+ :type _request_auth: dict, optional
1797
+ :param _content_type: force content-type for the request.
1798
+ :type _content_type: str, Optional
1799
+ :param _headers: set to override the headers for a single
1800
+ request; this effectively ignores the headers
1801
+ in the spec for a single request.
1802
+ :type _headers: dict, optional
1803
+ :param _host_index: set to override the host_index for a single
1804
+ request; this effectively ignores the host_index
1805
+ in the spec for a single request.
1806
+ :type _host_index: int, optional
1807
+ :return: Returns the result object.
1808
+ """ # noqa: E501
1809
+
1810
+ _param = self._toggle_snapshot_state_serialize(
1811
+ id=id,
1812
+ toggle_state=toggle_state,
1813
+ x_daytona_organization_id=x_daytona_organization_id,
1814
+ _request_auth=_request_auth,
1815
+ _content_type=_content_type,
1816
+ _headers=_headers,
1817
+ _host_index=_host_index
1818
+ )
1819
+
1820
+ _response_types_map: Dict[str, Optional[str]] = {
1821
+ '200': "SnapshotDto",
1822
+ }
1823
+ response_data = await self.api_client.call_api(
1824
+ *_param,
1825
+ _request_timeout=_request_timeout
1826
+ )
1827
+ await response_data.read()
1828
+ return self.api_client.response_deserialize(
1829
+ response_data=response_data,
1830
+ response_types_map=_response_types_map,
1831
+ ).data
1832
+
1833
+
1834
+ @validate_call
1835
+ async def toggle_snapshot_state_with_http_info(
1836
+ self,
1837
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1838
+ toggle_state: ToggleState,
1839
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1840
+ _request_timeout: Union[
1841
+ None,
1842
+ Annotated[StrictFloat, Field(gt=0)],
1843
+ Tuple[
1844
+ Annotated[StrictFloat, Field(gt=0)],
1845
+ Annotated[StrictFloat, Field(gt=0)]
1846
+ ]
1847
+ ] = None,
1848
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1849
+ _content_type: Optional[StrictStr] = None,
1850
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1851
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1852
+ ) -> ApiResponse[SnapshotDto]:
1853
+ """Toggle snapshot state
1854
+
1855
+
1856
+ :param id: Snapshot ID (required)
1857
+ :type id: str
1858
+ :param toggle_state: (required)
1859
+ :type toggle_state: ToggleState
1860
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1861
+ :type x_daytona_organization_id: str
1862
+ :param _request_timeout: timeout setting for this request. If one
1863
+ number provided, it will be total request
1864
+ timeout. It can also be a pair (tuple) of
1865
+ (connection, read) timeouts.
1866
+ :type _request_timeout: int, tuple(int, int), optional
1867
+ :param _request_auth: set to override the auth_settings for an a single
1868
+ request; this effectively ignores the
1869
+ authentication in the spec for a single request.
1870
+ :type _request_auth: dict, optional
1871
+ :param _content_type: force content-type for the request.
1872
+ :type _content_type: str, Optional
1873
+ :param _headers: set to override the headers for a single
1874
+ request; this effectively ignores the headers
1875
+ in the spec for a single request.
1876
+ :type _headers: dict, optional
1877
+ :param _host_index: set to override the host_index for a single
1878
+ request; this effectively ignores the host_index
1879
+ in the spec for a single request.
1880
+ :type _host_index: int, optional
1881
+ :return: Returns the result object.
1882
+ """ # noqa: E501
1883
+
1884
+ _param = self._toggle_snapshot_state_serialize(
1885
+ id=id,
1886
+ toggle_state=toggle_state,
1887
+ x_daytona_organization_id=x_daytona_organization_id,
1888
+ _request_auth=_request_auth,
1889
+ _content_type=_content_type,
1890
+ _headers=_headers,
1891
+ _host_index=_host_index
1892
+ )
1893
+
1894
+ _response_types_map: Dict[str, Optional[str]] = {
1895
+ '200': "SnapshotDto",
1896
+ }
1897
+ response_data = await self.api_client.call_api(
1898
+ *_param,
1899
+ _request_timeout=_request_timeout
1900
+ )
1901
+ await response_data.read()
1902
+ return self.api_client.response_deserialize(
1903
+ response_data=response_data,
1904
+ response_types_map=_response_types_map,
1905
+ )
1906
+
1907
+
1908
+ @validate_call
1909
+ async def toggle_snapshot_state_without_preload_content(
1910
+ self,
1911
+ id: Annotated[StrictStr, Field(description="Snapshot ID")],
1912
+ toggle_state: ToggleState,
1913
+ x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1914
+ _request_timeout: Union[
1915
+ None,
1916
+ Annotated[StrictFloat, Field(gt=0)],
1917
+ Tuple[
1918
+ Annotated[StrictFloat, Field(gt=0)],
1919
+ Annotated[StrictFloat, Field(gt=0)]
1920
+ ]
1921
+ ] = None,
1922
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1923
+ _content_type: Optional[StrictStr] = None,
1924
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1925
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1926
+ ) -> RESTResponseType:
1927
+ """Toggle snapshot state
1928
+
1929
+
1930
+ :param id: Snapshot ID (required)
1931
+ :type id: str
1932
+ :param toggle_state: (required)
1933
+ :type toggle_state: ToggleState
1934
+ :param x_daytona_organization_id: Use with JWT to specify the organization ID
1935
+ :type x_daytona_organization_id: str
1936
+ :param _request_timeout: timeout setting for this request. If one
1937
+ number provided, it will be total request
1938
+ timeout. It can also be a pair (tuple) of
1939
+ (connection, read) timeouts.
1940
+ :type _request_timeout: int, tuple(int, int), optional
1941
+ :param _request_auth: set to override the auth_settings for an a single
1942
+ request; this effectively ignores the
1943
+ authentication in the spec for a single request.
1944
+ :type _request_auth: dict, optional
1945
+ :param _content_type: force content-type for the request.
1946
+ :type _content_type: str, Optional
1947
+ :param _headers: set to override the headers for a single
1948
+ request; this effectively ignores the headers
1949
+ in the spec for a single request.
1950
+ :type _headers: dict, optional
1951
+ :param _host_index: set to override the host_index for a single
1952
+ request; this effectively ignores the host_index
1953
+ in the spec for a single request.
1954
+ :type _host_index: int, optional
1955
+ :return: Returns the result object.
1956
+ """ # noqa: E501
1957
+
1958
+ _param = self._toggle_snapshot_state_serialize(
1959
+ id=id,
1960
+ toggle_state=toggle_state,
1961
+ x_daytona_organization_id=x_daytona_organization_id,
1962
+ _request_auth=_request_auth,
1963
+ _content_type=_content_type,
1964
+ _headers=_headers,
1965
+ _host_index=_host_index
1966
+ )
1967
+
1968
+ _response_types_map: Dict[str, Optional[str]] = {
1969
+ '200': "SnapshotDto",
1970
+ }
1971
+ response_data = await self.api_client.call_api(
1972
+ *_param,
1973
+ _request_timeout=_request_timeout
1974
+ )
1975
+ return response_data.response
1976
+
1977
+
1978
+ def _toggle_snapshot_state_serialize(
1979
+ self,
1980
+ id,
1981
+ toggle_state,
1982
+ x_daytona_organization_id,
1983
+ _request_auth,
1984
+ _content_type,
1985
+ _headers,
1986
+ _host_index,
1987
+ ) -> RequestSerialized:
1988
+
1989
+ _host = None
1990
+
1991
+ _collection_formats: Dict[str, str] = {
1992
+ }
1993
+
1994
+ _path_params: Dict[str, str] = {}
1995
+ _query_params: List[Tuple[str, str]] = []
1996
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1997
+ _form_params: List[Tuple[str, str]] = []
1998
+ _files: Dict[
1999
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2000
+ ] = {}
2001
+ _body_params: Optional[bytes] = None
2002
+
2003
+ # process the path parameters
2004
+ if id is not None:
2005
+ _path_params['id'] = id
2006
+ # process the query parameters
2007
+ # process the header parameters
2008
+ if x_daytona_organization_id is not None:
2009
+ _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
2010
+ # process the form parameters
2011
+ # process the body parameter
2012
+ if toggle_state is not None:
2013
+ _body_params = toggle_state
2014
+
2015
+
2016
+ # set the HTTP header `Accept`
2017
+ if 'Accept' not in _header_params:
2018
+ _header_params['Accept'] = self.api_client.select_header_accept(
2019
+ [
2020
+ 'application/json'
2021
+ ]
2022
+ )
2023
+
2024
+ # set the HTTP header `Content-Type`
2025
+ if _content_type:
2026
+ _header_params['Content-Type'] = _content_type
2027
+ else:
2028
+ _default_content_type = (
2029
+ self.api_client.select_header_content_type(
2030
+ [
2031
+ 'application/json'
2032
+ ]
2033
+ )
2034
+ )
2035
+ if _default_content_type is not None:
2036
+ _header_params['Content-Type'] = _default_content_type
2037
+
2038
+ # authentication setting
2039
+ _auth_settings: List[str] = [
2040
+ 'bearer',
2041
+ 'oauth2'
2042
+ ]
2043
+
2044
+ return self.api_client.param_serialize(
2045
+ method='PATCH',
2046
+ resource_path='/snapshots/{id}/toggle',
2047
+ path_params=_path_params,
2048
+ query_params=_query_params,
2049
+ header_params=_header_params,
2050
+ body=_body_params,
2051
+ post_params=_form_params,
2052
+ files=_files,
2053
+ auth_settings=_auth_settings,
2054
+ collection_formats=_collection_formats,
2055
+ _host=_host,
2056
+ _request_auth=_request_auth
2057
+ )
2058
+
2059
+