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