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,592 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
8
+ from ..._utils import maybe_transform, async_maybe_transform
9
+ from ..._compat import cached_property
10
+ from ..._resource import SyncAPIResource, AsyncAPIResource
11
+ from ..._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ...types.cdn import (
18
+ trusted_ca_certificate_list_params,
19
+ trusted_ca_certificate_create_params,
20
+ trusted_ca_certificate_replace_params,
21
+ )
22
+ from ..._base_client import make_request_options
23
+ from ...types.cdn.ca_certificate import CaCertificate
24
+ from ...types.cdn.ca_certificate_list import CaCertificateList
25
+
26
+ __all__ = ["TrustedCaCertificatesResource", "AsyncTrustedCaCertificatesResource"]
27
+
28
+
29
+ class TrustedCaCertificatesResource(SyncAPIResource):
30
+ @cached_property
31
+ def with_raw_response(self) -> TrustedCaCertificatesResourceWithRawResponse:
32
+ """
33
+ This property can be used as a prefix for any HTTP method call to return
34
+ the raw response object instead of the parsed content.
35
+
36
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
37
+ """
38
+ return TrustedCaCertificatesResourceWithRawResponse(self)
39
+
40
+ @cached_property
41
+ def with_streaming_response(self) -> TrustedCaCertificatesResourceWithStreamingResponse:
42
+ """
43
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44
+
45
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
46
+ """
47
+ return TrustedCaCertificatesResourceWithStreamingResponse(self)
48
+
49
+ def create(
50
+ self,
51
+ *,
52
+ name: str,
53
+ ssl_certificate: str,
54
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
+ # The extra values given here take precedence over values defined on the client or passed to this method.
56
+ extra_headers: Headers | None = None,
57
+ extra_query: Query | None = None,
58
+ extra_body: Body | None = None,
59
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
+ ) -> CaCertificate:
61
+ """
62
+ Add a trusted CA certificate to verify an origin.
63
+
64
+ Enter all strings of the certificate in one string parameter. Each string should
65
+ be separated by the "\n" symbol.
66
+
67
+ Args:
68
+ name: CA certificate name.
69
+
70
+ It must be unique.
71
+
72
+ ssl_certificate: Public part of the CA certificate.
73
+
74
+ It must be in the PEM format.
75
+
76
+ extra_headers: Send extra headers
77
+
78
+ extra_query: Add additional query parameters to the request
79
+
80
+ extra_body: Add additional JSON properties to the request
81
+
82
+ timeout: Override the client-level default timeout for this request, in seconds
83
+ """
84
+ return self._post(
85
+ "/cdn/sslCertificates"
86
+ if self._client._base_url_overridden
87
+ else "https://api.gcore.com//cdn/sslCertificates",
88
+ body=maybe_transform(
89
+ {
90
+ "name": name,
91
+ "ssl_certificate": ssl_certificate,
92
+ },
93
+ trusted_ca_certificate_create_params.TrustedCaCertificateCreateParams,
94
+ ),
95
+ options=make_request_options(
96
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
97
+ ),
98
+ cast_to=CaCertificate,
99
+ )
100
+
101
+ def list(
102
+ self,
103
+ *,
104
+ automated: bool | Omit = omit,
105
+ resource_id: int | Omit = omit,
106
+ validity_not_after_lte: str | Omit = omit,
107
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108
+ # The extra values given here take precedence over values defined on the client or passed to this method.
109
+ extra_headers: Headers | None = None,
110
+ extra_query: Query | None = None,
111
+ extra_body: Body | None = None,
112
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
113
+ ) -> CaCertificateList:
114
+ """
115
+ Get list of trusted CA certificates used to verify an origin.
116
+
117
+ Args:
118
+ automated: How the certificate was issued.
119
+
120
+ Possible values:
121
+
122
+ - **true** – Certificate was issued automatically.
123
+ - **false** – Certificate was added by a user.
124
+
125
+ resource_id: CDN resource ID for which the certificates are requested.
126
+
127
+ validity_not_after_lte: Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
128
+ UTC.)
129
+
130
+ Response will contain certificates valid until the specified time.
131
+
132
+ extra_headers: Send extra headers
133
+
134
+ extra_query: Add additional query parameters to the request
135
+
136
+ extra_body: Add additional JSON properties to the request
137
+
138
+ timeout: Override the client-level default timeout for this request, in seconds
139
+ """
140
+ return self._get(
141
+ "/cdn/sslCertificates"
142
+ if self._client._base_url_overridden
143
+ else "https://api.gcore.com//cdn/sslCertificates",
144
+ options=make_request_options(
145
+ extra_headers=extra_headers,
146
+ extra_query=extra_query,
147
+ extra_body=extra_body,
148
+ timeout=timeout,
149
+ query=maybe_transform(
150
+ {
151
+ "automated": automated,
152
+ "resource_id": resource_id,
153
+ "validity_not_after_lte": validity_not_after_lte,
154
+ },
155
+ trusted_ca_certificate_list_params.TrustedCaCertificateListParams,
156
+ ),
157
+ ),
158
+ cast_to=CaCertificateList,
159
+ )
160
+
161
+ def delete(
162
+ self,
163
+ id: int,
164
+ *,
165
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166
+ # The extra values given here take precedence over values defined on the client or passed to this method.
167
+ extra_headers: Headers | None = None,
168
+ extra_query: Query | None = None,
169
+ extra_body: Body | None = None,
170
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
171
+ ) -> None:
172
+ """
173
+ Delete trusted CA certificate
174
+
175
+ Args:
176
+ extra_headers: Send extra headers
177
+
178
+ extra_query: Add additional query parameters to the request
179
+
180
+ extra_body: Add additional JSON properties to the request
181
+
182
+ timeout: Override the client-level default timeout for this request, in seconds
183
+ """
184
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
185
+ return self._delete(
186
+ f"/cdn/sslCertificates/{id}"
187
+ if self._client._base_url_overridden
188
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
189
+ options=make_request_options(
190
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
191
+ ),
192
+ cast_to=NoneType,
193
+ )
194
+
195
+ def get(
196
+ self,
197
+ id: int,
198
+ *,
199
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
200
+ # The extra values given here take precedence over values defined on the client or passed to this method.
201
+ extra_headers: Headers | None = None,
202
+ extra_query: Query | None = None,
203
+ extra_body: Body | None = None,
204
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
205
+ ) -> CaCertificate:
206
+ """
207
+ Get trusted CA certificate details
208
+
209
+ Args:
210
+ extra_headers: Send extra headers
211
+
212
+ extra_query: Add additional query parameters to the request
213
+
214
+ extra_body: Add additional JSON properties to the request
215
+
216
+ timeout: Override the client-level default timeout for this request, in seconds
217
+ """
218
+ return self._get(
219
+ f"/cdn/sslCertificates/{id}"
220
+ if self._client._base_url_overridden
221
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
222
+ options=make_request_options(
223
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
224
+ ),
225
+ cast_to=CaCertificate,
226
+ )
227
+
228
+ def replace(
229
+ self,
230
+ id: int,
231
+ *,
232
+ name: str,
233
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
234
+ # The extra values given here take precedence over values defined on the client or passed to this method.
235
+ extra_headers: Headers | None = None,
236
+ extra_query: Query | None = None,
237
+ extra_body: Body | None = None,
238
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
239
+ ) -> CaCertificate:
240
+ """
241
+ Change trusted CA certificate
242
+
243
+ Args:
244
+ name: CA certificate name.
245
+
246
+ It must be unique.
247
+
248
+ extra_headers: Send extra headers
249
+
250
+ extra_query: Add additional query parameters to the request
251
+
252
+ extra_body: Add additional JSON properties to the request
253
+
254
+ timeout: Override the client-level default timeout for this request, in seconds
255
+ """
256
+ return self._put(
257
+ f"/cdn/sslCertificates/{id}"
258
+ if self._client._base_url_overridden
259
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
260
+ body=maybe_transform(
261
+ {"name": name}, trusted_ca_certificate_replace_params.TrustedCaCertificateReplaceParams
262
+ ),
263
+ options=make_request_options(
264
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
265
+ ),
266
+ cast_to=CaCertificate,
267
+ )
268
+
269
+
270
+ class AsyncTrustedCaCertificatesResource(AsyncAPIResource):
271
+ @cached_property
272
+ def with_raw_response(self) -> AsyncTrustedCaCertificatesResourceWithRawResponse:
273
+ """
274
+ This property can be used as a prefix for any HTTP method call to return
275
+ the raw response object instead of the parsed content.
276
+
277
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
278
+ """
279
+ return AsyncTrustedCaCertificatesResourceWithRawResponse(self)
280
+
281
+ @cached_property
282
+ def with_streaming_response(self) -> AsyncTrustedCaCertificatesResourceWithStreamingResponse:
283
+ """
284
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
285
+
286
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
287
+ """
288
+ return AsyncTrustedCaCertificatesResourceWithStreamingResponse(self)
289
+
290
+ async def create(
291
+ self,
292
+ *,
293
+ name: str,
294
+ ssl_certificate: str,
295
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
296
+ # The extra values given here take precedence over values defined on the client or passed to this method.
297
+ extra_headers: Headers | None = None,
298
+ extra_query: Query | None = None,
299
+ extra_body: Body | None = None,
300
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
301
+ ) -> CaCertificate:
302
+ """
303
+ Add a trusted CA certificate to verify an origin.
304
+
305
+ Enter all strings of the certificate in one string parameter. Each string should
306
+ be separated by the "\n" symbol.
307
+
308
+ Args:
309
+ name: CA certificate name.
310
+
311
+ It must be unique.
312
+
313
+ ssl_certificate: Public part of the CA certificate.
314
+
315
+ It must be in the PEM format.
316
+
317
+ extra_headers: Send extra headers
318
+
319
+ extra_query: Add additional query parameters to the request
320
+
321
+ extra_body: Add additional JSON properties to the request
322
+
323
+ timeout: Override the client-level default timeout for this request, in seconds
324
+ """
325
+ return await self._post(
326
+ "/cdn/sslCertificates"
327
+ if self._client._base_url_overridden
328
+ else "https://api.gcore.com//cdn/sslCertificates",
329
+ body=await async_maybe_transform(
330
+ {
331
+ "name": name,
332
+ "ssl_certificate": ssl_certificate,
333
+ },
334
+ trusted_ca_certificate_create_params.TrustedCaCertificateCreateParams,
335
+ ),
336
+ options=make_request_options(
337
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
338
+ ),
339
+ cast_to=CaCertificate,
340
+ )
341
+
342
+ async def list(
343
+ self,
344
+ *,
345
+ automated: bool | Omit = omit,
346
+ resource_id: int | Omit = omit,
347
+ validity_not_after_lte: str | Omit = omit,
348
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349
+ # The extra values given here take precedence over values defined on the client or passed to this method.
350
+ extra_headers: Headers | None = None,
351
+ extra_query: Query | None = None,
352
+ extra_body: Body | None = None,
353
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
354
+ ) -> CaCertificateList:
355
+ """
356
+ Get list of trusted CA certificates used to verify an origin.
357
+
358
+ Args:
359
+ automated: How the certificate was issued.
360
+
361
+ Possible values:
362
+
363
+ - **true** – Certificate was issued automatically.
364
+ - **false** – Certificate was added by a user.
365
+
366
+ resource_id: CDN resource ID for which the certificates are requested.
367
+
368
+ validity_not_after_lte: Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
369
+ UTC.)
370
+
371
+ Response will contain certificates valid until the specified time.
372
+
373
+ extra_headers: Send extra headers
374
+
375
+ extra_query: Add additional query parameters to the request
376
+
377
+ extra_body: Add additional JSON properties to the request
378
+
379
+ timeout: Override the client-level default timeout for this request, in seconds
380
+ """
381
+ return await self._get(
382
+ "/cdn/sslCertificates"
383
+ if self._client._base_url_overridden
384
+ else "https://api.gcore.com//cdn/sslCertificates",
385
+ options=make_request_options(
386
+ extra_headers=extra_headers,
387
+ extra_query=extra_query,
388
+ extra_body=extra_body,
389
+ timeout=timeout,
390
+ query=await async_maybe_transform(
391
+ {
392
+ "automated": automated,
393
+ "resource_id": resource_id,
394
+ "validity_not_after_lte": validity_not_after_lte,
395
+ },
396
+ trusted_ca_certificate_list_params.TrustedCaCertificateListParams,
397
+ ),
398
+ ),
399
+ cast_to=CaCertificateList,
400
+ )
401
+
402
+ async def delete(
403
+ self,
404
+ id: int,
405
+ *,
406
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
407
+ # The extra values given here take precedence over values defined on the client or passed to this method.
408
+ extra_headers: Headers | None = None,
409
+ extra_query: Query | None = None,
410
+ extra_body: Body | None = None,
411
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
412
+ ) -> None:
413
+ """
414
+ Delete trusted CA certificate
415
+
416
+ Args:
417
+ extra_headers: Send extra headers
418
+
419
+ extra_query: Add additional query parameters to the request
420
+
421
+ extra_body: Add additional JSON properties to the request
422
+
423
+ timeout: Override the client-level default timeout for this request, in seconds
424
+ """
425
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
426
+ return await self._delete(
427
+ f"/cdn/sslCertificates/{id}"
428
+ if self._client._base_url_overridden
429
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
430
+ options=make_request_options(
431
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
432
+ ),
433
+ cast_to=NoneType,
434
+ )
435
+
436
+ async def get(
437
+ self,
438
+ id: int,
439
+ *,
440
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
441
+ # The extra values given here take precedence over values defined on the client or passed to this method.
442
+ extra_headers: Headers | None = None,
443
+ extra_query: Query | None = None,
444
+ extra_body: Body | None = None,
445
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
446
+ ) -> CaCertificate:
447
+ """
448
+ Get trusted CA certificate details
449
+
450
+ Args:
451
+ extra_headers: Send extra headers
452
+
453
+ extra_query: Add additional query parameters to the request
454
+
455
+ extra_body: Add additional JSON properties to the request
456
+
457
+ timeout: Override the client-level default timeout for this request, in seconds
458
+ """
459
+ return await self._get(
460
+ f"/cdn/sslCertificates/{id}"
461
+ if self._client._base_url_overridden
462
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
463
+ options=make_request_options(
464
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
465
+ ),
466
+ cast_to=CaCertificate,
467
+ )
468
+
469
+ async def replace(
470
+ self,
471
+ id: int,
472
+ *,
473
+ name: str,
474
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
475
+ # The extra values given here take precedence over values defined on the client or passed to this method.
476
+ extra_headers: Headers | None = None,
477
+ extra_query: Query | None = None,
478
+ extra_body: Body | None = None,
479
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
480
+ ) -> CaCertificate:
481
+ """
482
+ Change trusted CA certificate
483
+
484
+ Args:
485
+ name: CA certificate name.
486
+
487
+ It must be unique.
488
+
489
+ extra_headers: Send extra headers
490
+
491
+ extra_query: Add additional query parameters to the request
492
+
493
+ extra_body: Add additional JSON properties to the request
494
+
495
+ timeout: Override the client-level default timeout for this request, in seconds
496
+ """
497
+ return await self._put(
498
+ f"/cdn/sslCertificates/{id}"
499
+ if self._client._base_url_overridden
500
+ else f"https://api.gcore.com//cdn/sslCertificates/{id}",
501
+ body=await async_maybe_transform(
502
+ {"name": name}, trusted_ca_certificate_replace_params.TrustedCaCertificateReplaceParams
503
+ ),
504
+ options=make_request_options(
505
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
506
+ ),
507
+ cast_to=CaCertificate,
508
+ )
509
+
510
+
511
+ class TrustedCaCertificatesResourceWithRawResponse:
512
+ def __init__(self, trusted_ca_certificates: TrustedCaCertificatesResource) -> None:
513
+ self._trusted_ca_certificates = trusted_ca_certificates
514
+
515
+ self.create = to_raw_response_wrapper(
516
+ trusted_ca_certificates.create,
517
+ )
518
+ self.list = to_raw_response_wrapper(
519
+ trusted_ca_certificates.list,
520
+ )
521
+ self.delete = to_raw_response_wrapper(
522
+ trusted_ca_certificates.delete,
523
+ )
524
+ self.get = to_raw_response_wrapper(
525
+ trusted_ca_certificates.get,
526
+ )
527
+ self.replace = to_raw_response_wrapper(
528
+ trusted_ca_certificates.replace,
529
+ )
530
+
531
+
532
+ class AsyncTrustedCaCertificatesResourceWithRawResponse:
533
+ def __init__(self, trusted_ca_certificates: AsyncTrustedCaCertificatesResource) -> None:
534
+ self._trusted_ca_certificates = trusted_ca_certificates
535
+
536
+ self.create = async_to_raw_response_wrapper(
537
+ trusted_ca_certificates.create,
538
+ )
539
+ self.list = async_to_raw_response_wrapper(
540
+ trusted_ca_certificates.list,
541
+ )
542
+ self.delete = async_to_raw_response_wrapper(
543
+ trusted_ca_certificates.delete,
544
+ )
545
+ self.get = async_to_raw_response_wrapper(
546
+ trusted_ca_certificates.get,
547
+ )
548
+ self.replace = async_to_raw_response_wrapper(
549
+ trusted_ca_certificates.replace,
550
+ )
551
+
552
+
553
+ class TrustedCaCertificatesResourceWithStreamingResponse:
554
+ def __init__(self, trusted_ca_certificates: TrustedCaCertificatesResource) -> None:
555
+ self._trusted_ca_certificates = trusted_ca_certificates
556
+
557
+ self.create = to_streamed_response_wrapper(
558
+ trusted_ca_certificates.create,
559
+ )
560
+ self.list = to_streamed_response_wrapper(
561
+ trusted_ca_certificates.list,
562
+ )
563
+ self.delete = to_streamed_response_wrapper(
564
+ trusted_ca_certificates.delete,
565
+ )
566
+ self.get = to_streamed_response_wrapper(
567
+ trusted_ca_certificates.get,
568
+ )
569
+ self.replace = to_streamed_response_wrapper(
570
+ trusted_ca_certificates.replace,
571
+ )
572
+
573
+
574
+ class AsyncTrustedCaCertificatesResourceWithStreamingResponse:
575
+ def __init__(self, trusted_ca_certificates: AsyncTrustedCaCertificatesResource) -> None:
576
+ self._trusted_ca_certificates = trusted_ca_certificates
577
+
578
+ self.create = async_to_streamed_response_wrapper(
579
+ trusted_ca_certificates.create,
580
+ )
581
+ self.list = async_to_streamed_response_wrapper(
582
+ trusted_ca_certificates.list,
583
+ )
584
+ self.delete = async_to_streamed_response_wrapper(
585
+ trusted_ca_certificates.delete,
586
+ )
587
+ self.get = async_to_streamed_response_wrapper(
588
+ trusted_ca_certificates.get,
589
+ )
590
+ self.replace = async_to_streamed_response_wrapper(
591
+ trusted_ca_certificates.replace,
592
+ )