daytona_api_client 0.106.0a2__py3-none-any.whl → 0.107.0rc1__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.

@@ -17,14 +17,11 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
17
  from typing import Any, Dict, List, Optional, Tuple, Union
18
18
  from typing_extensions import Annotated
19
19
 
20
- from datetime import datetime
21
- from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
20
+ from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr
22
21
  from typing import List, Optional, Union
23
22
  from typing_extensions import Annotated
24
23
  from daytona_api_client.models.create_sandbox import CreateSandbox
25
- from daytona_api_client.models.paginated_sandboxes import PaginatedSandboxes
26
24
  from daytona_api_client.models.port_preview_url import PortPreviewUrl
27
- from daytona_api_client.models.region import Region
28
25
  from daytona_api_client.models.sandbox import Sandbox
29
26
  from daytona_api_client.models.sandbox_labels import SandboxLabels
30
27
  from daytona_api_client.models.ssh_access_dto import SshAccessDto
@@ -1172,6 +1169,7 @@ class SandboxApi:
1172
1169
  def delete_sandbox(
1173
1170
  self,
1174
1171
  sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1172
+ force: StrictBool,
1175
1173
  x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1176
1174
  _request_timeout: Union[
1177
1175
  None,
@@ -1191,6 +1189,8 @@ class SandboxApi:
1191
1189
 
1192
1190
  :param sandbox_id: ID of the sandbox (required)
1193
1191
  :type sandbox_id: str
1192
+ :param force: (required)
1193
+ :type force: bool
1194
1194
  :param x_daytona_organization_id: Use with JWT to specify the organization ID
1195
1195
  :type x_daytona_organization_id: str
1196
1196
  :param _request_timeout: timeout setting for this request. If one
@@ -1217,6 +1217,7 @@ class SandboxApi:
1217
1217
 
1218
1218
  _param = self._delete_sandbox_serialize(
1219
1219
  sandbox_id=sandbox_id,
1220
+ force=force,
1220
1221
  x_daytona_organization_id=x_daytona_organization_id,
1221
1222
  _request_auth=_request_auth,
1222
1223
  _content_type=_content_type,
@@ -1242,6 +1243,7 @@ class SandboxApi:
1242
1243
  def delete_sandbox_with_http_info(
1243
1244
  self,
1244
1245
  sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1246
+ force: StrictBool,
1245
1247
  x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1246
1248
  _request_timeout: Union[
1247
1249
  None,
@@ -1261,6 +1263,8 @@ class SandboxApi:
1261
1263
 
1262
1264
  :param sandbox_id: ID of the sandbox (required)
1263
1265
  :type sandbox_id: str
1266
+ :param force: (required)
1267
+ :type force: bool
1264
1268
  :param x_daytona_organization_id: Use with JWT to specify the organization ID
1265
1269
  :type x_daytona_organization_id: str
1266
1270
  :param _request_timeout: timeout setting for this request. If one
@@ -1287,6 +1291,7 @@ class SandboxApi:
1287
1291
 
1288
1292
  _param = self._delete_sandbox_serialize(
1289
1293
  sandbox_id=sandbox_id,
1294
+ force=force,
1290
1295
  x_daytona_organization_id=x_daytona_organization_id,
1291
1296
  _request_auth=_request_auth,
1292
1297
  _content_type=_content_type,
@@ -1312,6 +1317,7 @@ class SandboxApi:
1312
1317
  def delete_sandbox_without_preload_content(
1313
1318
  self,
1314
1319
  sandbox_id: Annotated[StrictStr, Field(description="ID of the sandbox")],
1320
+ force: StrictBool,
1315
1321
  x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
1316
1322
  _request_timeout: Union[
1317
1323
  None,
@@ -1331,6 +1337,8 @@ class SandboxApi:
1331
1337
 
1332
1338
  :param sandbox_id: ID of the sandbox (required)
1333
1339
  :type sandbox_id: str
1340
+ :param force: (required)
1341
+ :type force: bool
1334
1342
  :param x_daytona_organization_id: Use with JWT to specify the organization ID
1335
1343
  :type x_daytona_organization_id: str
1336
1344
  :param _request_timeout: timeout setting for this request. If one
@@ -1357,6 +1365,7 @@ class SandboxApi:
1357
1365
 
1358
1366
  _param = self._delete_sandbox_serialize(
1359
1367
  sandbox_id=sandbox_id,
1368
+ force=force,
1360
1369
  x_daytona_organization_id=x_daytona_organization_id,
1361
1370
  _request_auth=_request_auth,
1362
1371
  _content_type=_content_type,
@@ -1377,6 +1386,7 @@ class SandboxApi:
1377
1386
  def _delete_sandbox_serialize(
1378
1387
  self,
1379
1388
  sandbox_id,
1389
+ force,
1380
1390
  x_daytona_organization_id,
1381
1391
  _request_auth,
1382
1392
  _content_type,
@@ -1402,6 +1412,10 @@ class SandboxApi:
1402
1412
  if sandbox_id is not None:
1403
1413
  _path_params['sandboxId'] = sandbox_id
1404
1414
  # process the query parameters
1415
+ if force is not None:
1416
+
1417
+ _query_params.append(('force', force))
1418
+
1405
1419
  # process the header parameters
1406
1420
  if x_daytona_organization_id is not None:
1407
1421
  _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
@@ -2299,265 +2313,6 @@ class SandboxApi:
2299
2313
 
2300
2314
 
2301
2315
 
2302
- @validate_call
2303
- def get_sandbox_regions(
2304
- self,
2305
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
2306
- _request_timeout: Union[
2307
- None,
2308
- Annotated[StrictFloat, Field(gt=0)],
2309
- Tuple[
2310
- Annotated[StrictFloat, Field(gt=0)],
2311
- Annotated[StrictFloat, Field(gt=0)]
2312
- ]
2313
- ] = None,
2314
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2315
- _content_type: Optional[StrictStr] = None,
2316
- _headers: Optional[Dict[StrictStr, Any]] = None,
2317
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2318
- ) -> List[Region]:
2319
- """List all regions where sandboxes have been created
2320
-
2321
-
2322
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
2323
- :type x_daytona_organization_id: str
2324
- :param _request_timeout: timeout setting for this request. If one
2325
- number provided, it will be total request
2326
- timeout. It can also be a pair (tuple) of
2327
- (connection, read) timeouts.
2328
- :type _request_timeout: int, tuple(int, int), optional
2329
- :param _request_auth: set to override the auth_settings for an a single
2330
- request; this effectively ignores the
2331
- authentication in the spec for a single request.
2332
- :type _request_auth: dict, optional
2333
- :param _content_type: force content-type for the request.
2334
- :type _content_type: str, Optional
2335
- :param _headers: set to override the headers for a single
2336
- request; this effectively ignores the headers
2337
- in the spec for a single request.
2338
- :type _headers: dict, optional
2339
- :param _host_index: set to override the host_index for a single
2340
- request; this effectively ignores the host_index
2341
- in the spec for a single request.
2342
- :type _host_index: int, optional
2343
- :return: Returns the result object.
2344
- """ # noqa: E501
2345
-
2346
- _param = self._get_sandbox_regions_serialize(
2347
- x_daytona_organization_id=x_daytona_organization_id,
2348
- _request_auth=_request_auth,
2349
- _content_type=_content_type,
2350
- _headers=_headers,
2351
- _host_index=_host_index
2352
- )
2353
-
2354
- _response_types_map: Dict[str, Optional[str]] = {
2355
- '200': "List[Region]",
2356
- }
2357
- response_data = self.api_client.call_api(
2358
- *_param,
2359
- _request_timeout=_request_timeout
2360
- )
2361
- response_data.read()
2362
- return self.api_client.response_deserialize(
2363
- response_data=response_data,
2364
- response_types_map=_response_types_map,
2365
- ).data
2366
-
2367
-
2368
- @validate_call
2369
- def get_sandbox_regions_with_http_info(
2370
- self,
2371
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
2372
- _request_timeout: Union[
2373
- None,
2374
- Annotated[StrictFloat, Field(gt=0)],
2375
- Tuple[
2376
- Annotated[StrictFloat, Field(gt=0)],
2377
- Annotated[StrictFloat, Field(gt=0)]
2378
- ]
2379
- ] = None,
2380
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2381
- _content_type: Optional[StrictStr] = None,
2382
- _headers: Optional[Dict[StrictStr, Any]] = None,
2383
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2384
- ) -> ApiResponse[List[Region]]:
2385
- """List all regions where sandboxes have been created
2386
-
2387
-
2388
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
2389
- :type x_daytona_organization_id: str
2390
- :param _request_timeout: timeout setting for this request. If one
2391
- number provided, it will be total request
2392
- timeout. It can also be a pair (tuple) of
2393
- (connection, read) timeouts.
2394
- :type _request_timeout: int, tuple(int, int), optional
2395
- :param _request_auth: set to override the auth_settings for an a single
2396
- request; this effectively ignores the
2397
- authentication in the spec for a single request.
2398
- :type _request_auth: dict, optional
2399
- :param _content_type: force content-type for the request.
2400
- :type _content_type: str, Optional
2401
- :param _headers: set to override the headers for a single
2402
- request; this effectively ignores the headers
2403
- in the spec for a single request.
2404
- :type _headers: dict, optional
2405
- :param _host_index: set to override the host_index for a single
2406
- request; this effectively ignores the host_index
2407
- in the spec for a single request.
2408
- :type _host_index: int, optional
2409
- :return: Returns the result object.
2410
- """ # noqa: E501
2411
-
2412
- _param = self._get_sandbox_regions_serialize(
2413
- x_daytona_organization_id=x_daytona_organization_id,
2414
- _request_auth=_request_auth,
2415
- _content_type=_content_type,
2416
- _headers=_headers,
2417
- _host_index=_host_index
2418
- )
2419
-
2420
- _response_types_map: Dict[str, Optional[str]] = {
2421
- '200': "List[Region]",
2422
- }
2423
- response_data = self.api_client.call_api(
2424
- *_param,
2425
- _request_timeout=_request_timeout
2426
- )
2427
- response_data.read()
2428
- return self.api_client.response_deserialize(
2429
- response_data=response_data,
2430
- response_types_map=_response_types_map,
2431
- )
2432
-
2433
-
2434
- @validate_call
2435
- def get_sandbox_regions_without_preload_content(
2436
- self,
2437
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
2438
- _request_timeout: Union[
2439
- None,
2440
- Annotated[StrictFloat, Field(gt=0)],
2441
- Tuple[
2442
- Annotated[StrictFloat, Field(gt=0)],
2443
- Annotated[StrictFloat, Field(gt=0)]
2444
- ]
2445
- ] = None,
2446
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2447
- _content_type: Optional[StrictStr] = None,
2448
- _headers: Optional[Dict[StrictStr, Any]] = None,
2449
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2450
- ) -> RESTResponseType:
2451
- """List all regions where sandboxes have been created
2452
-
2453
-
2454
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
2455
- :type x_daytona_organization_id: str
2456
- :param _request_timeout: timeout setting for this request. If one
2457
- number provided, it will be total request
2458
- timeout. It can also be a pair (tuple) of
2459
- (connection, read) timeouts.
2460
- :type _request_timeout: int, tuple(int, int), optional
2461
- :param _request_auth: set to override the auth_settings for an a single
2462
- request; this effectively ignores the
2463
- authentication in the spec for a single request.
2464
- :type _request_auth: dict, optional
2465
- :param _content_type: force content-type for the request.
2466
- :type _content_type: str, Optional
2467
- :param _headers: set to override the headers for a single
2468
- request; this effectively ignores the headers
2469
- in the spec for a single request.
2470
- :type _headers: dict, optional
2471
- :param _host_index: set to override the host_index for a single
2472
- request; this effectively ignores the host_index
2473
- in the spec for a single request.
2474
- :type _host_index: int, optional
2475
- :return: Returns the result object.
2476
- """ # noqa: E501
2477
-
2478
- _param = self._get_sandbox_regions_serialize(
2479
- x_daytona_organization_id=x_daytona_organization_id,
2480
- _request_auth=_request_auth,
2481
- _content_type=_content_type,
2482
- _headers=_headers,
2483
- _host_index=_host_index
2484
- )
2485
-
2486
- _response_types_map: Dict[str, Optional[str]] = {
2487
- '200': "List[Region]",
2488
- }
2489
- response_data = self.api_client.call_api(
2490
- *_param,
2491
- _request_timeout=_request_timeout
2492
- )
2493
- return response_data.response
2494
-
2495
-
2496
- def _get_sandbox_regions_serialize(
2497
- self,
2498
- x_daytona_organization_id,
2499
- _request_auth,
2500
- _content_type,
2501
- _headers,
2502
- _host_index,
2503
- ) -> RequestSerialized:
2504
-
2505
- _host = None
2506
-
2507
- _collection_formats: Dict[str, str] = {
2508
- }
2509
-
2510
- _path_params: Dict[str, str] = {}
2511
- _query_params: List[Tuple[str, str]] = []
2512
- _header_params: Dict[str, Optional[str]] = _headers or {}
2513
- _form_params: List[Tuple[str, str]] = []
2514
- _files: Dict[
2515
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2516
- ] = {}
2517
- _body_params: Optional[bytes] = None
2518
-
2519
- # process the path parameters
2520
- # process the query parameters
2521
- # process the header parameters
2522
- if x_daytona_organization_id is not None:
2523
- _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
2524
- # process the form parameters
2525
- # process the body parameter
2526
-
2527
-
2528
- # set the HTTP header `Accept`
2529
- if 'Accept' not in _header_params:
2530
- _header_params['Accept'] = self.api_client.select_header_accept(
2531
- [
2532
- 'application/json'
2533
- ]
2534
- )
2535
-
2536
-
2537
- # authentication setting
2538
- _auth_settings: List[str] = [
2539
- 'bearer',
2540
- 'oauth2'
2541
- ]
2542
-
2543
- return self.api_client.param_serialize(
2544
- method='GET',
2545
- resource_path='/sandbox/regions',
2546
- path_params=_path_params,
2547
- query_params=_query_params,
2548
- header_params=_header_params,
2549
- body=_body_params,
2550
- post_params=_form_params,
2551
- files=_files,
2552
- auth_settings=_auth_settings,
2553
- collection_formats=_collection_formats,
2554
- _host=_host,
2555
- _request_auth=_request_auth
2556
- )
2557
-
2558
-
2559
-
2560
-
2561
2316
  @validate_call
2562
2317
  def get_sandboxes_for_runner(
2563
2318
  self,
@@ -3161,592 +2916,6 @@ class SandboxApi:
3161
2916
 
3162
2917
 
3163
2918
 
3164
- @validate_call
3165
- def list_sandboxes_paginated(
3166
- self,
3167
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
3168
- page: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Page number of the results")] = None,
3169
- limit: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Number of results per page")] = None,
3170
- id: Annotated[Optional[StrictStr], Field(description="Filter by partial ID match")] = None,
3171
- labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
3172
- include_errored_deleted: Annotated[Optional[StrictBool], Field(description="Include results with errored state and deleted desired state")] = None,
3173
- states: Annotated[Optional[List[StrictStr]], Field(description="List of states to filter by")] = None,
3174
- snapshots: Annotated[Optional[List[StrictStr]], Field(description="List of snapshot names to filter by")] = None,
3175
- regions: Annotated[Optional[List[StrictStr]], Field(description="List of regions to filter by")] = None,
3176
- min_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum CPU")] = None,
3177
- max_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum CPU")] = None,
3178
- min_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum memory in GiB")] = None,
3179
- max_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum memory in GiB")] = None,
3180
- min_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum disk space in GiB")] = None,
3181
- max_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum disk space in GiB")] = None,
3182
- last_event_after: Annotated[Optional[datetime], Field(description="Include items with last event after this timestamp")] = None,
3183
- last_event_before: Annotated[Optional[datetime], Field(description="Include items with last event before this timestamp")] = None,
3184
- sort: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None,
3185
- order: Annotated[Optional[StrictStr], Field(description="Direction to sort by")] = None,
3186
- _request_timeout: Union[
3187
- None,
3188
- Annotated[StrictFloat, Field(gt=0)],
3189
- Tuple[
3190
- Annotated[StrictFloat, Field(gt=0)],
3191
- Annotated[StrictFloat, Field(gt=0)]
3192
- ]
3193
- ] = None,
3194
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3195
- _content_type: Optional[StrictStr] = None,
3196
- _headers: Optional[Dict[StrictStr, Any]] = None,
3197
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3198
- ) -> PaginatedSandboxes:
3199
- """List all sandboxes paginated
3200
-
3201
-
3202
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
3203
- :type x_daytona_organization_id: str
3204
- :param page: Page number of the results
3205
- :type page: float
3206
- :param limit: Number of results per page
3207
- :type limit: float
3208
- :param id: Filter by partial ID match
3209
- :type id: str
3210
- :param labels: JSON encoded labels to filter by
3211
- :type labels: str
3212
- :param include_errored_deleted: Include results with errored state and deleted desired state
3213
- :type include_errored_deleted: bool
3214
- :param states: List of states to filter by
3215
- :type states: List[str]
3216
- :param snapshots: List of snapshot names to filter by
3217
- :type snapshots: List[str]
3218
- :param regions: List of regions to filter by
3219
- :type regions: List[str]
3220
- :param min_cpu: Minimum CPU
3221
- :type min_cpu: float
3222
- :param max_cpu: Maximum CPU
3223
- :type max_cpu: float
3224
- :param min_memory_gi_b: Minimum memory in GiB
3225
- :type min_memory_gi_b: float
3226
- :param max_memory_gi_b: Maximum memory in GiB
3227
- :type max_memory_gi_b: float
3228
- :param min_disk_gi_b: Minimum disk space in GiB
3229
- :type min_disk_gi_b: float
3230
- :param max_disk_gi_b: Maximum disk space in GiB
3231
- :type max_disk_gi_b: float
3232
- :param last_event_after: Include items with last event after this timestamp
3233
- :type last_event_after: datetime
3234
- :param last_event_before: Include items with last event before this timestamp
3235
- :type last_event_before: datetime
3236
- :param sort: Field to sort by
3237
- :type sort: str
3238
- :param order: Direction to sort by
3239
- :type order: str
3240
- :param _request_timeout: timeout setting for this request. If one
3241
- number provided, it will be total request
3242
- timeout. It can also be a pair (tuple) of
3243
- (connection, read) timeouts.
3244
- :type _request_timeout: int, tuple(int, int), optional
3245
- :param _request_auth: set to override the auth_settings for an a single
3246
- request; this effectively ignores the
3247
- authentication in the spec for a single request.
3248
- :type _request_auth: dict, optional
3249
- :param _content_type: force content-type for the request.
3250
- :type _content_type: str, Optional
3251
- :param _headers: set to override the headers for a single
3252
- request; this effectively ignores the headers
3253
- in the spec for a single request.
3254
- :type _headers: dict, optional
3255
- :param _host_index: set to override the host_index for a single
3256
- request; this effectively ignores the host_index
3257
- in the spec for a single request.
3258
- :type _host_index: int, optional
3259
- :return: Returns the result object.
3260
- """ # noqa: E501
3261
-
3262
- _param = self._list_sandboxes_paginated_serialize(
3263
- x_daytona_organization_id=x_daytona_organization_id,
3264
- page=page,
3265
- limit=limit,
3266
- id=id,
3267
- labels=labels,
3268
- include_errored_deleted=include_errored_deleted,
3269
- states=states,
3270
- snapshots=snapshots,
3271
- regions=regions,
3272
- min_cpu=min_cpu,
3273
- max_cpu=max_cpu,
3274
- min_memory_gi_b=min_memory_gi_b,
3275
- max_memory_gi_b=max_memory_gi_b,
3276
- min_disk_gi_b=min_disk_gi_b,
3277
- max_disk_gi_b=max_disk_gi_b,
3278
- last_event_after=last_event_after,
3279
- last_event_before=last_event_before,
3280
- sort=sort,
3281
- order=order,
3282
- _request_auth=_request_auth,
3283
- _content_type=_content_type,
3284
- _headers=_headers,
3285
- _host_index=_host_index
3286
- )
3287
-
3288
- _response_types_map: Dict[str, Optional[str]] = {
3289
- '200': "PaginatedSandboxes",
3290
- }
3291
- response_data = self.api_client.call_api(
3292
- *_param,
3293
- _request_timeout=_request_timeout
3294
- )
3295
- response_data.read()
3296
- return self.api_client.response_deserialize(
3297
- response_data=response_data,
3298
- response_types_map=_response_types_map,
3299
- ).data
3300
-
3301
-
3302
- @validate_call
3303
- def list_sandboxes_paginated_with_http_info(
3304
- self,
3305
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
3306
- page: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Page number of the results")] = None,
3307
- limit: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Number of results per page")] = None,
3308
- id: Annotated[Optional[StrictStr], Field(description="Filter by partial ID match")] = None,
3309
- labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
3310
- include_errored_deleted: Annotated[Optional[StrictBool], Field(description="Include results with errored state and deleted desired state")] = None,
3311
- states: Annotated[Optional[List[StrictStr]], Field(description="List of states to filter by")] = None,
3312
- snapshots: Annotated[Optional[List[StrictStr]], Field(description="List of snapshot names to filter by")] = None,
3313
- regions: Annotated[Optional[List[StrictStr]], Field(description="List of regions to filter by")] = None,
3314
- min_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum CPU")] = None,
3315
- max_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum CPU")] = None,
3316
- min_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum memory in GiB")] = None,
3317
- max_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum memory in GiB")] = None,
3318
- min_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum disk space in GiB")] = None,
3319
- max_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum disk space in GiB")] = None,
3320
- last_event_after: Annotated[Optional[datetime], Field(description="Include items with last event after this timestamp")] = None,
3321
- last_event_before: Annotated[Optional[datetime], Field(description="Include items with last event before this timestamp")] = None,
3322
- sort: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None,
3323
- order: Annotated[Optional[StrictStr], Field(description="Direction to sort by")] = None,
3324
- _request_timeout: Union[
3325
- None,
3326
- Annotated[StrictFloat, Field(gt=0)],
3327
- Tuple[
3328
- Annotated[StrictFloat, Field(gt=0)],
3329
- Annotated[StrictFloat, Field(gt=0)]
3330
- ]
3331
- ] = None,
3332
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3333
- _content_type: Optional[StrictStr] = None,
3334
- _headers: Optional[Dict[StrictStr, Any]] = None,
3335
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3336
- ) -> ApiResponse[PaginatedSandboxes]:
3337
- """List all sandboxes paginated
3338
-
3339
-
3340
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
3341
- :type x_daytona_organization_id: str
3342
- :param page: Page number of the results
3343
- :type page: float
3344
- :param limit: Number of results per page
3345
- :type limit: float
3346
- :param id: Filter by partial ID match
3347
- :type id: str
3348
- :param labels: JSON encoded labels to filter by
3349
- :type labels: str
3350
- :param include_errored_deleted: Include results with errored state and deleted desired state
3351
- :type include_errored_deleted: bool
3352
- :param states: List of states to filter by
3353
- :type states: List[str]
3354
- :param snapshots: List of snapshot names to filter by
3355
- :type snapshots: List[str]
3356
- :param regions: List of regions to filter by
3357
- :type regions: List[str]
3358
- :param min_cpu: Minimum CPU
3359
- :type min_cpu: float
3360
- :param max_cpu: Maximum CPU
3361
- :type max_cpu: float
3362
- :param min_memory_gi_b: Minimum memory in GiB
3363
- :type min_memory_gi_b: float
3364
- :param max_memory_gi_b: Maximum memory in GiB
3365
- :type max_memory_gi_b: float
3366
- :param min_disk_gi_b: Minimum disk space in GiB
3367
- :type min_disk_gi_b: float
3368
- :param max_disk_gi_b: Maximum disk space in GiB
3369
- :type max_disk_gi_b: float
3370
- :param last_event_after: Include items with last event after this timestamp
3371
- :type last_event_after: datetime
3372
- :param last_event_before: Include items with last event before this timestamp
3373
- :type last_event_before: datetime
3374
- :param sort: Field to sort by
3375
- :type sort: str
3376
- :param order: Direction to sort by
3377
- :type order: str
3378
- :param _request_timeout: timeout setting for this request. If one
3379
- number provided, it will be total request
3380
- timeout. It can also be a pair (tuple) of
3381
- (connection, read) timeouts.
3382
- :type _request_timeout: int, tuple(int, int), optional
3383
- :param _request_auth: set to override the auth_settings for an a single
3384
- request; this effectively ignores the
3385
- authentication in the spec for a single request.
3386
- :type _request_auth: dict, optional
3387
- :param _content_type: force content-type for the request.
3388
- :type _content_type: str, Optional
3389
- :param _headers: set to override the headers for a single
3390
- request; this effectively ignores the headers
3391
- in the spec for a single request.
3392
- :type _headers: dict, optional
3393
- :param _host_index: set to override the host_index for a single
3394
- request; this effectively ignores the host_index
3395
- in the spec for a single request.
3396
- :type _host_index: int, optional
3397
- :return: Returns the result object.
3398
- """ # noqa: E501
3399
-
3400
- _param = self._list_sandboxes_paginated_serialize(
3401
- x_daytona_organization_id=x_daytona_organization_id,
3402
- page=page,
3403
- limit=limit,
3404
- id=id,
3405
- labels=labels,
3406
- include_errored_deleted=include_errored_deleted,
3407
- states=states,
3408
- snapshots=snapshots,
3409
- regions=regions,
3410
- min_cpu=min_cpu,
3411
- max_cpu=max_cpu,
3412
- min_memory_gi_b=min_memory_gi_b,
3413
- max_memory_gi_b=max_memory_gi_b,
3414
- min_disk_gi_b=min_disk_gi_b,
3415
- max_disk_gi_b=max_disk_gi_b,
3416
- last_event_after=last_event_after,
3417
- last_event_before=last_event_before,
3418
- sort=sort,
3419
- order=order,
3420
- _request_auth=_request_auth,
3421
- _content_type=_content_type,
3422
- _headers=_headers,
3423
- _host_index=_host_index
3424
- )
3425
-
3426
- _response_types_map: Dict[str, Optional[str]] = {
3427
- '200': "PaginatedSandboxes",
3428
- }
3429
- response_data = self.api_client.call_api(
3430
- *_param,
3431
- _request_timeout=_request_timeout
3432
- )
3433
- response_data.read()
3434
- return self.api_client.response_deserialize(
3435
- response_data=response_data,
3436
- response_types_map=_response_types_map,
3437
- )
3438
-
3439
-
3440
- @validate_call
3441
- def list_sandboxes_paginated_without_preload_content(
3442
- self,
3443
- x_daytona_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
3444
- page: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Page number of the results")] = None,
3445
- limit: Annotated[Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]], Field(description="Number of results per page")] = None,
3446
- id: Annotated[Optional[StrictStr], Field(description="Filter by partial ID match")] = None,
3447
- labels: Annotated[Optional[StrictStr], Field(description="JSON encoded labels to filter by")] = None,
3448
- include_errored_deleted: Annotated[Optional[StrictBool], Field(description="Include results with errored state and deleted desired state")] = None,
3449
- states: Annotated[Optional[List[StrictStr]], Field(description="List of states to filter by")] = None,
3450
- snapshots: Annotated[Optional[List[StrictStr]], Field(description="List of snapshot names to filter by")] = None,
3451
- regions: Annotated[Optional[List[StrictStr]], Field(description="List of regions to filter by")] = None,
3452
- min_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum CPU")] = None,
3453
- max_cpu: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum CPU")] = None,
3454
- min_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum memory in GiB")] = None,
3455
- max_memory_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum memory in GiB")] = None,
3456
- min_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Minimum disk space in GiB")] = None,
3457
- max_disk_gi_b: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]], Field(description="Maximum disk space in GiB")] = None,
3458
- last_event_after: Annotated[Optional[datetime], Field(description="Include items with last event after this timestamp")] = None,
3459
- last_event_before: Annotated[Optional[datetime], Field(description="Include items with last event before this timestamp")] = None,
3460
- sort: Annotated[Optional[StrictStr], Field(description="Field to sort by")] = None,
3461
- order: Annotated[Optional[StrictStr], Field(description="Direction to sort by")] = None,
3462
- _request_timeout: Union[
3463
- None,
3464
- Annotated[StrictFloat, Field(gt=0)],
3465
- Tuple[
3466
- Annotated[StrictFloat, Field(gt=0)],
3467
- Annotated[StrictFloat, Field(gt=0)]
3468
- ]
3469
- ] = None,
3470
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3471
- _content_type: Optional[StrictStr] = None,
3472
- _headers: Optional[Dict[StrictStr, Any]] = None,
3473
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3474
- ) -> RESTResponseType:
3475
- """List all sandboxes paginated
3476
-
3477
-
3478
- :param x_daytona_organization_id: Use with JWT to specify the organization ID
3479
- :type x_daytona_organization_id: str
3480
- :param page: Page number of the results
3481
- :type page: float
3482
- :param limit: Number of results per page
3483
- :type limit: float
3484
- :param id: Filter by partial ID match
3485
- :type id: str
3486
- :param labels: JSON encoded labels to filter by
3487
- :type labels: str
3488
- :param include_errored_deleted: Include results with errored state and deleted desired state
3489
- :type include_errored_deleted: bool
3490
- :param states: List of states to filter by
3491
- :type states: List[str]
3492
- :param snapshots: List of snapshot names to filter by
3493
- :type snapshots: List[str]
3494
- :param regions: List of regions to filter by
3495
- :type regions: List[str]
3496
- :param min_cpu: Minimum CPU
3497
- :type min_cpu: float
3498
- :param max_cpu: Maximum CPU
3499
- :type max_cpu: float
3500
- :param min_memory_gi_b: Minimum memory in GiB
3501
- :type min_memory_gi_b: float
3502
- :param max_memory_gi_b: Maximum memory in GiB
3503
- :type max_memory_gi_b: float
3504
- :param min_disk_gi_b: Minimum disk space in GiB
3505
- :type min_disk_gi_b: float
3506
- :param max_disk_gi_b: Maximum disk space in GiB
3507
- :type max_disk_gi_b: float
3508
- :param last_event_after: Include items with last event after this timestamp
3509
- :type last_event_after: datetime
3510
- :param last_event_before: Include items with last event before this timestamp
3511
- :type last_event_before: datetime
3512
- :param sort: Field to sort by
3513
- :type sort: str
3514
- :param order: Direction to sort by
3515
- :type order: str
3516
- :param _request_timeout: timeout setting for this request. If one
3517
- number provided, it will be total request
3518
- timeout. It can also be a pair (tuple) of
3519
- (connection, read) timeouts.
3520
- :type _request_timeout: int, tuple(int, int), optional
3521
- :param _request_auth: set to override the auth_settings for an a single
3522
- request; this effectively ignores the
3523
- authentication in the spec for a single request.
3524
- :type _request_auth: dict, optional
3525
- :param _content_type: force content-type for the request.
3526
- :type _content_type: str, Optional
3527
- :param _headers: set to override the headers for a single
3528
- request; this effectively ignores the headers
3529
- in the spec for a single request.
3530
- :type _headers: dict, optional
3531
- :param _host_index: set to override the host_index for a single
3532
- request; this effectively ignores the host_index
3533
- in the spec for a single request.
3534
- :type _host_index: int, optional
3535
- :return: Returns the result object.
3536
- """ # noqa: E501
3537
-
3538
- _param = self._list_sandboxes_paginated_serialize(
3539
- x_daytona_organization_id=x_daytona_organization_id,
3540
- page=page,
3541
- limit=limit,
3542
- id=id,
3543
- labels=labels,
3544
- include_errored_deleted=include_errored_deleted,
3545
- states=states,
3546
- snapshots=snapshots,
3547
- regions=regions,
3548
- min_cpu=min_cpu,
3549
- max_cpu=max_cpu,
3550
- min_memory_gi_b=min_memory_gi_b,
3551
- max_memory_gi_b=max_memory_gi_b,
3552
- min_disk_gi_b=min_disk_gi_b,
3553
- max_disk_gi_b=max_disk_gi_b,
3554
- last_event_after=last_event_after,
3555
- last_event_before=last_event_before,
3556
- sort=sort,
3557
- order=order,
3558
- _request_auth=_request_auth,
3559
- _content_type=_content_type,
3560
- _headers=_headers,
3561
- _host_index=_host_index
3562
- )
3563
-
3564
- _response_types_map: Dict[str, Optional[str]] = {
3565
- '200': "PaginatedSandboxes",
3566
- }
3567
- response_data = self.api_client.call_api(
3568
- *_param,
3569
- _request_timeout=_request_timeout
3570
- )
3571
- return response_data.response
3572
-
3573
-
3574
- def _list_sandboxes_paginated_serialize(
3575
- self,
3576
- x_daytona_organization_id,
3577
- page,
3578
- limit,
3579
- id,
3580
- labels,
3581
- include_errored_deleted,
3582
- states,
3583
- snapshots,
3584
- regions,
3585
- min_cpu,
3586
- max_cpu,
3587
- min_memory_gi_b,
3588
- max_memory_gi_b,
3589
- min_disk_gi_b,
3590
- max_disk_gi_b,
3591
- last_event_after,
3592
- last_event_before,
3593
- sort,
3594
- order,
3595
- _request_auth,
3596
- _content_type,
3597
- _headers,
3598
- _host_index,
3599
- ) -> RequestSerialized:
3600
-
3601
- _host = None
3602
-
3603
- _collection_formats: Dict[str, str] = {
3604
- 'states': 'multi',
3605
- 'snapshots': 'multi',
3606
- 'regions': 'multi',
3607
- }
3608
-
3609
- _path_params: Dict[str, str] = {}
3610
- _query_params: List[Tuple[str, str]] = []
3611
- _header_params: Dict[str, Optional[str]] = _headers or {}
3612
- _form_params: List[Tuple[str, str]] = []
3613
- _files: Dict[
3614
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3615
- ] = {}
3616
- _body_params: Optional[bytes] = None
3617
-
3618
- # process the path parameters
3619
- # process the query parameters
3620
- if page is not None:
3621
-
3622
- _query_params.append(('page', page))
3623
-
3624
- if limit is not None:
3625
-
3626
- _query_params.append(('limit', limit))
3627
-
3628
- if id is not None:
3629
-
3630
- _query_params.append(('id', id))
3631
-
3632
- if labels is not None:
3633
-
3634
- _query_params.append(('labels', labels))
3635
-
3636
- if include_errored_deleted is not None:
3637
-
3638
- _query_params.append(('includeErroredDeleted', include_errored_deleted))
3639
-
3640
- if states is not None:
3641
-
3642
- _query_params.append(('states', states))
3643
-
3644
- if snapshots is not None:
3645
-
3646
- _query_params.append(('snapshots', snapshots))
3647
-
3648
- if regions is not None:
3649
-
3650
- _query_params.append(('regions', regions))
3651
-
3652
- if min_cpu is not None:
3653
-
3654
- _query_params.append(('minCpu', min_cpu))
3655
-
3656
- if max_cpu is not None:
3657
-
3658
- _query_params.append(('maxCpu', max_cpu))
3659
-
3660
- if min_memory_gi_b is not None:
3661
-
3662
- _query_params.append(('minMemoryGiB', min_memory_gi_b))
3663
-
3664
- if max_memory_gi_b is not None:
3665
-
3666
- _query_params.append(('maxMemoryGiB', max_memory_gi_b))
3667
-
3668
- if min_disk_gi_b is not None:
3669
-
3670
- _query_params.append(('minDiskGiB', min_disk_gi_b))
3671
-
3672
- if max_disk_gi_b is not None:
3673
-
3674
- _query_params.append(('maxDiskGiB', max_disk_gi_b))
3675
-
3676
- if last_event_after is not None:
3677
- if isinstance(last_event_after, datetime):
3678
- _query_params.append(
3679
- (
3680
- 'lastEventAfter',
3681
- last_event_after.strftime(
3682
- self.api_client.configuration.datetime_format
3683
- )
3684
- )
3685
- )
3686
- else:
3687
- _query_params.append(('lastEventAfter', last_event_after))
3688
-
3689
- if last_event_before is not None:
3690
- if isinstance(last_event_before, datetime):
3691
- _query_params.append(
3692
- (
3693
- 'lastEventBefore',
3694
- last_event_before.strftime(
3695
- self.api_client.configuration.datetime_format
3696
- )
3697
- )
3698
- )
3699
- else:
3700
- _query_params.append(('lastEventBefore', last_event_before))
3701
-
3702
- if sort is not None:
3703
-
3704
- _query_params.append(('sort', sort))
3705
-
3706
- if order is not None:
3707
-
3708
- _query_params.append(('order', order))
3709
-
3710
- # process the header parameters
3711
- if x_daytona_organization_id is not None:
3712
- _header_params['X-Daytona-Organization-ID'] = x_daytona_organization_id
3713
- # process the form parameters
3714
- # process the body parameter
3715
-
3716
-
3717
- # set the HTTP header `Accept`
3718
- if 'Accept' not in _header_params:
3719
- _header_params['Accept'] = self.api_client.select_header_accept(
3720
- [
3721
- 'application/json'
3722
- ]
3723
- )
3724
-
3725
-
3726
- # authentication setting
3727
- _auth_settings: List[str] = [
3728
- 'bearer',
3729
- 'oauth2'
3730
- ]
3731
-
3732
- return self.api_client.param_serialize(
3733
- method='GET',
3734
- resource_path='/sandbox/paginated',
3735
- path_params=_path_params,
3736
- query_params=_query_params,
3737
- header_params=_header_params,
3738
- body=_body_params,
3739
- post_params=_form_params,
3740
- files=_files,
3741
- auth_settings=_auth_settings,
3742
- collection_formats=_collection_formats,
3743
- _host=_host,
3744
- _request_auth=_request_auth
3745
- )
3746
-
3747
-
3748
-
3749
-
3750
2919
  @validate_call
3751
2920
  def replace_labels(
3752
2921
  self,