gcore 0.12.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 (340) 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 +270 -52
  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 +247 -189
  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 +70 -38
  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 +2 -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.py +1 -1
  268. gcore/types/cloud/floating_ip_detailed.py +1 -1
  269. gcore/types/cloud/floating_ip_update_params.py +43 -0
  270. gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
  271. gcore/types/cloud/inference/inference_deployment.py +3 -1
  272. gcore/types/cloud/instance_create_params.py +3 -1
  273. gcore/types/cloud/k8s/cluster_create_params.py +46 -4
  274. gcore/types/cloud/k8s/cluster_update_params.py +60 -6
  275. gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
  276. gcore/types/cloud/k8s/k8s_cluster.py +40 -3
  277. gcore/types/cloud/load_balancer_update_params.py +3 -1
  278. gcore/types/cloud/network_update_params.py +3 -1
  279. gcore/types/cloud/networks/subnet_update_params.py +3 -1
  280. gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
  281. gcore/types/cloud/registries/user_create_params.py +5 -3
  282. gcore/types/cloud/registry_create_params.py +5 -3
  283. gcore/types/cloud/security_group_update_params.py +3 -1
  284. gcore/types/cloud/ssh_key_created.py +6 -3
  285. gcore/types/cloud/volume_update_params.py +3 -1
  286. gcore/types/dns/zone_get_statistics_params.py +12 -9
  287. gcore/types/dns/zone_get_statistics_response.py +3 -1
  288. gcore/types/dns/zone_import_params.py +21 -15
  289. gcore/types/dns/zones/dns_output_rrset.py +7 -3
  290. gcore/types/iam/account_overview.py +7 -2
  291. gcore/types/iam/user.py +7 -2
  292. gcore/types/iam/user_detailed.py +7 -2
  293. gcore/types/iam/user_invite_params.py +4 -1
  294. gcore/types/iam/user_update.py +7 -2
  295. gcore/types/iam/user_update_params.py +7 -2
  296. gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
  297. gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
  298. gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
  299. gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
  300. gcore/types/streaming/ai_task.py +20 -11
  301. gcore/types/streaming/ai_task_create_params.py +20 -11
  302. gcore/types/streaming/ai_task_get_response.py +5 -4
  303. gcore/types/streaming/ai_task_list_params.py +11 -5
  304. gcore/types/streaming/clip.py +33 -22
  305. gcore/types/streaming/create_video_param.py +75 -43
  306. gcore/types/streaming/playlist.py +7 -5
  307. gcore/types/streaming/playlist_create_params.py +7 -5
  308. gcore/types/streaming/playlist_update_params.py +7 -5
  309. gcore/types/streaming/playlist_video.py +75 -43
  310. gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
  311. gcore/types/streaming/stream.py +207 -136
  312. gcore/types/streaming/stream_create_clip_params.py +33 -22
  313. gcore/types/streaming/stream_create_params.py +41 -24
  314. gcore/types/streaming/stream_update_params.py +41 -24
  315. gcore/types/streaming/video.py +138 -76
  316. gcore/types/streaming/video_list_params.py +4 -2
  317. gcore/types/streaming/video_update_params.py +75 -43
  318. gcore/types/waap/__init__.py +2 -1
  319. gcore/types/waap/domain_update_params.py +2 -2
  320. gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
  321. gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
  322. gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
  323. gcore/types/waap/domains/api_path_create_params.py +0 -3
  324. gcore/types/waap/domains/api_path_update_params.py +1 -3
  325. gcore/types/waap/domains/custom_rule_create_params.py +36 -35
  326. gcore/types/waap/domains/custom_rule_update_params.py +31 -33
  327. gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
  328. gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
  329. gcore/types/waap/domains/waap_advanced_rule.py +17 -9
  330. gcore/types/waap/domains/waap_custom_rule.py +5 -2
  331. gcore/types/waap/domains/waap_firewall_rule.py +1 -1
  332. gcore/types/waap/domains/waap_insight.py +1 -1
  333. gcore/types/waap/insight_list_types_params.py +1 -1
  334. gcore/types/waap/ip_info_get_top_urls_response.py +3 -12
  335. gcore/types/waap/{ip_info_get_ip_info_response.py → waap_ip_info.py} +2 -2
  336. gcore/types/waap/waap_top_url.py +13 -0
  337. {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/METADATA +1 -1
  338. {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/RECORD +340 -218
  339. {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
  340. {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,7 +6,7 @@ from typing_extensions import Literal
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10
10
  from ..._utils import maybe_transform, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -53,22 +53,22 @@ class AITasksResource(SyncAPIResource):
53
53
  *,
54
54
  task_name: Literal["transcription", "content-moderation"],
55
55
  url: str,
56
- audio_language: str | NotGiven = NOT_GIVEN,
57
- category: Literal["sport", "nsfw", "hard_nudity", "soft_nudity"] | NotGiven = NOT_GIVEN,
58
- client_entity_data: str | NotGiven = NOT_GIVEN,
59
- client_user_id: str | NotGiven = NOT_GIVEN,
60
- subtitles_language: str | NotGiven = NOT_GIVEN,
56
+ audio_language: str | Omit = omit,
57
+ category: Literal["sport", "nsfw", "hard_nudity", "soft_nudity"] | Omit = omit,
58
+ client_entity_data: str | Omit = omit,
59
+ client_user_id: str | Omit = omit,
60
+ subtitles_language: str | Omit = omit,
61
61
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
62
  # The extra values given here take precedence over values defined on the client or passed to this method.
63
63
  extra_headers: Headers | None = None,
64
64
  extra_query: Query | None = None,
65
65
  extra_body: Body | None = None,
66
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
66
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
67
67
  ) -> AITaskCreateResponse:
68
- """Creating an AI task.
68
+ """
69
+ Creating an AI task.
69
70
 
70
- This method allows you to create an AI task for VOD video
71
- processing:
71
+ This method allows you to create an AI task for VOD video processing:
72
72
 
73
73
  - ASR: Transcribe video
74
74
  - ASR: Translate subtitles
@@ -77,28 +77,39 @@ class AITasksResource(SyncAPIResource):
77
77
  - CM: Soft nudity detection
78
78
  - CM: Hard nudity detection
79
79
  - CM: Objects recognition (soon)
80
- ![Auto generated subtitles example](https://demo-files.gvideo.io/apidocs/captions.gif)
81
- How to use:
80
+
81
+ ![Auto generated subtitles example](https://demo-files.gvideo.io/apidocs/captions.gif)
82
+
83
+ How to use:
84
+
82
85
  - Create an AI task, specify algoritm to use
83
86
  - Get `task_id`
84
- - Check a result using `.../ai/tasks/{task_id}` method For more detailed
85
- information, see the description of each method separately.
87
+ - Check a result using `.../ai/tasks/{task_id}` method
88
+
89
+ For more detailed information, see the description of each method separately.
86
90
 
87
- **AI Automatic Speech Recognition (ASR)** AI is instrumental in automatic video
88
- processing for subtitles creation by using Automatic Speech Recognition (ASR)
89
- technology to transcribe spoken words into text, which can then be translated
90
- into multiple languages for broader accessibility. Categories:
91
+ **AI Automatic Speech Recognition (ASR)**
92
+
93
+ AI is instrumental in automatic video processing for subtitles creation by using
94
+ Automatic Speech Recognition (ASR) technology to transcribe spoken words into
95
+ text, which can then be translated into multiple languages for broader
96
+ accessibility.
97
+
98
+ Categories:
91
99
 
92
100
  - `transcription` – to create subtitles/captions from audio in the original
93
101
  language.
94
102
  - `translation` – to transate subtitles/captions from the original language to
95
- 99+ other languages. AI subtitle transcription and translation tools are
96
- highly efficient, processing large volumes of audio-visual content quickly and
97
- providing accurate transcriptions and translations with minimal human
98
- intervention. Additionally, AI-driven solutions can significantly reduce costs
99
- and turnaround times compared to traditional methods, making them an
100
- invaluable resource for content creators and broadcasters aiming to reach
101
- global audiences. Example response with positive result:
103
+ 99+ other languages.
104
+
105
+ AI subtitle transcription and translation tools are highly efficient, processing
106
+ large volumes of audio-visual content quickly and providing accurate
107
+ transcriptions and translations with minimal human intervention. Additionally,
108
+ AI-driven solutions can significantly reduce costs and turnaround times compared
109
+ to traditional methods, making them an invaluable resource for content creators
110
+ and broadcasters aiming to reach global audiences.
111
+
112
+ Example response with positive result:
102
113
 
103
114
  ```
104
115
  {
@@ -120,11 +131,14 @@ class AITasksResource(SyncAPIResource):
120
131
  }
121
132
  ```
122
133
 
123
- **AI Content Moderation (CM)** The AI Content Moderation API offers a powerful
124
- solution for analyzing video content to detect various categories of
125
- inappropriate material. Leveraging state-of-the-art AI models, this API ensures
126
- real-time analysis and flagging of sensitive or restricted content types, making
127
- it an essential tool for platforms requiring stringent content moderation.
134
+ **AI Content Moderation (CM)**
135
+
136
+ The AI Content Moderation API offers a powerful solution for analyzing video
137
+ content to detect various categories of inappropriate material. Leveraging
138
+ state-of-the-art AI models, this API ensures real-time analysis and flagging of
139
+ sensitive or restricted content types, making it an essential tool for platforms
140
+ requiring stringent content moderation.
141
+
128
142
  Categories:
129
143
 
130
144
  - `nsfw`: Quick algorithm to detect pornographic material, ensuring content is
@@ -134,11 +148,15 @@ class AITasksResource(SyncAPIResource):
134
148
  - `soft_nudity`: Detailed video analysis that reveals both explicit and partial
135
149
  nudity, including the presence of male and female faces and other uncovered
136
150
  body parts.
137
- - `sport`: Recognizes various sporting activities. The AI Content Moderation API
138
- is an invaluable tool for managing and controlling the type of content being
139
- shared or streamed on your platform. By implementing this API, you can ensure
140
- compliance with community guidelines and legal requirements, as well as
141
- provide a safer environment for your users. Important notes:
151
+ - `sport`: Recognizes various sporting activities.
152
+
153
+ The AI Content Moderation API is an invaluable tool for managing and controlling
154
+ the type of content being shared or streamed on your platform. By implementing
155
+ this API, you can ensure compliance with community guidelines and legal
156
+ requirements, as well as provide a safer environment for your users.
157
+
158
+ Important notes:
159
+
142
160
  - It's allowed to analyse still images too (where applicable). Format of image:
143
161
  JPEG, PNG. In that case one image is the same as video of 1 second duration.
144
162
  - Not all frames in the video are used for analysis, but only key frames
@@ -146,7 +164,9 @@ class AITasksResource(SyncAPIResource):
146
164
  detection will only occur at these timestamps. If an object appears and
147
165
  disappears between these time stamps, it will not be detected. We are working
148
166
  on a version to analyze more frames, please contact your manager or our
149
- support team to enable this method. Example response with positive result:
167
+ support team to enable this method.
168
+
169
+ Example response with positive result:
150
170
 
151
171
  ```
152
172
  {
@@ -159,9 +179,11 @@ class AITasksResource(SyncAPIResource):
159
179
  }
160
180
  ```
161
181
 
162
- **Additional information** Billing takes into account the duration of the
163
- analyzed video. Or the duration until the stop tag(where applicable), if the
164
- condition was triggered during the analysis.
182
+ **Additional information**
183
+
184
+ Billing takes into account the duration of the analyzed video. Or the duration
185
+ until the stop tag(where applicable), if the condition was triggered during the
186
+ analysis.
165
187
 
166
188
  The heart of content moderation is AI, with additional services. They run on our
167
189
  own infrastructure, so the files/data are not transferred anywhere to external
@@ -177,13 +199,20 @@ class AITasksResource(SyncAPIResource):
177
199
  url: URL to the MP4 file to analyse. File must be publicly accessible via HTTP/HTTPS.
178
200
 
179
201
  audio_language: Language in original audio (transcription only). This value is used to determine
180
- the language from which to transcribe. If this is not set, the system will run
181
- auto language identification and the subtitles will be in the detected language.
182
- The method also works based on AI analysis. It's fairly accurate, but if it's
183
- wrong, then set the language explicitly. Additionally, when this is not set, we
184
- also support recognition of alternate languages in the video (language
185
- code-switching). Language is set by 3-letter language code according to
186
- ISO-639-2 (bibliographic code). We can process languages:
202
+ the language from which to transcribe.
203
+
204
+ If this is not set, the system will run auto language identification and the
205
+ subtitles will be in the detected language. The method also works based on AI
206
+ analysis. It's fairly accurate, but if it's wrong, then set the language
207
+ explicitly.
208
+
209
+ Additionally, when this is not set, we also support recognition of alternate
210
+ languages in the video (language code-switching).
211
+
212
+ Language is set by 3-letter language code according to ISO-639-2 (bibliographic
213
+ code).
214
+
215
+ We can process languages:
187
216
 
188
217
  - 'afr': Afrikaans
189
218
  - 'alb': Albanian
@@ -290,10 +319,12 @@ class AITasksResource(SyncAPIResource):
290
319
 
291
320
  client_entity_data: Meta parameter, designed to store your own extra information about a video
292
321
  entity: video source, video id, etc. It is not used in any way in video
293
- processing. For example, if an AI-task was created automatically when you
294
- uploaded a video with the AI auto-processing option (nudity detection, etc),
295
- then the ID of the associated video for which the task was performed will be
296
- explicitly indicated here.
322
+ processing.
323
+
324
+ For example, if an AI-task was created automatically when you uploaded a video
325
+ with the AI auto-processing option (nudity detection, etc), then the ID of the
326
+ associated video for which the task was performed will be explicitly indicated
327
+ here.
297
328
 
298
329
  client_user_id: Meta parameter, designed to store your own identifier. Can be used by you to tag
299
330
  requests from different end-users. It is not used in any way in video
@@ -301,6 +332,7 @@ class AITasksResource(SyncAPIResource):
301
332
 
302
333
  subtitles_language: Indicates which language it is clearly necessary to translate into. If this is
303
334
  not set, the original language will be used from attribute "`audio_language`".
335
+
304
336
  Please note that:
305
337
 
306
338
  - transcription into the original language is a free procedure,
@@ -319,7 +351,7 @@ class AITasksResource(SyncAPIResource):
319
351
  timeout: Override the client-level default timeout for this request, in seconds
320
352
  """
321
353
  return self._post(
322
- "/streaming/ai/tasks",
354
+ "/streaming/ai/tasks" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/tasks",
323
355
  body=maybe_transform(
324
356
  {
325
357
  "task_name": task_name,
@@ -341,27 +373,26 @@ class AITasksResource(SyncAPIResource):
341
373
  def list(
342
374
  self,
343
375
  *,
344
- date_created: str | NotGiven = NOT_GIVEN,
345
- limit: int | NotGiven = NOT_GIVEN,
346
- ordering: Literal["task_id", "status", "task_name", "started_at"] | NotGiven = NOT_GIVEN,
347
- page: int | NotGiven = NOT_GIVEN,
348
- search: str | NotGiven = NOT_GIVEN,
349
- status: Literal["FAILURE", "PENDING", "RECEIVED", "RETRY", "REVOKED", "STARTED", "SUCCESS"]
350
- | NotGiven = NOT_GIVEN,
351
- task_id: str | NotGiven = NOT_GIVEN,
352
- task_name: Literal["transcription", "content-moderation"] | NotGiven = NOT_GIVEN,
376
+ date_created: str | Omit = omit,
377
+ limit: int | Omit = omit,
378
+ ordering: Literal["task_id", "status", "task_name", "started_at"] | Omit = omit,
379
+ page: int | Omit = omit,
380
+ search: str | Omit = omit,
381
+ status: Literal["FAILURE", "PENDING", "RECEIVED", "RETRY", "REVOKED", "STARTED", "SUCCESS"] | Omit = omit,
382
+ task_id: str | Omit = omit,
383
+ task_name: Literal["transcription", "content-moderation"] | Omit = omit,
353
384
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
354
385
  # The extra values given here take precedence over values defined on the client or passed to this method.
355
386
  extra_headers: Headers | None = None,
356
387
  extra_query: Query | None = None,
357
388
  extra_body: Body | None = None,
358
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
389
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
359
390
  ) -> SyncPageStreamingAI[AITask]:
360
- """Returns a list of previously created and processed AI tasks.
391
+ """
392
+ Returns a list of previously created and processed AI tasks.
361
393
 
362
- The list contains
363
- brief information about the task and its execution status. Data is displayed
364
- page by page.
394
+ The list contains brief information about the task and its execution status.
395
+ Data is displayed page by page.
365
396
 
366
397
  Args:
367
398
  date_created: Time when task was created. Datetime in ISO 8601 format.
@@ -369,15 +400,21 @@ class AITasksResource(SyncAPIResource):
369
400
  limit: Number of results to return per page.
370
401
 
371
402
  ordering: Which field to use when ordering the results: `task_id`, status, and
372
- `task_name`. Sorting is done in ascending (ASC) order. If parameter is omitted
373
- then "`started_at` DESC" is used for ordering by default.
403
+ `task_name`. Sorting is done in ascending (ASC) order.
404
+
405
+ If parameter is omitted then "`started_at` DESC" is used for ordering by
406
+ default.
374
407
 
375
408
  page: Page to view from task list, starting from 1
376
409
 
377
410
  search: This is an field for combined text search in the following fields: `task_id`,
378
- `task_name`, status, and `task_data`. Both full and partial searches are
379
- possible inside specified above fields. For example, you can filter tasks of a
380
- certain category, or tasks by a specific original file. Example:
411
+ `task_name`, status, and `task_data`.
412
+
413
+ Both full and partial searches are possible inside specified above fields. For
414
+ example, you can filter tasks of a certain category, or tasks by a specific
415
+ original file.
416
+
417
+ Example:
381
418
 
382
419
  - To filter tasks of Content Moderation NSFW method:
383
420
  `GET /streaming/ai/tasks?search=nsfw`
@@ -400,7 +437,7 @@ class AITasksResource(SyncAPIResource):
400
437
  timeout: Override the client-level default timeout for this request, in seconds
401
438
  """
402
439
  return self._get_api_list(
403
- "/streaming/ai/tasks",
440
+ "/streaming/ai/tasks" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/tasks",
404
441
  page=SyncPageStreamingAI[AITask],
405
442
  options=make_request_options(
406
443
  extra_headers=extra_headers,
@@ -433,11 +470,13 @@ class AITasksResource(SyncAPIResource):
433
470
  extra_headers: Headers | None = None,
434
471
  extra_query: Query | None = None,
435
472
  extra_body: Body | None = None,
436
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
473
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
437
474
  ) -> AITaskCancelResponse:
438
475
  """
439
476
  Stopping a previously launched AI-task without waiting for it to be fully
440
- completed. The task will be moved to "REVOKED" status.
477
+ completed.
478
+
479
+ The task will be moved to "REVOKED" status.
441
480
 
442
481
  Args:
443
482
  extra_headers: Send extra headers
@@ -451,7 +490,9 @@ class AITasksResource(SyncAPIResource):
451
490
  if not task_id:
452
491
  raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
453
492
  return self._post(
454
- f"/streaming/ai/tasks/{task_id}/cancel",
493
+ f"/streaming/ai/tasks/{task_id}/cancel"
494
+ if self._client._base_url_overridden
495
+ else f"https://api.gcore.com//streaming/ai/tasks/{task_id}/cancel",
455
496
  options=make_request_options(
456
497
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
457
498
  ),
@@ -467,13 +508,14 @@ class AITasksResource(SyncAPIResource):
467
508
  extra_headers: Headers | None = None,
468
509
  extra_query: Query | None = None,
469
510
  extra_body: Body | None = None,
470
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
511
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
471
512
  ) -> AITaskGetResponse:
472
513
  """
473
514
  This is the single method to check the execution status of an AI task, and
474
- obtain the result of any type of AI task. Based on the results of processing,
475
- the “result” field will contain an answer corresponding to the type of the
476
- initially created task:
515
+ obtain the result of any type of AI task.
516
+
517
+ Based on the results of processing, the “result” field will contain an answer
518
+ corresponding to the type of the initially created task:
477
519
 
478
520
  - ASR: Transcribe video
479
521
  - ASR: Translate subtitles
@@ -485,7 +527,9 @@ class AITasksResource(SyncAPIResource):
485
527
  - etc... (see other methods from /ai/ domain)
486
528
 
487
529
  A queue is used to process videos. The waiting time depends on the total number
488
- of requests in the system, so sometimes you will have to wait. Statuses:
530
+ of requests in the system, so sometimes you will have to wait.
531
+
532
+ Statuses:
489
533
 
490
534
  - PENDING – the task is received and it is pending for available resources
491
535
  - STARTED – processing has started
@@ -493,12 +537,14 @@ class AITasksResource(SyncAPIResource):
493
537
  - FAILURE – processing failed
494
538
  - REVOKED – processing was cancelled by the user (or the system)
495
539
  - RETRY – the task execution failed due to internal reasons, the task is queued
496
- for re-execution (up to 3 times) Each task is processed in sub-stages, for
497
- example, original language is first determined in a video, and then
498
- transcription is performed. In such cases, the video processing status may
499
- change from "STARTED" to "PENDING", and back. This is due to waiting for
500
- resources for a specific processing sub-stage. In this case, the overall
501
- percentage "progress" of video processing will reflect the full picture.
540
+ for re-execution (up to 3 times)
541
+
542
+ Each task is processed in sub-stages, for example, original language is first
543
+ determined in a video, and then transcription is performed. In such cases, the
544
+ video processing status may change from "STARTED" to "PENDING", and back. This
545
+ is due to waiting for resources for a specific processing sub-stage. In this
546
+ case, the overall percentage "progress" of video processing will reflect the
547
+ full picture.
502
548
 
503
549
  The result data is stored for 1 month, after which it is deleted.
504
550
 
@@ -518,7 +564,9 @@ class AITasksResource(SyncAPIResource):
518
564
  if not task_id:
519
565
  raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
520
566
  return self._get(
521
- f"/streaming/ai/tasks/{task_id}",
567
+ f"/streaming/ai/tasks/{task_id}"
568
+ if self._client._base_url_overridden
569
+ else f"https://api.gcore.com//streaming/ai/tasks/{task_id}",
522
570
  options=make_request_options(
523
571
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
524
572
  ),
@@ -529,14 +577,14 @@ class AITasksResource(SyncAPIResource):
529
577
  self,
530
578
  *,
531
579
  type: Literal["language_support"],
532
- audio_language: str | NotGiven = NOT_GIVEN,
533
- subtitles_language: str | NotGiven = NOT_GIVEN,
580
+ audio_language: str | Omit = omit,
581
+ subtitles_language: str | Omit = omit,
534
582
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
535
583
  # The extra values given here take precedence over values defined on the client or passed to this method.
536
584
  extra_headers: Headers | None = None,
537
585
  extra_query: Query | None = None,
538
586
  extra_body: Body | None = None,
539
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
587
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
540
588
  ) -> AITaskGetAISettingsResponse:
541
589
  """
542
590
  The method for revealing basic information and advanced underlying settings that
@@ -548,12 +596,17 @@ class AITasksResource(SyncAPIResource):
548
596
  or not for AI translation.
549
597
  - this list will expand as new AI methods are added.
550
598
 
551
- **`language_support`** There are many languages available for transcription. But
552
- not all languages can be automatically translated to and from with good quality.
553
- In order to determine the availability of translation from the audio language to
554
- the desired subtitle language, you can use this type of "`language_support`". AI
555
- models are constantly improving, so this method can be used for dynamic
556
- determination. Example:
599
+ **`language_support`**
600
+
601
+ There are many languages available for transcription. But not all languages can
602
+ be automatically translated to and from with good quality. In order to determine
603
+ the availability of translation from the audio language to the desired subtitle
604
+ language, you can use this type of "`language_support`".
605
+
606
+ AI models are constantly improving, so this method can be used for dynamic
607
+ determination.
608
+
609
+ Example:
557
610
 
558
611
  ```
559
612
  curl -L 'https://api.gcore.com/streaming/ai/info?type=language_support&audio_language=eng&subtitles_language=fre'
@@ -561,10 +614,12 @@ class AITasksResource(SyncAPIResource):
561
614
  { "supported": true }
562
615
  ```
563
616
 
564
- Today we provide the following capabilities as below. These are the 100
565
- languages for which we support only transcription and translation to English.
566
- The iso639-2b codes for these are:
617
+ Today we provide the following capabilities as below.
618
+
619
+ These are the 100 languages for which we support only transcription and
620
+ translation to English. The iso639-2b codes for these are:
567
621
  `afr, sqi, amh, ara, hye, asm, aze, bak, eus, bel, ben, bos, bre, bul, mya, cat, zho, hrv, ces, dan, nld, eng, est, fao, fin, fra, glg, kat, deu, guj, hat, hau, haw, heb, hin, hun, isl, ind, ita, jpn, jav, kan, kaz, khm, kor, lao, lat, lav, lin, lit, ltz, mkd, mlg, msa, mal, mlt, mri, mar, ell, mon, nep, nor, nno, oci, pan, fas, pol, por, pus, ron, rus, san, srp, sna, snd, sin, slk, slv, som, spa, sun, swa, swe, tgl, tgk, tam, tat, tel, tha, bod, tur, tuk, ukr, urd, uzb, vie, cym, yid, yor`.
622
+
568
623
  These are the 77 languages for which we support translation to other languages
569
624
  and translation to:
570
625
  `afr, amh, ara, hye, asm, aze, eus, bel, ben, bos, bul, mya, cat, zho, hrv, ces, dan, nld, eng, est, fin, fra, glg, kat, deu, guj, heb, hin, hun, isl, ind, ita, jpn, jav, kan, kaz, khm, kor, lao, lav, lit, mkd, mal, mlt, mar, ell, mon, nep, nno, pan, fas, pol, por, pus, ron, rus, srp, sna, snd, slk, slv, som, spa, swa, swe, tgl, tgk, tam, tel, tha, tur, ukr, urd, vie, cym, yor`.
@@ -590,7 +645,7 @@ class AITasksResource(SyncAPIResource):
590
645
  timeout: Override the client-level default timeout for this request, in seconds
591
646
  """
592
647
  return self._get(
593
- "/streaming/ai/info",
648
+ "/streaming/ai/info" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/info",
594
649
  options=make_request_options(
595
650
  extra_headers=extra_headers,
596
651
  extra_query=extra_query,
@@ -634,22 +689,22 @@ class AsyncAITasksResource(AsyncAPIResource):
634
689
  *,
635
690
  task_name: Literal["transcription", "content-moderation"],
636
691
  url: str,
637
- audio_language: str | NotGiven = NOT_GIVEN,
638
- category: Literal["sport", "nsfw", "hard_nudity", "soft_nudity"] | NotGiven = NOT_GIVEN,
639
- client_entity_data: str | NotGiven = NOT_GIVEN,
640
- client_user_id: str | NotGiven = NOT_GIVEN,
641
- subtitles_language: str | NotGiven = NOT_GIVEN,
692
+ audio_language: str | Omit = omit,
693
+ category: Literal["sport", "nsfw", "hard_nudity", "soft_nudity"] | Omit = omit,
694
+ client_entity_data: str | Omit = omit,
695
+ client_user_id: str | Omit = omit,
696
+ subtitles_language: str | Omit = omit,
642
697
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
643
698
  # The extra values given here take precedence over values defined on the client or passed to this method.
644
699
  extra_headers: Headers | None = None,
645
700
  extra_query: Query | None = None,
646
701
  extra_body: Body | None = None,
647
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
702
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
648
703
  ) -> AITaskCreateResponse:
649
- """Creating an AI task.
704
+ """
705
+ Creating an AI task.
650
706
 
651
- This method allows you to create an AI task for VOD video
652
- processing:
707
+ This method allows you to create an AI task for VOD video processing:
653
708
 
654
709
  - ASR: Transcribe video
655
710
  - ASR: Translate subtitles
@@ -658,28 +713,39 @@ class AsyncAITasksResource(AsyncAPIResource):
658
713
  - CM: Soft nudity detection
659
714
  - CM: Hard nudity detection
660
715
  - CM: Objects recognition (soon)
661
- ![Auto generated subtitles example](https://demo-files.gvideo.io/apidocs/captions.gif)
662
- How to use:
716
+
717
+ ![Auto generated subtitles example](https://demo-files.gvideo.io/apidocs/captions.gif)
718
+
719
+ How to use:
720
+
663
721
  - Create an AI task, specify algoritm to use
664
722
  - Get `task_id`
665
- - Check a result using `.../ai/tasks/{task_id}` method For more detailed
666
- information, see the description of each method separately.
723
+ - Check a result using `.../ai/tasks/{task_id}` method
724
+
725
+ For more detailed information, see the description of each method separately.
667
726
 
668
- **AI Automatic Speech Recognition (ASR)** AI is instrumental in automatic video
669
- processing for subtitles creation by using Automatic Speech Recognition (ASR)
670
- technology to transcribe spoken words into text, which can then be translated
671
- into multiple languages for broader accessibility. Categories:
727
+ **AI Automatic Speech Recognition (ASR)**
728
+
729
+ AI is instrumental in automatic video processing for subtitles creation by using
730
+ Automatic Speech Recognition (ASR) technology to transcribe spoken words into
731
+ text, which can then be translated into multiple languages for broader
732
+ accessibility.
733
+
734
+ Categories:
672
735
 
673
736
  - `transcription` – to create subtitles/captions from audio in the original
674
737
  language.
675
738
  - `translation` – to transate subtitles/captions from the original language to
676
- 99+ other languages. AI subtitle transcription and translation tools are
677
- highly efficient, processing large volumes of audio-visual content quickly and
678
- providing accurate transcriptions and translations with minimal human
679
- intervention. Additionally, AI-driven solutions can significantly reduce costs
680
- and turnaround times compared to traditional methods, making them an
681
- invaluable resource for content creators and broadcasters aiming to reach
682
- global audiences. Example response with positive result:
739
+ 99+ other languages.
740
+
741
+ AI subtitle transcription and translation tools are highly efficient, processing
742
+ large volumes of audio-visual content quickly and providing accurate
743
+ transcriptions and translations with minimal human intervention. Additionally,
744
+ AI-driven solutions can significantly reduce costs and turnaround times compared
745
+ to traditional methods, making them an invaluable resource for content creators
746
+ and broadcasters aiming to reach global audiences.
747
+
748
+ Example response with positive result:
683
749
 
684
750
  ```
685
751
  {
@@ -701,11 +767,14 @@ class AsyncAITasksResource(AsyncAPIResource):
701
767
  }
702
768
  ```
703
769
 
704
- **AI Content Moderation (CM)** The AI Content Moderation API offers a powerful
705
- solution for analyzing video content to detect various categories of
706
- inappropriate material. Leveraging state-of-the-art AI models, this API ensures
707
- real-time analysis and flagging of sensitive or restricted content types, making
708
- it an essential tool for platforms requiring stringent content moderation.
770
+ **AI Content Moderation (CM)**
771
+
772
+ The AI Content Moderation API offers a powerful solution for analyzing video
773
+ content to detect various categories of inappropriate material. Leveraging
774
+ state-of-the-art AI models, this API ensures real-time analysis and flagging of
775
+ sensitive or restricted content types, making it an essential tool for platforms
776
+ requiring stringent content moderation.
777
+
709
778
  Categories:
710
779
 
711
780
  - `nsfw`: Quick algorithm to detect pornographic material, ensuring content is
@@ -715,11 +784,15 @@ class AsyncAITasksResource(AsyncAPIResource):
715
784
  - `soft_nudity`: Detailed video analysis that reveals both explicit and partial
716
785
  nudity, including the presence of male and female faces and other uncovered
717
786
  body parts.
718
- - `sport`: Recognizes various sporting activities. The AI Content Moderation API
719
- is an invaluable tool for managing and controlling the type of content being
720
- shared or streamed on your platform. By implementing this API, you can ensure
721
- compliance with community guidelines and legal requirements, as well as
722
- provide a safer environment for your users. Important notes:
787
+ - `sport`: Recognizes various sporting activities.
788
+
789
+ The AI Content Moderation API is an invaluable tool for managing and controlling
790
+ the type of content being shared or streamed on your platform. By implementing
791
+ this API, you can ensure compliance with community guidelines and legal
792
+ requirements, as well as provide a safer environment for your users.
793
+
794
+ Important notes:
795
+
723
796
  - It's allowed to analyse still images too (where applicable). Format of image:
724
797
  JPEG, PNG. In that case one image is the same as video of 1 second duration.
725
798
  - Not all frames in the video are used for analysis, but only key frames
@@ -727,7 +800,9 @@ class AsyncAITasksResource(AsyncAPIResource):
727
800
  detection will only occur at these timestamps. If an object appears and
728
801
  disappears between these time stamps, it will not be detected. We are working
729
802
  on a version to analyze more frames, please contact your manager or our
730
- support team to enable this method. Example response with positive result:
803
+ support team to enable this method.
804
+
805
+ Example response with positive result:
731
806
 
732
807
  ```
733
808
  {
@@ -740,9 +815,11 @@ class AsyncAITasksResource(AsyncAPIResource):
740
815
  }
741
816
  ```
742
817
 
743
- **Additional information** Billing takes into account the duration of the
744
- analyzed video. Or the duration until the stop tag(where applicable), if the
745
- condition was triggered during the analysis.
818
+ **Additional information**
819
+
820
+ Billing takes into account the duration of the analyzed video. Or the duration
821
+ until the stop tag(where applicable), if the condition was triggered during the
822
+ analysis.
746
823
 
747
824
  The heart of content moderation is AI, with additional services. They run on our
748
825
  own infrastructure, so the files/data are not transferred anywhere to external
@@ -758,13 +835,20 @@ class AsyncAITasksResource(AsyncAPIResource):
758
835
  url: URL to the MP4 file to analyse. File must be publicly accessible via HTTP/HTTPS.
759
836
 
760
837
  audio_language: Language in original audio (transcription only). This value is used to determine
761
- the language from which to transcribe. If this is not set, the system will run
762
- auto language identification and the subtitles will be in the detected language.
763
- The method also works based on AI analysis. It's fairly accurate, but if it's
764
- wrong, then set the language explicitly. Additionally, when this is not set, we
765
- also support recognition of alternate languages in the video (language
766
- code-switching). Language is set by 3-letter language code according to
767
- ISO-639-2 (bibliographic code). We can process languages:
838
+ the language from which to transcribe.
839
+
840
+ If this is not set, the system will run auto language identification and the
841
+ subtitles will be in the detected language. The method also works based on AI
842
+ analysis. It's fairly accurate, but if it's wrong, then set the language
843
+ explicitly.
844
+
845
+ Additionally, when this is not set, we also support recognition of alternate
846
+ languages in the video (language code-switching).
847
+
848
+ Language is set by 3-letter language code according to ISO-639-2 (bibliographic
849
+ code).
850
+
851
+ We can process languages:
768
852
 
769
853
  - 'afr': Afrikaans
770
854
  - 'alb': Albanian
@@ -871,10 +955,12 @@ class AsyncAITasksResource(AsyncAPIResource):
871
955
 
872
956
  client_entity_data: Meta parameter, designed to store your own extra information about a video
873
957
  entity: video source, video id, etc. It is not used in any way in video
874
- processing. For example, if an AI-task was created automatically when you
875
- uploaded a video with the AI auto-processing option (nudity detection, etc),
876
- then the ID of the associated video for which the task was performed will be
877
- explicitly indicated here.
958
+ processing.
959
+
960
+ For example, if an AI-task was created automatically when you uploaded a video
961
+ with the AI auto-processing option (nudity detection, etc), then the ID of the
962
+ associated video for which the task was performed will be explicitly indicated
963
+ here.
878
964
 
879
965
  client_user_id: Meta parameter, designed to store your own identifier. Can be used by you to tag
880
966
  requests from different end-users. It is not used in any way in video
@@ -882,6 +968,7 @@ class AsyncAITasksResource(AsyncAPIResource):
882
968
 
883
969
  subtitles_language: Indicates which language it is clearly necessary to translate into. If this is
884
970
  not set, the original language will be used from attribute "`audio_language`".
971
+
885
972
  Please note that:
886
973
 
887
974
  - transcription into the original language is a free procedure,
@@ -900,7 +987,7 @@ class AsyncAITasksResource(AsyncAPIResource):
900
987
  timeout: Override the client-level default timeout for this request, in seconds
901
988
  """
902
989
  return await self._post(
903
- "/streaming/ai/tasks",
990
+ "/streaming/ai/tasks" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/tasks",
904
991
  body=await async_maybe_transform(
905
992
  {
906
993
  "task_name": task_name,
@@ -922,27 +1009,26 @@ class AsyncAITasksResource(AsyncAPIResource):
922
1009
  def list(
923
1010
  self,
924
1011
  *,
925
- date_created: str | NotGiven = NOT_GIVEN,
926
- limit: int | NotGiven = NOT_GIVEN,
927
- ordering: Literal["task_id", "status", "task_name", "started_at"] | NotGiven = NOT_GIVEN,
928
- page: int | NotGiven = NOT_GIVEN,
929
- search: str | NotGiven = NOT_GIVEN,
930
- status: Literal["FAILURE", "PENDING", "RECEIVED", "RETRY", "REVOKED", "STARTED", "SUCCESS"]
931
- | NotGiven = NOT_GIVEN,
932
- task_id: str | NotGiven = NOT_GIVEN,
933
- task_name: Literal["transcription", "content-moderation"] | NotGiven = NOT_GIVEN,
1012
+ date_created: str | Omit = omit,
1013
+ limit: int | Omit = omit,
1014
+ ordering: Literal["task_id", "status", "task_name", "started_at"] | Omit = omit,
1015
+ page: int | Omit = omit,
1016
+ search: str | Omit = omit,
1017
+ status: Literal["FAILURE", "PENDING", "RECEIVED", "RETRY", "REVOKED", "STARTED", "SUCCESS"] | Omit = omit,
1018
+ task_id: str | Omit = omit,
1019
+ task_name: Literal["transcription", "content-moderation"] | Omit = omit,
934
1020
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
935
1021
  # The extra values given here take precedence over values defined on the client or passed to this method.
936
1022
  extra_headers: Headers | None = None,
937
1023
  extra_query: Query | None = None,
938
1024
  extra_body: Body | None = None,
939
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1025
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
940
1026
  ) -> AsyncPaginator[AITask, AsyncPageStreamingAI[AITask]]:
941
- """Returns a list of previously created and processed AI tasks.
1027
+ """
1028
+ Returns a list of previously created and processed AI tasks.
942
1029
 
943
- The list contains
944
- brief information about the task and its execution status. Data is displayed
945
- page by page.
1030
+ The list contains brief information about the task and its execution status.
1031
+ Data is displayed page by page.
946
1032
 
947
1033
  Args:
948
1034
  date_created: Time when task was created. Datetime in ISO 8601 format.
@@ -950,15 +1036,21 @@ class AsyncAITasksResource(AsyncAPIResource):
950
1036
  limit: Number of results to return per page.
951
1037
 
952
1038
  ordering: Which field to use when ordering the results: `task_id`, status, and
953
- `task_name`. Sorting is done in ascending (ASC) order. If parameter is omitted
954
- then "`started_at` DESC" is used for ordering by default.
1039
+ `task_name`. Sorting is done in ascending (ASC) order.
1040
+
1041
+ If parameter is omitted then "`started_at` DESC" is used for ordering by
1042
+ default.
955
1043
 
956
1044
  page: Page to view from task list, starting from 1
957
1045
 
958
1046
  search: This is an field for combined text search in the following fields: `task_id`,
959
- `task_name`, status, and `task_data`. Both full and partial searches are
960
- possible inside specified above fields. For example, you can filter tasks of a
961
- certain category, or tasks by a specific original file. Example:
1047
+ `task_name`, status, and `task_data`.
1048
+
1049
+ Both full and partial searches are possible inside specified above fields. For
1050
+ example, you can filter tasks of a certain category, or tasks by a specific
1051
+ original file.
1052
+
1053
+ Example:
962
1054
 
963
1055
  - To filter tasks of Content Moderation NSFW method:
964
1056
  `GET /streaming/ai/tasks?search=nsfw`
@@ -981,7 +1073,7 @@ class AsyncAITasksResource(AsyncAPIResource):
981
1073
  timeout: Override the client-level default timeout for this request, in seconds
982
1074
  """
983
1075
  return self._get_api_list(
984
- "/streaming/ai/tasks",
1076
+ "/streaming/ai/tasks" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/tasks",
985
1077
  page=AsyncPageStreamingAI[AITask],
986
1078
  options=make_request_options(
987
1079
  extra_headers=extra_headers,
@@ -1014,11 +1106,13 @@ class AsyncAITasksResource(AsyncAPIResource):
1014
1106
  extra_headers: Headers | None = None,
1015
1107
  extra_query: Query | None = None,
1016
1108
  extra_body: Body | None = None,
1017
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1109
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1018
1110
  ) -> AITaskCancelResponse:
1019
1111
  """
1020
1112
  Stopping a previously launched AI-task without waiting for it to be fully
1021
- completed. The task will be moved to "REVOKED" status.
1113
+ completed.
1114
+
1115
+ The task will be moved to "REVOKED" status.
1022
1116
 
1023
1117
  Args:
1024
1118
  extra_headers: Send extra headers
@@ -1032,7 +1126,9 @@ class AsyncAITasksResource(AsyncAPIResource):
1032
1126
  if not task_id:
1033
1127
  raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
1034
1128
  return await self._post(
1035
- f"/streaming/ai/tasks/{task_id}/cancel",
1129
+ f"/streaming/ai/tasks/{task_id}/cancel"
1130
+ if self._client._base_url_overridden
1131
+ else f"https://api.gcore.com//streaming/ai/tasks/{task_id}/cancel",
1036
1132
  options=make_request_options(
1037
1133
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1038
1134
  ),
@@ -1048,13 +1144,14 @@ class AsyncAITasksResource(AsyncAPIResource):
1048
1144
  extra_headers: Headers | None = None,
1049
1145
  extra_query: Query | None = None,
1050
1146
  extra_body: Body | None = None,
1051
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1147
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1052
1148
  ) -> AITaskGetResponse:
1053
1149
  """
1054
1150
  This is the single method to check the execution status of an AI task, and
1055
- obtain the result of any type of AI task. Based on the results of processing,
1056
- the “result” field will contain an answer corresponding to the type of the
1057
- initially created task:
1151
+ obtain the result of any type of AI task.
1152
+
1153
+ Based on the results of processing, the “result” field will contain an answer
1154
+ corresponding to the type of the initially created task:
1058
1155
 
1059
1156
  - ASR: Transcribe video
1060
1157
  - ASR: Translate subtitles
@@ -1066,7 +1163,9 @@ class AsyncAITasksResource(AsyncAPIResource):
1066
1163
  - etc... (see other methods from /ai/ domain)
1067
1164
 
1068
1165
  A queue is used to process videos. The waiting time depends on the total number
1069
- of requests in the system, so sometimes you will have to wait. Statuses:
1166
+ of requests in the system, so sometimes you will have to wait.
1167
+
1168
+ Statuses:
1070
1169
 
1071
1170
  - PENDING – the task is received and it is pending for available resources
1072
1171
  - STARTED – processing has started
@@ -1074,12 +1173,14 @@ class AsyncAITasksResource(AsyncAPIResource):
1074
1173
  - FAILURE – processing failed
1075
1174
  - REVOKED – processing was cancelled by the user (or the system)
1076
1175
  - RETRY – the task execution failed due to internal reasons, the task is queued
1077
- for re-execution (up to 3 times) Each task is processed in sub-stages, for
1078
- example, original language is first determined in a video, and then
1079
- transcription is performed. In such cases, the video processing status may
1080
- change from "STARTED" to "PENDING", and back. This is due to waiting for
1081
- resources for a specific processing sub-stage. In this case, the overall
1082
- percentage "progress" of video processing will reflect the full picture.
1176
+ for re-execution (up to 3 times)
1177
+
1178
+ Each task is processed in sub-stages, for example, original language is first
1179
+ determined in a video, and then transcription is performed. In such cases, the
1180
+ video processing status may change from "STARTED" to "PENDING", and back. This
1181
+ is due to waiting for resources for a specific processing sub-stage. In this
1182
+ case, the overall percentage "progress" of video processing will reflect the
1183
+ full picture.
1083
1184
 
1084
1185
  The result data is stored for 1 month, after which it is deleted.
1085
1186
 
@@ -1099,7 +1200,9 @@ class AsyncAITasksResource(AsyncAPIResource):
1099
1200
  if not task_id:
1100
1201
  raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
1101
1202
  return await self._get(
1102
- f"/streaming/ai/tasks/{task_id}",
1203
+ f"/streaming/ai/tasks/{task_id}"
1204
+ if self._client._base_url_overridden
1205
+ else f"https://api.gcore.com//streaming/ai/tasks/{task_id}",
1103
1206
  options=make_request_options(
1104
1207
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1105
1208
  ),
@@ -1110,14 +1213,14 @@ class AsyncAITasksResource(AsyncAPIResource):
1110
1213
  self,
1111
1214
  *,
1112
1215
  type: Literal["language_support"],
1113
- audio_language: str | NotGiven = NOT_GIVEN,
1114
- subtitles_language: str | NotGiven = NOT_GIVEN,
1216
+ audio_language: str | Omit = omit,
1217
+ subtitles_language: str | Omit = omit,
1115
1218
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1116
1219
  # The extra values given here take precedence over values defined on the client or passed to this method.
1117
1220
  extra_headers: Headers | None = None,
1118
1221
  extra_query: Query | None = None,
1119
1222
  extra_body: Body | None = None,
1120
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1223
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1121
1224
  ) -> AITaskGetAISettingsResponse:
1122
1225
  """
1123
1226
  The method for revealing basic information and advanced underlying settings that
@@ -1129,12 +1232,17 @@ class AsyncAITasksResource(AsyncAPIResource):
1129
1232
  or not for AI translation.
1130
1233
  - this list will expand as new AI methods are added.
1131
1234
 
1132
- **`language_support`** There are many languages available for transcription. But
1133
- not all languages can be automatically translated to and from with good quality.
1134
- In order to determine the availability of translation from the audio language to
1135
- the desired subtitle language, you can use this type of "`language_support`". AI
1136
- models are constantly improving, so this method can be used for dynamic
1137
- determination. Example:
1235
+ **`language_support`**
1236
+
1237
+ There are many languages available for transcription. But not all languages can
1238
+ be automatically translated to and from with good quality. In order to determine
1239
+ the availability of translation from the audio language to the desired subtitle
1240
+ language, you can use this type of "`language_support`".
1241
+
1242
+ AI models are constantly improving, so this method can be used for dynamic
1243
+ determination.
1244
+
1245
+ Example:
1138
1246
 
1139
1247
  ```
1140
1248
  curl -L 'https://api.gcore.com/streaming/ai/info?type=language_support&audio_language=eng&subtitles_language=fre'
@@ -1142,10 +1250,12 @@ class AsyncAITasksResource(AsyncAPIResource):
1142
1250
  { "supported": true }
1143
1251
  ```
1144
1252
 
1145
- Today we provide the following capabilities as below. These are the 100
1146
- languages for which we support only transcription and translation to English.
1147
- The iso639-2b codes for these are:
1253
+ Today we provide the following capabilities as below.
1254
+
1255
+ These are the 100 languages for which we support only transcription and
1256
+ translation to English. The iso639-2b codes for these are:
1148
1257
  `afr, sqi, amh, ara, hye, asm, aze, bak, eus, bel, ben, bos, bre, bul, mya, cat, zho, hrv, ces, dan, nld, eng, est, fao, fin, fra, glg, kat, deu, guj, hat, hau, haw, heb, hin, hun, isl, ind, ita, jpn, jav, kan, kaz, khm, kor, lao, lat, lav, lin, lit, ltz, mkd, mlg, msa, mal, mlt, mri, mar, ell, mon, nep, nor, nno, oci, pan, fas, pol, por, pus, ron, rus, san, srp, sna, snd, sin, slk, slv, som, spa, sun, swa, swe, tgl, tgk, tam, tat, tel, tha, bod, tur, tuk, ukr, urd, uzb, vie, cym, yid, yor`.
1258
+
1149
1259
  These are the 77 languages for which we support translation to other languages
1150
1260
  and translation to:
1151
1261
  `afr, amh, ara, hye, asm, aze, eus, bel, ben, bos, bul, mya, cat, zho, hrv, ces, dan, nld, eng, est, fin, fra, glg, kat, deu, guj, heb, hin, hun, isl, ind, ita, jpn, jav, kan, kaz, khm, kor, lao, lav, lit, mkd, mal, mlt, mar, ell, mon, nep, nno, pan, fas, pol, por, pus, ron, rus, srp, sna, snd, slk, slv, som, spa, swa, swe, tgl, tgk, tam, tel, tha, tur, ukr, urd, vie, cym, yor`.
@@ -1171,7 +1281,7 @@ class AsyncAITasksResource(AsyncAPIResource):
1171
1281
  timeout: Override the client-level default timeout for this request, in seconds
1172
1282
  """
1173
1283
  return await self._get(
1174
- "/streaming/ai/info",
1284
+ "/streaming/ai/info" if self._client._base_url_overridden else "https://api.gcore.com//streaming/ai/info",
1175
1285
  options=make_request_options(
1176
1286
  extra_headers=extra_headers,
1177
1287
  extra_query=extra_query,