gcore 0.13.0__py3-none-any.whl → 0.14.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 (334) hide show
  1. gcore/__init__.py +3 -1
  2. gcore/_base_client.py +9 -9
  3. gcore/_client.py +25 -10
  4. gcore/_models.py +10 -4
  5. gcore/_qs.py +7 -7
  6. gcore/_types.py +18 -11
  7. gcore/_utils/_transform.py +2 -2
  8. gcore/_utils/_utils.py +4 -4
  9. gcore/_version.py +1 -1
  10. gcore/pagination.py +137 -0
  11. gcore/resources/__init__.py +14 -0
  12. gcore/resources/cdn/__init__.py +201 -0
  13. gcore/resources/cdn/audit_log.py +406 -0
  14. gcore/resources/cdn/cdn.py +957 -0
  15. gcore/resources/cdn/certificates.py +1062 -0
  16. gcore/resources/cdn/ip_ranges.py +224 -0
  17. gcore/resources/cdn/logs/__init__.py +33 -0
  18. gcore/resources/cdn/logs/logs.py +1424 -0
  19. gcore/resources/cdn/logs/settings.py +1081 -0
  20. gcore/resources/cdn/logs_uploader/__init__.py +61 -0
  21. gcore/resources/cdn/logs_uploader/configs.py +868 -0
  22. gcore/resources/cdn/logs_uploader/logs_uploader.py +166 -0
  23. gcore/resources/cdn/logs_uploader/policies.py +1060 -0
  24. gcore/resources/cdn/logs_uploader/targets.py +811 -0
  25. gcore/resources/cdn/metrics.py +419 -0
  26. gcore/resources/cdn/network_capacity.py +139 -0
  27. gcore/resources/cdn/origin_groups.py +1496 -0
  28. gcore/resources/cdn/resources/__init__.py +47 -0
  29. gcore/resources/cdn/resources/resources.py +2060 -0
  30. gcore/resources/cdn/resources/rules.py +1027 -0
  31. gcore/resources/cdn/resources/shield.py +259 -0
  32. gcore/resources/cdn/rule_templates.py +883 -0
  33. gcore/resources/cdn/shields.py +139 -0
  34. gcore/resources/cdn/statistics.py +1408 -0
  35. gcore/resources/cdn/trusted_ca_certificates.py +592 -0
  36. gcore/resources/cloud/audit_logs.py +33 -29
  37. gcore/resources/cloud/baremetal/flavors.py +21 -17
  38. gcore/resources/cloud/baremetal/images.py +19 -15
  39. gcore/resources/cloud/baremetal/servers.py +141 -119
  40. gcore/resources/cloud/billing_reservations.py +41 -33
  41. gcore/resources/cloud/cloud.py +24 -0
  42. gcore/resources/cloud/cost_reports.py +149 -119
  43. gcore/resources/cloud/file_shares/access_rules.py +25 -13
  44. gcore/resources/cloud/file_shares/file_shares.py +107 -71
  45. gcore/resources/cloud/floating_ips.py +101 -59
  46. gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +13 -9
  47. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +275 -65
  48. gcore/resources/cloud/gpu_baremetal_clusters/images.py +69 -53
  49. gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +9 -5
  50. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +151 -127
  51. gcore/resources/cloud/inference/api_keys.py +51 -31
  52. gcore/resources/cloud/inference/applications/deployments.py +49 -31
  53. gcore/resources/cloud/inference/applications/templates.py +17 -9
  54. gcore/resources/cloud/inference/deployments/deployments.py +171 -139
  55. gcore/resources/cloud/inference/deployments/logs.py +17 -13
  56. gcore/resources/cloud/inference/flavors.py +21 -13
  57. gcore/resources/cloud/inference/inference.py +9 -5
  58. gcore/resources/cloud/inference/registry_credentials.py +45 -25
  59. gcore/resources/cloud/inference/secrets.py +45 -25
  60. gcore/resources/cloud/instances/flavors.py +17 -13
  61. gcore/resources/cloud/instances/images.py +153 -129
  62. gcore/resources/cloud/instances/instances.py +287 -213
  63. gcore/resources/cloud/instances/interfaces.py +165 -161
  64. gcore/resources/cloud/instances/metrics.py +9 -5
  65. gcore/resources/cloud/ip_ranges.py +25 -15
  66. gcore/resources/cloud/k8s/clusters/clusters.py +151 -87
  67. gcore/resources/cloud/k8s/clusters/nodes.py +19 -11
  68. gcore/resources/cloud/k8s/clusters/pools/nodes.py +19 -11
  69. gcore/resources/cloud/k8s/clusters/pools/pools.py +83 -59
  70. gcore/resources/cloud/k8s/flavors.py +13 -9
  71. gcore/resources/cloud/k8s/k8s.py +9 -5
  72. gcore/resources/cloud/load_balancers/flavors.py +11 -7
  73. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +103 -83
  74. gcore/resources/cloud/load_balancers/l7_policies/rules.py +77 -57
  75. gcore/resources/cloud/load_balancers/listeners.py +125 -105
  76. gcore/resources/cloud/load_balancers/load_balancers.py +155 -123
  77. gcore/resources/cloud/load_balancers/metrics.py +9 -5
  78. gcore/resources/cloud/load_balancers/pools/health_monitors.py +25 -17
  79. gcore/resources/cloud/load_balancers/pools/members.py +31 -23
  80. gcore/resources/cloud/load_balancers/pools/pools.py +155 -129
  81. gcore/resources/cloud/load_balancers/statuses.py +17 -9
  82. gcore/resources/cloud/networks/networks.py +79 -55
  83. gcore/resources/cloud/networks/routers.py +75 -47
  84. gcore/resources/cloud/networks/subnets.py +105 -81
  85. gcore/resources/cloud/placement_groups.py +33 -17
  86. gcore/resources/cloud/projects.py +53 -41
  87. gcore/resources/cloud/quotas/quotas.py +25 -13
  88. gcore/resources/cloud/quotas/requests.py +41 -25
  89. gcore/resources/cloud/regions.py +25 -23
  90. gcore/resources/cloud/registries/artifacts.py +17 -9
  91. gcore/resources/cloud/registries/registries.py +55 -29
  92. gcore/resources/cloud/registries/repositories.py +17 -9
  93. gcore/resources/cloud/registries/tags.py +9 -5
  94. gcore/resources/cloud/registries/users.py +65 -35
  95. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +123 -107
  96. gcore/resources/cloud/reserved_fixed_ips/vip.py +45 -25
  97. gcore/resources/cloud/secrets.py +43 -27
  98. gcore/resources/cloud/security_groups/rules.py +55 -43
  99. gcore/resources/cloud/security_groups/security_groups.py +79 -47
  100. gcore/resources/cloud/ssh_keys.py +51 -31
  101. gcore/resources/cloud/tasks.py +57 -45
  102. gcore/resources/cloud/usage_reports.py +27 -23
  103. gcore/resources/cloud/users/role_assignments.py +49 -33
  104. gcore/resources/cloud/volumes.py +237 -201
  105. gcore/resources/dns/dns.py +17 -13
  106. gcore/resources/dns/locations.py +29 -17
  107. gcore/resources/dns/metrics.py +13 -9
  108. gcore/resources/dns/pickers/pickers.py +5 -5
  109. gcore/resources/dns/pickers/presets.py +9 -5
  110. gcore/resources/dns/zones/dnssec.py +19 -11
  111. gcore/resources/dns/zones/rrsets.py +149 -91
  112. gcore/resources/dns/zones/zones.py +245 -187
  113. gcore/resources/fastedge/apps/apps.py +105 -89
  114. gcore/resources/fastedge/apps/logs.py +25 -21
  115. gcore/resources/fastedge/binaries.py +33 -17
  116. gcore/resources/fastedge/fastedge.py +5 -5
  117. gcore/resources/fastedge/kv_stores.py +43 -31
  118. gcore/resources/fastedge/secrets.py +69 -45
  119. gcore/resources/fastedge/statistics.py +25 -17
  120. gcore/resources/fastedge/templates.py +59 -39
  121. gcore/resources/iam/api_tokens.py +43 -27
  122. gcore/resources/iam/iam.py +5 -5
  123. gcore/resources/iam/users.py +97 -65
  124. gcore/resources/security/bgp_announces.py +27 -19
  125. gcore/resources/security/events.py +23 -19
  126. gcore/resources/security/profile_templates.py +9 -5
  127. gcore/resources/security/profiles.py +69 -45
  128. gcore/resources/storage/buckets/buckets.py +37 -25
  129. gcore/resources/storage/buckets/cors.py +19 -11
  130. gcore/resources/storage/buckets/lifecycle.py +19 -11
  131. gcore/resources/storage/buckets/policy.py +25 -13
  132. gcore/resources/storage/credentials.py +19 -15
  133. gcore/resources/storage/locations.py +13 -9
  134. gcore/resources/storage/statistics.py +39 -31
  135. gcore/resources/storage/storage.py +105 -69
  136. gcore/resources/streaming/ai_tasks.py +307 -197
  137. gcore/resources/streaming/broadcasts.py +63 -35
  138. gcore/resources/streaming/directories.py +65 -39
  139. gcore/resources/streaming/players.py +47 -31
  140. gcore/resources/streaming/playlists.py +189 -123
  141. gcore/resources/streaming/quality_sets.py +69 -39
  142. gcore/resources/streaming/restreams.py +47 -27
  143. gcore/resources/streaming/statistics.py +613 -407
  144. gcore/resources/streaming/streams/overlays.py +107 -67
  145. gcore/resources/streaming/streams/streams.py +403 -263
  146. gcore/resources/streaming/videos/subtitles.py +131 -75
  147. gcore/resources/streaming/videos/videos.py +429 -279
  148. gcore/resources/waap/advanced_rules.py +9 -5
  149. gcore/resources/waap/custom_page_sets.py +99 -75
  150. gcore/resources/waap/domains/advanced_rules.py +157 -99
  151. gcore/resources/waap/domains/api_discovery.py +71 -47
  152. gcore/resources/waap/domains/api_path_groups.py +9 -5
  153. gcore/resources/waap/domains/api_paths.py +79 -83
  154. gcore/resources/waap/domains/custom_rules.py +89 -59
  155. gcore/resources/waap/domains/domains.py +59 -41
  156. gcore/resources/waap/domains/firewall_rules.py +83 -55
  157. gcore/resources/waap/domains/insight_silences.py +59 -39
  158. gcore/resources/waap/domains/insights.py +39 -27
  159. gcore/resources/waap/domains/settings.py +21 -13
  160. gcore/resources/waap/domains/statistics.py +99 -75
  161. gcore/resources/waap/insights.py +23 -21
  162. gcore/resources/waap/ip_info/ip_info.py +65 -33
  163. gcore/resources/waap/ip_info/metrics.py +11 -7
  164. gcore/resources/waap/organizations.py +17 -13
  165. gcore/resources/waap/statistics.py +9 -5
  166. gcore/resources/waap/tags.py +17 -17
  167. gcore/resources/waap/waap.py +5 -5
  168. gcore/types/cdn/__init__.py +80 -0
  169. gcore/types/cdn/audit_log_list_params.py +73 -0
  170. gcore/types/cdn/ca_certificate.py +53 -0
  171. gcore/types/cdn/ca_certificate_list.py +10 -0
  172. gcore/types/cdn/cdn_account.py +86 -0
  173. gcore/types/cdn/cdn_account_limits.py +27 -0
  174. gcore/types/cdn/cdn_audit_log_entry.py +66 -0
  175. gcore/types/cdn/cdn_available_features.py +46 -0
  176. gcore/types/cdn/cdn_list_purge_statuses_params.py +67 -0
  177. gcore/types/cdn/cdn_log_entry.py +70 -0
  178. gcore/types/cdn/cdn_metrics.py +22 -0
  179. gcore/types/cdn/cdn_metrics_groups.py +13 -0
  180. gcore/types/cdn/cdn_metrics_values.py +19 -0
  181. gcore/types/cdn/cdn_resource.py +1977 -0
  182. gcore/types/cdn/cdn_resource_list.py +10 -0
  183. gcore/types/cdn/cdn_update_account_params.py +15 -0
  184. gcore/types/cdn/certificate_create_params.py +51 -0
  185. gcore/types/cdn/certificate_get_status_params.py +14 -0
  186. gcore/types/cdn/certificate_list_params.py +29 -0
  187. gcore/types/cdn/certificate_replace_params.py +39 -0
  188. gcore/types/cdn/log_download_params.py +279 -0
  189. gcore/types/cdn/log_list_params.py +273 -0
  190. gcore/types/cdn/logs/__init__.py +7 -0
  191. gcore/types/cdn/logs/log_settings.py +172 -0
  192. gcore/types/cdn/logs/setting_create_params.py +200 -0
  193. gcore/types/cdn/logs/setting_update_params.py +200 -0
  194. gcore/types/cdn/logs_aggregated_stats.py +23 -0
  195. gcore/types/cdn/logs_uploader/__init__.py +23 -0
  196. gcore/types/cdn/logs_uploader/config_create_params.py +32 -0
  197. gcore/types/cdn/logs_uploader/config_list_params.py +16 -0
  198. gcore/types/cdn/logs_uploader/config_replace_params.py +32 -0
  199. gcore/types/cdn/logs_uploader/config_update_params.py +32 -0
  200. gcore/types/cdn/logs_uploader/logs_uploader_config.py +51 -0
  201. gcore/types/cdn/logs_uploader/logs_uploader_config_list.py +10 -0
  202. gcore/types/cdn/logs_uploader/logs_uploader_policy.py +73 -0
  203. gcore/types/cdn/logs_uploader/logs_uploader_policy_list.py +10 -0
  204. gcore/types/cdn/logs_uploader/logs_uploader_target.py +236 -0
  205. gcore/types/cdn/logs_uploader/logs_uploader_target_list.py +10 -0
  206. gcore/types/cdn/logs_uploader/policy_create_params.py +61 -0
  207. gcore/types/cdn/logs_uploader/policy_list_fields_response.py +8 -0
  208. gcore/types/cdn/logs_uploader/policy_list_params.py +16 -0
  209. gcore/types/cdn/logs_uploader/policy_replace_params.py +61 -0
  210. gcore/types/cdn/logs_uploader/policy_update_params.py +61 -0
  211. gcore/types/cdn/logs_uploader/target_create_params.py +249 -0
  212. gcore/types/cdn/logs_uploader/target_list_params.py +16 -0
  213. gcore/types/cdn/logs_uploader/target_replace_params.py +249 -0
  214. gcore/types/cdn/logs_uploader/target_update_params.py +249 -0
  215. gcore/types/cdn/logs_uploader_validation.py +23 -0
  216. gcore/types/cdn/metric_list_params.py +168 -0
  217. gcore/types/cdn/network_capacity.py +22 -0
  218. gcore/types/cdn/origin_group_create_params.py +184 -0
  219. gcore/types/cdn/origin_group_list_params.py +24 -0
  220. gcore/types/cdn/origin_group_replace_params.py +190 -0
  221. gcore/types/cdn/origin_group_update_params.py +190 -0
  222. gcore/types/cdn/origin_groups.py +212 -0
  223. gcore/types/cdn/origin_groups_list.py +10 -0
  224. gcore/types/cdn/public_ip_list.py +15 -0
  225. gcore/types/cdn/public_network_list.py +15 -0
  226. gcore/types/cdn/purge_status.py +55 -0
  227. gcore/types/cdn/resource_aggregated_stats.py +80 -0
  228. gcore/types/cdn/resource_create_params.py +1825 -0
  229. gcore/types/cdn/resource_list_params.py +107 -0
  230. gcore/types/cdn/resource_prefetch_params.py +17 -0
  231. gcore/types/cdn/resource_purge_params.py +71 -0
  232. gcore/types/cdn/resource_replace_params.py +1803 -0
  233. gcore/types/cdn/resource_update_params.py +1794 -0
  234. gcore/types/cdn/resource_usage_stats.py +111 -0
  235. gcore/types/cdn/resources/__init__.py +11 -0
  236. gcore/types/cdn/resources/cdn_resource_rule.py +1695 -0
  237. gcore/types/cdn/resources/origin_shielding.py +15 -0
  238. gcore/types/cdn/resources/rule_create_params.py +1652 -0
  239. gcore/types/cdn/resources/rule_list_response.py +10 -0
  240. gcore/types/cdn/resources/rule_replace_params.py +1654 -0
  241. gcore/types/cdn/resources/rule_update_params.py +1654 -0
  242. gcore/types/cdn/resources/shield_replace_params.py +16 -0
  243. gcore/types/cdn/rule_template.py +1666 -0
  244. gcore/types/cdn/rule_template_create_params.py +1636 -0
  245. gcore/types/cdn/rule_template_list.py +10 -0
  246. gcore/types/cdn/rule_template_replace_params.py +1636 -0
  247. gcore/types/cdn/rule_template_update_params.py +1636 -0
  248. gcore/types/cdn/shield_aggregated_stats.py +23 -0
  249. gcore/types/cdn/shield_list_response.py +25 -0
  250. gcore/types/cdn/ssl_detail.py +62 -0
  251. gcore/types/cdn/ssl_detail_list.py +10 -0
  252. gcore/types/cdn/ssl_request_status.py +135 -0
  253. gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +42 -0
  254. gcore/types/cdn/statistic_get_logs_usage_series_params.py +35 -0
  255. gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +151 -0
  256. gcore/types/cdn/statistic_get_resource_usage_series_params.py +131 -0
  257. gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +42 -0
  258. gcore/types/cdn/statistic_get_shield_usage_series_params.py +25 -0
  259. gcore/types/cdn/trusted_ca_certificate_create_params.py +23 -0
  260. gcore/types/cdn/trusted_ca_certificate_list_params.py +29 -0
  261. gcore/types/cdn/trusted_ca_certificate_replace_params.py +15 -0
  262. gcore/types/cdn/usage_series_stats.py +31 -0
  263. gcore/types/cloud/__init__.py +1 -0
  264. gcore/types/cloud/file_share.py +4 -0
  265. gcore/types/cloud/file_share_create_params.py +20 -0
  266. gcore/types/cloud/file_share_update_params.py +40 -3
  267. gcore/types/cloud/floating_ip_update_params.py +3 -1
  268. gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
  269. gcore/types/cloud/inference/inference_deployment.py +3 -1
  270. gcore/types/cloud/instance_create_params.py +3 -1
  271. gcore/types/cloud/k8s/cluster_create_params.py +46 -4
  272. gcore/types/cloud/k8s/cluster_update_params.py +60 -6
  273. gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
  274. gcore/types/cloud/k8s/k8s_cluster.py +40 -3
  275. gcore/types/cloud/load_balancer_update_params.py +3 -1
  276. gcore/types/cloud/network_update_params.py +3 -1
  277. gcore/types/cloud/networks/subnet_update_params.py +3 -1
  278. gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
  279. gcore/types/cloud/registries/user_create_params.py +5 -3
  280. gcore/types/cloud/registry_create_params.py +5 -3
  281. gcore/types/cloud/security_group_update_params.py +3 -1
  282. gcore/types/cloud/ssh_key_created.py +6 -3
  283. gcore/types/cloud/volume_update_params.py +3 -1
  284. gcore/types/dns/zone_get_statistics_params.py +12 -9
  285. gcore/types/dns/zone_get_statistics_response.py +3 -1
  286. gcore/types/dns/zone_import_params.py +21 -15
  287. gcore/types/dns/zones/dns_output_rrset.py +7 -3
  288. gcore/types/iam/account_overview.py +7 -2
  289. gcore/types/iam/user.py +7 -2
  290. gcore/types/iam/user_detailed.py +7 -2
  291. gcore/types/iam/user_invite_params.py +4 -1
  292. gcore/types/iam/user_update.py +7 -2
  293. gcore/types/iam/user_update_params.py +7 -2
  294. gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
  295. gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
  296. gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
  297. gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
  298. gcore/types/streaming/ai_task.py +20 -11
  299. gcore/types/streaming/ai_task_create_params.py +20 -11
  300. gcore/types/streaming/ai_task_get_response.py +5 -4
  301. gcore/types/streaming/ai_task_list_params.py +11 -5
  302. gcore/types/streaming/clip.py +33 -22
  303. gcore/types/streaming/create_video_param.py +75 -43
  304. gcore/types/streaming/playlist.py +7 -5
  305. gcore/types/streaming/playlist_create_params.py +7 -5
  306. gcore/types/streaming/playlist_update_params.py +7 -5
  307. gcore/types/streaming/playlist_video.py +75 -43
  308. gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
  309. gcore/types/streaming/stream.py +207 -136
  310. gcore/types/streaming/stream_create_clip_params.py +33 -22
  311. gcore/types/streaming/stream_create_params.py +41 -24
  312. gcore/types/streaming/stream_update_params.py +41 -24
  313. gcore/types/streaming/video.py +138 -76
  314. gcore/types/streaming/video_list_params.py +4 -2
  315. gcore/types/streaming/video_update_params.py +75 -43
  316. gcore/types/waap/domain_update_params.py +2 -2
  317. gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
  318. gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
  319. gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
  320. gcore/types/waap/domains/api_path_create_params.py +0 -3
  321. gcore/types/waap/domains/api_path_update_params.py +1 -3
  322. gcore/types/waap/domains/custom_rule_create_params.py +36 -35
  323. gcore/types/waap/domains/custom_rule_update_params.py +31 -33
  324. gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
  325. gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
  326. gcore/types/waap/domains/waap_advanced_rule.py +17 -9
  327. gcore/types/waap/domains/waap_custom_rule.py +5 -2
  328. gcore/types/waap/domains/waap_firewall_rule.py +1 -1
  329. gcore/types/waap/domains/waap_insight.py +1 -1
  330. gcore/types/waap/insight_list_types_params.py +1 -1
  331. {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/METADATA +1 -1
  332. {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/RECORD +334 -214
  333. {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
  334. {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1496 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Iterable, cast
6
+ from typing_extensions import overload
7
+
8
+ import httpx
9
+
10
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
11
+ from ..._utils import required_args, maybe_transform, async_maybe_transform
12
+ from ..._compat import cached_property
13
+ from ..._resource import SyncAPIResource, AsyncAPIResource
14
+ from ..._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from ...types.cdn import (
21
+ origin_group_list_params,
22
+ origin_group_create_params,
23
+ origin_group_update_params,
24
+ origin_group_replace_params,
25
+ )
26
+ from ..._base_client import make_request_options
27
+ from ...types.cdn.origin_groups import OriginGroups
28
+ from ...types.cdn.origin_groups_list import OriginGroupsList
29
+
30
+ __all__ = ["OriginGroupsResource", "AsyncOriginGroupsResource"]
31
+
32
+
33
+ class OriginGroupsResource(SyncAPIResource):
34
+ @cached_property
35
+ def with_raw_response(self) -> OriginGroupsResourceWithRawResponse:
36
+ """
37
+ This property can be used as a prefix for any HTTP method call to return
38
+ the raw response object instead of the parsed content.
39
+
40
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
41
+ """
42
+ return OriginGroupsResourceWithRawResponse(self)
43
+
44
+ @cached_property
45
+ def with_streaming_response(self) -> OriginGroupsResourceWithStreamingResponse:
46
+ """
47
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
48
+
49
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
50
+ """
51
+ return OriginGroupsResourceWithStreamingResponse(self)
52
+
53
+ @overload
54
+ def create(
55
+ self,
56
+ *,
57
+ name: str,
58
+ sources: Iterable[origin_group_create_params.NoneAuthSource],
59
+ auth_type: str | Omit = omit,
60
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
61
+ use_next: bool | Omit = omit,
62
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
63
+ # The extra values given here take precedence over values defined on the client or passed to this method.
64
+ extra_headers: Headers | None = None,
65
+ extra_query: Query | None = None,
66
+ extra_body: Body | None = None,
67
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
68
+ ) -> OriginGroups:
69
+ """
70
+ Create an origin group with one or more origin sources.
71
+
72
+ Args:
73
+ name: Origin group name.
74
+
75
+ sources: List of origin sources in the origin group.
76
+
77
+ auth_type: Origin authentication type.
78
+
79
+ Possible values:
80
+
81
+ - **none** - Used for public origins.
82
+ - **awsSignatureV4** - Used for S3 storage.
83
+
84
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
85
+
86
+ Possible values:
87
+
88
+ - **error** - an error occurred while establishing a connection with the origin,
89
+ passing a request to it, or reading the response header
90
+ - **timeout** - a timeout has occurred while establishing a connection with the
91
+ origin, passing a request to it, or reading the response header
92
+ - **`invalid_header`** - a origin returned an empty or invalid response
93
+ - **`http_403`** - a origin returned a response with the code 403
94
+ - **`http_404`** - a origin returned a response with the code 404
95
+ - **`http_429`** - a origin returned a response with the code 429
96
+ - **`http_500`** - a origin returned a response with the code 500
97
+ - **`http_502`** - a origin returned a response with the code 502
98
+ - **`http_503`** - a origin returned a response with the code 503
99
+ - **`http_504`** - a origin returned a response with the code 504
100
+
101
+ use_next: Defines whether to use the next origin from the origin group if origin responds
102
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
103
+ specify cases in `proxy_next_upstream`.
104
+
105
+ Possible values:
106
+
107
+ - **true** - Option is enabled.
108
+ - **false** - Option is disabled.
109
+
110
+ extra_headers: Send extra headers
111
+
112
+ extra_query: Add additional query parameters to the request
113
+
114
+ extra_body: Add additional JSON properties to the request
115
+
116
+ timeout: Override the client-level default timeout for this request, in seconds
117
+ """
118
+ ...
119
+
120
+ @overload
121
+ def create(
122
+ self,
123
+ *,
124
+ auth: origin_group_create_params.AwsSignatureV4Auth,
125
+ auth_type: str,
126
+ name: str,
127
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
128
+ use_next: bool | Omit = omit,
129
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130
+ # The extra values given here take precedence over values defined on the client or passed to this method.
131
+ extra_headers: Headers | None = None,
132
+ extra_query: Query | None = None,
133
+ extra_body: Body | None = None,
134
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
135
+ ) -> OriginGroups:
136
+ """
137
+ Create an origin group with one or more origin sources.
138
+
139
+ Args:
140
+ auth: Credentials to access the private bucket.
141
+
142
+ auth_type: Authentication type.
143
+
144
+ **awsSignatureV4** value is used for S3 storage.
145
+
146
+ name: Origin group name.
147
+
148
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
149
+
150
+ Possible values:
151
+
152
+ - **error** - an error occurred while establishing a connection with the origin,
153
+ passing a request to it, or reading the response header
154
+ - **timeout** - a timeout has occurred while establishing a connection with the
155
+ origin, passing a request to it, or reading the response header
156
+ - **`invalid_header`** - a origin returned an empty or invalid response
157
+ - **`http_403`** - a origin returned a response with the code 403
158
+ - **`http_404`** - a origin returned a response with the code 404
159
+ - **`http_429`** - a origin returned a response with the code 429
160
+ - **`http_500`** - a origin returned a response with the code 500
161
+ - **`http_502`** - a origin returned a response with the code 502
162
+ - **`http_503`** - a origin returned a response with the code 503
163
+ - **`http_504`** - a origin returned a response with the code 504
164
+
165
+ use_next: Defines whether to use the next origin from the origin group if origin responds
166
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
167
+ specify cases in `proxy_next_upstream`.
168
+
169
+ Possible values:
170
+
171
+ - **true** - Option is enabled.
172
+ - **false** - Option is disabled.
173
+
174
+ extra_headers: Send extra headers
175
+
176
+ extra_query: Add additional query parameters to the request
177
+
178
+ extra_body: Add additional JSON properties to the request
179
+
180
+ timeout: Override the client-level default timeout for this request, in seconds
181
+ """
182
+ ...
183
+
184
+ @required_args(["name", "sources"], ["auth", "auth_type", "name"])
185
+ def create(
186
+ self,
187
+ *,
188
+ name: str,
189
+ sources: Iterable[origin_group_create_params.NoneAuthSource] | Omit = omit,
190
+ auth_type: str | Omit = omit,
191
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
192
+ use_next: bool | Omit = omit,
193
+ auth: origin_group_create_params.AwsSignatureV4Auth | Omit = omit,
194
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195
+ # The extra values given here take precedence over values defined on the client or passed to this method.
196
+ extra_headers: Headers | None = None,
197
+ extra_query: Query | None = None,
198
+ extra_body: Body | None = None,
199
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
200
+ ) -> OriginGroups:
201
+ return cast(
202
+ OriginGroups,
203
+ self._post(
204
+ "/cdn/origin_groups"
205
+ if self._client._base_url_overridden
206
+ else "https://api.gcore.com//cdn/origin_groups",
207
+ body=maybe_transform(
208
+ {
209
+ "name": name,
210
+ "sources": sources,
211
+ "auth_type": auth_type,
212
+ "proxy_next_upstream": proxy_next_upstream,
213
+ "use_next": use_next,
214
+ "auth": auth,
215
+ },
216
+ origin_group_create_params.OriginGroupCreateParams,
217
+ ),
218
+ options=make_request_options(
219
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
220
+ ),
221
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
222
+ ),
223
+ )
224
+
225
+ @overload
226
+ def update(
227
+ self,
228
+ origin_group_id: int,
229
+ *,
230
+ name: str,
231
+ auth_type: str | Omit = omit,
232
+ path: str | Omit = omit,
233
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
234
+ sources: Iterable[origin_group_update_params.NoneAuthSource] | Omit = omit,
235
+ use_next: bool | Omit = omit,
236
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
237
+ # The extra values given here take precedence over values defined on the client or passed to this method.
238
+ extra_headers: Headers | None = None,
239
+ extra_query: Query | None = None,
240
+ extra_body: Body | None = None,
241
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
242
+ ) -> OriginGroups:
243
+ """
244
+ Change origin group
245
+
246
+ Args:
247
+ name: Origin group name.
248
+
249
+ auth_type: Origin authentication type.
250
+
251
+ Possible values:
252
+
253
+ - **none** - Used for public origins.
254
+ - **awsSignatureV4** - Used for S3 storage.
255
+
256
+ path: Parameter is **deprecated**.
257
+
258
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
259
+
260
+ Possible values:
261
+
262
+ - **error** - an error occurred while establishing a connection with the origin,
263
+ passing a request to it, or reading the response header
264
+ - **timeout** - a timeout has occurred while establishing a connection with the
265
+ origin, passing a request to it, or reading the response header
266
+ - **`invalid_header`** - a origin returned an empty or invalid response
267
+ - **`http_403`** - a origin returned a response with the code 403
268
+ - **`http_404`** - a origin returned a response with the code 404
269
+ - **`http_429`** - a origin returned a response with the code 429
270
+ - **`http_500`** - a origin returned a response with the code 500
271
+ - **`http_502`** - a origin returned a response with the code 502
272
+ - **`http_503`** - a origin returned a response with the code 503
273
+ - **`http_504`** - a origin returned a response with the code 504
274
+
275
+ sources: List of origin sources in the origin group.
276
+
277
+ use_next: Defines whether to use the next origin from the origin group if origin responds
278
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
279
+ specify cases in `proxy_next_upstream`.
280
+
281
+ Possible values:
282
+
283
+ - **true** - Option is enabled.
284
+ - **false** - Option is disabled.
285
+
286
+ extra_headers: Send extra headers
287
+
288
+ extra_query: Add additional query parameters to the request
289
+
290
+ extra_body: Add additional JSON properties to the request
291
+
292
+ timeout: Override the client-level default timeout for this request, in seconds
293
+ """
294
+ ...
295
+
296
+ @overload
297
+ def update(
298
+ self,
299
+ origin_group_id: int,
300
+ *,
301
+ auth: origin_group_update_params.AwsSignatureV4Auth | Omit = omit,
302
+ auth_type: str | Omit = omit,
303
+ name: str | Omit = omit,
304
+ path: str | Omit = omit,
305
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
306
+ use_next: bool | Omit = omit,
307
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
308
+ # The extra values given here take precedence over values defined on the client or passed to this method.
309
+ extra_headers: Headers | None = None,
310
+ extra_query: Query | None = None,
311
+ extra_body: Body | None = None,
312
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
313
+ ) -> OriginGroups:
314
+ """
315
+ Change origin group
316
+
317
+ Args:
318
+ auth: Credentials to access the private bucket.
319
+
320
+ auth_type: Authentication type.
321
+
322
+ **awsSignatureV4** value is used for S3 storage.
323
+
324
+ name: Origin group name.
325
+
326
+ path: Parameter is **deprecated**.
327
+
328
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
329
+
330
+ Possible values:
331
+
332
+ - **error** - an error occurred while establishing a connection with the origin,
333
+ passing a request to it, or reading the response header
334
+ - **timeout** - a timeout has occurred while establishing a connection with the
335
+ origin, passing a request to it, or reading the response header
336
+ - **`invalid_header`** - a origin returned an empty or invalid response
337
+ - **`http_403`** - a origin returned a response with the code 403
338
+ - **`http_404`** - a origin returned a response with the code 404
339
+ - **`http_429`** - a origin returned a response with the code 429
340
+ - **`http_500`** - a origin returned a response with the code 500
341
+ - **`http_502`** - a origin returned a response with the code 502
342
+ - **`http_503`** - a origin returned a response with the code 503
343
+ - **`http_504`** - a origin returned a response with the code 504
344
+
345
+ use_next: Defines whether to use the next origin from the origin group if origin responds
346
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
347
+ specify cases in `proxy_next_upstream`.
348
+
349
+ Possible values:
350
+
351
+ - **true** - Option is enabled.
352
+ - **false** - Option is disabled.
353
+
354
+ extra_headers: Send extra headers
355
+
356
+ extra_query: Add additional query parameters to the request
357
+
358
+ extra_body: Add additional JSON properties to the request
359
+
360
+ timeout: Override the client-level default timeout for this request, in seconds
361
+ """
362
+ ...
363
+
364
+ def update(
365
+ self,
366
+ origin_group_id: int,
367
+ *,
368
+ name: str | Omit = omit,
369
+ auth_type: str | Omit = omit,
370
+ path: str | Omit = omit,
371
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
372
+ sources: Iterable[origin_group_update_params.NoneAuthSource] | Omit = omit,
373
+ use_next: bool | Omit = omit,
374
+ auth: origin_group_update_params.AwsSignatureV4Auth | Omit = omit,
375
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376
+ # The extra values given here take precedence over values defined on the client or passed to this method.
377
+ extra_headers: Headers | None = None,
378
+ extra_query: Query | None = None,
379
+ extra_body: Body | None = None,
380
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
381
+ ) -> OriginGroups:
382
+ return cast(
383
+ OriginGroups,
384
+ self._patch(
385
+ f"/cdn/origin_groups/{origin_group_id}"
386
+ if self._client._base_url_overridden
387
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
388
+ body=maybe_transform(
389
+ {
390
+ "name": name,
391
+ "auth_type": auth_type,
392
+ "path": path,
393
+ "proxy_next_upstream": proxy_next_upstream,
394
+ "sources": sources,
395
+ "use_next": use_next,
396
+ "auth": auth,
397
+ },
398
+ origin_group_update_params.OriginGroupUpdateParams,
399
+ ),
400
+ options=make_request_options(
401
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
402
+ ),
403
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
404
+ ),
405
+ )
406
+
407
+ def list(
408
+ self,
409
+ *,
410
+ has_related_resources: bool | Omit = omit,
411
+ name: str | Omit = omit,
412
+ sources: str | Omit = omit,
413
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
414
+ # The extra values given here take precedence over values defined on the client or passed to this method.
415
+ extra_headers: Headers | None = None,
416
+ extra_query: Query | None = None,
417
+ extra_body: Body | None = None,
418
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
419
+ ) -> OriginGroupsList:
420
+ """
421
+ Get all origin groups and related origin sources.
422
+
423
+ Args:
424
+ has_related_resources: Defines whether the origin group has related CDN resources.
425
+
426
+ Possible values:
427
+
428
+ - **true** – Origin group has related CDN resources.
429
+ - **false** – Origin group does not have related CDN resources.
430
+
431
+ name: Origin group name.
432
+
433
+ sources: Origin sources (IP addresses or domains) in the origin group.
434
+
435
+ extra_headers: Send extra headers
436
+
437
+ extra_query: Add additional query parameters to the request
438
+
439
+ extra_body: Add additional JSON properties to the request
440
+
441
+ timeout: Override the client-level default timeout for this request, in seconds
442
+ """
443
+ return self._get(
444
+ "/cdn/origin_groups" if self._client._base_url_overridden else "https://api.gcore.com//cdn/origin_groups",
445
+ options=make_request_options(
446
+ extra_headers=extra_headers,
447
+ extra_query=extra_query,
448
+ extra_body=extra_body,
449
+ timeout=timeout,
450
+ query=maybe_transform(
451
+ {
452
+ "has_related_resources": has_related_resources,
453
+ "name": name,
454
+ "sources": sources,
455
+ },
456
+ origin_group_list_params.OriginGroupListParams,
457
+ ),
458
+ ),
459
+ cast_to=OriginGroupsList,
460
+ )
461
+
462
+ def delete(
463
+ self,
464
+ origin_group_id: int,
465
+ *,
466
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
467
+ # The extra values given here take precedence over values defined on the client or passed to this method.
468
+ extra_headers: Headers | None = None,
469
+ extra_query: Query | None = None,
470
+ extra_body: Body | None = None,
471
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
472
+ ) -> None:
473
+ """
474
+ Delete origin group
475
+
476
+ Args:
477
+ extra_headers: Send extra headers
478
+
479
+ extra_query: Add additional query parameters to the request
480
+
481
+ extra_body: Add additional JSON properties to the request
482
+
483
+ timeout: Override the client-level default timeout for this request, in seconds
484
+ """
485
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
486
+ return self._delete(
487
+ f"/cdn/origin_groups/{origin_group_id}"
488
+ if self._client._base_url_overridden
489
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
490
+ options=make_request_options(
491
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
492
+ ),
493
+ cast_to=NoneType,
494
+ )
495
+
496
+ def get(
497
+ self,
498
+ origin_group_id: int,
499
+ *,
500
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
501
+ # The extra values given here take precedence over values defined on the client or passed to this method.
502
+ extra_headers: Headers | None = None,
503
+ extra_query: Query | None = None,
504
+ extra_body: Body | None = None,
505
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
506
+ ) -> OriginGroups:
507
+ """
508
+ Get origin group details
509
+
510
+ Args:
511
+ extra_headers: Send extra headers
512
+
513
+ extra_query: Add additional query parameters to the request
514
+
515
+ extra_body: Add additional JSON properties to the request
516
+
517
+ timeout: Override the client-level default timeout for this request, in seconds
518
+ """
519
+ return cast(
520
+ OriginGroups,
521
+ self._get(
522
+ f"/cdn/origin_groups/{origin_group_id}"
523
+ if self._client._base_url_overridden
524
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
525
+ options=make_request_options(
526
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
527
+ ),
528
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
529
+ ),
530
+ )
531
+
532
+ @overload
533
+ def replace(
534
+ self,
535
+ origin_group_id: int,
536
+ *,
537
+ auth_type: str,
538
+ name: str,
539
+ path: str,
540
+ sources: Iterable[origin_group_replace_params.NoneAuthSource],
541
+ use_next: bool,
542
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
543
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
544
+ # The extra values given here take precedence over values defined on the client or passed to this method.
545
+ extra_headers: Headers | None = None,
546
+ extra_query: Query | None = None,
547
+ extra_body: Body | None = None,
548
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
549
+ ) -> OriginGroups:
550
+ """
551
+ Change origin group
552
+
553
+ Args:
554
+ auth_type: Origin authentication type.
555
+
556
+ Possible values:
557
+
558
+ - **none** - Used for public origins.
559
+ - **awsSignatureV4** - Used for S3 storage.
560
+
561
+ name: Origin group name.
562
+
563
+ path: Parameter is **deprecated**.
564
+
565
+ sources: List of origin sources in the origin group.
566
+
567
+ use_next: Defines whether to use the next origin from the origin group if origin responds
568
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
569
+ specify cases in `proxy_next_upstream`.
570
+
571
+ Possible values:
572
+
573
+ - **true** - Option is enabled.
574
+ - **false** - Option is disabled.
575
+
576
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
577
+
578
+ Possible values:
579
+
580
+ - **error** - an error occurred while establishing a connection with the origin,
581
+ passing a request to it, or reading the response header
582
+ - **timeout** - a timeout has occurred while establishing a connection with the
583
+ origin, passing a request to it, or reading the response header
584
+ - **`invalid_header`** - a origin returned an empty or invalid response
585
+ - **`http_403`** - a origin returned a response with the code 403
586
+ - **`http_404`** - a origin returned a response with the code 404
587
+ - **`http_429`** - a origin returned a response with the code 429
588
+ - **`http_500`** - a origin returned a response with the code 500
589
+ - **`http_502`** - a origin returned a response with the code 502
590
+ - **`http_503`** - a origin returned a response with the code 503
591
+ - **`http_504`** - a origin returned a response with the code 504
592
+
593
+ extra_headers: Send extra headers
594
+
595
+ extra_query: Add additional query parameters to the request
596
+
597
+ extra_body: Add additional JSON properties to the request
598
+
599
+ timeout: Override the client-level default timeout for this request, in seconds
600
+ """
601
+ ...
602
+
603
+ @overload
604
+ def replace(
605
+ self,
606
+ origin_group_id: int,
607
+ *,
608
+ auth: origin_group_replace_params.AwsSignatureV4Auth,
609
+ auth_type: str,
610
+ name: str,
611
+ path: str,
612
+ use_next: bool,
613
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
614
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
615
+ # The extra values given here take precedence over values defined on the client or passed to this method.
616
+ extra_headers: Headers | None = None,
617
+ extra_query: Query | None = None,
618
+ extra_body: Body | None = None,
619
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
620
+ ) -> OriginGroups:
621
+ """
622
+ Change origin group
623
+
624
+ Args:
625
+ auth: Credentials to access the private bucket.
626
+
627
+ auth_type: Authentication type.
628
+
629
+ **awsSignatureV4** value is used for S3 storage.
630
+
631
+ name: Origin group name.
632
+
633
+ path: Parameter is **deprecated**.
634
+
635
+ use_next: Defines whether to use the next origin from the origin group if origin responds
636
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
637
+ specify cases in `proxy_next_upstream`.
638
+
639
+ Possible values:
640
+
641
+ - **true** - Option is enabled.
642
+ - **false** - Option is disabled.
643
+
644
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
645
+
646
+ Possible values:
647
+
648
+ - **error** - an error occurred while establishing a connection with the origin,
649
+ passing a request to it, or reading the response header
650
+ - **timeout** - a timeout has occurred while establishing a connection with the
651
+ origin, passing a request to it, or reading the response header
652
+ - **`invalid_header`** - a origin returned an empty or invalid response
653
+ - **`http_403`** - a origin returned a response with the code 403
654
+ - **`http_404`** - a origin returned a response with the code 404
655
+ - **`http_429`** - a origin returned a response with the code 429
656
+ - **`http_500`** - a origin returned a response with the code 500
657
+ - **`http_502`** - a origin returned a response with the code 502
658
+ - **`http_503`** - a origin returned a response with the code 503
659
+ - **`http_504`** - a origin returned a response with the code 504
660
+
661
+ extra_headers: Send extra headers
662
+
663
+ extra_query: Add additional query parameters to the request
664
+
665
+ extra_body: Add additional JSON properties to the request
666
+
667
+ timeout: Override the client-level default timeout for this request, in seconds
668
+ """
669
+ ...
670
+
671
+ @required_args(
672
+ ["auth_type", "name", "path", "sources", "use_next"], ["auth", "auth_type", "name", "path", "use_next"]
673
+ )
674
+ def replace(
675
+ self,
676
+ origin_group_id: int,
677
+ *,
678
+ auth_type: str,
679
+ name: str,
680
+ path: str,
681
+ sources: Iterable[origin_group_replace_params.NoneAuthSource] | Omit = omit,
682
+ use_next: bool,
683
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
684
+ auth: origin_group_replace_params.AwsSignatureV4Auth | Omit = omit,
685
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
686
+ # The extra values given here take precedence over values defined on the client or passed to this method.
687
+ extra_headers: Headers | None = None,
688
+ extra_query: Query | None = None,
689
+ extra_body: Body | None = None,
690
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
691
+ ) -> OriginGroups:
692
+ return cast(
693
+ OriginGroups,
694
+ self._put(
695
+ f"/cdn/origin_groups/{origin_group_id}"
696
+ if self._client._base_url_overridden
697
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
698
+ body=maybe_transform(
699
+ {
700
+ "auth_type": auth_type,
701
+ "name": name,
702
+ "path": path,
703
+ "sources": sources,
704
+ "use_next": use_next,
705
+ "proxy_next_upstream": proxy_next_upstream,
706
+ "auth": auth,
707
+ },
708
+ origin_group_replace_params.OriginGroupReplaceParams,
709
+ ),
710
+ options=make_request_options(
711
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
712
+ ),
713
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
714
+ ),
715
+ )
716
+
717
+
718
+ class AsyncOriginGroupsResource(AsyncAPIResource):
719
+ @cached_property
720
+ def with_raw_response(self) -> AsyncOriginGroupsResourceWithRawResponse:
721
+ """
722
+ This property can be used as a prefix for any HTTP method call to return
723
+ the raw response object instead of the parsed content.
724
+
725
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
726
+ """
727
+ return AsyncOriginGroupsResourceWithRawResponse(self)
728
+
729
+ @cached_property
730
+ def with_streaming_response(self) -> AsyncOriginGroupsResourceWithStreamingResponse:
731
+ """
732
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
733
+
734
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
735
+ """
736
+ return AsyncOriginGroupsResourceWithStreamingResponse(self)
737
+
738
+ @overload
739
+ async def create(
740
+ self,
741
+ *,
742
+ name: str,
743
+ sources: Iterable[origin_group_create_params.NoneAuthSource],
744
+ auth_type: str | Omit = omit,
745
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
746
+ use_next: bool | Omit = omit,
747
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
748
+ # The extra values given here take precedence over values defined on the client or passed to this method.
749
+ extra_headers: Headers | None = None,
750
+ extra_query: Query | None = None,
751
+ extra_body: Body | None = None,
752
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
753
+ ) -> OriginGroups:
754
+ """
755
+ Create an origin group with one or more origin sources.
756
+
757
+ Args:
758
+ name: Origin group name.
759
+
760
+ sources: List of origin sources in the origin group.
761
+
762
+ auth_type: Origin authentication type.
763
+
764
+ Possible values:
765
+
766
+ - **none** - Used for public origins.
767
+ - **awsSignatureV4** - Used for S3 storage.
768
+
769
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
770
+
771
+ Possible values:
772
+
773
+ - **error** - an error occurred while establishing a connection with the origin,
774
+ passing a request to it, or reading the response header
775
+ - **timeout** - a timeout has occurred while establishing a connection with the
776
+ origin, passing a request to it, or reading the response header
777
+ - **`invalid_header`** - a origin returned an empty or invalid response
778
+ - **`http_403`** - a origin returned a response with the code 403
779
+ - **`http_404`** - a origin returned a response with the code 404
780
+ - **`http_429`** - a origin returned a response with the code 429
781
+ - **`http_500`** - a origin returned a response with the code 500
782
+ - **`http_502`** - a origin returned a response with the code 502
783
+ - **`http_503`** - a origin returned a response with the code 503
784
+ - **`http_504`** - a origin returned a response with the code 504
785
+
786
+ use_next: Defines whether to use the next origin from the origin group if origin responds
787
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
788
+ specify cases in `proxy_next_upstream`.
789
+
790
+ Possible values:
791
+
792
+ - **true** - Option is enabled.
793
+ - **false** - Option is disabled.
794
+
795
+ extra_headers: Send extra headers
796
+
797
+ extra_query: Add additional query parameters to the request
798
+
799
+ extra_body: Add additional JSON properties to the request
800
+
801
+ timeout: Override the client-level default timeout for this request, in seconds
802
+ """
803
+ ...
804
+
805
+ @overload
806
+ async def create(
807
+ self,
808
+ *,
809
+ auth: origin_group_create_params.AwsSignatureV4Auth,
810
+ auth_type: str,
811
+ name: str,
812
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
813
+ use_next: bool | Omit = omit,
814
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
815
+ # The extra values given here take precedence over values defined on the client or passed to this method.
816
+ extra_headers: Headers | None = None,
817
+ extra_query: Query | None = None,
818
+ extra_body: Body | None = None,
819
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
820
+ ) -> OriginGroups:
821
+ """
822
+ Create an origin group with one or more origin sources.
823
+
824
+ Args:
825
+ auth: Credentials to access the private bucket.
826
+
827
+ auth_type: Authentication type.
828
+
829
+ **awsSignatureV4** value is used for S3 storage.
830
+
831
+ name: Origin group name.
832
+
833
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
834
+
835
+ Possible values:
836
+
837
+ - **error** - an error occurred while establishing a connection with the origin,
838
+ passing a request to it, or reading the response header
839
+ - **timeout** - a timeout has occurred while establishing a connection with the
840
+ origin, passing a request to it, or reading the response header
841
+ - **`invalid_header`** - a origin returned an empty or invalid response
842
+ - **`http_403`** - a origin returned a response with the code 403
843
+ - **`http_404`** - a origin returned a response with the code 404
844
+ - **`http_429`** - a origin returned a response with the code 429
845
+ - **`http_500`** - a origin returned a response with the code 500
846
+ - **`http_502`** - a origin returned a response with the code 502
847
+ - **`http_503`** - a origin returned a response with the code 503
848
+ - **`http_504`** - a origin returned a response with the code 504
849
+
850
+ use_next: Defines whether to use the next origin from the origin group if origin responds
851
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
852
+ specify cases in `proxy_next_upstream`.
853
+
854
+ Possible values:
855
+
856
+ - **true** - Option is enabled.
857
+ - **false** - Option is disabled.
858
+
859
+ extra_headers: Send extra headers
860
+
861
+ extra_query: Add additional query parameters to the request
862
+
863
+ extra_body: Add additional JSON properties to the request
864
+
865
+ timeout: Override the client-level default timeout for this request, in seconds
866
+ """
867
+ ...
868
+
869
+ @required_args(["name", "sources"], ["auth", "auth_type", "name"])
870
+ async def create(
871
+ self,
872
+ *,
873
+ name: str,
874
+ sources: Iterable[origin_group_create_params.NoneAuthSource] | Omit = omit,
875
+ auth_type: str | Omit = omit,
876
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
877
+ use_next: bool | Omit = omit,
878
+ auth: origin_group_create_params.AwsSignatureV4Auth | Omit = omit,
879
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
880
+ # The extra values given here take precedence over values defined on the client or passed to this method.
881
+ extra_headers: Headers | None = None,
882
+ extra_query: Query | None = None,
883
+ extra_body: Body | None = None,
884
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
885
+ ) -> OriginGroups:
886
+ return cast(
887
+ OriginGroups,
888
+ await self._post(
889
+ "/cdn/origin_groups"
890
+ if self._client._base_url_overridden
891
+ else "https://api.gcore.com//cdn/origin_groups",
892
+ body=await async_maybe_transform(
893
+ {
894
+ "name": name,
895
+ "sources": sources,
896
+ "auth_type": auth_type,
897
+ "proxy_next_upstream": proxy_next_upstream,
898
+ "use_next": use_next,
899
+ "auth": auth,
900
+ },
901
+ origin_group_create_params.OriginGroupCreateParams,
902
+ ),
903
+ options=make_request_options(
904
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
905
+ ),
906
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
907
+ ),
908
+ )
909
+
910
+ @overload
911
+ async def update(
912
+ self,
913
+ origin_group_id: int,
914
+ *,
915
+ name: str,
916
+ auth_type: str | Omit = omit,
917
+ path: str | Omit = omit,
918
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
919
+ sources: Iterable[origin_group_update_params.NoneAuthSource] | Omit = omit,
920
+ use_next: bool | Omit = omit,
921
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
922
+ # The extra values given here take precedence over values defined on the client or passed to this method.
923
+ extra_headers: Headers | None = None,
924
+ extra_query: Query | None = None,
925
+ extra_body: Body | None = None,
926
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
927
+ ) -> OriginGroups:
928
+ """
929
+ Change origin group
930
+
931
+ Args:
932
+ name: Origin group name.
933
+
934
+ auth_type: Origin authentication type.
935
+
936
+ Possible values:
937
+
938
+ - **none** - Used for public origins.
939
+ - **awsSignatureV4** - Used for S3 storage.
940
+
941
+ path: Parameter is **deprecated**.
942
+
943
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
944
+
945
+ Possible values:
946
+
947
+ - **error** - an error occurred while establishing a connection with the origin,
948
+ passing a request to it, or reading the response header
949
+ - **timeout** - a timeout has occurred while establishing a connection with the
950
+ origin, passing a request to it, or reading the response header
951
+ - **`invalid_header`** - a origin returned an empty or invalid response
952
+ - **`http_403`** - a origin returned a response with the code 403
953
+ - **`http_404`** - a origin returned a response with the code 404
954
+ - **`http_429`** - a origin returned a response with the code 429
955
+ - **`http_500`** - a origin returned a response with the code 500
956
+ - **`http_502`** - a origin returned a response with the code 502
957
+ - **`http_503`** - a origin returned a response with the code 503
958
+ - **`http_504`** - a origin returned a response with the code 504
959
+
960
+ sources: List of origin sources in the origin group.
961
+
962
+ use_next: Defines whether to use the next origin from the origin group if origin responds
963
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
964
+ specify cases in `proxy_next_upstream`.
965
+
966
+ Possible values:
967
+
968
+ - **true** - Option is enabled.
969
+ - **false** - Option is disabled.
970
+
971
+ extra_headers: Send extra headers
972
+
973
+ extra_query: Add additional query parameters to the request
974
+
975
+ extra_body: Add additional JSON properties to the request
976
+
977
+ timeout: Override the client-level default timeout for this request, in seconds
978
+ """
979
+ ...
980
+
981
+ @overload
982
+ async def update(
983
+ self,
984
+ origin_group_id: int,
985
+ *,
986
+ auth: origin_group_update_params.AwsSignatureV4Auth | Omit = omit,
987
+ auth_type: str | Omit = omit,
988
+ name: str | Omit = omit,
989
+ path: str | Omit = omit,
990
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
991
+ use_next: bool | Omit = omit,
992
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
993
+ # The extra values given here take precedence over values defined on the client or passed to this method.
994
+ extra_headers: Headers | None = None,
995
+ extra_query: Query | None = None,
996
+ extra_body: Body | None = None,
997
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
998
+ ) -> OriginGroups:
999
+ """
1000
+ Change origin group
1001
+
1002
+ Args:
1003
+ auth: Credentials to access the private bucket.
1004
+
1005
+ auth_type: Authentication type.
1006
+
1007
+ **awsSignatureV4** value is used for S3 storage.
1008
+
1009
+ name: Origin group name.
1010
+
1011
+ path: Parameter is **deprecated**.
1012
+
1013
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
1014
+
1015
+ Possible values:
1016
+
1017
+ - **error** - an error occurred while establishing a connection with the origin,
1018
+ passing a request to it, or reading the response header
1019
+ - **timeout** - a timeout has occurred while establishing a connection with the
1020
+ origin, passing a request to it, or reading the response header
1021
+ - **`invalid_header`** - a origin returned an empty or invalid response
1022
+ - **`http_403`** - a origin returned a response with the code 403
1023
+ - **`http_404`** - a origin returned a response with the code 404
1024
+ - **`http_429`** - a origin returned a response with the code 429
1025
+ - **`http_500`** - a origin returned a response with the code 500
1026
+ - **`http_502`** - a origin returned a response with the code 502
1027
+ - **`http_503`** - a origin returned a response with the code 503
1028
+ - **`http_504`** - a origin returned a response with the code 504
1029
+
1030
+ use_next: Defines whether to use the next origin from the origin group if origin responds
1031
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
1032
+ specify cases in `proxy_next_upstream`.
1033
+
1034
+ Possible values:
1035
+
1036
+ - **true** - Option is enabled.
1037
+ - **false** - Option is disabled.
1038
+
1039
+ extra_headers: Send extra headers
1040
+
1041
+ extra_query: Add additional query parameters to the request
1042
+
1043
+ extra_body: Add additional JSON properties to the request
1044
+
1045
+ timeout: Override the client-level default timeout for this request, in seconds
1046
+ """
1047
+ ...
1048
+
1049
+ async def update(
1050
+ self,
1051
+ origin_group_id: int,
1052
+ *,
1053
+ name: str | Omit = omit,
1054
+ auth_type: str | Omit = omit,
1055
+ path: str | Omit = omit,
1056
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
1057
+ sources: Iterable[origin_group_update_params.NoneAuthSource] | Omit = omit,
1058
+ use_next: bool | Omit = omit,
1059
+ auth: origin_group_update_params.AwsSignatureV4Auth | Omit = omit,
1060
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1061
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1062
+ extra_headers: Headers | None = None,
1063
+ extra_query: Query | None = None,
1064
+ extra_body: Body | None = None,
1065
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1066
+ ) -> OriginGroups:
1067
+ return cast(
1068
+ OriginGroups,
1069
+ await self._patch(
1070
+ f"/cdn/origin_groups/{origin_group_id}"
1071
+ if self._client._base_url_overridden
1072
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
1073
+ body=await async_maybe_transform(
1074
+ {
1075
+ "name": name,
1076
+ "auth_type": auth_type,
1077
+ "path": path,
1078
+ "proxy_next_upstream": proxy_next_upstream,
1079
+ "sources": sources,
1080
+ "use_next": use_next,
1081
+ "auth": auth,
1082
+ },
1083
+ origin_group_update_params.OriginGroupUpdateParams,
1084
+ ),
1085
+ options=make_request_options(
1086
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1087
+ ),
1088
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
1089
+ ),
1090
+ )
1091
+
1092
+ async def list(
1093
+ self,
1094
+ *,
1095
+ has_related_resources: bool | Omit = omit,
1096
+ name: str | Omit = omit,
1097
+ sources: str | Omit = omit,
1098
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1099
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1100
+ extra_headers: Headers | None = None,
1101
+ extra_query: Query | None = None,
1102
+ extra_body: Body | None = None,
1103
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1104
+ ) -> OriginGroupsList:
1105
+ """
1106
+ Get all origin groups and related origin sources.
1107
+
1108
+ Args:
1109
+ has_related_resources: Defines whether the origin group has related CDN resources.
1110
+
1111
+ Possible values:
1112
+
1113
+ - **true** – Origin group has related CDN resources.
1114
+ - **false** – Origin group does not have related CDN resources.
1115
+
1116
+ name: Origin group name.
1117
+
1118
+ sources: Origin sources (IP addresses or domains) in the origin group.
1119
+
1120
+ extra_headers: Send extra headers
1121
+
1122
+ extra_query: Add additional query parameters to the request
1123
+
1124
+ extra_body: Add additional JSON properties to the request
1125
+
1126
+ timeout: Override the client-level default timeout for this request, in seconds
1127
+ """
1128
+ return await self._get(
1129
+ "/cdn/origin_groups" if self._client._base_url_overridden else "https://api.gcore.com//cdn/origin_groups",
1130
+ options=make_request_options(
1131
+ extra_headers=extra_headers,
1132
+ extra_query=extra_query,
1133
+ extra_body=extra_body,
1134
+ timeout=timeout,
1135
+ query=await async_maybe_transform(
1136
+ {
1137
+ "has_related_resources": has_related_resources,
1138
+ "name": name,
1139
+ "sources": sources,
1140
+ },
1141
+ origin_group_list_params.OriginGroupListParams,
1142
+ ),
1143
+ ),
1144
+ cast_to=OriginGroupsList,
1145
+ )
1146
+
1147
+ async def delete(
1148
+ self,
1149
+ origin_group_id: int,
1150
+ *,
1151
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1152
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1153
+ extra_headers: Headers | None = None,
1154
+ extra_query: Query | None = None,
1155
+ extra_body: Body | None = None,
1156
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1157
+ ) -> None:
1158
+ """
1159
+ Delete origin group
1160
+
1161
+ Args:
1162
+ extra_headers: Send extra headers
1163
+
1164
+ extra_query: Add additional query parameters to the request
1165
+
1166
+ extra_body: Add additional JSON properties to the request
1167
+
1168
+ timeout: Override the client-level default timeout for this request, in seconds
1169
+ """
1170
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
1171
+ return await self._delete(
1172
+ f"/cdn/origin_groups/{origin_group_id}"
1173
+ if self._client._base_url_overridden
1174
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
1175
+ options=make_request_options(
1176
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1177
+ ),
1178
+ cast_to=NoneType,
1179
+ )
1180
+
1181
+ async def get(
1182
+ self,
1183
+ origin_group_id: int,
1184
+ *,
1185
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1186
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1187
+ extra_headers: Headers | None = None,
1188
+ extra_query: Query | None = None,
1189
+ extra_body: Body | None = None,
1190
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1191
+ ) -> OriginGroups:
1192
+ """
1193
+ Get origin group details
1194
+
1195
+ Args:
1196
+ extra_headers: Send extra headers
1197
+
1198
+ extra_query: Add additional query parameters to the request
1199
+
1200
+ extra_body: Add additional JSON properties to the request
1201
+
1202
+ timeout: Override the client-level default timeout for this request, in seconds
1203
+ """
1204
+ return cast(
1205
+ OriginGroups,
1206
+ await self._get(
1207
+ f"/cdn/origin_groups/{origin_group_id}"
1208
+ if self._client._base_url_overridden
1209
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
1210
+ options=make_request_options(
1211
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1212
+ ),
1213
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
1214
+ ),
1215
+ )
1216
+
1217
+ @overload
1218
+ async def replace(
1219
+ self,
1220
+ origin_group_id: int,
1221
+ *,
1222
+ auth_type: str,
1223
+ name: str,
1224
+ path: str,
1225
+ sources: Iterable[origin_group_replace_params.NoneAuthSource],
1226
+ use_next: bool,
1227
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
1228
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1229
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1230
+ extra_headers: Headers | None = None,
1231
+ extra_query: Query | None = None,
1232
+ extra_body: Body | None = None,
1233
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1234
+ ) -> OriginGroups:
1235
+ """
1236
+ Change origin group
1237
+
1238
+ Args:
1239
+ auth_type: Origin authentication type.
1240
+
1241
+ Possible values:
1242
+
1243
+ - **none** - Used for public origins.
1244
+ - **awsSignatureV4** - Used for S3 storage.
1245
+
1246
+ name: Origin group name.
1247
+
1248
+ path: Parameter is **deprecated**.
1249
+
1250
+ sources: List of origin sources in the origin group.
1251
+
1252
+ use_next: Defines whether to use the next origin from the origin group if origin responds
1253
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
1254
+ specify cases in `proxy_next_upstream`.
1255
+
1256
+ Possible values:
1257
+
1258
+ - **true** - Option is enabled.
1259
+ - **false** - Option is disabled.
1260
+
1261
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
1262
+
1263
+ Possible values:
1264
+
1265
+ - **error** - an error occurred while establishing a connection with the origin,
1266
+ passing a request to it, or reading the response header
1267
+ - **timeout** - a timeout has occurred while establishing a connection with the
1268
+ origin, passing a request to it, or reading the response header
1269
+ - **`invalid_header`** - a origin returned an empty or invalid response
1270
+ - **`http_403`** - a origin returned a response with the code 403
1271
+ - **`http_404`** - a origin returned a response with the code 404
1272
+ - **`http_429`** - a origin returned a response with the code 429
1273
+ - **`http_500`** - a origin returned a response with the code 500
1274
+ - **`http_502`** - a origin returned a response with the code 502
1275
+ - **`http_503`** - a origin returned a response with the code 503
1276
+ - **`http_504`** - a origin returned a response with the code 504
1277
+
1278
+ extra_headers: Send extra headers
1279
+
1280
+ extra_query: Add additional query parameters to the request
1281
+
1282
+ extra_body: Add additional JSON properties to the request
1283
+
1284
+ timeout: Override the client-level default timeout for this request, in seconds
1285
+ """
1286
+ ...
1287
+
1288
+ @overload
1289
+ async def replace(
1290
+ self,
1291
+ origin_group_id: int,
1292
+ *,
1293
+ auth: origin_group_replace_params.AwsSignatureV4Auth,
1294
+ auth_type: str,
1295
+ name: str,
1296
+ path: str,
1297
+ use_next: bool,
1298
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
1299
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1300
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1301
+ extra_headers: Headers | None = None,
1302
+ extra_query: Query | None = None,
1303
+ extra_body: Body | None = None,
1304
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1305
+ ) -> OriginGroups:
1306
+ """
1307
+ Change origin group
1308
+
1309
+ Args:
1310
+ auth: Credentials to access the private bucket.
1311
+
1312
+ auth_type: Authentication type.
1313
+
1314
+ **awsSignatureV4** value is used for S3 storage.
1315
+
1316
+ name: Origin group name.
1317
+
1318
+ path: Parameter is **deprecated**.
1319
+
1320
+ use_next: Defines whether to use the next origin from the origin group if origin responds
1321
+ with the cases specified in `proxy_next_upstream`. If you enable it, you must
1322
+ specify cases in `proxy_next_upstream`.
1323
+
1324
+ Possible values:
1325
+
1326
+ - **true** - Option is enabled.
1327
+ - **false** - Option is disabled.
1328
+
1329
+ proxy_next_upstream: Defines cases when the request should be passed on to the next origin.
1330
+
1331
+ Possible values:
1332
+
1333
+ - **error** - an error occurred while establishing a connection with the origin,
1334
+ passing a request to it, or reading the response header
1335
+ - **timeout** - a timeout has occurred while establishing a connection with the
1336
+ origin, passing a request to it, or reading the response header
1337
+ - **`invalid_header`** - a origin returned an empty or invalid response
1338
+ - **`http_403`** - a origin returned a response with the code 403
1339
+ - **`http_404`** - a origin returned a response with the code 404
1340
+ - **`http_429`** - a origin returned a response with the code 429
1341
+ - **`http_500`** - a origin returned a response with the code 500
1342
+ - **`http_502`** - a origin returned a response with the code 502
1343
+ - **`http_503`** - a origin returned a response with the code 503
1344
+ - **`http_504`** - a origin returned a response with the code 504
1345
+
1346
+ extra_headers: Send extra headers
1347
+
1348
+ extra_query: Add additional query parameters to the request
1349
+
1350
+ extra_body: Add additional JSON properties to the request
1351
+
1352
+ timeout: Override the client-level default timeout for this request, in seconds
1353
+ """
1354
+ ...
1355
+
1356
+ @required_args(
1357
+ ["auth_type", "name", "path", "sources", "use_next"], ["auth", "auth_type", "name", "path", "use_next"]
1358
+ )
1359
+ async def replace(
1360
+ self,
1361
+ origin_group_id: int,
1362
+ *,
1363
+ auth_type: str,
1364
+ name: str,
1365
+ path: str,
1366
+ sources: Iterable[origin_group_replace_params.NoneAuthSource] | Omit = omit,
1367
+ use_next: bool,
1368
+ proxy_next_upstream: SequenceNotStr[str] | Omit = omit,
1369
+ auth: origin_group_replace_params.AwsSignatureV4Auth | Omit = omit,
1370
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1371
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1372
+ extra_headers: Headers | None = None,
1373
+ extra_query: Query | None = None,
1374
+ extra_body: Body | None = None,
1375
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1376
+ ) -> OriginGroups:
1377
+ return cast(
1378
+ OriginGroups,
1379
+ await self._put(
1380
+ f"/cdn/origin_groups/{origin_group_id}"
1381
+ if self._client._base_url_overridden
1382
+ else f"https://api.gcore.com//cdn/origin_groups/{origin_group_id}",
1383
+ body=await async_maybe_transform(
1384
+ {
1385
+ "auth_type": auth_type,
1386
+ "name": name,
1387
+ "path": path,
1388
+ "sources": sources,
1389
+ "use_next": use_next,
1390
+ "proxy_next_upstream": proxy_next_upstream,
1391
+ "auth": auth,
1392
+ },
1393
+ origin_group_replace_params.OriginGroupReplaceParams,
1394
+ ),
1395
+ options=make_request_options(
1396
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1397
+ ),
1398
+ cast_to=cast(Any, OriginGroups), # Union types cannot be passed in as arguments in the type system
1399
+ ),
1400
+ )
1401
+
1402
+
1403
+ class OriginGroupsResourceWithRawResponse:
1404
+ def __init__(self, origin_groups: OriginGroupsResource) -> None:
1405
+ self._origin_groups = origin_groups
1406
+
1407
+ self.create = to_raw_response_wrapper(
1408
+ origin_groups.create,
1409
+ )
1410
+ self.update = to_raw_response_wrapper(
1411
+ origin_groups.update,
1412
+ )
1413
+ self.list = to_raw_response_wrapper(
1414
+ origin_groups.list,
1415
+ )
1416
+ self.delete = to_raw_response_wrapper(
1417
+ origin_groups.delete,
1418
+ )
1419
+ self.get = to_raw_response_wrapper(
1420
+ origin_groups.get,
1421
+ )
1422
+ self.replace = to_raw_response_wrapper(
1423
+ origin_groups.replace,
1424
+ )
1425
+
1426
+
1427
+ class AsyncOriginGroupsResourceWithRawResponse:
1428
+ def __init__(self, origin_groups: AsyncOriginGroupsResource) -> None:
1429
+ self._origin_groups = origin_groups
1430
+
1431
+ self.create = async_to_raw_response_wrapper(
1432
+ origin_groups.create,
1433
+ )
1434
+ self.update = async_to_raw_response_wrapper(
1435
+ origin_groups.update,
1436
+ )
1437
+ self.list = async_to_raw_response_wrapper(
1438
+ origin_groups.list,
1439
+ )
1440
+ self.delete = async_to_raw_response_wrapper(
1441
+ origin_groups.delete,
1442
+ )
1443
+ self.get = async_to_raw_response_wrapper(
1444
+ origin_groups.get,
1445
+ )
1446
+ self.replace = async_to_raw_response_wrapper(
1447
+ origin_groups.replace,
1448
+ )
1449
+
1450
+
1451
+ class OriginGroupsResourceWithStreamingResponse:
1452
+ def __init__(self, origin_groups: OriginGroupsResource) -> None:
1453
+ self._origin_groups = origin_groups
1454
+
1455
+ self.create = to_streamed_response_wrapper(
1456
+ origin_groups.create,
1457
+ )
1458
+ self.update = to_streamed_response_wrapper(
1459
+ origin_groups.update,
1460
+ )
1461
+ self.list = to_streamed_response_wrapper(
1462
+ origin_groups.list,
1463
+ )
1464
+ self.delete = to_streamed_response_wrapper(
1465
+ origin_groups.delete,
1466
+ )
1467
+ self.get = to_streamed_response_wrapper(
1468
+ origin_groups.get,
1469
+ )
1470
+ self.replace = to_streamed_response_wrapper(
1471
+ origin_groups.replace,
1472
+ )
1473
+
1474
+
1475
+ class AsyncOriginGroupsResourceWithStreamingResponse:
1476
+ def __init__(self, origin_groups: AsyncOriginGroupsResource) -> None:
1477
+ self._origin_groups = origin_groups
1478
+
1479
+ self.create = async_to_streamed_response_wrapper(
1480
+ origin_groups.create,
1481
+ )
1482
+ self.update = async_to_streamed_response_wrapper(
1483
+ origin_groups.update,
1484
+ )
1485
+ self.list = async_to_streamed_response_wrapper(
1486
+ origin_groups.list,
1487
+ )
1488
+ self.delete = async_to_streamed_response_wrapper(
1489
+ origin_groups.delete,
1490
+ )
1491
+ self.get = async_to_streamed_response_wrapper(
1492
+ origin_groups.get,
1493
+ )
1494
+ self.replace = async_to_streamed_response_wrapper(
1495
+ origin_groups.replace,
1496
+ )