gcore 0.16.0__py3-none-any.whl → 0.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gcore might be problematic. Click here for more details.

Files changed (52) hide show
  1. gcore/_client.py +16 -0
  2. gcore/_version.py +1 -1
  3. gcore/resources/cdn/cdn.py +120 -21
  4. gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
  5. gcore/resources/cloud/baremetal/servers.py +8 -0
  6. gcore/resources/cloud/cloud.py +18 -0
  7. gcore/resources/cloud/file_shares/file_shares.py +124 -33
  8. gcore/resources/cloud/floating_ips.py +8 -0
  9. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +12 -0
  10. gcore/resources/cloud/gpu_baremetal_clusters/images.py +8 -0
  11. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +4 -0
  12. gcore/resources/cloud/inference/deployments/deployments.py +12 -0
  13. gcore/resources/cloud/instances/images.py +12 -0
  14. gcore/resources/cloud/instances/instances.py +20 -0
  15. gcore/resources/cloud/instances/interfaces.py +12 -0
  16. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +12 -0
  17. gcore/resources/cloud/load_balancers/l7_policies/rules.py +12 -0
  18. gcore/resources/cloud/load_balancers/listeners.py +12 -0
  19. gcore/resources/cloud/load_balancers/load_balancers.py +16 -0
  20. gcore/resources/cloud/load_balancers/pools/pools.py +12 -0
  21. gcore/resources/cloud/networks/networks.py +8 -0
  22. gcore/resources/cloud/networks/subnets.py +4 -0
  23. gcore/resources/cloud/placement_groups.py +8 -0
  24. gcore/resources/cloud/projects.py +109 -109
  25. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
  26. gcore/resources/cloud/secrets.py +4 -0
  27. gcore/resources/cloud/tasks.py +22 -7
  28. gcore/resources/cloud/volumes.py +27 -1
  29. gcore/types/cdn/__init__.py +3 -0
  30. gcore/types/cdn/alibaba_regions.py +22 -0
  31. gcore/types/cdn/aws_regions.py +22 -0
  32. gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
  33. gcore/types/cdn/cdn_resource.py +1 -1
  34. gcore/types/cdn/resource_create_params.py +1 -1
  35. gcore/types/cdn/resource_replace_params.py +1 -1
  36. gcore/types/cdn/resource_update_params.py +1 -1
  37. gcore/types/cdn/resources/cdn_resource_rule.py +1 -1
  38. gcore/types/cdn/resources/rule_create_params.py +1 -1
  39. gcore/types/cdn/resources/rule_replace_params.py +1 -1
  40. gcore/types/cdn/resources/rule_update_params.py +1 -1
  41. gcore/types/cdn/rule_template.py +1 -1
  42. gcore/types/cdn/rule_template_create_params.py +1 -1
  43. gcore/types/cdn/rule_template_replace_params.py +1 -1
  44. gcore/types/cdn/rule_template_update_params.py +1 -1
  45. gcore/types/cloud/__init__.py +1 -1
  46. gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
  47. {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/METADATA +2 -2
  48. {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/RECORD +50 -49
  49. gcore/resources/cdn/logs/__init__.py +0 -19
  50. gcore/types/cdn/logs/__init__.py +0 -3
  51. {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/WHEEL +0 -0
  52. {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/licenses/LICENSE +0 -0
@@ -513,6 +513,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
513
513
  ip_family: Optional[InterfaceIPFamily] | Omit = omit,
514
514
  is_vip: bool | Omit = omit,
515
515
  polling_interval_seconds: int | Omit = omit,
516
+ polling_timeout_seconds: int | Omit = omit,
516
517
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
517
518
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
518
519
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -550,6 +551,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
550
551
  type: Literal["subnet"],
551
552
  is_vip: bool | Omit = omit,
552
553
  polling_interval_seconds: int | Omit = omit,
554
+ polling_timeout_seconds: int | Omit = omit,
553
555
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
554
556
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
555
557
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -588,6 +590,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
588
590
  ip_family: Optional[InterfaceIPFamily] | Omit = omit,
589
591
  is_vip: bool | Omit = omit,
590
592
  polling_interval_seconds: int | Omit = omit,
593
+ polling_timeout_seconds: int | Omit = omit,
591
594
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
592
595
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
593
596
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -628,6 +631,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
628
631
  type: Literal["ip_address"],
629
632
  is_vip: bool | Omit = omit,
630
633
  polling_interval_seconds: int | Omit = omit,
634
+ polling_timeout_seconds: int | Omit = omit,
631
635
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
632
636
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
633
637
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -666,6 +670,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
666
670
  port_id: str,
667
671
  type: Literal["port"],
668
672
  polling_interval_seconds: int | Omit = omit,
673
+ polling_timeout_seconds: int | Omit = omit,
669
674
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
670
675
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
671
676
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -712,6 +717,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
712
717
  ip_address: str | Omit = omit,
713
718
  port_id: str | Omit = omit,
714
719
  polling_interval_seconds: int | Omit = omit,
720
+ polling_timeout_seconds: int | Omit = omit,
715
721
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
716
722
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
717
723
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -743,6 +749,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
743
749
  task_id=response.tasks[0], # type: ignore
744
750
  extra_headers=extra_headers,
745
751
  polling_interval_seconds=polling_interval_seconds,
752
+ polling_timeout_seconds=polling_timeout_seconds,
746
753
  )
747
754
  if (
748
755
  task.created_resources is None
@@ -768,6 +775,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
768
775
  project_id: int | None = None,
769
776
  region_id: int | None = None,
770
777
  polling_interval_seconds: int | Omit = omit,
778
+ polling_timeout_seconds: int | Omit = omit,
771
779
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
772
780
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
773
781
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -793,6 +801,7 @@ class ReservedFixedIPsResource(SyncAPIResource):
793
801
  task_id=response.tasks[0],
794
802
  extra_headers=extra_headers,
795
803
  polling_interval_seconds=polling_interval_seconds,
804
+ polling_timeout_seconds=polling_timeout_seconds,
796
805
  )
797
806
 
798
807
 
@@ -1271,6 +1280,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1271
1280
  ip_family: Optional[InterfaceIPFamily] | Omit = omit,
1272
1281
  is_vip: bool | Omit = omit,
1273
1282
  polling_interval_seconds: int | Omit = omit,
1283
+ polling_timeout_seconds: int | Omit = omit,
1274
1284
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1275
1285
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1276
1286
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1308,6 +1318,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1308
1318
  type: Literal["subnet"],
1309
1319
  is_vip: bool | Omit = omit,
1310
1320
  polling_interval_seconds: int | Omit = omit,
1321
+ polling_timeout_seconds: int | Omit = omit,
1311
1322
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1312
1323
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1313
1324
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1346,6 +1357,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1346
1357
  ip_family: Optional[InterfaceIPFamily] | Omit = omit,
1347
1358
  is_vip: bool | Omit = omit,
1348
1359
  polling_interval_seconds: int | Omit = omit,
1360
+ polling_timeout_seconds: int | Omit = omit,
1349
1361
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1350
1362
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1351
1363
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1386,6 +1398,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1386
1398
  type: Literal["ip_address"],
1387
1399
  is_vip: bool | Omit = omit,
1388
1400
  polling_interval_seconds: int | Omit = omit,
1401
+ polling_timeout_seconds: int | Omit = omit,
1389
1402
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1390
1403
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1391
1404
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1424,6 +1437,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1424
1437
  port_id: str,
1425
1438
  type: Literal["port"],
1426
1439
  polling_interval_seconds: int | Omit = omit,
1440
+ polling_timeout_seconds: int | Omit = omit,
1427
1441
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1428
1442
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1429
1443
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1470,6 +1484,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1470
1484
  ip_address: str | Omit = omit,
1471
1485
  port_id: str | Omit = omit,
1472
1486
  polling_interval_seconds: int | Omit = omit,
1487
+ polling_timeout_seconds: int | Omit = omit,
1473
1488
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1474
1489
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1475
1490
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1501,6 +1516,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1501
1516
  task_id=response.tasks[0], # type: ignore
1502
1517
  extra_headers=extra_headers,
1503
1518
  polling_interval_seconds=polling_interval_seconds,
1519
+ polling_timeout_seconds=polling_timeout_seconds,
1504
1520
  )
1505
1521
  if (
1506
1522
  task.created_resources is None
@@ -1526,6 +1542,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1526
1542
  project_id: int | None = None,
1527
1543
  region_id: int | None = None,
1528
1544
  polling_interval_seconds: int | Omit = omit,
1545
+ polling_timeout_seconds: int | Omit = omit,
1529
1546
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1530
1547
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1531
1548
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1551,6 +1568,7 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
1551
1568
  task_id=response.tasks[0],
1552
1569
  extra_headers=extra_headers,
1553
1570
  polling_interval_seconds=polling_interval_seconds,
1571
+ polling_timeout_seconds=polling_timeout_seconds,
1554
1572
  )
1555
1573
 
1556
1574
 
@@ -260,6 +260,7 @@ class SecretsResource(SyncAPIResource):
260
260
  payload: secret_upload_tls_certificate_params.Payload,
261
261
  expiration: Union[str, datetime, None] | Omit = omit,
262
262
  polling_interval_seconds: int | Omit = omit,
263
+ polling_timeout_seconds: int | Omit = omit,
263
264
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
264
265
  # The extra values given here take precedence over values defined on the client or passed to this method.
265
266
  extra_headers: Headers | None = None,
@@ -282,6 +283,7 @@ class SecretsResource(SyncAPIResource):
282
283
  task_id=response.tasks[0],
283
284
  extra_headers=extra_headers,
284
285
  polling_interval_seconds=polling_interval_seconds,
286
+ polling_timeout_seconds=polling_timeout_seconds,
285
287
  )
286
288
  if not task.created_resources or not task.created_resources.secrets or len(task.created_resources.secrets) != 1:
287
289
  raise ValueError(f"Expected exactly one resource to be created in a task")
@@ -527,6 +529,7 @@ class AsyncSecretsResource(AsyncAPIResource):
527
529
  payload: secret_upload_tls_certificate_params.Payload,
528
530
  expiration: Union[str, datetime, None] | Omit = omit,
529
531
  polling_interval_seconds: int | Omit = omit,
532
+ polling_timeout_seconds: int | Omit = omit,
530
533
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
531
534
  # The extra values given here take precedence over values defined on the client or passed to this method.
532
535
  extra_headers: Headers | None = None,
@@ -549,6 +552,7 @@ class AsyncSecretsResource(AsyncAPIResource):
549
552
  task_id=response.tasks[0],
550
553
  extra_headers=extra_headers,
551
554
  polling_interval_seconds=polling_interval_seconds,
555
+ polling_timeout_seconds=polling_timeout_seconds,
552
556
  )
553
557
  if not task.created_resources or not task.created_resources.secrets or len(task.created_resources.secrets) != 1:
554
558
  raise ValueError(f"Expected exactly one resource to be created in a task")
@@ -20,7 +20,6 @@ from ..._response import (
20
20
  async_to_streamed_response_wrapper,
21
21
  )
22
22
  from ...pagination import SyncOffsetPage, AsyncOffsetPage
23
- from ...lib.polling import extract_timeout_value
24
23
  from ...types.cloud import task_list_params, task_acknowledge_all_params
25
24
  from ..._base_client import AsyncPaginator, make_request_options
26
25
  from ...types.cloud.task import Task
@@ -53,6 +52,7 @@ class TasksResource(SyncAPIResource):
53
52
  task_id: str,
54
53
  *,
55
54
  polling_interval_seconds: int | Omit = omit,
55
+ polling_timeout_seconds: int | Omit = omit,
56
56
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
57
57
  # The extra values given here take precedence over values defined on the client or passed to this method.
58
58
  extra_headers: Headers | None = None,
@@ -65,16 +65,22 @@ class TasksResource(SyncAPIResource):
65
65
  # Ensure the polling interval is at least 1 second
66
66
  polling_interval_seconds = max(1, polling_interval_seconds)
67
67
 
68
- if not is_given(timeout):
69
- timeout = extract_timeout_value(self._client.timeout)
68
+ if not is_given(polling_timeout_seconds):
69
+ polling_timeout_seconds = cast(int, self._client.cloud_polling_timeout_seconds)
70
70
 
71
- end_time = time.time() + timeout
71
+ if polling_timeout_seconds <= polling_interval_seconds:
72
+ raise ValueError(
73
+ f"`polling_timeout_seconds` must be greater than `polling_interval_seconds` ({polling_interval_seconds})"
74
+ )
75
+
76
+ end_time = time.time() + polling_timeout_seconds
72
77
  while time.time() <= end_time:
73
78
  task = self.get(
74
79
  task_id,
75
80
  extra_headers=extra_headers,
76
81
  extra_query=extra_query,
77
82
  extra_body=extra_body,
83
+ timeout=timeout,
78
84
  )
79
85
  if task.state == "ERROR":
80
86
  raise ValueError(task.error or f"Task {task_id} failed")
@@ -364,6 +370,7 @@ class AsyncTasksResource(AsyncAPIResource):
364
370
  task_id: str,
365
371
  *,
366
372
  polling_interval_seconds: int | Omit = omit,
373
+ polling_timeout_seconds: int | Omit = omit,
367
374
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
368
375
  # The extra values given here take precedence over values defined on the client or passed to this method.
369
376
  extra_headers: Headers | None = None,
@@ -373,17 +380,25 @@ class AsyncTasksResource(AsyncAPIResource):
373
380
  ) -> Task:
374
381
  if not is_given(polling_interval_seconds):
375
382
  polling_interval_seconds = cast(int, self._client.cloud_polling_interval_seconds)
383
+ # Ensure the polling interval is at least 1 second
384
+ polling_interval_seconds = max(1, polling_interval_seconds)
385
+
386
+ if not is_given(polling_timeout_seconds):
387
+ polling_timeout_seconds = cast(int, self._client.cloud_polling_timeout_seconds)
376
388
 
377
- if not is_given(timeout):
378
- timeout = extract_timeout_value(self._client.timeout)
389
+ if polling_timeout_seconds <= polling_interval_seconds:
390
+ raise ValueError(
391
+ f"`polling_timeout_seconds` must be greater than `polling_interval_seconds` ({polling_interval_seconds})"
392
+ )
379
393
 
380
- end_time = time.time() + timeout
394
+ end_time = time.time() + polling_timeout_seconds
381
395
  while time.time() <= end_time:
382
396
  task = await self.get(
383
397
  task_id,
384
398
  extra_headers=extra_headers,
385
399
  extra_query=extra_query,
386
400
  extra_body=extra_body,
401
+ timeout=timeout,
387
402
  )
388
403
  if task.state == "ERROR":
389
404
  raise ValueError(task.error or f"Task {task_id} failed")
@@ -859,6 +859,7 @@ class VolumesResource(SyncAPIResource):
859
859
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
860
860
  | Omit = omit,
861
861
  polling_interval_seconds: int | Omit = omit,
862
+ polling_timeout_seconds: int | Omit = omit,
862
863
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
863
864
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
864
865
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -929,6 +930,7 @@ class VolumesResource(SyncAPIResource):
929
930
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
930
931
  | Omit = omit,
931
932
  polling_interval_seconds: int | Omit = omit,
933
+ polling_timeout_seconds: int | Omit = omit,
932
934
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
933
935
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
934
936
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -999,6 +1001,7 @@ class VolumesResource(SyncAPIResource):
999
1001
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
1000
1002
  | Omit = omit,
1001
1003
  polling_interval_seconds: int | Omit = omit,
1004
+ polling_timeout_seconds: int | Omit = omit,
1002
1005
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1003
1006
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1004
1007
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1070,6 +1073,7 @@ class VolumesResource(SyncAPIResource):
1070
1073
  | Omit = omit,
1071
1074
  snapshot_id: str | Omit = omit,
1072
1075
  polling_interval_seconds: int | Omit = omit,
1076
+ polling_timeout_seconds: int | Omit = omit,
1073
1077
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1074
1078
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1075
1079
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1102,6 +1106,7 @@ class VolumesResource(SyncAPIResource):
1102
1106
  task_id=response.tasks[0], # type: ignore
1103
1107
  extra_headers=extra_headers,
1104
1108
  polling_interval_seconds=polling_interval_seconds,
1109
+ polling_timeout_seconds=polling_timeout_seconds,
1105
1110
  )
1106
1111
  if task.created_resources is None or task.created_resources.volumes is None or len(task.created_resources.volumes) != 1:
1107
1112
  raise ValueError("Task completed but created_resources or volumes is missing or invalid")
@@ -1124,6 +1129,7 @@ class VolumesResource(SyncAPIResource):
1124
1129
  region_id: int | None = None,
1125
1130
  snapshots: str | Omit = omit,
1126
1131
  polling_interval_seconds: int | Omit = omit,
1132
+ polling_timeout_seconds: int | Omit = omit,
1127
1133
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1128
1134
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1129
1135
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1148,6 +1154,7 @@ class VolumesResource(SyncAPIResource):
1148
1154
  task_id=response.tasks[0],
1149
1155
  extra_headers=extra_headers,
1150
1156
  polling_interval_seconds=polling_interval_seconds,
1157
+ polling_timeout_seconds=polling_timeout_seconds,
1151
1158
  )
1152
1159
 
1153
1160
  def attach_to_instance_and_poll(
@@ -1159,6 +1166,7 @@ class VolumesResource(SyncAPIResource):
1159
1166
  instance_id: str,
1160
1167
  attachment_tag: str | Omit = omit,
1161
1168
  polling_interval_seconds: int | Omit = omit,
1169
+ polling_timeout_seconds: int | Omit = omit,
1162
1170
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1163
1171
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1164
1172
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1184,6 +1192,7 @@ class VolumesResource(SyncAPIResource):
1184
1192
  task_id=response.tasks[0],
1185
1193
  extra_headers=extra_headers,
1186
1194
  polling_interval_seconds=polling_interval_seconds,
1195
+ polling_timeout_seconds=polling_timeout_seconds,
1187
1196
  )
1188
1197
 
1189
1198
  def detach_from_instance_and_poll(
@@ -1194,6 +1203,7 @@ class VolumesResource(SyncAPIResource):
1194
1203
  region_id: int | None = None,
1195
1204
  instance_id: str,
1196
1205
  polling_interval_seconds: int | Omit = omit,
1206
+ polling_timeout_seconds: int | Omit = omit,
1197
1207
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1198
1208
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1199
1209
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1218,6 +1228,7 @@ class VolumesResource(SyncAPIResource):
1218
1228
  task_id=response.tasks[0],
1219
1229
  extra_headers=extra_headers,
1220
1230
  polling_interval_seconds=polling_interval_seconds,
1231
+ polling_timeout_seconds=polling_timeout_seconds,
1221
1232
  )
1222
1233
 
1223
1234
  def resize_and_poll(
@@ -1228,6 +1239,7 @@ class VolumesResource(SyncAPIResource):
1228
1239
  region_id: int | None = None,
1229
1240
  size: int,
1230
1241
  polling_interval_seconds: int | Omit = omit,
1242
+ polling_timeout_seconds: int | Omit = omit,
1231
1243
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1232
1244
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1233
1245
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1252,6 +1264,7 @@ class VolumesResource(SyncAPIResource):
1252
1264
  task_id=response.tasks[0],
1253
1265
  extra_headers=extra_headers,
1254
1266
  polling_interval_seconds=polling_interval_seconds,
1267
+ polling_timeout_seconds=polling_timeout_seconds,
1255
1268
  )
1256
1269
  return self.get(
1257
1270
  volume_id=volume_id,
@@ -2089,6 +2102,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2089
2102
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
2090
2103
  | Omit = omit,
2091
2104
  polling_interval_seconds: int | Omit = omit,
2105
+ polling_timeout_seconds: int | Omit = omit,
2092
2106
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2093
2107
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2094
2108
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2159,6 +2173,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2159
2173
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
2160
2174
  | Omit = omit,
2161
2175
  polling_interval_seconds: int | Omit = omit,
2176
+ polling_timeout_seconds: int | Omit = omit,
2162
2177
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2163
2178
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2164
2179
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2229,6 +2244,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2229
2244
  type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
2230
2245
  | Omit = omit,
2231
2246
  polling_interval_seconds: int | Omit = omit,
2247
+ polling_timeout_seconds: int | Omit = omit,
2232
2248
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2233
2249
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2234
2250
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2300,6 +2316,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2300
2316
  | Omit = omit,
2301
2317
  snapshot_id: str | Omit = omit,
2302
2318
  polling_interval_seconds: int | Omit = omit,
2319
+ polling_timeout_seconds: int | Omit = omit,
2303
2320
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2304
2321
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2305
2322
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2328,10 +2345,11 @@ class AsyncVolumesResource(AsyncAPIResource):
2328
2345
  )
2329
2346
  if not response.tasks: # type: ignore
2330
2347
  raise ValueError("Expected at least one task to be created")
2331
- task = await self._client.cloud.tasks.poll(
2348
+ task = await self._client.cloud.tasks.poll(
2332
2349
  task_id=response.tasks[0], # type: ignore
2333
2350
  extra_headers=extra_headers,
2334
2351
  polling_interval_seconds=polling_interval_seconds,
2352
+ polling_timeout_seconds=polling_timeout_seconds,
2335
2353
  )
2336
2354
  if task.created_resources is None or task.created_resources.volumes is None or len(task.created_resources.volumes) != 1:
2337
2355
  raise ValueError("Task completed but created_resources or volumes is missing or invalid")
@@ -2354,6 +2372,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2354
2372
  region_id: int | None = None,
2355
2373
  snapshots: str | Omit = omit,
2356
2374
  polling_interval_seconds: int | Omit = omit,
2375
+ polling_timeout_seconds: int | Omit = omit,
2357
2376
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2358
2377
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2359
2378
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2378,6 +2397,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2378
2397
  task_id=response.tasks[0],
2379
2398
  extra_headers=extra_headers,
2380
2399
  polling_interval_seconds=polling_interval_seconds,
2400
+ polling_timeout_seconds=polling_timeout_seconds,
2381
2401
  )
2382
2402
 
2383
2403
  async def attach_to_instance_and_poll(
@@ -2389,6 +2409,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2389
2409
  instance_id: str,
2390
2410
  attachment_tag: str | Omit = omit,
2391
2411
  polling_interval_seconds: int | Omit = omit,
2412
+ polling_timeout_seconds: int | Omit = omit,
2392
2413
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2393
2414
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2394
2415
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2414,6 +2435,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2414
2435
  task_id=response.tasks[0],
2415
2436
  extra_headers=extra_headers,
2416
2437
  polling_interval_seconds=polling_interval_seconds,
2438
+ polling_timeout_seconds=polling_timeout_seconds,
2417
2439
  )
2418
2440
 
2419
2441
  async def detach_from_instance_and_poll(
@@ -2424,6 +2446,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2424
2446
  region_id: int | None = None,
2425
2447
  instance_id: str,
2426
2448
  polling_interval_seconds: int | Omit = omit,
2449
+ polling_timeout_seconds: int | Omit = omit,
2427
2450
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2428
2451
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2429
2452
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2448,6 +2471,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2448
2471
  task_id=response.tasks[0],
2449
2472
  extra_headers=extra_headers,
2450
2473
  polling_interval_seconds=polling_interval_seconds,
2474
+ polling_timeout_seconds=polling_timeout_seconds,
2451
2475
  )
2452
2476
 
2453
2477
  async def resize_and_poll(
@@ -2458,6 +2482,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2458
2482
  region_id: int | None = None,
2459
2483
  size: int,
2460
2484
  polling_interval_seconds: int | Omit = omit,
2485
+ polling_timeout_seconds: int | Omit = omit,
2461
2486
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2462
2487
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2463
2488
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2482,6 +2507,7 @@ class AsyncVolumesResource(AsyncAPIResource):
2482
2507
  task_id=response.tasks[0],
2483
2508
  extra_headers=extra_headers,
2484
2509
  polling_interval_seconds=polling_interval_seconds,
2510
+ polling_timeout_seconds=polling_timeout_seconds,
2485
2511
  )
2486
2512
  return await self.get(
2487
2513
  volume_id=volume_id,
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from .ssl_detail import SslDetail as SslDetail
6
+ from .aws_regions import AwsRegions as AwsRegions
6
7
  from .cdn_account import CdnAccount as CdnAccount
7
8
  from .cdn_metrics import CdnMetrics as CdnMetrics
8
9
  from .cdn_resource import CdnResource as CdnResource
@@ -12,6 +13,7 @@ from .origin_groups import OriginGroups as OriginGroups
12
13
  from .rule_template import RuleTemplate as RuleTemplate
13
14
  from .ca_certificate import CaCertificate as CaCertificate
14
15
  from .public_ip_list import PublicIPList as PublicIPList
16
+ from .alibaba_regions import AlibabaRegions as AlibabaRegions
15
17
  from .log_list_params import LogListParams as LogListParams
16
18
  from .ssl_detail_list import SslDetailList as SslDetailList
17
19
  from .network_capacity import NetworkCapacity as NetworkCapacity
@@ -55,6 +57,7 @@ from .rule_template_update_params import RuleTemplateUpdateParams as RuleTemplat
55
57
  from .rule_template_replace_params import RuleTemplateReplaceParams as RuleTemplateReplaceParams
56
58
  from .certificate_get_status_params import CertificateGetStatusParams as CertificateGetStatusParams
57
59
  from .cdn_list_purge_statuses_params import CdnListPurgeStatusesParams as CdnListPurgeStatusesParams
60
+ from .cdn_list_purge_statuses_response import CdnListPurgeStatusesResponse as CdnListPurgeStatusesResponse
58
61
  from .trusted_ca_certificate_list_params import TrustedCaCertificateListParams as TrustedCaCertificateListParams
59
62
  from .trusted_ca_certificate_create_params import TrustedCaCertificateCreateParams as TrustedCaCertificateCreateParams
60
63
  from .trusted_ca_certificate_replace_params import (
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import TypeAlias
5
+
6
+ from ..._models import BaseModel
7
+
8
+ __all__ = ["AlibabaRegions", "AlibabaRegionItem"]
9
+
10
+
11
+ class AlibabaRegionItem(BaseModel):
12
+ id: Optional[int] = None
13
+ """Region ID."""
14
+
15
+ code: Optional[str] = None
16
+ """Region code."""
17
+
18
+ name: Optional[str] = None
19
+ """Region name."""
20
+
21
+
22
+ AlibabaRegions: TypeAlias = List[AlibabaRegionItem]
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import TypeAlias
5
+
6
+ from ..._models import BaseModel
7
+
8
+ __all__ = ["AwsRegions", "AwsRegionItem"]
9
+
10
+
11
+ class AwsRegionItem(BaseModel):
12
+ id: Optional[int] = None
13
+ """Region ID."""
14
+
15
+ code: Optional[str] = None
16
+ """Region code."""
17
+
18
+ name: Optional[str] = None
19
+ """Region name."""
20
+
21
+
22
+ AwsRegions: TypeAlias = List[AwsRegionItem]
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .purge_status import PurgeStatus
7
+
8
+ __all__ = ["CdnListPurgeStatusesResponse"]
9
+
10
+ CdnListPurgeStatusesResponse: TypeAlias = List[PurgeStatus]
@@ -1189,7 +1189,7 @@ class OptionsStaticHeaders(BaseModel):
1189
1189
  - **false** - Option is disabled.
1190
1190
  """
1191
1191
 
1192
- value: Dict[str, str]
1192
+ value: object
1193
1193
  """A MAP for static headers in a format of `header_name: header_value`.
1194
1194
 
1195
1195
  Restrictions:
@@ -1310,7 +1310,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1310
1310
  - **false** - Option is disabled.
1311
1311
  """
1312
1312
 
1313
- value: Required[Dict[str, str]]
1313
+ value: Required[object]
1314
1314
  """A MAP for static headers in a format of `header_name: header_value`.
1315
1315
 
1316
1316
  Restrictions:
@@ -1288,7 +1288,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1288
1288
  - **false** - Option is disabled.
1289
1289
  """
1290
1290
 
1291
- value: Required[Dict[str, str]]
1291
+ value: Required[object]
1292
1292
  """A MAP for static headers in a format of `header_name: header_value`.
1293
1293
 
1294
1294
  Restrictions:
@@ -1279,7 +1279,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1279
1279
  - **false** - Option is disabled.
1280
1280
  """
1281
1281
 
1282
- value: Required[Dict[str, str]]
1282
+ value: Required[object]
1283
1283
  """A MAP for static headers in a format of `header_name: header_value`.
1284
1284
 
1285
1285
  Restrictions:
@@ -1166,7 +1166,7 @@ class OptionsStaticHeaders(BaseModel):
1166
1166
  - **false** - Option is disabled.
1167
1167
  """
1168
1168
 
1169
- value: Dict[str, str]
1169
+ value: object
1170
1170
  """A MAP for static headers in a format of `header_name: header_value`.
1171
1171
 
1172
1172
  Restrictions:
@@ -1240,7 +1240,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1240
1240
  - **false** - Option is disabled.
1241
1241
  """
1242
1242
 
1243
- value: Required[Dict[str, str]]
1243
+ value: Required[object]
1244
1244
  """A MAP for static headers in a format of `header_name: header_value`.
1245
1245
 
1246
1246
  Restrictions:
@@ -1242,7 +1242,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1242
1242
  - **false** - Option is disabled.
1243
1243
  """
1244
1244
 
1245
- value: Required[Dict[str, str]]
1245
+ value: Required[object]
1246
1246
  """A MAP for static headers in a format of `header_name: header_value`.
1247
1247
 
1248
1248
  Restrictions:
@@ -1242,7 +1242,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1242
1242
  - **false** - Option is disabled.
1243
1243
  """
1244
1244
 
1245
- value: Required[Dict[str, str]]
1245
+ value: Required[object]
1246
1246
  """A MAP for static headers in a format of `header_name: header_value`.
1247
1247
 
1248
1248
  Restrictions:
@@ -1166,7 +1166,7 @@ class OptionsStaticHeaders(BaseModel):
1166
1166
  - **false** - Option is disabled.
1167
1167
  """
1168
1168
 
1169
- value: Dict[str, str]
1169
+ value: object
1170
1170
  """A MAP for static headers in a format of `header_name: header_value`.
1171
1171
 
1172
1172
  Restrictions:
@@ -1224,7 +1224,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1224
1224
  - **false** - Option is disabled.
1225
1225
  """
1226
1226
 
1227
- value: Required[Dict[str, str]]
1227
+ value: Required[object]
1228
1228
  """A MAP for static headers in a format of `header_name: header_value`.
1229
1229
 
1230
1230
  Restrictions:
@@ -1224,7 +1224,7 @@ class OptionsStaticHeaders(TypedDict, total=False):
1224
1224
  - **false** - Option is disabled.
1225
1225
  """
1226
1226
 
1227
- value: Required[Dict[str, str]]
1227
+ value: Required[object]
1228
1228
  """A MAP for static headers in a format of `header_name: header_value`.
1229
1229
 
1230
1230
  Restrictions: