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
148 changes: 46 additions & 102 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions crates/clickhouse-cloud-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ minor version; read the entries before raising it.

## Unreleased

Timestamp fields are now `jiff::Timestamp` instead of
`chrono::DateTime<chrono::Utc>`, and the crate no longer depends on `chrono`,
which is unmaintained (RUSTSEC-2026-0543). This covers every model field that
held a timestamp (`created_at`, `expire_at`, `start_timestamp` and similar) and
the `PgCreatedAtProperty` and `PgPitrRestoreTargetProperty` aliases. Callers
depend on `jiff` 1.x and convert at the boundary:
`"2030-01-02T03:04:05Z".parse::<jiff::Timestamp>()?` to build a value,
`timestamp.to_string()` for RFC 3339 and `timestamp.as_second()` for Unix
seconds. A caller that must keep `chrono` can convert with
`chrono::DateTime::from_timestamp(ts.as_second(), ts.subsec_nanosecond() as u32)`.
On the wire, timestamps are still RFC 3339 in UTC with a `Z` suffix. One
difference: a fractional second is written with the fewest digits that
represent it (`.5Z`), where `chrono` padded to 3, 6 or 9 (`.500Z`).

Structs with a required field no longer implement `Default`: request bodies
such as `ServicePostRequest`, `ClickPipePostRequest` and
`ClickStackCreateAlertRequest`, their nested required types, the request
Expand Down
3 changes: 1 addition & 2 deletions crates/clickhouse-cloud-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde_json = "1"
thiserror = "2"
url = "2"
uuid = { version = "1", features = ["serde", "v4"] }
chrono = { version = "0.4", features = ["serde"] }
jiff = { version = "1.0.0", default-features = false, features = ["std", "serde"] }

[dev-dependencies]
# `credentials-login` lets the default credential chain read `aws login` sessions.
Expand All @@ -45,7 +45,6 @@ aws-sdk-iam = { version = "1.108.1", default-features = false, features = ["defa
aws-sdk-kinesis = { version = "1.104.0", default-features = false, features = ["default-https-client", "rt-tokio"] }
aws-sdk-s3 = { version = "1.132.0", default-features = false, features = ["default-https-client", "rt-tokio", "sigv4a", "http-1x"] }
base64 = "0.23"
chrono = "0.4"
rcgen = "0.14.8"
rustls = { version = "0.23.40", default-features = false, features = ["ring", "std", "tls12"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/clickhouse-cloud-api/src/models/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ pub struct Activity {
#[serde(rename = "actorType", skip_serializing_if = "Option::is_none")]
pub actor_type: Option<ActivityActortype>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
pub created_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "keyUpdateType", skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 5 additions & 5 deletions crates/clickhouse-cloud-api/src/models/api_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ pub struct ApiKey {
#[serde(rename = "assignedRoles", skip_serializing_if = "Option::is_none")]
pub assigned_roles: Option<Vec<AssignedRole>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
pub created_at: Option<jiff::Timestamp>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<chrono::DateTime<chrono::Utc>>,
pub expire_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "ipAccessList", skip_serializing_if = "Option::is_none")]
Expand All @@ -92,7 +92,7 @@ pub struct ApiKey {
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<ApiKeyState>,
#[serde(rename = "usedAt", skip_serializing_if = "Option::is_none")]
pub used_at: Option<chrono::DateTime<chrono::Utc>>,
pub used_at: Option<jiff::Timestamp>,
}

/// `ApiKeyHashData` from the ClickHouse Cloud API.
Expand All @@ -113,7 +113,7 @@ pub struct ApiKeyPatchRequest {
pub assigned_role_ids: Option<Vec<uuid::Uuid>>,
/// `None` preserves the expiry, `Some(Some(time))` sets it, and `Some(None)` clears it.
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<Option<chrono::DateTime<chrono::Utc>>>,
pub expire_at: Option<Option<jiff::Timestamp>>,
#[serde(rename = "ipAccessList", skip_serializing_if = "Option::is_none")]
pub ip_access_list: Option<Vec<IpAccessListEntry>>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -163,7 +163,7 @@ pub struct ApiKeyPostRequest {
#[serde(rename = "assignedRoleIds", skip_serializing_if = "Option::is_none")]
pub assigned_role_ids: Option<Vec<uuid::Uuid>>,
#[serde(rename = "expireAt", skip_serializing_if = "Option::is_none")]
pub expire_at: Option<chrono::DateTime<chrono::Utc>>,
pub expire_at: Option<jiff::Timestamp>,
#[serde(rename = "hashData", skip_serializing_if = "Option::is_none")]
pub hash_data: Option<ApiKeyHashData>,
#[serde(rename = "ipAccessList", skip_serializing_if = "Option::is_none")]
Expand Down
8 changes: 4 additions & 4 deletions crates/clickhouse-cloud-api/src/models/backups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ pub struct Snapshot {
#[serde(rename = "durationInSeconds", skip_serializing_if = "Option::is_none")]
pub duration_in_seconds: Option<f64>,
#[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none")]
pub finished_at: Option<chrono::DateTime<chrono::Utc>>,
pub finished_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "serviceId", skip_serializing_if = "Option::is_none")]
pub service_id: Option<String>,
#[serde(rename = "sizeInBytes", skip_serializing_if = "Option::is_none")]
pub size_in_bytes: Option<f64>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<chrono::DateTime<chrono::Utc>>,
pub started_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<SnapshotStatus>,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -692,15 +692,15 @@ pub struct Backup {
#[serde(rename = "durationInSeconds", skip_serializing_if = "Option::is_none")]
pub duration_in_seconds: Option<f64>,
#[serde(rename = "finishedAt", skip_serializing_if = "Option::is_none")]
pub finished_at: Option<chrono::DateTime<chrono::Utc>>,
pub finished_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "serviceId", skip_serializing_if = "Option::is_none")]
pub service_id: Option<String>,
#[serde(rename = "sizeInBytes", skip_serializing_if = "Option::is_none")]
pub size_in_bytes: Option<f64>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<chrono::DateTime<chrono::Utc>>,
pub started_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<BackupStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 5 additions & 5 deletions crates/clickhouse-cloud-api/src/models/byoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ pub struct ByocInfrastructureProgress {
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ByocInfrastructureProgressStatus>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
pub updated_at: Option<jiff::Timestamp>,
}

/// `ByocInfrastructureProgressStage` from the ClickHouse Cloud API.
Expand All @@ -850,7 +850,7 @@ pub struct ByocInfrastructureProgressStage {
#[serde(rename = "subStages", skip_serializing_if = "Option::is_none")]
pub sub_stages: Option<Vec<ByocInfrastructureProgressStage>>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
pub updated_at: Option<jiff::Timestamp>,
}

/// `ByocInfrastructureValidation` from the ClickHouse Cloud API.
Expand Down Expand Up @@ -902,11 +902,11 @@ pub struct ByocCustomerAuthorizedAccess {
pub mode: Option<String>,
/// Start of the access window; present only for `window` mode.
#[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none")]
pub start_timestamp: Option<chrono::DateTime<chrono::Utc>>,
pub start_timestamp: Option<jiff::Timestamp>,
/// End of the current access window; present only while access is allowed
/// until a deadline.
#[serde(rename = "windowEndTimestamp", skip_serializing_if = "Option::is_none")]
pub window_end_timestamp: Option<chrono::DateTime<chrono::Utc>>,
pub window_end_timestamp: Option<jiff::Timestamp>,
}

/// `ByocCustomerAuthorizedAccessPatchRequest` from the ClickHouse Cloud API (Beta).
Expand All @@ -921,5 +921,5 @@ pub struct ByocCustomerAuthorizedAccessPatchRequest {
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none")]
pub start_timestamp: Option<chrono::DateTime<chrono::Utc>>,
pub start_timestamp: Option<jiff::Timestamp>,
}
4 changes: 2 additions & 2 deletions crates/clickhouse-cloud-api/src/models/clickpipes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl std::fmt::Display for ClickPipeStatePatchRequestCommand {
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ClickPipe {
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
pub created_at: Option<jiff::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
pub destination: Option<ClickPipeDestination>,
#[serde(rename = "fieldMappings", skip_serializing_if = "Option::is_none")]
Expand All @@ -144,7 +144,7 @@ pub struct ClickPipe {
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<ClickPipeState>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
pub updated_at: Option<jiff::Timestamp>,
}

/// `ClickPipeDestination` from the ClickHouse Cloud API.
Expand Down
Loading
Loading