gcore 0.16.0__py3-none-any.whl → 0.23.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.
- gcore/_client.py +16 -0
- gcore/_models.py +37 -15
- gcore/_streaming.py +12 -12
- gcore/_utils/_sync.py +3 -31
- gcore/_utils/_utils.py +1 -1
- gcore/_version.py +1 -1
- gcore/resources/cdn/audit_log.py +4 -4
- gcore/resources/cdn/cdn.py +120 -21
- gcore/resources/cdn/ip_ranges.py +97 -5
- gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
- gcore/resources/cdn/resources/resources.py +20 -20
- gcore/resources/cdn/statistics.py +56 -58
- gcore/resources/cloud/__init__.py +40 -12
- gcore/resources/cloud/audit_logs.py +20 -0
- gcore/resources/cloud/baremetal/servers.py +48 -14
- gcore/resources/cloud/billing_reservations.py +2 -2
- gcore/resources/cloud/cloud.py +100 -18
- gcore/resources/cloud/databases/__init__.py +33 -0
- gcore/resources/cloud/databases/databases.py +102 -0
- gcore/resources/cloud/databases/postgres/__init__.py +61 -0
- gcore/resources/cloud/databases/postgres/clusters/__init__.py +33 -0
- gcore/resources/cloud/databases/postgres/clusters/clusters.py +716 -0
- gcore/resources/cloud/databases/postgres/clusters/user_credentials.py +281 -0
- gcore/resources/cloud/databases/postgres/configurations.py +169 -0
- gcore/resources/cloud/databases/postgres/custom_configurations.py +197 -0
- gcore/resources/cloud/databases/postgres/postgres.py +166 -0
- gcore/resources/cloud/file_shares/file_shares.py +154 -49
- gcore/resources/cloud/floating_ips.py +42 -10
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +70 -10
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +40 -6
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +16 -0
- gcore/resources/cloud/gpu_virtual_clusters/__init__.py +89 -0
- gcore/resources/cloud/gpu_virtual_clusters/flavors.py +211 -0
- gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py +1551 -0
- gcore/resources/cloud/gpu_virtual_clusters/images.py +582 -0
- gcore/resources/cloud/gpu_virtual_clusters/interfaces.py +187 -0
- gcore/resources/cloud/gpu_virtual_clusters/servers.py +506 -0
- gcore/resources/cloud/gpu_virtual_clusters/volumes.py +187 -0
- gcore/resources/cloud/inference/deployments/deployments.py +52 -4
- gcore/resources/cloud/instances/images.py +72 -18
- gcore/resources/cloud/instances/instances.py +110 -18
- gcore/resources/cloud/instances/interfaces.py +12 -0
- gcore/resources/cloud/k8s/__init__.py +12 -12
- gcore/resources/cloud/k8s/clusters/clusters.py +25 -25
- gcore/resources/cloud/k8s/clusters/pools/pools.py +14 -14
- gcore/resources/cloud/k8s/k8s.py +24 -24
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1420 -218
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +134 -22
- gcore/resources/cloud/load_balancers/listeners.py +77 -6
- gcore/resources/cloud/load_balancers/load_balancers.py +92 -14
- gcore/resources/cloud/load_balancers/pools/pools.py +52 -4
- gcore/resources/cloud/networks/networks.py +30 -10
- gcore/resources/cloud/networks/subnets.py +26 -10
- gcore/resources/cloud/placement_groups.py +8 -0
- gcore/resources/cloud/projects.py +99 -119
- gcore/resources/cloud/quotas/requests.py +0 -8
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
- gcore/resources/cloud/secrets.py +16 -0
- gcore/resources/cloud/security_groups/security_groups.py +38 -12
- gcore/resources/cloud/ssh_keys.py +10 -0
- gcore/resources/cloud/tasks.py +22 -7
- gcore/resources/cloud/volumes.py +65 -23
- gcore/resources/dns/zones/rrsets.py +10 -10
- gcore/resources/dns/zones/zones.py +2 -2
- gcore/resources/security/bgp_announces.py +0 -4
- gcore/resources/security/profiles.py +31 -7
- gcore/resources/storage/credentials.py +0 -28
- gcore/resources/storage/storage.py +2 -2
- gcore/types/cdn/__init__.py +5 -0
- gcore/types/cdn/alibaba_regions.py +22 -0
- gcore/types/cdn/audit_log_list_params.py +2 -2
- gcore/types/cdn/aws_regions.py +22 -0
- gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
- gcore/types/cdn/cdn_resource.py +17 -12
- gcore/types/cdn/ip_range_list_ips_params.py +19 -0
- gcore/types/cdn/ip_range_list_params.py +19 -0
- gcore/types/cdn/resource_create_params.py +17 -12
- gcore/types/cdn/resource_purge_params.py +4 -4
- gcore/types/cdn/resource_replace_params.py +17 -12
- gcore/types/cdn/resource_update_params.py +17 -12
- gcore/types/cdn/resource_usage_stats.py +16 -15
- gcore/types/cdn/resources/cdn_resource_rule.py +15 -10
- gcore/types/cdn/resources/rule_create_params.py +15 -10
- gcore/types/cdn/resources/rule_replace_params.py +15 -10
- gcore/types/cdn/resources/rule_update_params.py +15 -10
- gcore/types/cdn/rule_template.py +15 -10
- gcore/types/cdn/rule_template_create_params.py +15 -10
- gcore/types/cdn/rule_template_replace_params.py +15 -10
- gcore/types/cdn/rule_template_update_params.py +15 -10
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +4 -1
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +5 -12
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +10 -21
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +6 -1
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +5 -2
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +3 -0
- gcore/types/cloud/__init__.py +9 -3
- gcore/types/cloud/audit_log_entry.py +9 -3
- gcore/types/cloud/audit_log_list_params.py +12 -0
- gcore/types/cloud/baremetal/server_create_params.py +7 -7
- gcore/types/cloud/baremetal_flavor.py +0 -6
- gcore/types/cloud/billing_reservation_list_params.py +1 -1
- gcore/types/cloud/blackhole_port.py +4 -1
- gcore/types/cloud/databases/postgres/__init__.py +12 -0
- gcore/types/cloud/databases/postgres/cluster_create_params.py +108 -0
- gcore/types/cloud/databases/postgres/cluster_list_params.py +19 -0
- gcore/types/cloud/databases/postgres/cluster_update_params.py +102 -0
- gcore/types/cloud/databases/postgres/clusters/__init__.py +5 -0
- gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py +13 -0
- gcore/types/cloud/databases/postgres/custom_configuration_validate_params.py +19 -0
- gcore/types/cloud/databases/postgres/pg_conf_validation.py +15 -0
- gcore/types/cloud/databases/postgres/postgres_cluster.py +118 -0
- gcore/types/cloud/databases/postgres/postgres_cluster_short.py +22 -0
- gcore/types/cloud/databases/postgres/postgres_configuration.py +31 -0
- gcore/types/cloud/file_share_create_params.py +8 -8
- gcore/types/cloud/file_share_update_params.py +7 -2
- gcore/types/cloud/floating_ip.py +5 -1
- gcore/types/cloud/floating_ip_create_params.py +4 -4
- gcore/types/cloud/floating_ip_detailed.py +5 -1
- gcore/types/cloud/floating_ip_list_params.py +8 -0
- gcore/types/cloud/floating_ip_update_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +18 -3
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +16 -4
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +5 -2
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +4 -4
- gcore/types/cloud/gpu_image.py +9 -0
- gcore/types/cloud/gpu_virtual_cluster.py +189 -0
- gcore/types/cloud/gpu_virtual_cluster_action_params.py +127 -0
- gcore/types/cloud/gpu_virtual_cluster_create_params.py +213 -0
- gcore/types/cloud/gpu_virtual_cluster_delete_params.py +41 -0
- gcore/types/cloud/gpu_virtual_cluster_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_cluster_update_params.py +18 -0
- gcore/types/cloud/gpu_virtual_clusters/__init__.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py +77 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py +64 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py +155 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py +190 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py +56 -0
- gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py +44 -0
- gcore/types/cloud/gpu_virtual_clusters/server_list_params.py +75 -0
- gcore/types/cloud/image.py +9 -0
- gcore/types/cloud/inference/deployment_create_params.py +1 -1
- gcore/types/cloud/inference/deployment_update_params.py +1 -1
- gcore/types/cloud/inference/inference_deployment.py +1 -1
- gcore/types/cloud/instance_create_params.py +27 -27
- gcore/types/cloud/instance_update_params.py +7 -2
- gcore/types/cloud/instances/image_create_from_volume_params.py +4 -4
- gcore/types/cloud/instances/image_update_params.py +4 -4
- gcore/types/cloud/instances/image_upload_params.py +4 -4
- gcore/types/cloud/k8s/__init__.py +4 -4
- gcore/types/cloud/k8s/cluster_update_params.py +5 -5
- gcore/types/cloud/k8s/clusters/__init__.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster_certificate.py +2 -2
- gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +14 -2
- gcore/types/cloud/k8s/k8s_cluster_list.py +4 -4
- gcore/types/cloud/k8s_cluster_version.py +2 -2
- gcore/types/cloud/k8s_cluster_version_list.py +4 -4
- gcore/types/cloud/load_balancer_create_params.py +14 -8
- gcore/types/cloud/load_balancer_flavor_detail.py +2 -2
- gcore/types/cloud/load_balancer_l7_policy.py +29 -16
- gcore/types/cloud/load_balancer_l7_policy_list.py +3 -3
- gcore/types/cloud/load_balancer_l7_rule.py +14 -23
- gcore/types/cloud/load_balancer_l7_rule_list.py +3 -3
- gcore/types/cloud/load_balancer_listener_detail.py +2 -2
- gcore/types/cloud/load_balancer_update_params.py +7 -2
- gcore/types/cloud/load_balancers/__init__.py +1 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +5 -10
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +7 -11
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +102 -18
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +94 -16
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -1
- gcore/types/cloud/load_balancers/listener_delete_params.py +18 -0
- gcore/types/cloud/load_balancers/listener_update_params.py +4 -1
- gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
- gcore/types/cloud/network_create_params.py +4 -4
- gcore/types/cloud/network_update_params.py +7 -2
- gcore/types/cloud/networks/subnet_create_params.py +4 -4
- gcore/types/cloud/networks/subnet_update_params.py +7 -2
- gcore/types/cloud/project_create_params.py +0 -6
- gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
- gcore/types/cloud/quotas/request_create_params.py +0 -3
- gcore/types/cloud/region.py +3 -3
- gcore/types/cloud/security_group.py +8 -1
- gcore/types/cloud/security_group_create_params.py +7 -5
- gcore/types/cloud/security_group_list_params.py +6 -4
- gcore/types/cloud/security_group_update_params.py +7 -2
- gcore/types/cloud/ssh_key_list_params.py +7 -0
- gcore/types/cloud/tag.py +2 -2
- gcore/types/cloud/task_id_list.py +3 -3
- gcore/types/cloud/volume_create_params.py +12 -12
- gcore/types/cloud/volume_update_params.py +7 -2
- gcore/types/dns/zone_list_params.py +1 -1
- gcore/types/iam/api_token_create.py +70 -1
- gcore/types/security/bgp_announce_list_params.py +0 -2
- gcore/types/security/client_profile.py +1 -0
- gcore/types/security/profile_create_params.py +4 -2
- gcore/types/security/profile_recreate_params.py +4 -2
- gcore/types/security/profile_replace_params.py +4 -2
- gcore/types/storage/credential_recreate_params.py +0 -17
- gcore/types/storage/storage.py +1 -1
- gcore/types/storage/storage_create_params.py +1 -1
- gcore/types/streaming/stream.py +3 -2
- gcore/types/streaming/video.py +1 -1
- gcore/types/waap/domains/custom_rule_create_params.py +1 -1
- gcore/types/waap/domains/custom_rule_update_params.py +1 -1
- gcore/types/waap/domains/waap_custom_rule.py +1 -1
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/METADATA +14 -14
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/RECORD +219 -168
- gcore/resources/cdn/logs/__init__.py +0 -19
- /gcore/types/{cdn/logs → cloud/databases}/__init__.py +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/WHEEL +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/licenses/LICENSE +0 -0
gcore/_client.py
CHANGED
|
@@ -59,6 +59,7 @@ class Gcore(SyncAPIClient):
|
|
|
59
59
|
cloud_project_id: int | None
|
|
60
60
|
cloud_region_id: int | None
|
|
61
61
|
cloud_polling_interval_seconds: int | None
|
|
62
|
+
cloud_polling_timeout_seconds: int | None
|
|
62
63
|
|
|
63
64
|
def __init__(
|
|
64
65
|
self,
|
|
@@ -67,6 +68,7 @@ class Gcore(SyncAPIClient):
|
|
|
67
68
|
cloud_project_id: int | None = None,
|
|
68
69
|
cloud_region_id: int | None = None,
|
|
69
70
|
cloud_polling_interval_seconds: int | None = 3,
|
|
71
|
+
cloud_polling_timeout_seconds: int | None = 7200,
|
|
70
72
|
base_url: str | httpx.URL | None = None,
|
|
71
73
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
72
74
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -113,6 +115,10 @@ class Gcore(SyncAPIClient):
|
|
|
113
115
|
cloud_polling_interval_seconds = 3
|
|
114
116
|
self.cloud_polling_interval_seconds = cloud_polling_interval_seconds
|
|
115
117
|
|
|
118
|
+
if cloud_polling_timeout_seconds is None:
|
|
119
|
+
cloud_polling_timeout_seconds = 7200
|
|
120
|
+
self.cloud_polling_timeout_seconds = cloud_polling_timeout_seconds
|
|
121
|
+
|
|
116
122
|
if base_url is None:
|
|
117
123
|
base_url = os.environ.get("GCORE_BASE_URL")
|
|
118
124
|
if base_url is None:
|
|
@@ -168,6 +174,7 @@ class Gcore(SyncAPIClient):
|
|
|
168
174
|
cloud_project_id: int | None = None,
|
|
169
175
|
cloud_region_id: int | None = None,
|
|
170
176
|
cloud_polling_interval_seconds: int | None = None,
|
|
177
|
+
cloud_polling_timeout_seconds: int | None = None,
|
|
171
178
|
base_url: str | httpx.URL | None = None,
|
|
172
179
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
173
180
|
http_client: httpx.Client | None = None,
|
|
@@ -205,6 +212,7 @@ class Gcore(SyncAPIClient):
|
|
|
205
212
|
cloud_project_id=cloud_project_id or self.cloud_project_id,
|
|
206
213
|
cloud_region_id=cloud_region_id or self.cloud_region_id,
|
|
207
214
|
cloud_polling_interval_seconds=cloud_polling_interval_seconds or self.cloud_polling_interval_seconds,
|
|
215
|
+
cloud_polling_timeout_seconds=cloud_polling_timeout_seconds or self.cloud_polling_timeout_seconds,
|
|
208
216
|
base_url=base_url or self.base_url,
|
|
209
217
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
210
218
|
http_client=http_client,
|
|
@@ -288,6 +296,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
288
296
|
cloud_project_id: int | None
|
|
289
297
|
cloud_region_id: int | None
|
|
290
298
|
cloud_polling_interval_seconds: int | None
|
|
299
|
+
cloud_polling_timeout_seconds: int | None
|
|
291
300
|
|
|
292
301
|
def __init__(
|
|
293
302
|
self,
|
|
@@ -296,6 +305,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
296
305
|
cloud_project_id: int | None = None,
|
|
297
306
|
cloud_region_id: int | None = None,
|
|
298
307
|
cloud_polling_interval_seconds: int | None = 3,
|
|
308
|
+
cloud_polling_timeout_seconds: int | None = 7200,
|
|
299
309
|
base_url: str | httpx.URL | None = None,
|
|
300
310
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
301
311
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -342,6 +352,10 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
342
352
|
cloud_polling_interval_seconds = 3
|
|
343
353
|
self.cloud_polling_interval_seconds = cloud_polling_interval_seconds
|
|
344
354
|
|
|
355
|
+
if cloud_polling_timeout_seconds is None:
|
|
356
|
+
cloud_polling_timeout_seconds = 7200
|
|
357
|
+
self.cloud_polling_timeout_seconds = cloud_polling_timeout_seconds
|
|
358
|
+
|
|
345
359
|
if base_url is None:
|
|
346
360
|
base_url = os.environ.get("GCORE_BASE_URL")
|
|
347
361
|
if base_url is None:
|
|
@@ -397,6 +411,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
397
411
|
cloud_project_id: int | None = None,
|
|
398
412
|
cloud_region_id: int | None = None,
|
|
399
413
|
cloud_polling_interval_seconds: int | None = None,
|
|
414
|
+
cloud_polling_timeout_seconds: int | None = None,
|
|
400
415
|
base_url: str | httpx.URL | None = None,
|
|
401
416
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
402
417
|
http_client: httpx.AsyncClient | None = None,
|
|
@@ -434,6 +449,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
434
449
|
cloud_project_id=cloud_project_id or self.cloud_project_id,
|
|
435
450
|
cloud_region_id=cloud_region_id or self.cloud_region_id,
|
|
436
451
|
cloud_polling_interval_seconds=cloud_polling_interval_seconds or self.cloud_polling_interval_seconds,
|
|
452
|
+
cloud_polling_timeout_seconds=cloud_polling_timeout_seconds or self.cloud_polling_timeout_seconds,
|
|
437
453
|
base_url=base_url or self.base_url,
|
|
438
454
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
439
455
|
http_client=http_client,
|
gcore/_models.py
CHANGED
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import inspect
|
|
5
|
+
import weakref
|
|
5
6
|
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
|
|
6
7
|
from datetime import date, datetime
|
|
7
8
|
from typing_extensions import (
|
|
@@ -256,15 +257,16 @@ class BaseModel(pydantic.BaseModel):
|
|
|
256
257
|
mode: Literal["json", "python"] | str = "python",
|
|
257
258
|
include: IncEx | None = None,
|
|
258
259
|
exclude: IncEx | None = None,
|
|
260
|
+
context: Any | None = None,
|
|
259
261
|
by_alias: bool | None = None,
|
|
260
262
|
exclude_unset: bool = False,
|
|
261
263
|
exclude_defaults: bool = False,
|
|
262
264
|
exclude_none: bool = False,
|
|
265
|
+
exclude_computed_fields: bool = False,
|
|
263
266
|
round_trip: bool = False,
|
|
264
267
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
265
|
-
context: dict[str, Any] | None = None,
|
|
266
|
-
serialize_as_any: bool = False,
|
|
267
268
|
fallback: Callable[[Any], Any] | None = None,
|
|
269
|
+
serialize_as_any: bool = False,
|
|
268
270
|
) -> dict[str, Any]:
|
|
269
271
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
|
|
270
272
|
|
|
@@ -272,16 +274,24 @@ class BaseModel(pydantic.BaseModel):
|
|
|
272
274
|
|
|
273
275
|
Args:
|
|
274
276
|
mode: The mode in which `to_python` should run.
|
|
275
|
-
If mode is 'json', the
|
|
276
|
-
If mode is 'python', the
|
|
277
|
-
include: A
|
|
278
|
-
exclude: A
|
|
277
|
+
If mode is 'json', the output will only contain JSON serializable types.
|
|
278
|
+
If mode is 'python', the output may contain non-JSON-serializable Python objects.
|
|
279
|
+
include: A set of fields to include in the output.
|
|
280
|
+
exclude: A set of fields to exclude from the output.
|
|
281
|
+
context: Additional context to pass to the serializer.
|
|
279
282
|
by_alias: Whether to use the field's alias in the dictionary key if defined.
|
|
280
|
-
exclude_unset: Whether to exclude fields that
|
|
281
|
-
exclude_defaults: Whether to exclude fields that are set to their default value
|
|
282
|
-
exclude_none: Whether to exclude fields that have a value of `None
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
exclude_unset: Whether to exclude fields that have not been explicitly set.
|
|
284
|
+
exclude_defaults: Whether to exclude fields that are set to their default value.
|
|
285
|
+
exclude_none: Whether to exclude fields that have a value of `None`.
|
|
286
|
+
exclude_computed_fields: Whether to exclude computed fields.
|
|
287
|
+
While this can be useful for round-tripping, it is usually recommended to use the dedicated
|
|
288
|
+
`round_trip` parameter instead.
|
|
289
|
+
round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].
|
|
290
|
+
warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors,
|
|
291
|
+
"error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError].
|
|
292
|
+
fallback: A function to call when an unknown value is encountered. If not provided,
|
|
293
|
+
a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised.
|
|
294
|
+
serialize_as_any: Whether to serialize fields with duck-typing serialization behavior.
|
|
285
295
|
|
|
286
296
|
Returns:
|
|
287
297
|
A dictionary representation of the model.
|
|
@@ -298,6 +308,8 @@ class BaseModel(pydantic.BaseModel):
|
|
|
298
308
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
299
309
|
if fallback is not None:
|
|
300
310
|
raise ValueError("fallback is only supported in Pydantic v2")
|
|
311
|
+
if exclude_computed_fields != False:
|
|
312
|
+
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
|
|
301
313
|
dumped = super().dict( # pyright: ignore[reportDeprecated]
|
|
302
314
|
include=include,
|
|
303
315
|
exclude=exclude,
|
|
@@ -314,15 +326,17 @@ class BaseModel(pydantic.BaseModel):
|
|
|
314
326
|
self,
|
|
315
327
|
*,
|
|
316
328
|
indent: int | None = None,
|
|
329
|
+
ensure_ascii: bool = False,
|
|
317
330
|
include: IncEx | None = None,
|
|
318
331
|
exclude: IncEx | None = None,
|
|
332
|
+
context: Any | None = None,
|
|
319
333
|
by_alias: bool | None = None,
|
|
320
334
|
exclude_unset: bool = False,
|
|
321
335
|
exclude_defaults: bool = False,
|
|
322
336
|
exclude_none: bool = False,
|
|
337
|
+
exclude_computed_fields: bool = False,
|
|
323
338
|
round_trip: bool = False,
|
|
324
339
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
325
|
-
context: dict[str, Any] | None = None,
|
|
326
340
|
fallback: Callable[[Any], Any] | None = None,
|
|
327
341
|
serialize_as_any: bool = False,
|
|
328
342
|
) -> str:
|
|
@@ -354,6 +368,10 @@ class BaseModel(pydantic.BaseModel):
|
|
|
354
368
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
355
369
|
if fallback is not None:
|
|
356
370
|
raise ValueError("fallback is only supported in Pydantic v2")
|
|
371
|
+
if ensure_ascii != False:
|
|
372
|
+
raise ValueError("ensure_ascii is only supported in Pydantic v2")
|
|
373
|
+
if exclude_computed_fields != False:
|
|
374
|
+
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
|
|
357
375
|
return super().json( # type: ignore[reportDeprecated]
|
|
358
376
|
indent=indent,
|
|
359
377
|
include=include,
|
|
@@ -573,6 +591,9 @@ class CachedDiscriminatorType(Protocol):
|
|
|
573
591
|
__discriminator__: DiscriminatorDetails
|
|
574
592
|
|
|
575
593
|
|
|
594
|
+
DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary()
|
|
595
|
+
|
|
596
|
+
|
|
576
597
|
class DiscriminatorDetails:
|
|
577
598
|
field_name: str
|
|
578
599
|
"""The name of the discriminator field in the variant class, e.g.
|
|
@@ -615,8 +636,9 @@ class DiscriminatorDetails:
|
|
|
615
636
|
|
|
616
637
|
|
|
617
638
|
def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None:
|
|
618
|
-
|
|
619
|
-
|
|
639
|
+
cached = DISCRIMINATOR_CACHE.get(union)
|
|
640
|
+
if cached is not None:
|
|
641
|
+
return cached
|
|
620
642
|
|
|
621
643
|
discriminator_field_name: str | None = None
|
|
622
644
|
|
|
@@ -669,7 +691,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|
|
669
691
|
discriminator_field=discriminator_field_name,
|
|
670
692
|
discriminator_alias=discriminator_alias,
|
|
671
693
|
)
|
|
672
|
-
|
|
694
|
+
DISCRIMINATOR_CACHE.setdefault(union, details)
|
|
673
695
|
return details
|
|
674
696
|
|
|
675
697
|
|
gcore/_streaming.py
CHANGED
|
@@ -54,12 +54,12 @@ class Stream(Generic[_T]):
|
|
|
54
54
|
process_data = self._client._process_response_data
|
|
55
55
|
iterator = self._iter_events()
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
try:
|
|
58
|
+
for sse in iterator:
|
|
59
|
+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
60
|
+
finally:
|
|
61
|
+
# Ensure the response is closed even if the consumer doesn't read all data
|
|
62
|
+
response.close()
|
|
63
63
|
|
|
64
64
|
def __enter__(self) -> Self:
|
|
65
65
|
return self
|
|
@@ -118,12 +118,12 @@ class AsyncStream(Generic[_T]):
|
|
|
118
118
|
process_data = self._client._process_response_data
|
|
119
119
|
iterator = self._iter_events()
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
try:
|
|
122
|
+
async for sse in iterator:
|
|
123
|
+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
|
|
124
|
+
finally:
|
|
125
|
+
# Ensure the response is closed even if the consumer doesn't read all data
|
|
126
|
+
await response.aclose()
|
|
127
127
|
|
|
128
128
|
async def __aenter__(self) -> Self:
|
|
129
129
|
return self
|
gcore/_utils/_sync.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import sys
|
|
4
3
|
import asyncio
|
|
5
4
|
import functools
|
|
6
|
-
import
|
|
7
|
-
from typing import Any, TypeVar, Callable, Awaitable
|
|
5
|
+
from typing import TypeVar, Callable, Awaitable
|
|
8
6
|
from typing_extensions import ParamSpec
|
|
9
7
|
|
|
10
8
|
import anyio
|
|
@@ -15,34 +13,11 @@ T_Retval = TypeVar("T_Retval")
|
|
|
15
13
|
T_ParamSpec = ParamSpec("T_ParamSpec")
|
|
16
14
|
|
|
17
15
|
|
|
18
|
-
if sys.version_info >= (3, 9):
|
|
19
|
-
_asyncio_to_thread = asyncio.to_thread
|
|
20
|
-
else:
|
|
21
|
-
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
|
22
|
-
# for Python 3.8 support
|
|
23
|
-
async def _asyncio_to_thread(
|
|
24
|
-
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
25
|
-
) -> Any:
|
|
26
|
-
"""Asynchronously run function *func* in a separate thread.
|
|
27
|
-
|
|
28
|
-
Any *args and **kwargs supplied for this function are directly passed
|
|
29
|
-
to *func*. Also, the current :class:`contextvars.Context` is propagated,
|
|
30
|
-
allowing context variables from the main thread to be accessed in the
|
|
31
|
-
separate thread.
|
|
32
|
-
|
|
33
|
-
Returns a coroutine that can be awaited to get the eventual result of *func*.
|
|
34
|
-
"""
|
|
35
|
-
loop = asyncio.events.get_running_loop()
|
|
36
|
-
ctx = contextvars.copy_context()
|
|
37
|
-
func_call = functools.partial(ctx.run, func, *args, **kwargs)
|
|
38
|
-
return await loop.run_in_executor(None, func_call)
|
|
39
|
-
|
|
40
|
-
|
|
41
16
|
async def to_thread(
|
|
42
17
|
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
43
18
|
) -> T_Retval:
|
|
44
19
|
if sniffio.current_async_library() == "asyncio":
|
|
45
|
-
return await
|
|
20
|
+
return await asyncio.to_thread(func, *args, **kwargs)
|
|
46
21
|
|
|
47
22
|
return await anyio.to_thread.run_sync(
|
|
48
23
|
functools.partial(func, *args, **kwargs),
|
|
@@ -53,10 +28,7 @@ async def to_thread(
|
|
|
53
28
|
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
|
54
29
|
"""
|
|
55
30
|
Take a blocking function and create an async one that receives the same
|
|
56
|
-
positional and keyword arguments.
|
|
57
|
-
asyncio.to_thread to run the function in a separate thread. For python version
|
|
58
|
-
3.8, it uses locally defined copy of the asyncio.to_thread function which was
|
|
59
|
-
introduced in python 3.9.
|
|
31
|
+
positional and keyword arguments.
|
|
60
32
|
|
|
61
33
|
Usage:
|
|
62
34
|
|
gcore/_utils/_utils.py
CHANGED
|
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
|
134
134
|
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
|
|
135
135
|
# however this cause Pyright to rightfully report errors. As we know we don't
|
|
136
|
-
# care about the contained types we can safely use `object` in
|
|
136
|
+
# care about the contained types we can safely use `object` in its place.
|
|
137
137
|
#
|
|
138
138
|
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
|
|
139
139
|
# `is_*` is for when you're dealing with an unknown input
|
gcore/_version.py
CHANGED
gcore/resources/cdn/audit_log.py
CHANGED
|
@@ -99,9 +99,9 @@ class AuditLogResource(SyncAPIResource):
|
|
|
99
99
|
|
|
100
100
|
offset: Offset relative to the beginning of activity logs.
|
|
101
101
|
|
|
102
|
-
path:
|
|
102
|
+
path: Exact URL path.
|
|
103
103
|
|
|
104
|
-
remote_ip_address: IP address
|
|
104
|
+
remote_ip_address: Exact IP address from which requests are sent.
|
|
105
105
|
|
|
106
106
|
status_code: Status code returned in the response.
|
|
107
107
|
|
|
@@ -263,9 +263,9 @@ class AsyncAuditLogResource(AsyncAPIResource):
|
|
|
263
263
|
|
|
264
264
|
offset: Offset relative to the beginning of activity logs.
|
|
265
265
|
|
|
266
|
-
path:
|
|
266
|
+
path: Exact URL path.
|
|
267
267
|
|
|
268
|
-
remote_ip_address: IP address
|
|
268
|
+
remote_ip_address: Exact IP address from which requests are sent.
|
|
269
269
|
|
|
270
270
|
status_code: Status code returned in the response.
|
|
271
271
|
|
gcore/resources/cdn/cdn.py
CHANGED
|
@@ -4,6 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
+
from .logs import (
|
|
8
|
+
LogsResource,
|
|
9
|
+
AsyncLogsResource,
|
|
10
|
+
LogsResourceWithRawResponse,
|
|
11
|
+
AsyncLogsResourceWithRawResponse,
|
|
12
|
+
LogsResourceWithStreamingResponse,
|
|
13
|
+
AsyncLogsResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
7
15
|
from .metrics import (
|
|
8
16
|
MetricsResource,
|
|
9
17
|
AsyncMetricsResource,
|
|
@@ -39,14 +47,6 @@ from .ip_ranges import (
|
|
|
39
47
|
IPRangesResourceWithStreamingResponse,
|
|
40
48
|
AsyncIPRangesResourceWithStreamingResponse,
|
|
41
49
|
)
|
|
42
|
-
from .logs.logs import (
|
|
43
|
-
LogsResource,
|
|
44
|
-
AsyncLogsResource,
|
|
45
|
-
LogsResourceWithRawResponse,
|
|
46
|
-
AsyncLogsResourceWithRawResponse,
|
|
47
|
-
LogsResourceWithStreamingResponse,
|
|
48
|
-
AsyncLogsResourceWithStreamingResponse,
|
|
49
|
-
)
|
|
50
50
|
from .statistics import (
|
|
51
51
|
StatisticsResource,
|
|
52
52
|
AsyncStatisticsResource,
|
|
@@ -63,7 +63,6 @@ from ..._response import (
|
|
|
63
63
|
async_to_streamed_response_wrapper,
|
|
64
64
|
)
|
|
65
65
|
from ...types.cdn import cdn_update_account_params, cdn_list_purge_statuses_params
|
|
66
|
-
from ...pagination import SyncOffsetPageCdn, AsyncOffsetPageCdn
|
|
67
66
|
from .certificates import (
|
|
68
67
|
CertificatesResource,
|
|
69
68
|
AsyncCertificatesResource,
|
|
@@ -80,7 +79,7 @@ from .origin_groups import (
|
|
|
80
79
|
OriginGroupsResourceWithStreamingResponse,
|
|
81
80
|
AsyncOriginGroupsResourceWithStreamingResponse,
|
|
82
81
|
)
|
|
83
|
-
from ..._base_client import
|
|
82
|
+
from ..._base_client import make_request_options
|
|
84
83
|
from .rule_templates import (
|
|
85
84
|
RuleTemplatesResource,
|
|
86
85
|
AsyncRuleTemplatesResource,
|
|
@@ -105,6 +104,7 @@ from .resources.resources import (
|
|
|
105
104
|
ResourcesResourceWithStreamingResponse,
|
|
106
105
|
AsyncResourcesResourceWithStreamingResponse,
|
|
107
106
|
)
|
|
107
|
+
from ...types.cdn.aws_regions import AwsRegions
|
|
108
108
|
from ...types.cdn.cdn_account import CdnAccount
|
|
109
109
|
from .trusted_ca_certificates import (
|
|
110
110
|
TrustedCaCertificatesResource,
|
|
@@ -114,7 +114,7 @@ from .trusted_ca_certificates import (
|
|
|
114
114
|
TrustedCaCertificatesResourceWithStreamingResponse,
|
|
115
115
|
AsyncTrustedCaCertificatesResourceWithStreamingResponse,
|
|
116
116
|
)
|
|
117
|
-
from ...types.cdn.
|
|
117
|
+
from ...types.cdn.alibaba_regions import AlibabaRegions
|
|
118
118
|
from .logs_uploader.logs_uploader import (
|
|
119
119
|
LogsUploaderResource,
|
|
120
120
|
AsyncLogsUploaderResource,
|
|
@@ -125,6 +125,7 @@ from .logs_uploader.logs_uploader import (
|
|
|
125
125
|
)
|
|
126
126
|
from ...types.cdn.cdn_account_limits import CdnAccountLimits
|
|
127
127
|
from ...types.cdn.cdn_available_features import CdnAvailableFeatures
|
|
128
|
+
from ...types.cdn.cdn_list_purge_statuses_response import CdnListPurgeStatusesResponse
|
|
128
129
|
|
|
129
130
|
__all__ = ["CdnResource", "AsyncCdnResource"]
|
|
130
131
|
|
|
@@ -258,6 +259,44 @@ class CdnResource(SyncAPIResource):
|
|
|
258
259
|
cast_to=CdnAvailableFeatures,
|
|
259
260
|
)
|
|
260
261
|
|
|
262
|
+
def list_alibaba_regions(
|
|
263
|
+
self,
|
|
264
|
+
*,
|
|
265
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
266
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
267
|
+
extra_headers: Headers | None = None,
|
|
268
|
+
extra_query: Query | None = None,
|
|
269
|
+
extra_body: Body | None = None,
|
|
270
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
271
|
+
) -> AlibabaRegions:
|
|
272
|
+
"""Get the list of Alibaba Cloud regions."""
|
|
273
|
+
return self._get(
|
|
274
|
+
"/cdn/alibaba_regions",
|
|
275
|
+
options=make_request_options(
|
|
276
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
277
|
+
),
|
|
278
|
+
cast_to=AlibabaRegions,
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
def list_aws_regions(
|
|
282
|
+
self,
|
|
283
|
+
*,
|
|
284
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
|
+
extra_headers: Headers | None = None,
|
|
287
|
+
extra_query: Query | None = None,
|
|
288
|
+
extra_body: Body | None = None,
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
+
) -> AwsRegions:
|
|
291
|
+
"""Get the list of Amazon AWS regions."""
|
|
292
|
+
return self._get(
|
|
293
|
+
"/cdn/aws_regions",
|
|
294
|
+
options=make_request_options(
|
|
295
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
296
|
+
),
|
|
297
|
+
cast_to=AwsRegions,
|
|
298
|
+
)
|
|
299
|
+
|
|
261
300
|
def list_purge_statuses(
|
|
262
301
|
self,
|
|
263
302
|
*,
|
|
@@ -274,7 +313,7 @@ class CdnResource(SyncAPIResource):
|
|
|
274
313
|
extra_query: Query | None = None,
|
|
275
314
|
extra_body: Body | None = None,
|
|
276
315
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
277
|
-
) ->
|
|
316
|
+
) -> CdnListPurgeStatusesResponse:
|
|
278
317
|
"""
|
|
279
318
|
Get purges history.
|
|
280
319
|
|
|
@@ -330,9 +369,8 @@ class CdnResource(SyncAPIResource):
|
|
|
330
369
|
|
|
331
370
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
332
371
|
"""
|
|
333
|
-
return self.
|
|
372
|
+
return self._get(
|
|
334
373
|
"/cdn/purge_statuses",
|
|
335
|
-
page=SyncOffsetPageCdn[PurgeStatus],
|
|
336
374
|
options=make_request_options(
|
|
337
375
|
extra_headers=extra_headers,
|
|
338
376
|
extra_query=extra_query,
|
|
@@ -351,7 +389,7 @@ class CdnResource(SyncAPIResource):
|
|
|
351
389
|
cdn_list_purge_statuses_params.CdnListPurgeStatusesParams,
|
|
352
390
|
),
|
|
353
391
|
),
|
|
354
|
-
|
|
392
|
+
cast_to=CdnListPurgeStatusesResponse,
|
|
355
393
|
)
|
|
356
394
|
|
|
357
395
|
def update_account(
|
|
@@ -522,7 +560,45 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
522
560
|
cast_to=CdnAvailableFeatures,
|
|
523
561
|
)
|
|
524
562
|
|
|
525
|
-
def
|
|
563
|
+
async def list_alibaba_regions(
|
|
564
|
+
self,
|
|
565
|
+
*,
|
|
566
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
567
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
568
|
+
extra_headers: Headers | None = None,
|
|
569
|
+
extra_query: Query | None = None,
|
|
570
|
+
extra_body: Body | None = None,
|
|
571
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
572
|
+
) -> AlibabaRegions:
|
|
573
|
+
"""Get the list of Alibaba Cloud regions."""
|
|
574
|
+
return await self._get(
|
|
575
|
+
"/cdn/alibaba_regions",
|
|
576
|
+
options=make_request_options(
|
|
577
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
578
|
+
),
|
|
579
|
+
cast_to=AlibabaRegions,
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
async def list_aws_regions(
|
|
583
|
+
self,
|
|
584
|
+
*,
|
|
585
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
586
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
587
|
+
extra_headers: Headers | None = None,
|
|
588
|
+
extra_query: Query | None = None,
|
|
589
|
+
extra_body: Body | None = None,
|
|
590
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
591
|
+
) -> AwsRegions:
|
|
592
|
+
"""Get the list of Amazon AWS regions."""
|
|
593
|
+
return await self._get(
|
|
594
|
+
"/cdn/aws_regions",
|
|
595
|
+
options=make_request_options(
|
|
596
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
597
|
+
),
|
|
598
|
+
cast_to=AwsRegions,
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
async def list_purge_statuses(
|
|
526
602
|
self,
|
|
527
603
|
*,
|
|
528
604
|
cname: str | Omit = omit,
|
|
@@ -538,7 +614,7 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
538
614
|
extra_query: Query | None = None,
|
|
539
615
|
extra_body: Body | None = None,
|
|
540
616
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
541
|
-
) ->
|
|
617
|
+
) -> CdnListPurgeStatusesResponse:
|
|
542
618
|
"""
|
|
543
619
|
Get purges history.
|
|
544
620
|
|
|
@@ -594,15 +670,14 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
594
670
|
|
|
595
671
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
596
672
|
"""
|
|
597
|
-
return self.
|
|
673
|
+
return await self._get(
|
|
598
674
|
"/cdn/purge_statuses",
|
|
599
|
-
page=AsyncOffsetPageCdn[PurgeStatus],
|
|
600
675
|
options=make_request_options(
|
|
601
676
|
extra_headers=extra_headers,
|
|
602
677
|
extra_query=extra_query,
|
|
603
678
|
extra_body=extra_body,
|
|
604
679
|
timeout=timeout,
|
|
605
|
-
query=
|
|
680
|
+
query=await async_maybe_transform(
|
|
606
681
|
{
|
|
607
682
|
"cname": cname,
|
|
608
683
|
"from_created": from_created,
|
|
@@ -615,7 +690,7 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
615
690
|
cdn_list_purge_statuses_params.CdnListPurgeStatusesParams,
|
|
616
691
|
),
|
|
617
692
|
),
|
|
618
|
-
|
|
693
|
+
cast_to=CdnListPurgeStatusesResponse,
|
|
619
694
|
)
|
|
620
695
|
|
|
621
696
|
async def update_account(
|
|
@@ -670,6 +745,12 @@ class CdnResourceWithRawResponse:
|
|
|
670
745
|
self.get_available_features = to_raw_response_wrapper(
|
|
671
746
|
cdn.get_available_features,
|
|
672
747
|
)
|
|
748
|
+
self.list_alibaba_regions = to_raw_response_wrapper(
|
|
749
|
+
cdn.list_alibaba_regions,
|
|
750
|
+
)
|
|
751
|
+
self.list_aws_regions = to_raw_response_wrapper(
|
|
752
|
+
cdn.list_aws_regions,
|
|
753
|
+
)
|
|
673
754
|
self.list_purge_statuses = to_raw_response_wrapper(
|
|
674
755
|
cdn.list_purge_statuses,
|
|
675
756
|
)
|
|
@@ -743,6 +824,12 @@ class AsyncCdnResourceWithRawResponse:
|
|
|
743
824
|
self.get_available_features = async_to_raw_response_wrapper(
|
|
744
825
|
cdn.get_available_features,
|
|
745
826
|
)
|
|
827
|
+
self.list_alibaba_regions = async_to_raw_response_wrapper(
|
|
828
|
+
cdn.list_alibaba_regions,
|
|
829
|
+
)
|
|
830
|
+
self.list_aws_regions = async_to_raw_response_wrapper(
|
|
831
|
+
cdn.list_aws_regions,
|
|
832
|
+
)
|
|
746
833
|
self.list_purge_statuses = async_to_raw_response_wrapper(
|
|
747
834
|
cdn.list_purge_statuses,
|
|
748
835
|
)
|
|
@@ -816,6 +903,12 @@ class CdnResourceWithStreamingResponse:
|
|
|
816
903
|
self.get_available_features = to_streamed_response_wrapper(
|
|
817
904
|
cdn.get_available_features,
|
|
818
905
|
)
|
|
906
|
+
self.list_alibaba_regions = to_streamed_response_wrapper(
|
|
907
|
+
cdn.list_alibaba_regions,
|
|
908
|
+
)
|
|
909
|
+
self.list_aws_regions = to_streamed_response_wrapper(
|
|
910
|
+
cdn.list_aws_regions,
|
|
911
|
+
)
|
|
819
912
|
self.list_purge_statuses = to_streamed_response_wrapper(
|
|
820
913
|
cdn.list_purge_statuses,
|
|
821
914
|
)
|
|
@@ -889,6 +982,12 @@ class AsyncCdnResourceWithStreamingResponse:
|
|
|
889
982
|
self.get_available_features = async_to_streamed_response_wrapper(
|
|
890
983
|
cdn.get_available_features,
|
|
891
984
|
)
|
|
985
|
+
self.list_alibaba_regions = async_to_streamed_response_wrapper(
|
|
986
|
+
cdn.list_alibaba_regions,
|
|
987
|
+
)
|
|
988
|
+
self.list_aws_regions = async_to_streamed_response_wrapper(
|
|
989
|
+
cdn.list_aws_regions,
|
|
990
|
+
)
|
|
892
991
|
self.list_purge_statuses = async_to_streamed_response_wrapper(
|
|
893
992
|
cdn.list_purge_statuses,
|
|
894
993
|
)
|