Skip to content
Open
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
25 changes: 24 additions & 1 deletion crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.0",
"contact": {
"name": "ClickHouse Support",
"url": "https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-837009",
"url": "https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-838082",
"email": "support@clickhouse.com"
}
},
Expand Down Expand Up @@ -17069,6 +17069,15 @@
}
}
},
"CustomPrivateDnsMapping": {
"properties": {
"privateDnsName": {
"description": "Custom private DNS name managed by the DNS controller. No Route53 hosted zone is required.",
"type": "string",
"example": "my-service.example.com"
}
}
},
"CreateReversePrivateEndpoint": {
"properties": {
"description": {
Expand Down Expand Up @@ -17138,6 +17147,13 @@
"null"
],
"example": "projects/my-project/regions/us-central1/serviceAttachments/my-service"
},
"customPrivateDnsMappings": {
"type": "array",
"description": "Private Preview. Optional list of custom private DNS mappings. Each mapping points a private DNS name at this endpoint without creating a Route53 hosted zone.",
"items": {
"$ref": "#/components/schemas/CustomPrivateDnsMapping"
}
}
}
},
Expand Down Expand Up @@ -17211,6 +17227,13 @@
],
"example": "projects/my-project/regions/us-central1/serviceAttachments/my-service"
},
"customPrivateDnsMappings": {
"type": "array",
"description": "Private Preview. Optional list of custom private DNS mappings. Each mapping points a private DNS name at this endpoint without creating a Route53 hosted zone.",
"items": {
"$ref": "#/components/schemas/CustomPrivateDnsMapping"
}
},
"id": {
"description": "Reverse private endpoint ID.",
"type": "string",
Expand Down
11 changes: 11 additions & 0 deletions crates/clickhouse-cloud-api/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10128,6 +10128,8 @@ pub struct ClickStackUpdateDashboardRequest {
/// `CreateReversePrivateEndpoint` from the ClickHouse Cloud API.
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateReversePrivateEndpoint {
#[serde(rename = "customPrivateDnsMappings", skip_serializing_if = "Option::is_none", default)]
pub custom_private_dns_mappings: Option<Vec<CustomPrivateDnsMapping>>,
#[serde(default)]
pub description: String,
#[serde(rename = "gcpServiceAttachment", skip_serializing_if = "Option::is_none", default)]
Expand Down Expand Up @@ -10167,6 +10169,13 @@ pub struct CurrentScaling {
pub effective_min_replicas: i64,
}

/// `CustomPrivateDnsMapping` from the ClickHouse Cloud API.
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct CustomPrivateDnsMapping {
#[serde(rename = "privateDnsName", skip_serializing_if = "Option::is_none", default)]
pub private_dns_name: Option<String>,
}

/// `GcpBackupBucket` from the ClickHouse Cloud API.
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct GcpBackupBucket {
Expand Down Expand Up @@ -10665,6 +10674,8 @@ pub struct ResourceTagsV1 {
/// `ReversePrivateEndpoint` from the ClickHouse Cloud API.
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ReversePrivateEndpoint {
#[serde(rename = "customPrivateDnsMappings", skip_serializing_if = "Option::is_none", default)]
pub custom_private_dns_mappings: Option<Vec<CustomPrivateDnsMapping>>,
#[serde(default)]
pub description: String,
#[serde(rename = "dnsNames", default)]
Expand Down
12 changes: 12 additions & 0 deletions crates/clickhouse-cloud-api/tests/spec_coverage_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,18 @@ const OPTIONALITY_EXEMPTIONS: &[(&str, &str)] = &[
// `Option<ApiKeyHashData>` lets callers omit it and have the API
// generate the key as the spec's response description implies.
("ApiKeyPostRequest", "hashData"),
// `customPrivateDnsMappings` is documented as optional ("Private Preview.
// Optional list of custom private DNS mappings.") but the description
// heuristic keys on the literal "Optional" prefix, so the "Private
// Preview." lead-in causes it to be inferred as required. The field has
// no `required` array and the API treats it as opt-in.
("CreateReversePrivateEndpoint", "customPrivateDnsMappings"),
("ReversePrivateEndpoint", "customPrivateDnsMappings"),
// `CustomPrivateDnsMapping` is a single-field schema with no `required`
// array. The mapping object itself is only meaningful when supplied
// inside the (optional) `customPrivateDnsMappings` list, and the API
// treats the name as optional within that context.
("CustomPrivateDnsMapping", "privateDnsName"),
];

fn assert_field_optionality(spec: &Value) {
Expand Down