gcore 0.3.0__py3-none-any.whl → 0.5.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 (226) hide show
  1. gcore/__init__.py +2 -1
  2. gcore/_base_client.py +31 -2
  3. gcore/_client.py +18 -0
  4. gcore/_constants.py +2 -2
  5. gcore/_models.py +8 -5
  6. gcore/_version.py +1 -1
  7. gcore/pagination.py +252 -1
  8. gcore/resources/__init__.py +28 -0
  9. gcore/resources/cloud/baremetal/flavors.py +11 -137
  10. gcore/resources/cloud/baremetal/images.py +10 -12
  11. gcore/resources/cloud/baremetal/servers.py +33 -30
  12. gcore/resources/cloud/billing_reservations.py +2 -2
  13. gcore/resources/cloud/file_shares/file_shares.py +7 -8
  14. gcore/resources/cloud/floating_ips.py +7 -12
  15. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +33 -22
  16. gcore/resources/cloud/gpu_baremetal_clusters/images.py +9 -10
  17. gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -2
  18. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +8 -4
  19. gcore/resources/cloud/inference/deployments/deployments.py +76 -35
  20. gcore/resources/cloud/inference/deployments/logs.py +7 -7
  21. gcore/resources/cloud/inference/inference.py +5 -5
  22. gcore/resources/cloud/inference/models.py +16 -15
  23. gcore/resources/cloud/inference/registry_credentials.py +18 -18
  24. gcore/resources/cloud/inference/secrets.py +12 -13
  25. gcore/resources/cloud/instances/flavors.py +9 -233
  26. gcore/resources/cloud/instances/images.py +47 -37
  27. gcore/resources/cloud/instances/instances.py +49 -34
  28. gcore/resources/cloud/instances/interfaces.py +2 -2
  29. gcore/resources/cloud/ip_ranges.py +34 -2
  30. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +10 -2
  31. gcore/resources/cloud/load_balancers/listeners.py +17 -8
  32. gcore/resources/cloud/load_balancers/load_balancers.py +73 -21
  33. gcore/resources/cloud/load_balancers/metrics.py +2 -2
  34. gcore/resources/cloud/load_balancers/pools/health_monitors.py +2 -2
  35. gcore/resources/cloud/load_balancers/pools/members.py +6 -2
  36. gcore/resources/cloud/networks/networks.py +81 -17
  37. gcore/resources/cloud/networks/routers.py +18 -18
  38. gcore/resources/cloud/networks/subnets.py +51 -11
  39. gcore/resources/cloud/projects.py +38 -24
  40. gcore/resources/cloud/quotas/quotas.py +6 -6
  41. gcore/resources/cloud/quotas/requests.py +8 -8
  42. gcore/resources/cloud/registries/artifacts.py +4 -4
  43. gcore/resources/cloud/registries/registries.py +14 -16
  44. gcore/resources/cloud/registries/repositories.py +4 -4
  45. gcore/resources/cloud/registries/tags.py +2 -2
  46. gcore/resources/cloud/registries/users.py +21 -22
  47. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +20 -20
  48. gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -10
  49. gcore/resources/cloud/secrets.py +14 -224
  50. gcore/resources/cloud/security_groups/rules.py +6 -6
  51. gcore/resources/cloud/security_groups/security_groups.py +70 -31
  52. gcore/resources/cloud/tasks.py +34 -32
  53. gcore/resources/cloud/users/role_assignments.py +12 -14
  54. gcore/resources/cloud/volumes.py +139 -49
  55. gcore/resources/fastedge/__init__.py +103 -0
  56. gcore/resources/fastedge/apps/__init__.py +33 -0
  57. gcore/resources/fastedge/apps/apps.py +932 -0
  58. gcore/resources/fastedge/apps/logs.py +248 -0
  59. gcore/resources/fastedge/binaries.py +286 -0
  60. gcore/resources/fastedge/fastedge.py +327 -0
  61. gcore/resources/fastedge/kv_stores.py +523 -0
  62. gcore/resources/fastedge/secrets.py +687 -0
  63. gcore/resources/fastedge/statistics.py +347 -0
  64. gcore/resources/fastedge/templates.py +652 -0
  65. gcore/resources/iam/__init__.py +47 -0
  66. gcore/resources/iam/api_tokens.py +521 -0
  67. gcore/resources/iam/iam.py +199 -0
  68. gcore/resources/iam/users.py +642 -0
  69. gcore/resources/waap/__init__.py +0 -14
  70. gcore/resources/waap/waap.py +0 -32
  71. gcore/types/cloud/__init__.py +2 -28
  72. gcore/types/cloud/baremetal/__init__.py +0 -1
  73. gcore/types/cloud/baremetal/image_list_params.py +1 -5
  74. gcore/types/cloud/baremetal/server_create_params.py +5 -9
  75. gcore/types/cloud/baremetal/server_list_params.py +1 -5
  76. gcore/types/cloud/ddos_profile.py +9 -3
  77. gcore/types/cloud/file_share_create_params.py +3 -5
  78. gcore/types/cloud/floating_ip_create_params.py +2 -4
  79. gcore/types/cloud/floating_ip_list_params.py +1 -5
  80. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +3 -4
  81. gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +2 -4
  82. gcore/types/cloud/health_monitor.py +6 -1
  83. gcore/types/cloud/inference/__init__.py +12 -8
  84. gcore/types/cloud/inference/deployment_create_params.py +224 -7
  85. gcore/types/cloud/inference/deployment_update_params.py +24 -3
  86. gcore/types/cloud/inference/deployments/__init__.py +1 -0
  87. gcore/types/cloud/inference/{inference_log.py → deployments/inference_deployment_log.py} +3 -3
  88. gcore/types/cloud/inference/inference_deployment.py +266 -0
  89. gcore/types/cloud/inference/{inference_apikey_secret.py → inference_deployment_api_key.py} +2 -2
  90. gcore/types/cloud/inference/{mlcatalog_model_card.py → inference_model.py} +2 -2
  91. gcore/types/cloud/inference/{inference_registry_credential.py → inference_registry_credentials.py} +2 -2
  92. gcore/types/cloud/inference/{inference_registry_credential_full.py → inference_registry_credentials_create.py} +2 -2
  93. gcore/types/cloud/inference/inference_secret.py +10 -3
  94. gcore/types/cloud/inference/model_list_params.py +2 -4
  95. gcore/types/cloud/{container_probe.py → inference/probe.py} +9 -9
  96. gcore/types/cloud/{container_probe_config.py → inference/probe_config.py} +5 -5
  97. gcore/types/cloud/{container_probe_exec.py → inference/probe_exec.py} +3 -3
  98. gcore/types/cloud/{container_probe_http_get.py → inference/probe_http_get.py} +3 -3
  99. gcore/types/cloud/{container_probe_tcp_socket.py → inference/probe_tcp_socket.py} +3 -3
  100. gcore/types/cloud/inference/secret_create_params.py +10 -4
  101. gcore/types/cloud/inference/secret_replace_params.py +10 -4
  102. gcore/types/cloud/{region_capacity.py → inference_region_capacity.py} +10 -3
  103. gcore/types/cloud/{region_capacity_list.py → inference_region_capacity_list.py} +4 -4
  104. gcore/types/cloud/instance_create_params.py +8 -9
  105. gcore/types/cloud/instance_list_params.py +1 -5
  106. gcore/types/cloud/instances/__init__.py +0 -2
  107. gcore/types/cloud/instances/image_create_from_volume_params.py +2 -4
  108. gcore/types/cloud/instances/image_list_params.py +1 -5
  109. gcore/types/cloud/instances/image_upload_params.py +2 -4
  110. gcore/types/cloud/load_balancer_create_params.py +8 -4
  111. gcore/types/cloud/load_balancer_list_params.py +1 -5
  112. gcore/types/cloud/load_balancer_update_params.py +24 -0
  113. gcore/types/cloud/load_balancers/pool_create_params.py +6 -1
  114. gcore/types/cloud/load_balancers/pool_update_params.py +6 -1
  115. gcore/types/cloud/load_balancers/pools/member_add_params.py +6 -1
  116. gcore/types/cloud/member.py +6 -1
  117. gcore/types/cloud/network_create_params.py +2 -3
  118. gcore/types/cloud/network_list_params.py +4 -5
  119. gcore/types/cloud/network_update_params.py +28 -2
  120. gcore/types/cloud/networks/router_list_params.py +2 -2
  121. gcore/types/cloud/networks/subnet_create_params.py +2 -3
  122. gcore/types/cloud/networks/subnet_list_params.py +1 -5
  123. gcore/types/cloud/networks/subnet_update_params.py +25 -0
  124. gcore/types/cloud/registries/__init__.py +1 -0
  125. gcore/types/cloud/registries/user_refresh_secret_response.py +31 -0
  126. gcore/types/cloud/reserved_fixed_ip_list_params.py +2 -2
  127. gcore/types/cloud/security_group_list_params.py +3 -7
  128. gcore/types/cloud/security_group_update_params.py +25 -0
  129. gcore/types/cloud/tag_update_map_param.py +2 -2
  130. gcore/types/cloud/task_list_params.py +15 -14
  131. gcore/types/cloud/volume_list_params.py +1 -5
  132. gcore/types/cloud/volume_update_params.py +29 -3
  133. gcore/types/fastedge/__init__.py +48 -0
  134. gcore/types/fastedge/app.py +81 -0
  135. gcore/types/fastedge/app_create_params.py +56 -0
  136. gcore/types/fastedge/app_list_params.py +50 -0
  137. gcore/types/fastedge/app_param.py +56 -0
  138. gcore/types/fastedge/app_replace_params.py +17 -0
  139. gcore/types/fastedge/app_short.py +60 -0
  140. gcore/types/fastedge/app_update_params.py +56 -0
  141. gcore/types/fastedge/apps/__init__.py +6 -0
  142. gcore/types/fastedge/apps/log.py +28 -0
  143. gcore/types/fastedge/apps/log_list_params.py +37 -0
  144. gcore/types/fastedge/binary.py +40 -0
  145. gcore/types/fastedge/binary_list_response.py +12 -0
  146. gcore/types/fastedge/binary_short.py +32 -0
  147. gcore/types/fastedge/call_status.py +24 -0
  148. gcore/types/fastedge/client.py +57 -0
  149. gcore/types/fastedge/duration_stats.py +30 -0
  150. gcore/types/fastedge/kv_store.py +33 -0
  151. gcore/types/fastedge/kv_store_create_params.py +23 -0
  152. gcore/types/fastedge/kv_store_get_response.py +10 -0
  153. gcore/types/fastedge/kv_store_list_params.py +12 -0
  154. gcore/types/fastedge/kv_store_list_response.py +15 -0
  155. gcore/types/fastedge/kv_store_replace_params.py +23 -0
  156. gcore/types/fastedge/kv_store_short.py +19 -0
  157. gcore/types/fastedge/kv_store_stats.py +26 -0
  158. gcore/types/fastedge/secret.py +29 -0
  159. gcore/types/fastedge/secret_create_params.py +27 -0
  160. gcore/types/fastedge/secret_create_response.py +12 -0
  161. gcore/types/fastedge/secret_delete_params.py +12 -0
  162. gcore/types/fastedge/secret_list_params.py +15 -0
  163. gcore/types/{cloud → fastedge}/secret_list_response.py +2 -6
  164. gcore/types/fastedge/secret_replace_params.py +27 -0
  165. gcore/types/fastedge/secret_short.py +21 -0
  166. gcore/types/fastedge/secret_update_params.py +27 -0
  167. gcore/types/fastedge/statistic_get_call_series_params.py +28 -0
  168. gcore/types/fastedge/statistic_get_call_series_response.py +12 -0
  169. gcore/types/fastedge/statistic_get_duration_series_params.py +28 -0
  170. gcore/types/fastedge/statistic_get_duration_series_response.py +12 -0
  171. gcore/types/fastedge/template.py +31 -0
  172. gcore/types/fastedge/template_create_params.py +30 -0
  173. gcore/types/fastedge/template_delete_params.py +12 -0
  174. gcore/types/fastedge/template_list_params.py +25 -0
  175. gcore/types/fastedge/template_parameter.py +22 -0
  176. gcore/types/fastedge/template_parameter_param.py +21 -0
  177. gcore/types/fastedge/template_replace_params.py +30 -0
  178. gcore/types/fastedge/template_short.py +27 -0
  179. gcore/types/iam/__init__.py +17 -0
  180. gcore/types/iam/account_overview.py +488 -0
  181. gcore/types/iam/api_token.py +78 -0
  182. gcore/types/iam/api_token_create.py +15 -0
  183. gcore/types/iam/api_token_create_params.py +42 -0
  184. gcore/types/iam/api_token_list.py +81 -0
  185. gcore/types/iam/api_token_list_params.py +41 -0
  186. gcore/types/iam/user.py +86 -0
  187. gcore/types/iam/user_detailed.py +104 -0
  188. gcore/types/iam/user_invite.py +15 -0
  189. gcore/types/iam/user_invite_params.py +37 -0
  190. gcore/types/iam/user_list_params.py +15 -0
  191. gcore/types/iam/user_update.py +104 -0
  192. gcore/types/iam/user_update_params.py +52 -0
  193. gcore/types/waap/__init__.py +0 -1
  194. gcore/types/waap/domains/custom_rule_create_params.py +7 -3
  195. gcore/types/waap/domains/custom_rule_update_params.py +7 -3
  196. gcore/types/waap/waap_custom_rule.py +7 -3
  197. {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/METADATA +44 -5
  198. {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/RECORD +200 -151
  199. gcore/resources/waap/clients.py +0 -135
  200. gcore/types/cloud/aws_iam_data.py +0 -13
  201. gcore/types/cloud/aws_iam_data_param.py +0 -15
  202. gcore/types/cloud/baremetal/flavor_list_suitable_params.py +0 -22
  203. gcore/types/cloud/capacity.py +0 -13
  204. gcore/types/cloud/container_probe_config_create_param.py +0 -17
  205. gcore/types/cloud/container_probe_create_param.py +0 -38
  206. gcore/types/cloud/container_probe_exec_create_param.py +0 -13
  207. gcore/types/cloud/container_probe_http_get_create_param.py +0 -25
  208. gcore/types/cloud/container_probe_tcp_socket_create_param.py +0 -12
  209. gcore/types/cloud/container_scale.py +0 -25
  210. gcore/types/cloud/container_scale_trigger_rate.py +0 -13
  211. gcore/types/cloud/container_scale_trigger_sqs.py +0 -33
  212. gcore/types/cloud/container_scale_trigger_threshold.py +0 -10
  213. gcore/types/cloud/container_scale_triggers.py +0 -36
  214. gcore/types/cloud/deploy_status.py +0 -13
  215. gcore/types/cloud/inference/container.py +0 -26
  216. gcore/types/cloud/inference/inference.py +0 -95
  217. gcore/types/cloud/inference/mlcatalog_order_by_choices.py +0 -7
  218. gcore/types/cloud/inference_probes.py +0 -19
  219. gcore/types/cloud/ingress_opts_out.py +0 -16
  220. gcore/types/cloud/ingress_opts_param.py +0 -18
  221. gcore/types/cloud/instances/flavor_list_for_resize_params.py +0 -16
  222. gcore/types/cloud/instances/flavor_list_suitable_params.py +0 -59
  223. gcore/types/cloud/secret_create_params.py +0 -66
  224. gcore/types/waap/client_me_response.py +0 -34
  225. {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/WHEEL +0 -0
  226. {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import Dict, List, Optional
6
6
  from typing_extensions import Literal
7
7
 
8
8
  import httpx
@@ -74,7 +74,7 @@ class ImagesResource(SyncAPIResource):
74
74
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
75
75
  ) -> Image:
76
76
  """
77
- Update image fields
77
+ Update image properties and tags.
78
78
 
79
79
  Args:
80
80
  hw_firmware_type: Specifies the type of firmware with which to boot the guest.
@@ -146,10 +146,11 @@ class ImagesResource(SyncAPIResource):
146
146
  extra_body: Body | None = None,
147
147
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
148
  ) -> ImageList:
149
- """Retrieve an available images list.
149
+ """Retrieve a list of available images in the project and region.
150
150
 
151
- Returned entities owned by the project and
152
- public OR shared with the client
151
+ The list can be
152
+ filtered by visibility, tags, and other parameters. Returned entities are owned
153
+ by the project or are public/shared with the client.
153
154
 
154
155
  Args:
155
156
  include_prices: Show price
@@ -158,9 +159,7 @@ class ImagesResource(SyncAPIResource):
158
159
 
159
160
  tag_key: Filter by tag keys.
160
161
 
161
- tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. 'curl -G
162
- --data-urlencode '`tag_key_value`={"key": "value"}' --url
163
- 'http://localhost:1111/v1/images/1/1'"
162
+ tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
164
163
 
165
164
  visibility: Image visibility. Globally visible images are public
166
165
 
@@ -210,8 +209,10 @@ class ImagesResource(SyncAPIResource):
210
209
  extra_body: Body | None = None,
211
210
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
212
211
  ) -> TaskIDList:
213
- """
214
- Delete the image
212
+ """Delete a specific image.
213
+
214
+ The image cannot be deleted if it is used by protected
215
+ snapshots.
215
216
 
216
217
  Args:
217
218
  extra_headers: Send extra headers
@@ -284,7 +285,7 @@ class ImagesResource(SyncAPIResource):
284
285
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
285
286
  source: Literal["volume"] | NotGiven = NOT_GIVEN,
286
287
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
287
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
288
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
288
289
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
289
290
  # The extra values given here take precedence over values defined on the client or passed to this method.
290
291
  extra_headers: Headers | None = None,
@@ -292,8 +293,10 @@ class ImagesResource(SyncAPIResource):
292
293
  extra_body: Body | None = None,
293
294
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
294
295
  ) -> TaskIDList:
295
- """
296
- Create image from volume
296
+ """Create a new image from a bootable volume.
297
+
298
+ The volume must be bootable to create
299
+ an image from it.
297
300
 
298
301
  Args:
299
302
  name: Image name
@@ -369,7 +372,7 @@ class ImagesResource(SyncAPIResource):
369
372
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
370
373
  source: Literal["volume"] | NotGiven = NOT_GIVEN,
371
374
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
372
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
375
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
373
376
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
374
377
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
375
378
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -430,7 +433,7 @@ class ImagesResource(SyncAPIResource):
430
433
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
431
434
  ) -> Image:
432
435
  """
433
- Get image
436
+ Retrieve detailed information about a specific image.
434
437
 
435
438
  Args:
436
439
  include_prices: Show price
@@ -477,7 +480,7 @@ class ImagesResource(SyncAPIResource):
477
480
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
478
481
  os_version: Optional[str] | NotGiven = NOT_GIVEN,
479
482
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
480
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
483
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
481
484
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
482
485
  # The extra values given here take precedence over values defined on the client or passed to this method.
483
486
  extra_headers: Headers | None = None,
@@ -485,8 +488,10 @@ class ImagesResource(SyncAPIResource):
485
488
  extra_body: Body | None = None,
486
489
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
487
490
  ) -> TaskIDList:
488
- """
489
- Upload image
491
+ """Upload an image from a URL.
492
+
493
+ The image can be configured with various properties
494
+ like OS type, architecture, and tags.
490
495
 
491
496
  Args:
492
497
  name: Image name
@@ -571,7 +576,7 @@ class ImagesResource(SyncAPIResource):
571
576
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
572
577
  os_version: Optional[str] | NotGiven = NOT_GIVEN,
573
578
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
574
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
579
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
575
580
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
576
581
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
577
582
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -661,7 +666,7 @@ class AsyncImagesResource(AsyncAPIResource):
661
666
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
662
667
  ) -> Image:
663
668
  """
664
- Update image fields
669
+ Update image properties and tags.
665
670
 
666
671
  Args:
667
672
  hw_firmware_type: Specifies the type of firmware with which to boot the guest.
@@ -733,10 +738,11 @@ class AsyncImagesResource(AsyncAPIResource):
733
738
  extra_body: Body | None = None,
734
739
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
735
740
  ) -> ImageList:
736
- """Retrieve an available images list.
741
+ """Retrieve a list of available images in the project and region.
737
742
 
738
- Returned entities owned by the project and
739
- public OR shared with the client
743
+ The list can be
744
+ filtered by visibility, tags, and other parameters. Returned entities are owned
745
+ by the project or are public/shared with the client.
740
746
 
741
747
  Args:
742
748
  include_prices: Show price
@@ -745,9 +751,7 @@ class AsyncImagesResource(AsyncAPIResource):
745
751
 
746
752
  tag_key: Filter by tag keys.
747
753
 
748
- tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. 'curl -G
749
- --data-urlencode '`tag_key_value`={"key": "value"}' --url
750
- 'http://localhost:1111/v1/images/1/1'"
754
+ tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
751
755
 
752
756
  visibility: Image visibility. Globally visible images are public
753
757
 
@@ -797,8 +801,10 @@ class AsyncImagesResource(AsyncAPIResource):
797
801
  extra_body: Body | None = None,
798
802
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
799
803
  ) -> TaskIDList:
800
- """
801
- Delete the image
804
+ """Delete a specific image.
805
+
806
+ The image cannot be deleted if it is used by protected
807
+ snapshots.
802
808
 
803
809
  Args:
804
810
  extra_headers: Send extra headers
@@ -871,7 +877,7 @@ class AsyncImagesResource(AsyncAPIResource):
871
877
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
872
878
  source: Literal["volume"] | NotGiven = NOT_GIVEN,
873
879
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
874
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
880
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
875
881
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
876
882
  # The extra values given here take precedence over values defined on the client or passed to this method.
877
883
  extra_headers: Headers | None = None,
@@ -879,8 +885,10 @@ class AsyncImagesResource(AsyncAPIResource):
879
885
  extra_body: Body | None = None,
880
886
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
881
887
  ) -> TaskIDList:
882
- """
883
- Create image from volume
888
+ """Create a new image from a bootable volume.
889
+
890
+ The volume must be bootable to create
891
+ an image from it.
884
892
 
885
893
  Args:
886
894
  name: Image name
@@ -956,7 +964,7 @@ class AsyncImagesResource(AsyncAPIResource):
956
964
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
957
965
  source: Literal["volume"] | NotGiven = NOT_GIVEN,
958
966
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
959
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
967
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
960
968
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
961
969
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
962
970
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1017,7 +1025,7 @@ class AsyncImagesResource(AsyncAPIResource):
1017
1025
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1018
1026
  ) -> Image:
1019
1027
  """
1020
- Get image
1028
+ Retrieve detailed information about a specific image.
1021
1029
 
1022
1030
  Args:
1023
1031
  include_prices: Show price
@@ -1064,7 +1072,7 @@ class AsyncImagesResource(AsyncAPIResource):
1064
1072
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
1065
1073
  os_version: Optional[str] | NotGiven = NOT_GIVEN,
1066
1074
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
1067
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1075
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1068
1076
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1069
1077
  # The extra values given here take precedence over values defined on the client or passed to this method.
1070
1078
  extra_headers: Headers | None = None,
@@ -1072,8 +1080,10 @@ class AsyncImagesResource(AsyncAPIResource):
1072
1080
  extra_body: Body | None = None,
1073
1081
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1074
1082
  ) -> TaskIDList:
1075
- """
1076
- Upload image
1083
+ """Upload an image from a URL.
1084
+
1085
+ The image can be configured with various properties
1086
+ like OS type, architecture, and tags.
1077
1087
 
1078
1088
  Args:
1079
1089
  name: Image name
@@ -1158,7 +1168,7 @@ class AsyncImagesResource(AsyncAPIResource):
1158
1168
  os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
1159
1169
  os_version: Optional[str] | NotGiven = NOT_GIVEN,
1160
1170
  ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
1161
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1171
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1162
1172
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1163
1173
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1164
1174
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Iterable, Optional
5
+ from typing import Dict, List, Union, Iterable, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal, overload
8
8
 
@@ -68,7 +68,6 @@ from ....types.cloud.console import Console
68
68
  from ....types.cloud.instance import Instance
69
69
  from ....types.cloud.task_id_list import TaskIDList
70
70
  from ....types.cloud.instance_interface import InstanceInterface
71
- from ....types.cloud.tag_update_map_param import TagUpdateMapParam
72
71
 
73
72
  __all__ = ["InstancesResource", "AsyncInstancesResource"]
74
73
 
@@ -125,7 +124,7 @@ class InstancesResource(SyncAPIResource):
125
124
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
126
125
  servergroup_id: str | NotGiven = NOT_GIVEN,
127
126
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
128
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
127
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
129
128
  user_data: str | NotGiven = NOT_GIVEN,
130
129
  username: str | NotGiven = NOT_GIVEN,
131
130
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -135,8 +134,9 @@ class InstancesResource(SyncAPIResource):
135
134
  extra_body: Body | None = None,
136
135
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
137
136
  ) -> TaskIDList:
138
- """
139
- For Linux,
137
+ """Create an instance with specified configuration.
138
+
139
+ How to get access: For Linux,
140
140
 
141
141
  - Use the `user_data` field to provide a
142
142
  [cloud-init script](https://cloudinit.readthedocs.io/en/latest/reference/examples.html)
@@ -198,7 +198,7 @@ class InstancesResource(SyncAPIResource):
198
198
  sharing if needed.
199
199
 
200
200
  ssh_key_name: Specifies the name of the SSH keypair, created via the
201
- [/v1/`ssh_keys` endpoint](/docs/api-reference/ssh-keys/add-or-generate-ssh-key).
201
+ [/v1/`ssh_keys` endpoint](/docs/api-reference/cloud/ssh-keys/add-or-generate-ssh-key).
202
202
 
203
203
  tags: Key-value tags to associate with the resource. A tag is a key-value pair that
204
204
  can be associated with a resource, enabling efficient filtering and grouping for
@@ -270,7 +270,7 @@ class InstancesResource(SyncAPIResource):
270
270
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
271
271
  servergroup_id: str | NotGiven = NOT_GIVEN,
272
272
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
273
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
273
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
274
274
  user_data: str | NotGiven = NOT_GIVEN,
275
275
  username: str | NotGiven = NOT_GIVEN,
276
276
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
@@ -429,8 +429,10 @@ class InstancesResource(SyncAPIResource):
429
429
  extra_body: Body | None = None,
430
430
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
431
431
  ) -> SyncOffsetPage[Instance]:
432
- """
433
- List instances
432
+ """List all instances in the specified project and region.
433
+
434
+ Results can be filtered
435
+ by various parameters like name, status, and IP address.
434
436
 
435
437
  Args:
436
438
  project_id: Project ID
@@ -485,9 +487,7 @@ class InstancesResource(SyncAPIResource):
485
487
 
486
488
  status: Filters instances by status.
487
489
 
488
- tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
489
- "`tag_key_value`={"key": "value"}" --url
490
- "https://example.com/cloud/v1/resource/1/1"
490
+ tag_key_value: Optional. Filter by tag key-value pairs.
491
491
 
492
492
  tag_value: Optional. Filter by tag values. ?`tag_value`=value1&`tag_value`=value2
493
493
 
@@ -787,8 +787,10 @@ class InstancesResource(SyncAPIResource):
787
787
  extra_body: Body | None = None,
788
788
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
789
789
  ) -> TaskIDList:
790
- """
791
- Put instance into the server group
790
+ """Add an instance to a server group.
791
+
792
+ The instance must not already be in a server
793
+ group. Bare metal servers do not support server groups.
792
794
 
793
795
  Args:
794
796
  servergroup_id: Anti-affinity or affinity or soft-anti-affinity server group ID.
@@ -1008,8 +1010,11 @@ class InstancesResource(SyncAPIResource):
1008
1010
  extra_body: Body | None = None,
1009
1011
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1010
1012
  ) -> Instance:
1011
- """
1012
- **Cookie Parameters**:
1013
+ """Retrieve detailed information about a specific instance.
1014
+
1015
+ The response content
1016
+ language for `ddos_profile` can be controlled via the 'language' cookie
1017
+ parameter. **Cookie Parameters**:
1013
1018
 
1014
1019
  - `language` (str, optional): Language for the response content. Affects the
1015
1020
  `ddos_profile` field. Supported values:
@@ -1107,8 +1112,10 @@ class InstancesResource(SyncAPIResource):
1107
1112
  extra_body: Body | None = None,
1108
1113
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1109
1114
  ) -> TaskIDList:
1110
- """
1111
- Remove instance from the server group
1115
+ """Remove an instance from its current server group.
1116
+
1117
+ The instance must be in a
1118
+ server group to be removed. Bare metal servers do not support server groups.
1112
1119
 
1113
1120
  Args:
1114
1121
  extra_headers: Send extra headers
@@ -1367,7 +1374,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1367
1374
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
1368
1375
  servergroup_id: str | NotGiven = NOT_GIVEN,
1369
1376
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
1370
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1377
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1371
1378
  user_data: str | NotGiven = NOT_GIVEN,
1372
1379
  username: str | NotGiven = NOT_GIVEN,
1373
1380
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1377,8 +1384,9 @@ class AsyncInstancesResource(AsyncAPIResource):
1377
1384
  extra_body: Body | None = None,
1378
1385
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1379
1386
  ) -> TaskIDList:
1380
- """
1381
- For Linux,
1387
+ """Create an instance with specified configuration.
1388
+
1389
+ How to get access: For Linux,
1382
1390
 
1383
1391
  - Use the `user_data` field to provide a
1384
1392
  [cloud-init script](https://cloudinit.readthedocs.io/en/latest/reference/examples.html)
@@ -1440,7 +1448,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1440
1448
  sharing if needed.
1441
1449
 
1442
1450
  ssh_key_name: Specifies the name of the SSH keypair, created via the
1443
- [/v1/`ssh_keys` endpoint](/docs/api-reference/ssh-keys/add-or-generate-ssh-key).
1451
+ [/v1/`ssh_keys` endpoint](/docs/api-reference/cloud/ssh-keys/add-or-generate-ssh-key).
1444
1452
 
1445
1453
  tags: Key-value tags to associate with the resource. A tag is a key-value pair that
1446
1454
  can be associated with a resource, enabling efficient filtering and grouping for
@@ -1512,7 +1520,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1512
1520
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
1513
1521
  servergroup_id: str | NotGiven = NOT_GIVEN,
1514
1522
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
1515
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1523
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1516
1524
  user_data: str | NotGiven = NOT_GIVEN,
1517
1525
  username: str | NotGiven = NOT_GIVEN,
1518
1526
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
@@ -1671,8 +1679,10 @@ class AsyncInstancesResource(AsyncAPIResource):
1671
1679
  extra_body: Body | None = None,
1672
1680
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1673
1681
  ) -> AsyncPaginator[Instance, AsyncOffsetPage[Instance]]:
1674
- """
1675
- List instances
1682
+ """List all instances in the specified project and region.
1683
+
1684
+ Results can be filtered
1685
+ by various parameters like name, status, and IP address.
1676
1686
 
1677
1687
  Args:
1678
1688
  project_id: Project ID
@@ -1727,9 +1737,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1727
1737
 
1728
1738
  status: Filters instances by status.
1729
1739
 
1730
- tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
1731
- "`tag_key_value`={"key": "value"}" --url
1732
- "https://example.com/cloud/v1/resource/1/1"
1740
+ tag_key_value: Optional. Filter by tag key-value pairs.
1733
1741
 
1734
1742
  tag_value: Optional. Filter by tag values. ?`tag_value`=value1&`tag_value`=value2
1735
1743
 
@@ -2029,8 +2037,10 @@ class AsyncInstancesResource(AsyncAPIResource):
2029
2037
  extra_body: Body | None = None,
2030
2038
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2031
2039
  ) -> TaskIDList:
2032
- """
2033
- Put instance into the server group
2040
+ """Add an instance to a server group.
2041
+
2042
+ The instance must not already be in a server
2043
+ group. Bare metal servers do not support server groups.
2034
2044
 
2035
2045
  Args:
2036
2046
  servergroup_id: Anti-affinity or affinity or soft-anti-affinity server group ID.
@@ -2250,8 +2260,11 @@ class AsyncInstancesResource(AsyncAPIResource):
2250
2260
  extra_body: Body | None = None,
2251
2261
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2252
2262
  ) -> Instance:
2253
- """
2254
- **Cookie Parameters**:
2263
+ """Retrieve detailed information about a specific instance.
2264
+
2265
+ The response content
2266
+ language for `ddos_profile` can be controlled via the 'language' cookie
2267
+ parameter. **Cookie Parameters**:
2255
2268
 
2256
2269
  - `language` (str, optional): Language for the response content. Affects the
2257
2270
  `ddos_profile` field. Supported values:
@@ -2349,8 +2362,10 @@ class AsyncInstancesResource(AsyncAPIResource):
2349
2362
  extra_body: Body | None = None,
2350
2363
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2351
2364
  ) -> TaskIDList:
2352
- """
2353
- Remove instance from the server group
2365
+ """Remove an instance from its current server group.
2366
+
2367
+ The instance must be in a
2368
+ server group to be removed. Bare metal servers do not support server groups.
2354
2369
 
2355
2370
  Args:
2356
2371
  extra_headers: Send extra headers
@@ -59,7 +59,7 @@ class InterfacesResource(SyncAPIResource):
59
59
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
60
  ) -> NetworkInterfaceList:
61
61
  """
62
- List network interfaces attached to the instance
62
+ List all network interfaces attached to the specified instance.
63
63
 
64
64
  Args:
65
65
  extra_headers: Send extra headers
@@ -415,7 +415,7 @@ class AsyncInterfacesResource(AsyncAPIResource):
415
415
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
416
416
  ) -> NetworkInterfaceList:
417
417
  """
418
- List network interfaces attached to the instance
418
+ List all network interfaces attached to the specified instance.
419
419
 
420
420
  Args:
421
421
  extra_headers: Send extra headers
@@ -49,7 +49,23 @@ class IPRangesResource(SyncAPIResource):
49
49
  extra_body: Body | None = None,
50
50
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
51
  ) -> IPRanges:
52
- """List of all Edge Cloud Egress Public IPs."""
52
+ """
53
+ Returns the complete list of IPv4 and IPv6 address ranges that Cloud uses for
54
+ outbound (egress) traffic. Typical reasons to call this endpoint:
55
+
56
+ - Host-file delivery workflows – You upload images or other assets to the Cloud
57
+ and share a download link that points to your own infrastructure. Add these
58
+ egress prefixes to your firewall or object-storage allow-list so our clients
59
+ can fetch the files without being blocked.
60
+ - Push integrations / webhooks – You subscribe to the user-actions event log and
61
+ Cloud pushes events to your listener endpoint. Whitelisting the egress IP
62
+ ranges lets you accept only traffic that originates from us.
63
+ - General security controls, audit tooling, or SIEM rules that need to verify
64
+ that traffic truly comes from the Cloud. The list is global (covers all
65
+ regions) and refreshed automatically whenever Gcore allocates new egress IP
66
+ space. The response is an array of CIDR blocks; duplicate prefixes are not
67
+ returned.
68
+ """
53
69
  return self._get(
54
70
  "/cloud/public/v1/ipranges/egress",
55
71
  options=make_request_options(
@@ -89,7 +105,23 @@ class AsyncIPRangesResource(AsyncAPIResource):
89
105
  extra_body: Body | None = None,
90
106
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91
107
  ) -> IPRanges:
92
- """List of all Edge Cloud Egress Public IPs."""
108
+ """
109
+ Returns the complete list of IPv4 and IPv6 address ranges that Cloud uses for
110
+ outbound (egress) traffic. Typical reasons to call this endpoint:
111
+
112
+ - Host-file delivery workflows – You upload images or other assets to the Cloud
113
+ and share a download link that points to your own infrastructure. Add these
114
+ egress prefixes to your firewall or object-storage allow-list so our clients
115
+ can fetch the files without being blocked.
116
+ - Push integrations / webhooks – You subscribe to the user-actions event log and
117
+ Cloud pushes events to your listener endpoint. Whitelisting the egress IP
118
+ ranges lets you accept only traffic that originates from us.
119
+ - General security controls, audit tooling, or SIEM rules that need to verify
120
+ that traffic truly comes from the Cloud. The list is global (covers all
121
+ regions) and refreshed automatically whenever Gcore allocates new egress IP
122
+ space. The response is an array of CIDR blocks; duplicate prefixes are not
123
+ returned.
124
+ """
93
125
  return await self._get(
94
126
  "/cloud/public/v1/ipranges/egress",
95
127
  options=make_request_options(
@@ -381,7 +381,11 @@ class L7PoliciesResource(SyncAPIResource):
381
381
  extra_headers=extra_headers,
382
382
  polling_interval_seconds=polling_interval_seconds,
383
383
  )
384
- if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
384
+ if (
385
+ not task.created_resources
386
+ or not task.created_resources.l7polices
387
+ or len(task.created_resources.l7polices) != 1
388
+ ):
385
389
  raise ValueError(f"Expected exactly one resource to be created in a task")
386
390
  return self.get(
387
391
  l7policy_id=task.created_resources.l7polices[0],
@@ -824,7 +828,11 @@ class AsyncL7PoliciesResource(AsyncAPIResource):
824
828
  extra_headers=extra_headers,
825
829
  polling_interval_seconds=polling_interval_seconds,
826
830
  )
827
- if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
831
+ if (
832
+ not task.created_resources
833
+ or not task.created_resources.l7polices
834
+ or len(task.created_resources.l7polices) != 1
835
+ ):
828
836
  raise ValueError(f"Expected exactly one resource to be created in a task")
829
837
  return await self.get(
830
838
  l7policy_id=task.created_resources.l7polices[0],
@@ -175,7 +175,7 @@ class ListenersResource(SyncAPIResource):
175
175
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
176
  ) -> TaskIDList:
177
177
  """
178
- Update listener
178
+ Update load balancer listener
179
179
 
180
180
  Args:
181
181
  project_id: Project ID
@@ -356,7 +356,7 @@ class ListenersResource(SyncAPIResource):
356
356
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
357
357
  ) -> LoadBalancerListenerDetail:
358
358
  """
359
- Get listener
359
+ Get load balancer listener
360
360
 
361
361
  Args:
362
362
  project_id: Project ID
@@ -447,7 +447,11 @@ class ListenersResource(SyncAPIResource):
447
447
  extra_headers=extra_headers,
448
448
  polling_interval_seconds=polling_interval_seconds,
449
449
  )
450
- if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
450
+ if (
451
+ not task.created_resources
452
+ or not task.created_resources.listeners
453
+ or len(task.created_resources.listeners) != 1
454
+ ):
451
455
  raise ValueError(f"Expected exactly one resource to be created in a task")
452
456
  return self.get(
453
457
  listener_id=task.created_resources.listeners[0],
@@ -694,7 +698,7 @@ class AsyncListenersResource(AsyncAPIResource):
694
698
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
695
699
  ) -> TaskIDList:
696
700
  """
697
- Update listener
701
+ Update load balancer listener
698
702
 
699
703
  Args:
700
704
  project_id: Project ID
@@ -875,7 +879,7 @@ class AsyncListenersResource(AsyncAPIResource):
875
879
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
876
880
  ) -> LoadBalancerListenerDetail:
877
881
  """
878
- Get listener
882
+ Get load balancer listener
879
883
 
880
884
  Args:
881
885
  project_id: Project ID
@@ -966,7 +970,11 @@ class AsyncListenersResource(AsyncAPIResource):
966
970
  extra_headers=extra_headers,
967
971
  polling_interval_seconds=polling_interval_seconds,
968
972
  )
969
- if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
973
+ if (
974
+ not task.created_resources
975
+ or not task.created_resources.listeners
976
+ or len(task.created_resources.listeners) != 1
977
+ ):
970
978
  raise ValueError(f"Expected exactly one resource to be created in a task")
971
979
  return await self.get(
972
980
  listener_id=task.created_resources.listeners[0],
@@ -975,7 +983,7 @@ class AsyncListenersResource(AsyncAPIResource):
975
983
  extra_headers=extra_headers,
976
984
  timeout=timeout,
977
985
  )
978
-
986
+
979
987
  async def delete_and_poll(
980
988
  self,
981
989
  listener_id: str,
@@ -1008,7 +1016,7 @@ class AsyncListenersResource(AsyncAPIResource):
1008
1016
  task_id=response.tasks[0],
1009
1017
  extra_headers=extra_headers,
1010
1018
  polling_interval_seconds=polling_interval_seconds,
1011
- )
1019
+ )
1012
1020
 
1013
1021
  async def update_and_poll(
1014
1022
  self,
@@ -1069,6 +1077,7 @@ class AsyncListenersResource(AsyncAPIResource):
1069
1077
  timeout=timeout,
1070
1078
  )
1071
1079
 
1080
+
1072
1081
  class ListenersResourceWithRawResponse:
1073
1082
  def __init__(self, listeners: ListenersResource) -> None:
1074
1083
  self._listeners = listeners