Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ Add an exemption only for intentional, verified runtime behavior, with a nearby

Enum values and struct fields are checked bidirectionally. Enum mapping is structural: named schemas resolve to model types; properties, array items, compositions, and operation parameters resolve through their Rust field/argument type. Serde container/variant renames determine wire values. Catch-alls are recognized through `untagged`/`other` attributes, never variant names; a genuine unit variant named `Unknown` remains a value. Numeric, mixed, and scalar-backed enum constraints are reported explicitly as unsupported rather than silently skipped.

##### `VALUES` const checking

Enums that the CLI validates against declare `pub const VALUES: &'static [&'static str]` in an `impl` block — a hand-written literal slice of the enum's non-catch-all wire values. The analyzer verifies that any enum with a `VALUES` const has it exactly equal (as a set) to its variant wire values; a mismatch produces `FindingKind::EnumValuesMismatch`. This is opt-in: enums without a `VALUES` const are not checked. When adding a new enum value to a `VALUES`-bearing enum, update both the variant and the const or CI will fail.

##### Deprecated field hiding

Every spec-deprecated request or response field belongs in `meta.rs::DEPRECATED_FIELDS` and carries `#[cfg(feature = "deprecated-fields")]` on the `models.rs` field. It is therefore absent from the public model by default. Request fields that must be gated out but resolve as required are `Option<T>` with a documented optionality exemption. Update CLI code that directly accesses or constructs an affected model so both feature configurations compile.
Expand Down
468 changes: 363 additions & 105 deletions crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions crates/clickhouse-cloud-api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,31 @@ impl Client {
Ok(serde_json::from_str(&body_text)?)
}

/// Discover ClickPipe source schema (Beta).
pub async fn click_pipe_schema_discovery(
&self,
organization_id: &str,
service_id: &str,
body: &ClickPipeSchemaDiscoveryRequest,
) -> Result<ApiResponse<ClickPipeSchemaDiscoveryResponse>, Error> {
let path = format!("/v1/organizations/{organization_id}/services/{service_id}/clickpipes/schemaDiscovery");
let mut req = self.request(reqwest::Method::POST, &path);
req = req.json(body);
let resp = req.send().await?;
let status = resp.status();
let body_text = resp.text().await?;
if !status.is_success() {
return Err(Error::Api {
status: status.as_u16(),
message: serde_json::from_str::<ApiResponse<serde_json::Value>>(&body_text)
.ok()
.and_then(|r| r.error)
.unwrap_or(body_text.clone()),
});
}
Ok(serde_json::from_str(&body_text)?)
}

/// ClickStack: List Alerts
pub async fn click_stack_list_alerts(
&self,
Expand Down
1 change: 1 addition & 0 deletions crates/clickhouse-cloud-api/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub const BETA_OPERATIONS: &[&str] = &[
"backup_bucket_delete",
"backup_bucket_get",
"backup_bucket_update",
"click_pipe_schema_discovery",
"click_stack_create_alert",
"click_stack_create_dashboard",
"click_stack_delete_alert",
Expand Down
Loading