clickhouse_cloud_api/
meta.rs1pub const BETA_OPERATIONS: &[&str] = &[
23 "backup_bucket_create",
24 "backup_bucket_delete",
25 "backup_bucket_get",
26 "backup_bucket_update",
27 "click_stack_create_alert",
28 "click_stack_create_dashboard",
29 "click_stack_delete_alert",
30 "click_stack_delete_dashboard",
31 "click_stack_get_alert",
32 "click_stack_get_dashboard",
33 "click_stack_list_alerts",
34 "click_stack_list_dashboards",
35 "click_stack_list_sources",
36 "click_stack_list_webhooks",
37 "click_stack_update_alert",
38 "click_stack_update_dashboard",
39 "postgres_instance_config_get",
40 "postgres_instance_config_patch",
41 "postgres_instance_config_post",
42 "postgres_instance_create_read_replica",
43 "postgres_instance_prometheus_get",
44 "postgres_instance_restore",
45 "postgres_org_prometheus_get",
46 "postgres_service_certs_get",
47 "postgres_service_create",
48 "postgres_service_delete",
49 "postgres_service_get",
50 "postgres_service_get_list",
51 "postgres_service_patch",
52 "postgres_service_patch_state",
53 "postgres_service_set_password",
54 "scaling_schedule_delete",
55 "scaling_schedule_get",
56 "scaling_schedule_upsert",
57 "service_clickhouse_setting_get",
58 "service_clickhouse_settings_list_get",
59 "service_clickhouse_settings_schema_get",
60 "service_clickhouse_settings_update",
61];
62
63pub fn is_beta_operation(name: &str) -> bool {
67 BETA_OPERATIONS.binary_search(&name).is_ok()
68}
69
70#[cfg(test)]
71mod tests {
72 use super::*;
73
74 #[test]
75 fn list_is_sorted_and_unique() {
76 for pair in BETA_OPERATIONS.windows(2) {
77 assert!(
78 pair[0] < pair[1],
79 "BETA_OPERATIONS must be sorted and unique; {:?} >= {:?}",
80 pair[0],
81 pair[1],
82 );
83 }
84 }
85
86 #[test]
87 fn is_beta_operation_matches_constant() {
88 assert!(is_beta_operation("scaling_schedule_get"));
89 assert!(is_beta_operation("postgres_service_get_list"));
90 assert!(!is_beta_operation("services_list"));
91 assert!(!is_beta_operation("not_a_real_op"));
92 }
93}